vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Make avatars a link to user's homepage (https://vborg.vbsupport.ru/showthread.php?t=25046)

Admin 08-09-2001 10:00 PM

This hack was requested by Sinema.

1. Open functions.php (in your admin folder), and find
PHP Code:

        if ($avatarurl=="" or ($bbuserinfo[userid]>and !($bbuserinfo[showavatars]))) {
            
$post[avatar]="";
        } else {
            eval(
"\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
        } 

replace it with
PHP Code:

        if ($avatarurl=="" or ($bbuserinfo[userid]>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
PHP Code:

<a href="$post[homepage]target="_blank"><img src="$avatarurlborder="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 08-11-2001 12:26 AM

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

Code:

$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 {.

Meta 12-24-2001 05:29 PM

Works fine for me ... thank you for this nice little hack, Firefly!

Rick 12-25-2001 12:00 AM

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


All times are GMT. The time now is 02:45 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01119 seconds
  • Memory Usage 1,755KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (16)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete