PDA

View Full Version : Make avatars a link to user's homepage


Chen
10 Aug 2001, 15:06
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! :)

dxb
11 Aug 2001, 01:26
simple and effective firefly good job :)

Sinema
11 Aug 2001, 02:09
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-
11 Aug 2001, 02:11
Nice hack! I'll have to try it out. https://www.vbulletin.org/forum/

Chen
11 Aug 2001, 05:41
Thanks all! :)

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
No, I don't know what you mean... :confused: :(

Omega
11 Aug 2001, 07:47
Hmm dont you mean showthread.php instead of functions.php???

Sinema
11 Aug 2001, 10:16
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
11 Aug 2001, 10:56
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?

Chen
11 Aug 2001, 13:23
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
11 Aug 2001, 13:35
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.

Chen
11 Aug 2001, 13:40
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
11 Aug 2001, 17:38
2.0.3

$bbregex[bbcodetag]);
}
$searcharray[] = $regex;
$replacearray[] = $bbregex[bbcodereplacement];

Chen
11 Aug 2001, 17:48
This is strange, for me the code you pasted is on line 717.

Make sure that you didn't dropped / added any unnecessary } or {.

Meta
24 Dec 2001, 18:29
Works fine for me ... thank you for this nice little hack, Firefly!

Rick
25 Dec 2001, 01:00
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
03 Apr 2007, 00:41
Is this or anything similar avaliable for 3.6 would anyone know? thanks