Avatar in top five

Support for mods released by phpbbmodders.net found at either https://github.com/phpbbmodders/ or the MODDB at http://www.phpbb.com
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
BOoOm
New member
New member
Posts: 14
Joined: 24 Jan 2014, 00:26

Avatar in top five

Postby BOoOm » 26 Aug 2014, 10:12

How to add? :D

User avatar
RMcGirr83
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: Avatar in top five

Postby RMcGirr83 » 26 Aug 2014, 10:56


BOoOm
New member
New member
Posts: 14
Joined: 24 Jan 2014, 00:26

Re: Avatar in top five

Postby BOoOm » 26 Aug 2014, 11:04

Its only for latest post, i wanna for all include top online and top thanks :D

User avatar
RMcGirr83
Past Contributor
Past Contributor
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: Avatar in top five

Postby RMcGirr83 » 26 Aug 2014, 11:11

Everything you need is in that topic except for top thanks which is an addon. You will have to try and ***gasp*** learn.

User avatar
Neculai Anișor
Supporter
Supporter
Posts: 150
Joined: 11 Jan 2013, 17:01
Location: Liverpool, UK

Re: Avatar in top five

Postby Neculai Anișor » 26 Aug 2014, 11:53

This is based on Rich`s code.

OPEN includes/top_five.php
Find This may be a partial find and not the whole line

Code: 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 find

Code: 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 line

Code: 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 following

Code: 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 line

Code: 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 find

Code: 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 line

Code: Select all

'TOPIC_TITLE'    => $user->lang['IN'] . ' ' . $topic_title));

Replace with Replace the preceding lines with the following

Code: 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 line

Code: Select all

SELECT user_id, username, user_colour, user_regdate

Replace with Replace the preceding lines with the following

Code: 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 line

Code: 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 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

         '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 find

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

SELECT user_id, username, user_colour, user_posts

Replace with Replace the preceding lines with the following

Code: 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 line

Code: 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 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

 'S_SEARCH_ACTION'   => append_sid("{$phpbb_root_path}search.$phpEx", 'author_id=' . $row['user_id'] . '&amp;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 find

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="" />',


OPEN top_five_body.html
Find This may be a partial find and not the whole line

Code: 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 />&nbsp;&nbsp;{top_five_topic.USERNAME_FULL}&nbsp;&nbsp;{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 />&nbsp;&nbsp;{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 />&nbsp;&nbsp;{L_JOINED}: {top_five_newest.REG_DATE}<br /><!-- END top_five_newest --></td>

Replace with Replace the preceding lines with the following

Code: 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}&nbsp;{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}&nbsp;{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}&nbsp;{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>


[img]http://i.epvpimg.com/C1HFd.png[/img]

BOoOm
New member
New member
Posts: 14
Joined: 24 Jan 2014, 00:26

Re: Avatar in top five

Postby BOoOm » 26 Aug 2014, 13:26

Thanks its good, can you give me for online and thanks too? :D

User avatar
Neculai Anișor
Supporter
Supporter
Posts: 150
Joined: 11 Jan 2013, 17:01
Location: Liverpool, UK

Re: Avatar in top five

Postby Neculai Anișor » 26 Aug 2014, 14:01

Dont know what that means.

BOoOm
New member
New member
Posts: 14
Joined: 24 Jan 2014, 00:26

Re: Avatar in top five

Postby BOoOm » 26 Aug 2014, 14:19


User avatar
Neculai Anișor
Supporter
Supporter
Posts: 150
Joined: 11 Jan 2013, 17:01
Location: Liverpool, UK

Re: Avatar in top five

Postby Neculai Anișor » 26 Aug 2014, 15:02

Link to your board please.

BOoOm
New member
New member
Posts: 14
Joined: 24 Jan 2014, 00:26

Re: Avatar in top five

Postby BOoOm » 26 Aug 2014, 15:08


User avatar
Neculai Anișor
Supporter
Supporter
Posts: 150
Joined: 11 Jan 2013, 17:01
Location: Liverpool, UK

Re: Avatar in top five

Postby Neculai Anișor » 26 Aug 2014, 15:18

Where is your top five?

BOoOm
New member
New member
Posts: 14
Joined: 24 Jan 2014, 00:26

Re: Avatar in top five

Postby BOoOm » 26 Aug 2014, 15:20

sidebar u must be log in

http://prntscr.com/4gnqdy

[img]http://www.dodaj.rs/f/2p/7Q/4I0WJGfU/sjenica-community-index-.png[/img]

User avatar
Neculai Anișor
Supporter
Supporter
Posts: 150
Joined: 11 Jan 2013, 17:01
Location: Liverpool, UK

Re: Avatar in top five

Postby Neculai Anișor » 26 Aug 2014, 15:49

Try this ..

OPEN includes/top_five.php

Find This may be a partial find and not the whole line

Code: Select all

$sql = 'SELECT user_id, username, user_colour, user_online_timeformat, user_online_time

Replace with Replace the preceding lines with the following

Code: Select all

$sql = 'SELECT user_id, user_avatar, user_avatar_type, user_avatar_width, user_avatar_height, username, user_colour, user_online_timeformat, user_online_time

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_online_timeformat'    => $row['user_online_timeformat'],
         'user_online_time'   => $row['user_online_time'],

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

'USERNAME_FULL'      => $username_string)

Add before Add these lines on a new blank line before the preceding line(s) to find

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="" />',


OPEN top_five_body.html
Find This may be a partial find and not the whole line

Code: Select all

<td valign="top"><!-- BEGIN top_five_online -->{top_five_online.USERNAME_FULL}<br />{L_TOTAL_TIME_LOGGED_IN}: {top_five_online.USER_ONLINE_TIME}<br /><!-- END top_five_online --></td>

Replace with Replace the preceding lines with the following

Code: Select all

<td valign="top"><!-- BEGIN top_five_online --><div style="margin-top: 3px"><span style="float: left; margin-right: 8px;">{top_five_online.USER_AVATAR}&nbsp;{top_five_online.USER_AVATAR_THUMB}</span>{top_five_online.USERNAME_FULL}<br />{L_TOTAL_TIME_LOGGED_IN}: {top_five_online.USER_ONLINE_TIME}<br /></div><!-- END top_five_online --></td>

BOoOm
New member
New member
Posts: 14
Joined: 24 Jan 2014, 00:26

Re: Avatar in top five

Postby BOoOm » 26 Aug 2014, 20:42

its work :D
can you give me for thanks mod? :D

User avatar
Neculai Anișor
Supporter
Supporter
Posts: 150
Joined: 11 Jan 2013, 17:01
Location: Liverpool, UK

Re: Avatar in top five

Postby Neculai Anișor » 26 Aug 2014, 22:07

I have to try it first.


Return to “Modders MOD support”

Who is online

Users browsing this forum: CommonCrawl [Bot] and 4 guests