View Full Version : Make avatars a link to user's homepage
Admin
08-09-2001, 10:00 PM
This hack was requested by Sinema.
1. Open functions.php (in your admin folder), and find
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="";
} else {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
}
replace it with
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="";
} else {
if ($post[homepage]!="" and $post[homepage]!="http://") {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar_link")."\";");
} else {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
}
}
2. Add a template and name it postbit_avatar_link with this
<a href="$post[homepage]" target="_blank"><img src="$avatarurl" border="0" alt="Visit $post[username]'s homepage!"></a>
And that's it! :)
See a demo here:
http://forum.t-cove.com/showthread.php?threadid=5
Feedback is welcome! :)
simple and effective firefly good job :)
Sinema
08-11-2001, 01:09 AM
Hey that worked like a charm!!
Thanks a lot of fan site owners will love that!
Hey quick question
Is there a way to preset certain buttons to have a certain URL?
I don't want people promoting their site with someon elses button .. if you know what I mean
badmeetsevil-
08-11-2001, 01:11 AM
Nice hack! I'll have to try it out. https://vborg.vbsupport.ru/
Admin
08-11-2001, 04:41 AM
Thanks all! :)
[QUOTE]Originally posted by Sinema
Is there a way to preset certain buttons to have a certain URL?
I don't want people promoting their site with someon elses button .. if you know what I mean
Omega
08-11-2001, 06:47 AM
Hmm dont you mean showthread.php instead of functions.php???
Sinema
08-11-2001, 09:16 AM
It's like presetting the image
Lets say your using a button for TheBronze.tv
the image was created for TheBronze.tv so when the person selects it .. it automatically is linked back to
http://www.thebronze.tv
this way people can't use the "Bronze" button to promote their own site ..
Piston
08-11-2001, 09:56 AM
I keep getting a parse error on line 226 of Functions.php
I've retried 4 times just to make sure with the same results each time. Any Idea's?
Admin
08-11-2001, 12:23 PM
Omega: No, I mean functions.php. :)
Sinema: Would someone explain me what he wants? :p
Piston: What version of vB are you running, and what's line 226?
Sinema
08-11-2001, 12:35 PM
LoL let me try again
Right now you can use buttons and whatever URL you enter in your Profile is the url that is used.
However I'm curious if there is a way to preset the URL
So if a user selects an Avatar from Avatars uploaded .. the url is already preset .
Example
Joe Bob goes and selects an avatar for the site "SpikeSpotting.com"
The avatar is a button promoting the site "SpikeSpotting.com"
instead of Joe Bob going into his profile and entering in http://www.spikespotting.com in his "Homepage" section ..
the urls could be preset so he selects the SpikeSpotting avatar and it automatically hyperlinks to http://www.spikespotting.com
This would stop users from using Buttons to promote their own site and have them promote the site of the avatar they are using.
Admin
08-11-2001, 12:40 PM
Then why didn't you say so?! :)
Now I understand what you mean... to associate URLs with certain avatars.
Err... I'm not sure if I know how to do this... I suggest you request this from another guy. :(
Piston
08-11-2001, 04:38 PM
2.0.3
$bbregex[bbcodetag]);
}
$searcharray[] = $regex;
$replacearray[] = $bbregex[bbcodereplacement];
Admin
08-11-2001, 04:48 PM
This is strange, for me the code you pasted is on line 717.
Make sure that you didn't dropped / added any unnecessary } or {.
Works fine for me ... thank you for this nice little hack, Firefly!
I tried installing this hack and my avatars disappeared. I replaced the code and created the new template, but no luck...
Of course I now have the avatars back since I replaced the code.
ams3521
04-02-2007, 11:41 PM
Is this or anything similar avaliable for 3.6 would anyone know? thanks
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.