Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Link Avatar to Profile V1.3 for YaBB 2.4 (Read 144 times)
Derek Barnstorm
God Member
*****
Offline



Posts: 1146
Location: Warwickshire
Joined: Mar 23rd, 2008
Gender: Male
Link Avatar to Profile V1.3 for YaBB 2.4
Jun 16th, 2009 at 6:23pm
Print Post  
Link Avatar to Profile V1.3

Description:
----------------
This is just an extremely simple hack that will link user avatars to their profile. Avatars are only clickable when logged in.

Installation:
----------------
Modify YaBB files using BoardMod or manually.
Upload modified files to your server. 

Files to edit:
----------------
Admin/ModList.pl
Sources/Load.pl

Zip package:
-----------------
Link_Avatar_to_Profile_V1_3.mod

History:
----------
1.0 - First Release - 16th November 2008
1.1 - Updated for YaBB 2.3.1 - 4th January 2009
1.2 - Updated for YaBB 2.4 - 16th June 2009
1.3 - Removed unneeded '!$iamguest' variable - 12th November 2009
« Last Edit: Nov 12th, 2009 at 11:56pm by Derek Barnstorm »  

Back to top
 
IP Logged
 
Unilat
Full Member
***
Offline



Posts: 164
Location: Making Stuff
Joined: Jun 26th, 2008
Gender: Male
Re: Link Avatar to Profile V1.2 for YaBB 2.4
Reply #1 - Jun 16th, 2009 at 6:45pm
Print Post  
I was just thinking, what if a user puts a link of their own in the signature? Will this overwrite it?
  
Back to top
WWWAIM  
IP Logged
 
Derek Barnstorm
God Member
*****
Offline



Posts: 1146
Location: Warwickshire
Joined: Mar 23rd, 2008
Gender: Male
Re: Link Avatar to Profile V1.2 for YaBB 2.4
Reply #2 - Jun 16th, 2009 at 6:52pm
Print Post  
I'm afraid I'm not to sure what you mean...

This deserves 'The Worlds Simplest Forum Modification Award'  Grin

All it does is, when clicking on a users avatar it links to their profile...

The only change is in Load.pl (maybe there is a better way?)

Code
Select All
<search for>
	if ($showuserpic && $allowpics) {
		${$uid.$user}{'userpic'} ||= 'blank.gif';
		${$uid.$user}{'userpic'} = qq~<img src="~ .(${$uid.$user}{'userpic'} =~ m~\A[\s\n]*https?://~i ? ${$uid.$user}{'userpic'} : "$facesurl/${$uid.$user}{'userpic'}") . qq~" name="avatar_img_resize" alt="" border="0" style="display:none" /><br />~;
	} else {
		${$uid.$user}{'userpic'} = '<br />';
	}
</search for>

<replace>
	if ($showuserpic && $allowpics && $iamguest) {
		${$uid.$user}{'userpic'} ||= 'blank.gif';
		${$uid.$user}{'userpic'} = qq~<img src="~ .(${$uid.$user}{'userpic'} =~ m~\A[\s\n]*https?://~i ? ${$uid.$user}{'userpic'} : "$facesurl/${$uid.$user}{'userpic'}") . qq~" name="avatar_img_resize" alt="" border="0" style="display:none" /><br />~;
	} elsif ($showuserpic && $allowpics && !$iamguest) {
		${$uid.$user}{'userpic'} ||= 'blank.gif';
		${$uid.$user}{'userpic'} = qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$user}"><img src="~ .(${$uid.$user}{'userpic'} =~ m~\A[\s\n]*https?://~i ? ${$uid.$user}{'userpic'} : "$facesurl/${$uid.$user}{'userpic'}") . qq~" name="avatar_img_resize" alt="" border="0" style="display:none" /></a><br />~;
	} else {
		${$uid.$user}{'userpic'} = '<br />';
	}
</replace> 




  
Back to top
 
IP Logged
 
Unilat
Full Member
***
Offline



Posts: 164
Location: Making Stuff
Joined: Jun 26th, 2008
Gender: Male
Re: Link Avatar to Profile V1.2 for YaBB 2.4
Reply #3 - Jun 17th, 2009 at 4:58pm
Print Post  
Oh I read wrong. I was thinking that this linked an image in the user's signature!

My fault  Wink
  
Back to top
WWWAIM  
IP Logged
 
Derek Barnstorm
God Member
*****
Offline



Posts: 1146
Location: Warwickshire
Joined: Mar 23rd, 2008
Gender: Male
Re: Link Avatar to Profile V1.2 for YaBB 2.4
Reply #4 - Jun 17th, 2009 at 8:33pm
Print Post  
Ah, no worries. Smiley
  
Back to top
 
IP Logged
 
Derek Barnstorm
God Member
*****
Offline



Posts: 1146
Location: Warwickshire
Joined: Mar 23rd, 2008
Gender: Male
Re: Link Avatar to Profile V1.3 for YaBB 2.4
Reply #5 - Nov 12th, 2009 at 11:57pm
Print Post  
I've removed an unneeded '!$iamguest' variable from this.

New Zip attached to first post.

I'll call this simple one done soon.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint