Recordad que para pedir soporte alguno, debéis facilitar los datos de soporte oportunos por favor, mirad aquí y leer las Normas generales del foro, esto nos servirá de ayuda para dar el mejor soporte..
Gracias.
La Administración de phpBB España.
Estadisticas de phpBB3 en web externaTema Solucionado
Estadisticas de phpBB3 en web externa
Con estadisticas me refiero a usuarios conectados, invitados, bot's, mayor cantidad de usuarios que han visitado el foro, etc.
メルビン・ガルシア • nextgen Solutions • DDAnime • XenForo Hispano
Re: Estadisticas de phpBB3 en web externa

http://www.phpbb.com/customise/db/mod/phpbb_statistics
saludos
Datos de Soporte:
- URL del Foro: http://www.peruvoley.com/foro
- Hosting donde está alojada: http://www.rogohosting.com
- Versión del foro: 3.3.11
- Estilo: stasis-leak
- Mods Instalados:
Guias de ayuda:
Guia para corregir el copyright en foros phpBB3
Re: Estadisticas de phpBB3 en web externa

メルビン・ガルシア • nextgen Solutions • DDAnime • XenForo Hispano
Re: Estadisticas de phpBB3 en web externa

saludos
Datos de Soporte:
- URL del Foro: http://www.peruvoley.com/foro
- Hosting donde está alojada: http://www.rogohosting.com
- Versión del foro: 3.3.11
- Estilo: stasis-leak
- Mods Instalados:
Guias de ayuda:
Guia para corregir el copyright en foros phpBB3
Re: Estadisticas de phpBB3 en web externa


メルビン・ガルシア • nextgen Solutions • DDAnime • XenForo Hispano
Re: Estadisticas de phpBB3 en web externa

saludos
Datos de Soporte:
- URL del Foro: http://www.peruvoley.com/foro
- Hosting donde está alojada: http://www.rogohosting.com
- Versión del foro: 3.3.11
- Estilo: stasis-leak
- Mods Instalados:
Guias de ayuda:
Guia para corregir el copyright en foros phpBB3
Re: Estadisticas de phpBB3 en web externa

メルビン・ガルシア • nextgen Solutions • DDAnime • XenForo Hispano
Re: Estadisticas de phpBB3 en web externa
http://www.phpbb-es.com/foro/soporte-mo ... ml#p140572
Además puedes agregarle fácilmente otro tipo de datos, igual si lo ves complicado me avisas para colaborarte que justo ahora ando haciendo una especie de portal (va a ser para una web externa) donde muestro todo este tipo de datos... no va muy avanzado ya que apenas empecé anoche, pero llevo algunas cositas, si algo te sirve o te gusta me avisas, ahí lo dejo...
pMi Portal
Re: Estadisticas de phpBB3 en web externa
http://www.necross-fansub.com/online.php
メルビン・ガルシア • nextgen Solutions • DDAnime • XenForo Hispano
Re: Estadisticas de phpBB3 en web externa

Re: Estadisticas de phpBB3 en web externa
aqui dejo la dirección de nuevo para que veas como voy
http://necross-fansub.com/online.php

el codigo lo tengo asi.
Código: Seleccionar todo
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './foro/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('');
// Get and set some variables
$mode = request_var('mode', '');
$session_id = request_var('s', '');
$start = request_var('start', 0);
$sort_key = request_var('sk', 'b');
$sort_dir = request_var('sd', 'd');
$show_guests= ($config['load_online_guests']) ? request_var('sg', 0) : 0;
// Can this user view profiles/memberlist?
if (!$auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel'))
{
if ($user->data['user_id'] != ANONYMOUS)
{
trigger_error('NO_VIEW_USERS');
}
login_box('', $user->lang['LOGIN_EXPLAIN_VIEWONLINE']);
}
$sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_JOINED'], 'c' => $user->lang['SORT_LOCATION']);
$sort_key_sql = array('a' => 'u.username_clean', 'b' => 's.session_time', 'c' => 's.session_page');
// Sorting and order
if (!isset($sort_key_text[$sort_key]))
{
$sort_key = 'b';
}
$order_by = $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC');
// Whois requested
if ($mode == 'whois' && $auth->acl_get('a_') && $session_id)
{
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
$sql = 'SELECT u.user_id, u.username, u.user_type, s.session_ip
FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . " s
WHERE s.session_id = '" . $db->sql_escape($session_id) . "'
AND u.user_id = s.session_user_id";
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
{
$template->assign_var('WHOIS', user_ipwhois($row['session_ip']));
}
$db->sql_freeresult($result);
// Output the page
page_header($user->lang['WHO_IS_ONLINE']);
$template->set_filenames(array(
'body' => 'viewonline_whois.html')
);
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
}
// Forum info
$sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id
FROM ' . FORUMS_TABLE . '
ORDER BY left_id ASC';
$result = $db->sql_query($sql, 600);
$forum_data = array();
while ($row = $db->sql_fetchrow($result))
{
$forum_data[$row['forum_id']] = $row;
}
$db->sql_freeresult($result);
$guest_counter = 0;
// Get number of online guests (if we do not display them)
if (!$show_guests)
{
switch ($db->sql_layer)
{
case 'sqlite':
$sql = 'SELECT COUNT(session_ip) as num_guests
FROM (
SELECT DISTINCT session_ip
FROM ' . SESSIONS_TABLE . '
WHERE session_user_id = ' . ANONYMOUS . '
AND session_time >= ' . (time() - ($config['load_online_time'] * 60)) .
')';
break;
default:
$sql = 'SELECT COUNT(DISTINCT session_ip) as num_guests
FROM ' . SESSIONS_TABLE . '
WHERE session_user_id = ' . ANONYMOUS . '
AND session_time >= ' . (time() - ($config['load_online_time'] * 60));
break;
}
$result = $db->sql_query($sql);
$guest_counter = (int) $db->sql_fetchfield('num_guests');
$db->sql_freeresult($result);
}
// Get user list
$sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_type, u.user_colour, s.session_id, s.session_time, s.session_page, s.session_ip, s.session_browser, s.session_viewonline, s.session_forum_id
FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . ' s
WHERE u.user_id = s.session_user_id
AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) .
((!$show_guests) ? ' AND s.session_user_id <> ' . ANONYMOUS : '') . '
ORDER BY ' . $order_by;
$result = $db->sql_query($sql);
$prev_id = $prev_ip = $user_list = array();
$logged_visible_online = $logged_hidden_online = $counter = 0;
// BEGIN: Topic in "Who is online"
$topic_ids = $post_ids = $topic_post_ids = $topic_titles = array();
while ($row = $db->sql_fetchrow($result))
{
if ($row['user_id'] != ANONYMOUS && !isset($prev_id[$row['user_id']]))
{
$view_online = false;
if (!$row['session_viewonline'])
{
$view_online = ($auth->acl_get('u_viewonline')) ? true : false;
}
else
{
$view_online = true;
}
$prev_id[$row['user_id']] = 1;
if (!$view_online)
{
continue;
}
}
else if ($show_guests && $row['user_id'] == ANONYMOUS && !isset($prev_ip[$row['session_ip']]))
{
$prev_ip[$row['session_ip']] = 1;
}
else
{
continue;
}
preg_match('#^([a-z/]+)#i', $row['session_page'], $on_page);
if (!sizeof($on_page))
{
$on_page[1] = '';
}
if (!in_array($on_page[1], array('viewtopic', 'posting')))
{
continue;
}
preg_match('#t=([0-9]+)#', $row['session_page'], $on_page);
if (sizeof($on_page))
{
$topic_ids[] = $on_page[1];
continue;
}
preg_match('#p=([0-9]+)#', $row['session_page'], $on_page);
if (sizeof($on_page))
{
$post_ids[] = $on_page[1];
continue;
}
}
unset($prev_id, $prev_ip);
if (sizeof($topic_ids) || sizeof($post_ids))
{
if (sizeof($post_ids))
{
$sql = 'SELECT topic_id, post_id FROM ' . POSTS_TABLE . ' WHERE ' . $db->sql_in_set('post_id', $post_ids);
$post_result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($post_result))
{
$topic_post_ids[$row['post_id']] = $row['topic_id'];
$topic_ids[] = $row['topic_id'];
}
$db->sql_freeresult($post_result);
}
$sql = 'SELECT topic_id, topic_title FROM ' . TOPICS_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', array_unique($topic_ids));
$topic_result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($topic_result))
{
$topic_titles[$row['topic_id']] = $row['topic_title'];
}
$db->sql_freeresult($topic_result);
}
$db->sql_rowseek(0, $result);
// END: Topic in "Who is online"
while ($row = $db->sql_fetchrow($result))
{
if ($row['user_id'] != ANONYMOUS && !isset($prev_id[$row['user_id']]))
{
$view_online = $s_user_hidden = false;
$user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] . '" class="username-coloured"' : '';
$username_full = ($row['user_type'] != USER_IGNORE) ? get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) : '<span' . $user_colour . '>' . $row['username'] . '</span>';
if (!$row['session_viewonline'])
{
$view_online = ($auth->acl_get('u_viewonline')) ? true : false;
$logged_hidden_online++;
$username_full = '<em>' . $username_full . '</em>';
$s_user_hidden = true;
}
else
{
$view_online = true;
$logged_visible_online++;
}
$prev_id[$row['user_id']] = 1;
if ($view_online)
{
$counter++;
}
if (!$view_online || $counter > $start + $config['topics_per_page'] || $counter <= $start)
{
continue;
}
}
else if ($show_guests && $row['user_id'] == ANONYMOUS && !isset($prev_ip[$row['session_ip']]))
{
$prev_ip[$row['session_ip']] = 1;
$guest_counter++;
$counter++;
if ($counter > $start + $config['topics_per_page'] || $counter <= $start)
{
continue;
}
$s_user_hidden = false;
$username_full = get_username_string('full', $row['user_id'], $user->lang['GUEST']);
}
else
{
continue;
}
preg_match('#^([a-z0-9/_-]+)#i', $row['session_page'], $on_page);
if (!sizeof($on_page))
{
$on_page[1] = '';
}
switch ($on_page[1])
{
case 'index':
$location = $user->lang['INDEX'];
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
break;
case 'adm/index':
$location = $user->lang['ACP'];
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
break;
case 'posting':
case 'viewforum':
case 'viewtopic':
$forum_id = $row['session_forum_id'];
if ($forum_id && $auth->acl_get('f_list', $forum_id))
{
$location = '';
$location_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
if ($forum_data[$forum_id]['forum_type'] == FORUM_LINK)
{
$location = sprintf($user->lang['READING_LINK'], $forum_data[$forum_id]['forum_name']);
break;
}
switch ($on_page[1])
{
case 'posting':
preg_match('#mode=([a-z]+)#', $row['session_page'], $on_page);
$posting_mode = (!empty($on_page[1])) ? $on_page[1] : '';
switch ($posting_mode)
{
case 'reply':
case 'quote':
// BEGIN: Topic in "Who is online"
preg_match('#t=([0-9]+)#', $row['session_page'], $on_page);
preg_match('#p=([0-9]+)#', $row['session_page'], $on_page_p);
if (sizeof($on_page) && isset($topic_titles[$on_page[1]]))
{
$location = sprintf($user->lang['REPLYING_MESSAGE_TOPIC'], $forum_data[$forum_id]['forum_name'], $topic_titles[$on_page[1]]);
$location_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&t=' . $on_page[1]);
}
else if (sizeof($on_page_p) && isset($topic_post_ids[$on_page_p[1]]))
{
$location = sprintf($user->lang['REPLYING_MESSAGE_TOPIC'], $forum_data[$forum_id]['forum_name'], $topic_titles[$topic_post_ids[$on_page[1]]]);
$location_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&p=' . $on_page_p[1]);
}
else
{
$location = sprintf($user->lang['REPLYING_MESSAGE'], $forum_data[$forum_id]['forum_name']);
}
// END: Topic in "Who is online"
break;
default:
$location = sprintf($user->lang['POSTING_MESSAGE'], $forum_data[$forum_id]['forum_name']);
break;
}
break;
case 'viewtopic':
// BEGIN: Topic in "Who is online"
preg_match('#t=([0-9]+)#', $row['session_page'], $on_page);
preg_match('#p=([0-9]+)#', $row['session_page'], $on_page_p);
if (sizeof($on_page) && isset($topic_titles[$on_page[1]]))
{
$location = sprintf($user->lang['READING_TOPIC_TOPIC'], $forum_data[$forum_id]['forum_name'], $topic_titles[$on_page[1]]);
$location_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&t=' . $on_page[1]);
}
else if (sizeof($on_page_p) && isset($topic_post_ids[$on_page_p[1]]))
{
$location = sprintf($user->lang['READING_TOPIC_TOPIC'], $forum_data[$forum_id]['forum_name'], $topic_titles[$topic_post_ids[$on_page_p[1]]]);
$location_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&p=' . $on_page_p[1]);
}
else
{
$location = sprintf($user->lang['READING_TOPIC'], $forum_data[$forum_id]['forum_name']);
}
// END: Topic in "Who is online"
break;
case 'viewforum':
$location = sprintf($user->lang['READING_FORUM'], $forum_data[$forum_id]['forum_name']);
break;
}
}
else
{
$location = $user->lang['INDEX'];
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
}
break;
case 'search':
$location = $user->lang['SEARCHING_FORUMS'];
$location_url = append_sid("{$phpbb_root_path}search.$phpEx");
break;
case 'faq':
$location = $user->lang['VIEWING_FAQ'];
$location_url = append_sid("{$phpbb_root_path}faq.$phpEx");
break;
case 'viewonline':
$location = $user->lang['VIEWING_ONLINE'];
$location_url = append_sid("{$phpbb_root_path}viewonline.$phpEx");
break;
case 'memberlist':
$location = (strpos($row['session_page'], 'mode=viewprofile') !== false) ? $user->lang['VIEWING_MEMBER_PROFILE'] : $user->lang['VIEWING_MEMBERS'];
$location_url = append_sid("{$phpbb_root_path}memberlist.$phpEx");
break;
case 'mcp':
$location = $user->lang['VIEWING_MCP'];
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
break;
case 'ucp':
$location = $user->lang['VIEWING_UCP'];
// Grab some common modules
$url_params = array(
'mode=register' => 'VIEWING_REGISTER',
'i=pm&mode=compose' => 'POSTING_PRIVATE_MESSAGE',
'i=pm&' => 'VIEWING_PRIVATE_MESSAGES',
'i=profile&' => 'CHANGING_PROFILE',
'i=prefs&' => 'CHANGING_PREFERENCES',
);
foreach ($url_params as $param => $lang)
{
if (strpos($row['session_page'], $param) !== false)
{
$location = $user->lang[$lang];
break;
}
}
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
break;
case 'download/file':
$location = $user->lang['DOWNLOADING_FILE'];
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
break;
case 'report':
$location = $user->lang['REPORTING_POST'];
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
break;
default:
$location = $user->lang['INDEX'];
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
break;
}
$template->assign_block_vars('user_row', array(
'USERNAME' => $row['username'],
'USERNAME_COLOUR' => $row['user_colour'],
'USERNAME_FULL' => $username_full,
'LASTUPDATE' => $user->format_date($row['session_time']),
'FORUM_LOCATION' => $location,
'USER_IP' => ($auth->acl_get('a_')) ? (($mode == 'lookup' && $session_id == $row['session_id']) ? gethostbyaddr($row['session_ip']) : $row['session_ip']) : '',
'USER_BROWSER' => ($auth->acl_get('a_user')) ? $row['session_browser'] : '',
'U_USER_PROFILE' => ($row['user_type'] != USER_IGNORE) ? get_username_string('profile', $row['user_id'], '') : '',
'U_USER_IP' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'mode=lookup' . (($mode != 'lookup' || $row['session_id'] != $session_id) ? '&s=' . $row['session_id'] : '') . "&sg=$show_guests&start=$start&sk=$sort_key&sd=$sort_dir"),
'U_WHOIS' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'mode=whois&s=' . $row['session_id']),
'U_FORUM_LOCATION' => $location_url,
'S_USER_HIDDEN' => $s_user_hidden,
'S_GUEST' => ($row['user_id'] == ANONYMOUS) ? true : false,
'S_USER_TYPE' => $row['user_type'],
));
}
$db->sql_freeresult($result);
unset($prev_id, $prev_ip);
// Generate reg/hidden/guest online text
$vars_online = array(
'REG' => array('logged_visible_online', 'l_r_user_s'),
'HIDDEN'=> array('logged_hidden_online', 'l_h_user_s'),
'GUEST' => array('guest_counter', 'l_g_user_s')
);
foreach ($vars_online as $l_prefix => $var_ary)
{
switch ($$var_ary[0])
{
case 0:
$$var_ary[1] = $user->lang[$l_prefix . '_USERS_ZERO_ONLINE'];
break;
case 1:
$$var_ary[1] = $user->lang[$l_prefix . '_USER_ONLINE'];
break;
default:
$$var_ary[1] = $user->lang[$l_prefix . '_USERS_ONLINE'];
break;
}
}
unset($vars_online);
$pagination = generate_pagination(append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&sk=$sort_key&sd=$sort_dir"), $counter, $config['topics_per_page'], $start);
// Grab group details for legend display
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
{
$sql = 'SELECT group_id, group_name, group_colour, group_type
FROM ' . GROUPS_TABLE . '
WHERE group_legend = 1
ORDER BY group_name ASC';
}
else
{
$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type
FROM ' . GROUPS_TABLE . ' g
LEFT JOIN ' . USER_GROUP_TABLE . ' ug
ON (
g.group_id = ug.group_id
AND ug.user_id = ' . $user->data['user_id'] . '
AND ug.user_pending = 0
)
WHERE g.group_legend = 1
AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')
ORDER BY g.group_name ASC';
}
$result = $db->sql_query($sql);
$legend = '';
while ($row = $db->sql_fetchrow($result))
{
if ($row['group_name'] == 'BOTS')
{
$legend .= (($legend != '') ? ', ' : '') . '<span style="color:#' . $row['group_colour'] . '">' . $user->lang['G_BOTS'] . '</span>';
}
else
{
$legend .= (($legend != '') ? ', ' : '') . '<a style="color:#' . $row['group_colour'] . '" href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
}
}
$db->sql_freeresult($result);
// Refreshing the page every 60 seconds...
meta_refresh(60, append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&sk=$sort_key&sd=$sort_dir&start=$start"));
// Send data to template
$template->assign_vars(array(
'TOTAL_REGISTERED_USERS_ONLINE' => sprintf($l_r_user_s, $logged_visible_online) . sprintf($l_h_user_s, $logged_hidden_online),
'TOTAL_GUEST_USERS_ONLINE' => sprintf($l_g_user_s, $guest_counter),
'LEGEND' => $legend,
'PAGINATION' => $pagination,
'PAGE_NUMBER' => on_page($counter, $config['topics_per_page'], $start),
'U_SORT_USERNAME' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)),
'U_SORT_UPDATED' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)),
'U_SORT_LOCATION' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=c&sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)),
'U_SWITCH_GUEST_DISPLAY' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sg=' . ((int) !$show_guests)),
'L_SWITCH_GUEST_DISPLAY' => ($show_guests) ? $user->lang['HIDE_GUESTS'] : $user->lang['DISPLAY_GUESTS'],
'S_SWITCH_GUEST_DISPLAY' => ($config['load_online_guests']) ? true : false)
);
// We do not need to load the who is online box here. ;)
$config['load_online'] = false;
// Output the page
page_header($user->lang['WHO_IS_ONLINE']);
$template->set_filenames(array(
'body' => 'viewonline_body.html')
);
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>
メルビン・ガルシア • nextgen Solutions • DDAnime • XenForo Hispano
Re: Estadisticas de phpBB3 en web externa
Lo único que debes hacer es agregarlas a la plantilla:
{TOTAL_USERS_ONLINE}
{RECORD_USERS}
{TOTAL_POSTS}
{TOTAL_TOPICS}
{TOTAL_USERS}
{LOGGED_IN_USER_LIST}
Y Listo, estas ya se verán... para uqe funcionen, recuerda que debes tener el include($phpbb_root_path . 'common.' . $phpEx); en el archivo que las vas a usar...
De resto estas funcionan correctamente.
Si no es esto lo que necesitras entonces fue que no te comprendí bien, pero vuelves y me dices y seguiré intentando ayudarte jeje
Re: Estadisticas de phpBB3 en web externa
bueno haciendo chapuztes como siempre XD lo eh puesto asi.
Código: Seleccionar todo
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './foro/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Prueba de estadisticas</title>
<link href="style.css" type="text/css" rel="stylesheet"/>
</head>
<body>
{TOTAL_USERS_ONLINE}
{RECORD_USERS}
{TOTAL_POSTS}
{TOTAL_TOPICS}
{TOTAL_USERS}
{LOGGED_IN_USER_LIST}
</body>
</html>
メルビン・ガルシア • nextgen Solutions • DDAnime • XenForo Hispano
Re: Estadisticas de phpBB3 en web externa Tema Solucionado
Fijate este archivo que tenia hecho por ahí de no se cuando:
Código: Seleccionar todo
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './phpbb/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
// Get users online list ... if required
$l_online_users = $online_userlist = $l_online_record = '';
if ($config['load_online'] && $config['load_online_time'])
{
$f = request_var('f', 0);
$f = max($f, 0);
$online_users = obtain_users_online($f);
$user_online_strings = obtain_users_online_string($online_users, $f);
$l_online_users = $user_online_strings['l_online_users'];
$online_userlist = $user_online_strings['online_userlist'];
$total_online_users = $online_users['total_online'];
if ($total_online_users > $config['record_online_users'])
{
set_config('record_online_users', $total_online_users, true);
set_config('record_online_date', time(), true);
}
$l_online_record = sprintf($user->lang['RECORD_ONLINE_USERS'], $config['record_online_users'], $user->format_date($config['record_online_date']));
$l_online_time = ($config['load_online_time'] == 1) ? 'VIEW_ONLINE_TIME' : 'VIEW_ONLINE_TIMES';
$l_online_time = sprintf($user->lang[$l_online_time], $config['load_online_time']);
}
else
{
$l_online_time = '';
}
// Grab group details for legend display
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
{
$sql = 'SELECT group_id, group_name, group_colour, group_type
FROM ' . GROUPS_TABLE . '
WHERE group_legend = 1
ORDER BY group_name ASC';
}
else
{
$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type
FROM ' . GROUPS_TABLE . ' g
LEFT JOIN ' . USER_GROUP_TABLE . ' ug
ON (
g.group_id = ug.group_id
AND ug.user_id = ' . $user->data['user_id'] . '
AND ug.user_pending = 0
)
WHERE g.group_legend = 1
AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')
ORDER BY g.group_name ASC';
}
$result = $db->sql_query($sql);
$legend = array();
while ($row = $db->sql_fetchrow($result))
{
$colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';
$group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
if ($row['group_name'] == 'BOTS' || ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')))
{
$legend[] = '<span' . $colour_text . '>' . $group_name . '</span>';
}
else
{
$legend[] = '<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . $group_name . '</a>';
}
}
$db->sql_freeresult($result);
$legend = implode(', ', $legend);
echo 'Total posts: ' . $config['num_posts'] . '<br />';
echo 'Total temas: ' . $config['num_topics'] . '<br />';
echo 'Cantidad de usuarios: ' . $config['num_users'] . '<br />';
echo 'Ultimo Usuario: ' . get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour']) . '<br />';
echo 'Referencia: ' . $legend . '.';
echo $online_userlist . '<br />';
echo $l_online_record . '<br />';
echo $l_online_users . '<br />';
?>
Re: Estadisticas de phpBB3 en web externa



メルビン・ガルシア • nextgen Solutions • DDAnime • XenForo Hispano