Avatar in top five
Forum rules
Please only request support for mods released by phpbbmodders.net found at either https://github.com/phpbbmodders/ or the MODDB at http://www.phpbb.com
Please only request support for mods released by phpbbmodders.net found at either https://github.com/phpbbmodders/ or the MODDB at http://www.phpbb.com
Re: Avatar in top five
I like the look of what you guys are doing in here. I could use some of your code in even another project. Thanks Neculai Anișor
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!™
-
- Supporter
- Posts: 150
- Joined: 11 Jan 2013, 17:01
- Location: Liverpool, UK
Re: Avatar in top five
You can try this but im not sure if it works or not.
OPEN includes/top_five.php
OPEN includes/top_five.php
Find This may be a partial find and not the whole line
Code: Select all
$sql = 'SELECT COUNT(t.post_id) AS tally, u.user_id, u.username, u.user_colour
Replace with Replace the preceding lines with the following
Code: Select all
$sql = 'SELECT COUNT(t.post_id) AS tally, u.user_id, u.username, u.user_colour, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height
Find This may be a partial find and not the whole line
Code: Select all
'user_id' => $row['user_id'],
'username' => $row['username'],
'user_colour' => $row['user_colour'],
'user_thanks' => $row['tally'],
Add after Add these lines on a new blank line after the preceding line(s) to find
Code: Select all
'user_avatar' => $row['user_avatar'],
'user_avatar_type' => $row['user_avatar_type'],
'user_avatar_width' => $row['user_avatar_width'],
'user_avatar_height' => $row['user_avatar_height'],
Find This may be a partial find and not the whole line
Code: Select all
'THANKS' => $row['user_thanks'] > 1 ? sprintf($user->lang['THANKEDS'], $row['user_thanks']) : sprintf($user->lang['THANKED'], $row['user_thanks']),
Add after Add these lines on a new blank line after the preceding line(s) to find
OPEN top_five_body.html
Code: Select all
'USER_AVATAR' => get_user_avatar($data['user_avatar'], $data['user_avatar_type'], $data['user_avatar_width'], $data['user_avatar_height']),
'USER_AVATAR_THUMB' => ($row['user_avatar']) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], ($row['user_avatar_width'] > $row['user_avatar_height']) ? 25 : (25 / $row['user_avatar_height']) * $row['user_avatar_width'], ($row['user_avatar_height'] > $row['user_avatar_width']) ? 25 : (25 / $row['user_avatar_width']) * $row['user_avatar_height']) : '<img src="http://i.epvpimg.com/Qg3Pd.gif" width="25px;" height="25px;" alt="" />',
Find This may be a partial find and not the whole line
Code: Select all
<td valign="top"><!-- BEGIN top_five_thanked -->{top_five_thanked.USERNAME_FULL}<br /> {top_five_thanked.THANKS}<br /><!-- END top_five_thanked --></td>
Replace with Replace the preceding lines with the following
OFF: With pleasure Sniper Code: Select all
<td valign="top"><!-- BEGIN top_five_thanked --><div style="margin-top: 3px"><span style="float: left; margin-right: 8px;">{top_five_thanked.USER_AVATAR} {top_five_thanked.USER_AVATAR_THUMB}</span>{top_five_thanked.USERNAME_FULL}<br /> {top_five_thanked.THANKS}<br /></div><!-- END top_five_thanked --></td>
Re: Avatar in top five
Its not working, but thank
-
- Supporter
- Posts: 150
- Joined: 11 Jan 2013, 17:01
- Location: Liverpool, UK
Re: Avatar in top five
I know why because its trying to select data from thanks table.
Re: Avatar in top five
Which means you have to do a left join on the users table.
-
- Supporter
- Posts: 150
- Joined: 11 Jan 2013, 17:01
- Location: Liverpool, UK
Re: Avatar in top five
Yup i will try after phpbb.com its up again.
Re: Avatar in top five
I used this for 3.1.2 on my portal and everything worked except for the resizing of the avatar. Is there a fix for this?Neculai Anișor wrote:This is based on Rich`s code.
OPEN includes/top_five.phpFind This may be a partial find and not the whole lineCode: Select all
global $auth, $cache, $user, $db, $phpbb_root_path, $phpEx, $template;
Add after Add these lines on a new blank line after the preceding line(s) to findCode: Select all
if (!function_exists('get_user_avatar')) { include($phpbb_root_path . 'includes/functions_display.' . $phpEx); }
Find This may be a partial find and not the whole lineCode: Select all
'SELECT' => 'u.user_id, u.username, u.user_colour, t.topic_title, t.forum_id, t.topic_last_post_id, t.topic_last_post_time, t.topic_last_poster_name',
Replace with Replace the preceding lines with the followingCode: Select all
'SELECT' => 'u.user_id, u.username, u.user_colour, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, t.topic_title, t.forum_id, t.topic_last_post_id, t.topic_last_post_time, t.topic_last_poster_name',
Find This may be a partial find and not the whole lineCode: Select all
$is_guest = $row['user_id'] != ANONYMOUS ? false : true;
Add after Add these lines on a new blank line after the preceding line(s) to findCode: Select all
$user_avatar = ($row['user_avatar']) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], ($row['user_avatar_width'] > $row['user_avatar_height']) ? 25 : (25 / $row['user_avatar_height']) * $row['user_avatar_width'], ($row['user_avatar_height'] > $row['user_avatar_width']) ? 25 : (25 / $row['user_avatar_width']) * $row['user_avatar_height']) : '';
Find This may be a partial find and not the whole lineCode: Select all
'TOPIC_TITLE' => $user->lang['IN'] . ' ' . $topic_title));
Replace with Replace the preceding lines with the followingCode: Select all
'TOPIC_TITLE' => '<span style="float: left; margin-right: 8px;">' . $user_avatar . '</span>' . ' ' . $user->lang['IN'] . ' ' . $topic_title));
Find This may be a partial find and not the whole lineCode: Select all
SELECT user_id, username, user_colour, user_regdate
Replace with Replace the preceding lines with the followingCode: Select all
SELECT user_id, user_avatar, user_avatar_type, user_avatar_width, user_avatar_height, username, user_colour, user_regdate
Find This may be a partial find and not the whole lineCode: Select all
$newest_users[$row['user_id']] = array( 'user_id' => $row['user_id'], 'username' => $row['username'], 'user_colour' => $row['user_colour'], 'user_regdate' => $row['user_regdate'],
Add after Add these lines on a new blank line after the preceding line(s) to findCode: Select all
'user_avatar' => $row['user_avatar'], 'user_avatar_type' => $row['user_avatar_type'], 'user_avatar_width' => $row['user_avatar_width'], 'user_avatar_height' => $row['user_avatar_height'],
Find This may be a partial find and not the whole lineCode: Select all
'REG_DATE' => $user->format_date($row['user_regdate']), 'USERNAME_FULL' => $username_string)
Add before Add these lines on a new blank line before the preceding line(s) to findCode: Select all
'USER_AVATAR' => get_user_avatar($data['user_avatar'], $data['user_avatar_type'], $data['user_avatar_width'], $data['user_avatar_height']), 'USER_AVATAR_THUMB' => ($row['user_avatar']) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], ($row['user_avatar_width'] > $row['user_avatar_height']) ? 25 : (25 / $row['user_avatar_height']) * $row['user_avatar_width'], ($row['user_avatar_height'] > $row['user_avatar_width']) ? 25 : (25 / $row['user_avatar_width']) * $row['user_avatar_height']) : '<img src="http://i.epvpimg.com/Qg3Pd.gif" width="25px;" height="25px;" alt="" />',
Find This may be a partial find and not the whole lineCode: Select all
SELECT user_id, username, user_colour, user_posts
Replace with Replace the preceding lines with the followingCode: Select all
SELECT user_id, user_avatar, user_avatar_type, user_avatar_width, user_avatar_height, username, user_colour, user_posts
Find This may be a partial find and not the whole lineCode: Select all
$user_posts[$row['user_id']] = array( 'user_id' => $row['user_id'], 'username' => $row['username'], 'user_colour' => $row['user_colour'], 'user_posts' => $row['user_posts'],
Add after Add these lines on a new blank line after the preceding line(s) to findCode: Select all
'user_avatar' => $row['user_avatar'], 'user_avatar_type' => $row['user_avatar_type'], 'user_avatar_width' => $row['user_avatar_width'], 'user_avatar_height' => $row['user_avatar_height'],
Find This may be a partial find and not the whole lineCode: Select all
'S_SEARCH_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $row['user_id'] . '&sr=posts'), 'POSTS' => $row['user_posts'], 'USERNAME_FULL' => $username_string)
Add before Add these lines on a new blank line before the preceding line(s) to findOPEN top_five_body.htmlCode: Select all
'USER_AVATAR' => get_user_avatar($data['user_avatar'], $data['user_avatar_type'], $data['user_avatar_width'], $data['user_avatar_height']), 'USER_AVATAR_THUMB' => ($row['user_avatar']) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], ($row['user_avatar_width'] > $row['user_avatar_height']) ? 25 : (25 / $row['user_avatar_height']) * $row['user_avatar_width'], ($row['user_avatar_height'] > $row['user_avatar_width']) ? 25 : (25 / $row['user_avatar_width']) * $row['user_avatar_height']) : '<img src="http://i.epvpimg.com/Qg3Pd.gif" width="25px;" height="25px;" alt="" />',
Find This may be a partial find and not the whole lineCode: Select all
<td valign="top"><!-- BEGIN top_five_topic --><!-- IF top_five_topic.NO_TOPIC_TITLE-->{top_five_topic.NO_TOPIC_TITLE}<!-- ELSE --><a href="{top_five_topic.U_TOPIC}">{top_five_topic.TOPIC_TITLE}</a><br /> {top_five_topic.USERNAME_FULL} {top_five_topic.LAST_TOPIC_TIME}<br /><!-- ENDIF --><!-- END top_five_topic --></td> <td valign="top"><!-- BEGIN top_five_active -->{top_five_active.USERNAME_FULL}<br /> {L_POSTS}: <a href="{top_five_active.S_SEARCH_ACTION}">{top_five_active.POSTS}</a><br /><!-- END top_five_active --></td> <td valign="top"><!-- BEGIN top_five_newest -->{top_five_newest.USERNAME_FULL}<br /> {L_JOINED}: {top_five_newest.REG_DATE}<br /><!-- END top_five_newest --></td>
Replace with Replace the preceding lines with the followingCode: Select all
<td valign="top"><!-- BEGIN top_five_topic --><div style="margin-top: 3px"><!-- IF top_five_topic.NO_TOPIC_TITLE-->{top_five_topic.NO_TOPIC_TITLE}<!-- ELSE --><a href="{top_five_topic.U_TOPIC}">{top_five_topic.TOPIC_TITLE}</a><br />{top_five_topic.USERNAME_FULL} {top_five_topic.LAST_TOPIC_TIME}<br /></div><!-- ENDIF --><!-- END top_five_topic --></td> <td valign="top"><!-- BEGIN top_five_active --><div style="margin-top: 3px"><span style="float: left; margin-right: 8px;">{top_five_active.USER_AVATAR} {top_five_active.USER_AVATAR_THUMB}</span>{top_five_active.USERNAME_FULL}<br />{L_POSTS}: <a href="{top_five_active.S_SEARCH_ACTION}">{top_five_active.POSTS}</a><br /></div><!-- END top_five_active --></td> <td valign="top"><!-- BEGIN top_five_newest --><div style="margin-top: 3px"><span style="float: left; margin-right: 8px;">{top_five_newest.USER_AVATAR} {top_five_newest.USER_AVATAR_THUMB}</span>{top_five_newest.USERNAME_FULL}<br />{L_JOINED}: {top_five_newest.REG_DATE}<br /></div><!-- END top_five_newest --></td>
Results