Kurduğum mod bu, viewtopic.php?f=34&t=19334
Temadaki problem, http://img522.imageshack.us/img522/6194/topuy.png
[ resmi görüntülemek için tıklayın ]
Kod: Tümünü seç
functions_top_stats.php
Kod: Tümünü seç
<?php
/**
*
* @package phpBB3
* @version $Id: view_reply.php 2011-08-22 20:19:43 Stoker $
* @copyright (c) 2011 PhpBB3 BBCodes
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Include only once.
*/
if (!defined('INCLUDES_VIEW_REPLY_PHP'))
{
define('INCLUDES_VIEW_REPLY_PHP', true);
$flist = $auth->acl_getf('f_read', true);
$flist = array_unique(array_keys($flist));
// Recent Active Topics
$sql = 'SELECT topic_id, forum_id, topic_title, topic_time, topic_views, topic_poster, topic_replies, topic_first_poster_name, topic_first_poster_colour, topic_last_post_id, topic_last_poster_name, topic_last_poster_colour, topic_last_post_time, topic_last_view_time, topic_last_poster_id
FROM ' . TOPICS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $flist) . ' AND topic_moved_id = 0
ORDER BY topic_last_post_id DESC';
$result = $db->sql_query_limit($sql, 5);
while ($row = $db->sql_fetchrow($result))
{
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']);
$view_last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id']);
$view_first_poster = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['topic_poster']);
$view_last_poster = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['topic_last_poster_id']);
$template->assign_block_vars('recent_active', array(
'TOPIC_TITLE' => $row['topic_title'],
'TOPIC_TIME' => $user->format_date($row['topic_time']),
'TOPIC_VIEWS' => $row['topic_views'],
'TOPIC_REPLIES' => $row['topic_replies'],
'TOPIC_FIRST_POSTER_NAME' => $row['topic_first_poster_name'],
'TOPIC_FIRST_POSTER_COLOUR' => $row['topic_first_poster_colour'],
'TOPIC_LAST_POSTER_NAME' => $row['topic_last_poster_name'],
'TOPIC_LAST_POSTER_COLOUR' => $row['topic_last_poster_colour'],
'TOPIC_LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
'TOPIC_LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']),
'U_FIRST_TOPIC' => $view_topic_url,
'U_LAST_TOPIC' => $view_last_post_url,
'USERNAME_FIRST' => $view_first_poster,
'USERNAME_LAST' => $view_last_poster,
));
}
$db->sql_freeresult($result);
// Most viewed topics
$sql = 'SELECT topic_id, forum_id, topic_title, topic_views, topic_time, topic_first_poster_name, topic_first_poster_colour, topic_poster, topic_last_poster_id
FROM ' . TOPICS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $flist) . '
ORDER BY topic_views DESC';
$result = $db->sql_query_limit($sql, 5);
while ($row = $db->sql_fetchrow($result))
{
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']);
$view_first_poster = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['topic_poster']);
$view_last_poster = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['topic_last_poster_id']);
$template->assign_block_vars('most_viewed', array(
'TOPIC_ID' => $row['topic_id'],
'FORUM_ID' => $row['forum_id'],
'TOPIC_TITLE' => $row['topic_title'],
'TOPIC_VIEWS' => $row['topic_views'],
'TOPIC_TIME' => $user->format_date($row['topic_time']),
'TOPIC_FIRST_POSTER_NAME' => $row['topic_first_poster_name'],
'TOPIC_FIRST_POSTER_COLOUR' => $row['topic_first_poster_colour'],
'U_FIRST_TOPIC' => $view_topic_url,
'USERNAME_FIRST' => $view_first_poster,
'USERNAME_LAST' => $view_last_poster,
));
}
$db->sql_freeresult($result);
// Most replied topics
$sql = 'SELECT topic_id, forum_id, topic_title, topic_replies, topic_time, topic_first_poster_name, topic_first_poster_colour, topic_poster, topic_last_poster_id
FROM ' . TOPICS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $flist) . '
ORDER BY topic_replies DESC';
$result = $db->sql_query_limit($sql, 5);
while ($row = $db->sql_fetchrow($result))
{
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']);
$view_first_poster = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['topic_poster']);
$view_last_poster = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile' . '&u=' . $row['topic_last_poster_id']);
$template->assign_block_vars('most_replied', array(
'TOPIC_ID' => $row['topic_id'],
'FORUM_ID' => $row['forum_id'],
'TOPIC_TITLE' => $row['topic_title'],
'TOPIC_REPLIES' => $row['topic_replies'],
'TOPIC_TIME' => $user->format_date($row['topic_time']),
'TOPIC_FIRST_POSTER_NAME' => $row['topic_first_poster_name'],
'TOPIC_FIRST_POSTER_COLOUR' => $row['topic_first_poster_colour'],
'U_FIRST_TOPIC' => $view_topic_url,
'USERNAME_FIRST' => $view_first_poster,
'USERNAME_LAST' => $view_last_poster,
));
}
$db->sql_freeresult($result);
}
?>