phpBBHacks.com - [RC] Avatar of poster on Index and Viewforum 1.2.1
Get Photoshop help and share your work at PhotoshopForums.com
StatsForums Home   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in
FAQFAQ   SearchSearch   MemberlistMemberlist   TutorialsTutorials   ContactContact Us
Add Us:     MySpace     Facebook     StumbleUpon
Username:    Password:
Remember Me?    
[RC] Avatar of poster on Index and Viewforum 1.2.1
Goto page 1, 2  Next
BlinkList
del.icio.us
Furl
linkaGoGo
reddit
Simpy
Mister Wong
Yahoo! My Web

Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 3 Hack Development
 See a User Guidelines violation? Please contact us.
Author Message

lefty74
Not So New User

Joined: 13 Feb 2006
Posts: 81

PostPosted: June 22nd 2007, 1:47 pm    Post subject: [RC] Avatar of poster on Index and Viewforum 1.2.1 Reply with quote

MOD Title:Avatar of poster on Index and Viewforum
MOD Description:Shows the last poster's avatar in on the Index and subforums as well as the author's avatar and last poster's avatar on Viewforum
MOD Version:1.2.1
phpBB Version:3.0.4

MOD Download: [RC] Avatar of poster on Index and Viewforum 1.2.1

Demo: Demoboard
prosilver index

prosilver viewforum

subsilver2 index

subsilver2 viewforum


Last edited by lefty74 on December 13th 2008, 8:36 am; edited 10 times in total
Back to top
View user's profile Send private message Visit poster's website MSN Messenger

Patrick
Admin/Webmaster

Joined: 11 May 2001
Posts: 12847
Location: Harbinger, NC, U.S.A.

PostPosted: June 23rd 2007, 8:58 am    Post subject: Reply with quote

Thanks for posting, lefty74. Looks like an interesting addition. It reminds me of the old ezboards, but these avatars, you can actually see.
_________________
Patrick O'Keefe - phpBBHacks.com Administrator
Author, Managing Online Forums (New Book)

Have a suggestion or a bit of feedback relating to phpBBHacks.com? Please contact me!
User Guidelines - phpBBHacks.com Awards - Featured phpBB - About Us - Supported Sites - Utilities
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger

lefty74
Not So New User

Joined: 13 Feb 2006
Posts: 81

PostPosted: June 23rd 2007, 5:41 pm    Post subject: Reply with quote

Thanks Patrick

edit:
updated Install instructions to make RC2 compliant
Back to top
View user's profile Send private message Visit poster's website MSN Messenger

lefty74
Not So New User

Joined: 13 Feb 2006
Posts: 81

PostPosted: August 21st 2007, 3:58 pm    Post subject: Reply with quote

upgraded to fix bug when moving, merging posts etc via mcp.

to upgrade from version 0.1.2 just do the changes for includes/functions_admin.php
Back to top
View user's profile Send private message Visit poster's website MSN Messenger

lefty74
Not So New User

Joined: 13 Feb 2006
Posts: 81

PostPosted: October 28th 2007, 3:06 pm    Post subject: Reply with quote

updated to v 020 which fixes a bug when updating the avatar, also now fixes the problem when avatars smaller then the max dimensions are uploaded.

to upgrade from 0.1.3 to 0.2.0
Code:
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_user.php
#
#-----[ FIND ]------------------------------------------
#
      user_update_avatar($user_id, $sql_ary['user_avatar'], $sql_ary['user_avatar_type'], $sql_ary['user_avatar_width'], $sql_ary['user_avatar_width']);         
#
#-----[ REPLACE WITH ]------------------------------------------
#
      user_update_avatar($user_id, $sql_ary['user_avatar'], $sql_ary['user_avatar_type'], $sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']);         
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_display.php
#
#-----[ FIND ]------------------------------------------
#
      $template->assign_block_vars('forumrow', array(
#
#-----[ BEFORE, ADD ]------------------------------------------
#
      $avatar_max_dimensions = $avatar_width = $avatar_height = '';
      if ( !empty($row['forum_last_poster_avatar']) )
      {
      $avatar_max_dimensions = 40; // here you can change the max-width you would like to have the avatars displayed
      
         if ( $row['forum_last_poster_avatar_width'] >= $row['forum_last_poster_avatar_height'] )
         {
         $avatar_width = ( $row['forum_last_poster_avatar_width'] > $avatar_max_dimensions ) ? $avatar_max_dimensions : $row['forum_last_poster_avatar_width'] ;
         $avatar_height = ( $avatar_width == $avatar_max_dimensions ) ? round($avatar_max_dimensions / $row['forum_last_poster_avatar_width'] * $row['forum_last_poster_avatar_height']) : $row['forum_last_poster_avatar_height'] ;
         }
         else
         {
         $avatar_height = ( $row['forum_last_poster_avatar_height'] > $avatar_max_dimensions ) ? $avatar_max_dimensions : $row['forum_last_poster_avatar_height'] ;
         $avatar_width = ( $avatar_height == $avatar_max_dimensions ) ? round($avatar_max_dimensions / $row['forum_last_poster_avatar_height'] * $row['forum_last_poster_avatar_width']) : $row['forum_last_poster_avatar_width'] ;
         }
      }

#
#-----[ FIND ]------------------------------------------
#
//         if you want the avatar resized to another width then 40, change the value 40 to whichever you like
// Use the following if you want to keep the original avatar size
//         'LAST_POSTER_AVATAR'   => get_user_avatar($row['forum_last_poster_avatar'], $row['forum_last_poster_avatar_type'], $row['forum_last_poster_avatar_width'], $row['forum_last_poster_avatar_height']),
         'LAST_POSTER_AVATAR'   => get_user_avatar($row['forum_last_poster_avatar'], $row['forum_last_poster_avatar_type'], '40', ''),


#
#-----[ REPLACE WITH ]------------------------------------------
#
         'LAST_POSTER_AVATAR'   => get_user_avatar($row['forum_last_poster_avatar'], $row['forum_last_poster_avatar_type'], $avatar_width, $avatar_height),
         'LAST_POSTER_AVATAR_MARGIN'   => ( $avatar_width == $avatar_max_dimensions ) ? 5 : ( $avatar_max_dimensions - $avatar_width + 5 ),
         'AVATAR_WIDTH'         => $avatar_max_dimensions,
#
#-----[ FIND ]------------------------------------------
#
// have to add this as otherwise IE wont show the avatar properly ... IE SUCKS
   if ( empty($avatar_height) )
   {
   return '<img src="' . $avatar_img . '" width="' . $avatar_width . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
   }
   else
   {
   return '<img src="' . $avatar_img . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
   }
#
#-----[ REPLACE WITH ]------------------------------------------
#   restoring the original code, careful though if you have other avatar mods installed from me, they may be using the previous code
   return '<img src="' . $avatar_img . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
#
#-----[ OPEN ]------------------------------------------
#
viewforum.php
#
#-----[ FIND ]------------------------------------------
#
      // Send vars to template
      $template->assign_block_vars('topicrow', array(
#
#-----[ BEFORE, ADD ]------------------------------------------
#
      $avatar_img = $avatar_max_dimensions = $topic_last_poster_avatar_height = $topic_last_poster_avatar_width = $topic_first_poster_avatar_width = $topic_first_poster_avatar_height = '';
      
      if ( !empty($row['topic_first_poster_avatar']) || !empty($row['topic_last_poster_avatar']))
      {
      $avatar_max_dimensions = 40; // here you can change the max-width you would like to have the avatars displayed
      
         if ( $row['topic_first_poster_avatar_width'] >= $row['topic_first_poster_avatar_height'] )
         {
         $topic_first_poster_avatar_width = ( $row['topic_first_poster_avatar_width'] > $avatar_max_dimensions ) ? $avatar_max_dimensions : $row['topic_first_poster_avatar_width'] ;
         $topic_first_poster_avatar_height = ( $topic_first_poster_avatar_width == $avatar_max_dimensions ) ? round($avatar_max_dimensions / $row['topic_first_poster_avatar_width'] * $row['topic_first_poster_avatar_height']) : $row['topic_first_poster_avatar_height'] ;
         }
         else
         {
         $topic_first_poster_avatar_height = ( $row['topic_first_poster_avatar_height'] > $avatar_max_dimensions ) ? $avatar_max_dimensions : $row['topic_first_poster_avatar_height'] ;
         $topic_first_poster_avatar_width = ( $topic_first_poster_avatar_height == $avatar_max_dimensions ) ? round($avatar_max_dimensions / $row['topic_first_poster_avatar_height'] * $row['topic_first_poster_avatar_width']) : $row['topic_first_poster_avatar_width'] ;
         }

         if ( $row['topic_last_poster_avatar_width'] >= $row['topic_last_poster_avatar_height'] )
         {
         $topic_last_poster_avatar_width = ( $row['topic_last_poster_avatar_width'] > $avatar_max_dimensions ) ? $avatar_max_dimensions : $row['topic_last_poster_avatar_width'] ;
         $topic_last_poster_avatar_height = ( $topic_last_poster_avatar_width == $avatar_max_dimensions ) ? round($avatar_max_dimensions / $row['topic_last_poster_avatar_width'] * $row['topic_last_poster_avatar_height']) : $row['topic_last_poster_avatar_height'] ;
         }
         else
         {
         $topic_last_poster_avatar_height = ( $row['topic_last_poster_avatar_height'] > $avatar_max_dimensions ) ? $avatar_max_dimensions : $row['topic_last_poster_avatar_height'] ;
         $topic_last_poster_avatar_width = ( $topic_last_poster_avatar_height == $avatar_max_dimensions ) ? round($avatar_max_dimensions / $row['topic_last_poster_avatar_height'] * $row['topic_last_poster_avatar_width']) : $row['topic_last_poster_avatar_width'] ;
         }
         
      }
#
#-----[ FIND ]------------------------------------------
#
//         if you want the avatar resized to another width then 40, change the value 40 to whichever you like
// Use the following if you want to keep the original avatar size
//         'TOPIC_AUTHOR_AVATAR'   => get_user_avatar($row['topic_first_poster_avatar'], $row['topic_first_poster_avatar_type'], $row['topic_first_poster_avatar_width'], $row['topic_first_poster_avatar_height']),
         'TOPIC_AUTHOR_AVATAR'      => get_user_avatar($row['topic_first_poster_avatar'], $row['topic_first_poster_avatar_type'], '40', ''),
#
#-----[ REPLACE WITH ]------------------------------------------
#   
         'TOPIC_AUTHOR_AVATAR'      => get_user_avatar($row['topic_first_poster_avatar'], $row['topic_first_poster_avatar_type'], $topic_first_poster_avatar_width, $topic_first_poster_avatar_height),
         'TOPIC_AUTHOR_AVATAR_MARGIN'   => ( $topic_first_poster_avatar_width == '' ) ? '' : (( $topic_first_poster_avatar_width == $avatar_max_dimensions ) ? 5 : ( $avatar_max_dimensions - $topic_first_poster_avatar_width + 5 )),
         'AVATAR_WIDTH'            => $avatar_max_dimensions ,
#
#-----[ FIND ]------------------------------------------
#
//         if you want the avatar resized to another width then 40, change the value 40 to whichever you like
// Use the following if you want to keep the original avatar size
//         'LAST_POST_AUTHOR_AVATAR'   => get_user_avatar($row['topic_last_poster_avatar'], $row['topic_last_poster_avatar_type'], $row['topic_last_poster_avatar_width'], $row['topic_last_poster_avatar_height']),
         'LAST_POST_AUTHOR_AVATAR'         => get_user_avatar($row['topic_last_poster_avatar'], $row['topic_last_poster_avatar_type'], '40', ''),
#
#-----[ REPLACE WITH ]------------------------------------------
#         
         'LAST_POST_AUTHOR_AVATAR'   => get_user_avatar($row['topic_last_poster_avatar'], $row['topic_last_poster_avatar_type'], $topic_last_poster_avatar_width, $topic_last_poster_avatar_height),
         'LAST_POST_AUTHOR_AVATAR_MARGIN'=> ( $topic_last_poster_avatar_width == $avatar_max_dimensions ) ? 5 : ( $avatar_max_dimensions - $topic_last_poster_avatar_width + 5 ),
#
#-----[ OPEN ]------------------------------------------
#
styles/prosilver/template/forumlist_body.html
#
#-----[ FIND ]------------------------------------------
#
               <dd class="lastpost"><span><div style="float: left; padding-top: 0px; margin-right: 5px;">{forumrow.LAST_POSTER_AVATAR}</div>
#
#-----[ REPLACE WITH ]------------------------------------------
#         
               <dd class="lastpost"><span><div style="float: left; padding-top: 0px; margin-right: {forumrow.LAST_POSTER_AVATAR_MARGIN}px;">{forumrow.LAST_POSTER_AVATAR}</div>
#
#-----[ OPEN ]------------------------------------------
#
styles/prosilver/template/viewforum_body.html
#
#-----[ FIND ]------------------------------------------
#
            <dt style="<!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS -->background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;<!-- ENDIF -->" title="{topicrow.TOPIC_FOLDER_IMG_ALT}"> <div style="float: left; padding-top: 3px; margin-right: 5px;">{topicrow.TOPIC_AUTHOR_AVATAR}</div><!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
#
#-----[ REPLACE WITH ]------------------------------------------
#         
            <dt style="<!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS -->background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;<!-- ENDIF -->" title="{topicrow.TOPIC_FOLDER_IMG_ALT}"> <div style="float: left; padding-top: 3px; margin-right: {topicrow.TOPIC_AUTHOR_AVATAR_MARGIN}px;">{topicrow.TOPIC_AUTHOR_AVATAR}</div><!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
#
#-----[ FIND ]------------------------------------------
#
            <dd class="lastpost"> <div style="float: left; padding-top: 0px; margin-right: 5px;">{topicrow.LAST_POST_AUTHOR_AVATAR}</div><span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL}
#
#-----[ REPLACE WITH ]------------------------------------------
#         
            <dd class="lastpost"> <div style="float: left; padding-top: 0px; margin-right: {topicrow.LAST_POST_AUTHOR_AVATAR_MARGIN}px;">{topicrow.LAST_POST_AUTHOR_AVATAR}</div><span><dfn>{L_LAST_POST} </dfn>{L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL}
#
#-----[ OPEN ]------------------------------------------
#
styles/subsilver2/template/forumlist_body.html
#
#-----[ FIND ]------------------------------------------
#
            <td width="40">{forumrow.LAST_POSTER_AVATAR}</td>
            <td align="center" width="100%" nowrap="nowrap">
#
#-----[ REPLACE WITH ]------------------------------------------
#         
            <!-- IF forumrow.LAST_POSTER_AVATAR --><td width="{forumrow.AVATAR_WIDTH}">{forumrow.LAST_POSTER_AVATAR}</td><!-- ENDIF -->
            <td align="center"  nowrap="nowrap">
#
#-----[ OPEN ]------------------------------------------
#
styles/subsilver2/template/viewforum_body.html
#
#-----[ FIND ]------------------------------------------
#
         <td >{topicrow.TOPIC_AUTHOR_AVATAR}</td>
#
#-----[ REPLACE WITH ]------------------------------------------
#         
         <!-- IF topicrow.TOPIC_AUTHOR_AVATAR --><td align="center" width="{topicrow.AVATAR_WIDTH}" >{topicrow.TOPIC_AUTHOR_AVATAR}</td><!-- ENDIF -->
#
#-----[ FIND ]------------------------------------------
#
         <td >{topicrow.LAST_POST_AUTHOR_AVATAR}</td>
#
#-----[ REPLACE WITH ]------------------------------------------
#         
         <!-- IF topicrow.LAST_POST_AUTHOR_AVATAR --> <td width="{topicrow.AVATAR_WIDTH}">{topicrow.LAST_POST_AUTHOR_AVATAR}</td><!-- ENDIF -->
#
#-----[ FIND ]------------------------------------------
#
         <td >{topicrow.TOPIC_AUTHOR_AVATAR}</td>
#
#-----[ REPLACE WITH ]------------------------------------------
#         
         <!-- IF topicrow.TOPIC_AUTHOR_AVATAR --><td align="center" width="{topicrow.AVATAR_WIDTH}" >{topicrow.TOPIC_AUTHOR_AVATAR}</td><!-- ENDIF -->
#
#-----[ FIND ]------------------------------------------
#
         <td >{topicrow.LAST_POST_AUTHOR_AVATAR}</td>
#
#-----[ REPLACE WITH ]------------------------------------------
#         
         <!-- IF topicrow.LAST_POST_AUTHOR_AVATAR --> <td width="{topicrow.AVATAR_WIDTH}">{topicrow.LAST_POST_AUTHOR_AVATAR}</td><!-- ENDIF -->
#
#-----[ DIY INSTRUCTIONS ]------------------------------------------
#
Refresh all your templates and clear your cache via the ACP after editing the template files.
Copy avatar_update.php to the root folder and run it to update earlier topic author or last post avatar data.
            
Back to top
View user's profile Send private message Visit poster's website MSN Messenger

dr skunk
Not So New User

Joined: 01 Mar 2008
Posts: 27

PostPosted: March 6th 2008, 4:30 am    Post subject: Reply with quote

very, very cool. I'm looking forward to the end of this one.
Back to top
View user's profile Send private message Visit poster's website

~HG~
Dedicated User

Joined: 08 Nov 2003
Posts: 3232
Location: Australia

PostPosted: May 5th 2008, 12:30 pm    Post subject: Reply with quote

Does this hack change the size of the user avatar in their profile and mini profile on view topic?
_________________
~HG~

|| rodneyangell.com || My Hacks || Tutorial - Stopping Spam Bots
Back to top
View user's profile Send private message Send e-mail Visit poster's website

lefty74
Not So New User

Joined: 13 Feb 2006
Posts: 81

PostPosted: May 5th 2008, 1:41 pm    Post subject: Reply with quote

only the display size, it changes it to 40px longest side.

Code:
      $avatar_max_dimensions = 40; // here you can change the max-width you would like to have the avatars displayed

_________________
www.zoocrew.eu - Help us save our wildlife -
Back to top
View user's profile Send private message Visit poster's website MSN Messenger

~HG~
Dedicated User

Joined: 08 Nov 2003
Posts: 3232
Location: Australia

PostPosted: May 7th 2008, 12:31 pm    Post subject: Reply with quote

That much I understand but does it change the size in view profile and view topics or does it only change the size on the index?
_________________
~HG~

|| rodneyangell.com || My Hacks || Tutorial - Stopping Spam Bots
Back to top
View user's profile Send private message Send e-mail Visit poster's website

lefty74
Not So New User

Joined: 13 Feb 2006
Posts: 81

PostPosted: May 7th 2008, 12:45 pm    Post subject: Reply with quote

no, index and viewforum only (as per mod title) it won't do anything to profile and viewtopic
_________________
www.zoocrew.eu - Help us save our wildlife -
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 3 Hack Development All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Links: Big Message Boards - Free JavaScript - phpBB2 - phpbb styles - Suporte phpBB - phpBB.it - phpBB Česky - phpBB Turkiye - phpBBArabia.com - phpBB-fr.com - Romanian phpBB online community - phpBB-TW.net - phpBBservice.nl - phpBB Brasil

Network: iFroggy Network Blog - iFroggy Hosting - SportsForums.net - KarateForums.com - YanksBlog.com - PhotoshopForums.com - DeveloperCube - Managing Online Forums - ManagingCommunities.com - CommunityAdmins.com - DrGregHouse.com - Bad Boy Blog - SodaRatings.com - Patrick O'Keefe

< Advertising - Contact Us - Staff - User Guidelines >

Copyright © 2001-2009. iFroggy Network, phpBBHacks.com. All Rights Reserved. Privacy Policy. We Support phpBBHacks.com (of course!).
Powered by phpBB © phpBB Group. phpBB SEO. Hosted by 100MegsWebHosting. We are in no way affiliated with the phpBB Group. phpBB is copyright to the phpBB Group.