Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #1  
Old 05-04-2003, 04:30 AM
Ron G Ron G is offline
 
Join Date: Aug 2002
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Add image next to avatar

I am trying to figure out how to add one or more images next to a user's avatar, depending upon whether they belong to specific classes. What I'd like to do is create hidden user profile fields, and then depending on whether a user belongs to one of these categories, a small image will appear next to the user's avatar.

I've seen this on numerous sites, usually for different levels of donars. I just can't figure out how to do it. Does anyone know of any existing hacks for this?

Thanks
Reply With Quote
  #2  
Old 05-04-2003, 02:33 PM
CRego3D CRego3D is offline
 
Join Date: May 2002
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

maybe the awards hack is what you thinking of ?
Reply With Quote
  #3  
Old 05-04-2003, 03:35 PM
Ron G Ron G is offline
 
Join Date: Aug 2002
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found something under "perks" but it doesn't work for vBulletin 2.9
Reply With Quote
  #4  
Old 05-04-2003, 06:07 PM
EvilLS1's Avatar
EvilLS1 EvilLS1 is offline
 
Join Date: Apr 2002
Location: Georgia, USA
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What do you mean by "depending on whether a user belongs to one of these categories".. By catagories do you mean usergroups? If so, just create the new usergroup, then in functions.php

Find:
Code:
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
}
Below that add:
Code:
if ($post[usergroupid] ==X) {
$image = "<img src=\"http://www.yoursite.com/forums/images/specialimage.gif\">";
} else {
$image="";
}
Just replace the red X with the usergroup ID # for the one you want to have the image. The in the postbit next to the avatar add $image .

You could also do it based on custom profile fields if thats what you mean. But you'd need to add the drop down profile field selection hack first.
Reply With Quote
  #5  
Old 05-04-2003, 07:40 PM
Ron G Ron G is offline
 
Join Date: Aug 2002
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the tip, but I just can't make it work.

I wasn't sure if you meant Postbit or Postbit_avatar, so I tired various combinations with both. This is what I used:

In Postbit

<a name="post$post[postid]"></a>
$post[firstnewinsert]
<normalfont><b>$post[username]</b></normalfont><br>
<smallfont>$post[usertitle]</smallfont><br>
$post[avatar]<br />Feild name: $post[field9]$image
<smallfont>Registered: $post[joindate]<br>
Location: $post[field2]<br>
Posts: $post[posts]</smallfont></td>

In Postbit_avatar

<img src="$avatarurl""$image" $imageborder="0" alt="">

In neither case did it work.
Reply With Quote
  #6  
Old 05-04-2003, 08:51 PM
EvilLS1's Avatar
EvilLS1 EvilLS1 is offline
 
Join Date: Apr 2002
Location: Georgia, USA
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I meant the postbit, not postbit_avatar.

What exactly did you put in functions.php? Copy and paste it here and I'll tell you why its not working.
Reply With Quote
  #7  
Old 05-04-2003, 10:26 PM
Ron G Ron G is offline
 
Join Date: Aug 2002
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks,

This is the relevant portion of functions.php:

}
if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="";
} else {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
}
if ($post[usergroupid] ==14) {
$image = "<img src=\"http://usslibertyinquiry.com/forums/images/PH.gif\">";
} else {
$image="";
}
Reply With Quote
  #8  
Old 05-04-2003, 11:07 PM
EvilLS1's Avatar
EvilLS1 EvilLS1 is offline
 
Join Date: Apr 2002
Location: Georgia, USA
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you sure that you put the correct usergroup id? I just tested it on my board and it works fine.
Attached Images
File Type: jpg testhack.jpg (8.7 KB, 0 views)
Reply With Quote
  #9  
Old 05-04-2003, 11:38 PM
Ron G Ron G is offline
 
Join Date: Aug 2002
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In Admin, I opened up User Groups and moused over the selected group. Down below, it showed the group id as 14.

In functions.php it is written as "==14" Are there supposed to be two equal signs? Also, is it enough to just use "14" or does it need to be "usergroupid14"?

Finally, in postbit, is this the correct placement of $Image:

$post[avatar]<br />Feild name: $post[field9]$image

Thanks,

Ron
Reply With Quote
  #10  
Old 05-04-2003, 11:51 PM
EvilLS1's Avatar
EvilLS1 EvilLS1 is offline
 
Join Date: Apr 2002
Location: Georgia, USA
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your functions.php code is correct. I copied the code from your post and pasted it into my functions.php then changed the usergroupid to 6 (admin) and it worked fine.

Make sure when you add the $image text to your postbit that its all smallcase, just like the code in functions.php. I don't know what else could be causing it not to work for you.

You have actually added some people to the new usergroup, correct? If nobody is in that usergroup then you're not gonna see anything. Just to test it, try changing the usergroup ID to 6.. You should then see the image in all admins posts.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:06 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06705 seconds
  • Memory Usage 2,265KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete