Log in

View Full Version : How can I make it so that...


MaDCaT75
09-01-2003, 01:33 AM
so that users who dont have an avatar get the "no avatar selected" avatar put into their user CP and then it shows up in postbit? Or if that isnt possible.... then just put the avatar into the postbit part?

Sylvus
09-01-2003, 02:13 AM
Ug. How did I do this.

Well, what I did for my forum was break it down on the number of posts required to receive an avatar. This crossed the entire forum and I kept it simple and did not have different avatars available based on different post count totals. Anyone on my forum can receive an avatar once they've reached 201 posts.

With that said, I simply force it in functions.php to display the guestavatar.gif image (or you can call it whatever you want if you use a different filename).

The code below does the following.

If a poster has less than 200 posts, default to the guestavatar.gif image.

If a poster has no avatar selected, even if they have over 200+ posts, default to the guestavatar.gif image.

This modification is based on VB v2.3.0.

Open up functions.php

### FIND:

$post[message]=bbcodeparse($post[pagetext],$forum[forumid],$post[allowsmilie]);

### BENEATH IT, ADD:

if($post[posts] <= 200) { $post[avatar] = "<img src={imagesfolder}/guestavatar.gif"; }
if($post[avatar] == "") { $post[avatar] = "<img src={imagesfolder}/guestavatar.gif"; }

That should do it. $post[avatar] is a variable used by VB to display a users avatar in the postbit.

guestavatar.gif is the filename of the avatar you want to display if someone has less than 200 posts OR has not selected an avatar.

If your own forum allows avatars at 50 posts or 100 posts, simply change the <=200 to the number of required posts needed on your own forum.

Rename guestavatar.gif to your own image.gif file if you are using a different filename.

This modification will only change the Postbit and not the Control Panel.

When a member is able to choose their own avatar, the above code will not stop it from being displayed.

Hope that's what you're looking for.

Syl...

MaDCaT75
09-01-2003, 02:17 AM
Yes I think that will do nicley. Thank you!

MaDCaT75
09-01-2003, 02:28 AM
erm actually something weird is going on here:

the avatar is showing up as a red X because the URL to the avatar is:

http://www.sims2forums.com/images/SilverOSX/noavatar.gif<BR

WTF? How did a <BR get in there? I didnt put a <BR into the functions.php!

SmEdD
09-01-2003, 04:17 AM
Try checking in the avatars in the admincp. Where it has default avatar or atleast I thought I seen that some time put it to that.

MaDCaT75
09-01-2003, 05:18 AM
I did.... this makes no sense!

SmEdD
09-01-2003, 05:49 AM
if($post['avatar'] == "") { $post['avatar'] = "<img src=http://yourdomin.com/forum/inages/guestavatar.gif"; }

Plop that some where in a file where it calls the avatars. Showthread would be one area and the user cp another.

assassingod
09-01-2003, 05:59 AM
You can check my Avatar in UserCP and then finish the if statement with the code SmEdD posted

(Also, you can use {imagesfolder} ;))

MaDCaT75
09-01-2003, 08:35 AM
Thanks guys

SmEdD
09-01-2003, 01:24 PM
Today at 02:59 AM assassingod said this in Post #8 (https://vborg.vbsupport.ru/showthread.php?postid=430305#post430305)
(Also, you can use {imagesfolder} ;))

Not in a file only template ;)

Unless they changed that . . .

assassingod
09-01-2003, 01:30 PM
Yeah, you've always been able to use replacements in files (I used them in my 'Coloured Users Online per Style' hack ;))