Report #74: get_username_string(
This commit is contained in:
@@ -63,6 +63,7 @@ if($announcement < 0)
|
||||
'FORUM_NAME' => ( $forum_id ) ? $fetch_news[$i]['forum_name'] : '',
|
||||
'TITLE' => $fetch_news[$i]['topic_title'],
|
||||
'POSTER' => $fetch_news[$i]['username'],
|
||||
'POSTER_FULL' => $fetch_news[$i]['username_full'],
|
||||
'U_USER_PROFILE' => (($fetch_news[$i]['user_type'] == USER_NORMAL || $fetch_news[$i]['user_type'] == USER_FOUNDER) && $fetch_news[$i]['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $fetch_news[$i]['user_id']) : '',
|
||||
'TIME' => $fetch_news[$i]['topic_time'],
|
||||
'TEXT' => $fetch_news[$i]['post_text'],
|
||||
|
||||
@@ -141,33 +141,6 @@ while ($row = $db->sql_fetchrow($result))
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
/*we may delete this?
|
||||
// Generate online information for user
|
||||
if ($config['load_onlinetrack'] && sizeof($id_cache))
|
||||
{
|
||||
$sql = 'SELECT session_user_id, MAX(session_time) as online_time, MIN(session_viewonline) AS viewonline
|
||||
FROM ' . SESSIONS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('session_user_id', $id_cache) . '
|
||||
GROUP BY session_user_id';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$update_time = $config['load_online_time'] * 60;
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$user_cache[$row['session_user_id']]['online'] = (time() - $update_time < $row['online_time'] && (($row['viewonline'] && $user_cache[$row['session_user_id']]['viewonline']) || $auth->acl_get('u_viewonline'))) ? true : false;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
unset($id_cache);
|
||||
|
||||
// Assign specific vars
|
||||
$template->assign_vars(array(
|
||||
'ONLINE_IMG'=> ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? '' : (($user_cache[$poster_id]['online']) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')),
|
||||
'S_ONLINE' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false),
|
||||
));
|
||||
*/
|
||||
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_DISPLAY_LEADERS' => true,
|
||||
));
|
||||
|
||||
@@ -70,6 +70,7 @@ if($news < 0)
|
||||
'FORUM_NAME' => ( $forum_id ) ? $fetch_news[$i]['forum_name'] : '',
|
||||
'TITLE' => $fetch_news[$i]['topic_title'],
|
||||
'POSTER' => $fetch_news[$i]['username'],
|
||||
'POSTER_FULL' => $fetch_news[$i]['username_full'],
|
||||
'U_USER_PROFILE' => (($fetch_news[$i]['user_type'] == USER_NORMAL || $fetch_news[$i]['user_type'] == USER_FOUNDER) && $fetch_news[$i]['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $fetch_news[$i]['user_id']) : '',
|
||||
'TIME' => $fetch_news[$i]['topic_time'],
|
||||
'TEXT' => $fetch_news[$i]['post_text'],
|
||||
|
||||
@@ -39,7 +39,7 @@ $user_id = (int) $row['user_id'];
|
||||
$colour = $row['user_colour'];
|
||||
|
||||
$template->assign_block_vars('random_member', array(
|
||||
//'USERNAME_FULL' => get_username_string('full', $user_id, $username, $colour),
|
||||
'USERNAME_FULL' => get_username_string('full', $user_id, $username, $colour),
|
||||
'USERNAME' => get_username_string('username', $user_id, $username, $colour),
|
||||
'USER_COLOR' => get_username_string('colour', $user_id, $username, $colour),
|
||||
'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $username, $colour),
|
||||
|
||||
@@ -119,42 +119,6 @@ while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title']) )
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
||||
/*//we may also delete this?
|
||||
//
|
||||
// Recent active topic
|
||||
//
|
||||
$last_post_time_sql = ($sort_days) ? ' AND t.topic_last_post_time > ' . (time() - ($sort_days * 24 * 3600)) : '';
|
||||
|
||||
$sql = 'SELECT topic_title, forum_id, topic_id, topic_time, topic_first_poster_name
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE topic_status <> ' . FORUM_LINK . "
|
||||
$last_post_time_sql
|
||||
AND topic_moved_id = 0
|
||||
AND topic_approved = 1
|
||||
AND topic_type = " . POST_NORMAL . '
|
||||
' . $sql_where . '
|
||||
ORDER BY topic_time DESC';
|
||||
|
||||
$result = $db->sql_query_limit($sql, $portal_config['portal_max_topics']);
|
||||
|
||||
while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title']) )
|
||||
{
|
||||
// auto auth
|
||||
if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
|
||||
{
|
||||
$template->assign_block_vars('active_topics', array(
|
||||
'TITLE' => character_limit($row['topic_title'], $portal_config['portal_recent_title_limit']),
|
||||
'FULL_TITLE' => censor_text($row['topic_title']),
|
||||
'DATE' => $user->format_date($row['topic_time']),
|
||||
'POSTER' => $row['topic_first_poster_name'],
|
||||
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'])
|
||||
));
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
*/
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_DISPLAY_RECENT' => true,
|
||||
));
|
||||
|
||||
@@ -288,9 +288,10 @@ function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_le
|
||||
'topic_last_post_time' => $row['topic_last_post_time'],
|
||||
'topic_title' => $row['topic_title'],
|
||||
'username' => $row['username'],
|
||||
'username_full' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $row['username']),
|
||||
'user_id' => $row['user_id'],
|
||||
'user_type' => $row['user_type'],
|
||||
'user_user_colour' => $row['user_colour'],
|
||||
'user_colour' => $row['user_colour'],
|
||||
'poll' => ($row['poll_title']) ? true : false,
|
||||
'attachment' => ($row['topic_attachment']) ? true : false,
|
||||
'topic_views' => $row['topic_views'],
|
||||
|
||||
Reference in New Issue
Block a user