vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   User title graphics: Hack needed? (https://vborg.vbsupport.ru/showthread.php?t=36801)

mjames 03-31-2002 04:13 PM

User title graphics: Hack needed?
 
I have added user title graphics to my moderators on my message boards (similar to what SitePointForums.com has done) and the only way I figured out how to do this was manually edit moderator's options in the CP and add the HTML for the graphic.

Ideally, I'd like to have it so certain graphics go underneath different usergroup's user titles - but can you do that? I tried coding the HTML into a usergroup's properties and it didn't work.

Since custom user titles are enabled, if my moderators change their titles, they will lose their graphic unless they code it in. There has to be a better way to do this, what I'm doing is not complicated. So, perhaps I overlooked a way to do this - should I be looking for a hack? Thanks for your assistance. :)

Admin 03-31-2002 04:32 PM

Yup, you need a hack. Since you have custom titles on putting the image in the usergroup's title won't do the trick. :)

Anyway, in functions.php find:
Code:

                $post[joindate]=vbdate($registereddateformat,$post[joindate]);
and right after that add this:
Code:

                $post['userimage'] = '<img src="{imagesfolder}/userimages/'.$post['usergroupid'].'.gif" border="0">';
Now create a folder under your images folder named userimages, and in that folder place an image for every usergroup: Admin's usergroup (by default) is 6, so name the admin's picture 6.gif, and so on. :)

mjames 03-31-2002 05:29 PM

Thanks. :) So that's all I need to do in order to place the image under my moderator's title? I only want it to do this for my moderators and administrators, how do I do that?

Admin 04-01-2002 03:54 AM

Then use this code:
Code:

                if (ismoderator(0, '', $post['userid'])) {
                        $post['userimage'] = '<img src="https://vborg.vbsupport.ru/images/userimages/'.$post['usergroupid'].'.gif" border="0">';
                } else {
                        $post['userimage'] = '';
                }

Then use 5.gif for super mods, 6.gif for admins and 7.gif for mods.

mjames 04-03-2002 11:44 PM

Thanks, Chen - weird that I didn't receive a notification to this thread.

Could you rephrase what I have to do from the beginning? :) In functions.php, I replace the code you mentioned above with the code you mentioned in your last post? Just trying to make sure I put the pieces together right. Why do I need to use 5.gif, 6.gif, and 7.gif?

Admin 04-04-2002 05:08 AM

Ok :) After the code I mentioned in my first post (with $post[joindate]), add the code I gave you in the 2nd post.
Now create a folder named userimages under your images folder, and create 3 images:
5.gif - this will show up under Super Mods names.
7.gif - under Regular Mods names.
6.gif - under Admins names.

Admin 04-05-2002 06:05 AM

Ok, another update. Instead of this in the code:
Code:

                if (ismoderator(0, '', $post['userid'])) {
Use this:
Code:

                if ($post['usergroupid'] == 5 or $post['usergroupid'] == 6 or $post['usergroupid'] == 7) {
(if you are using these usergroup ID's for super mods, admins and mods)
freddie told me it's bad to run ismoderator() in a loop. :)

mjames 04-07-2002 03:15 PM

Chen,

I finally got around to actually trying this little code and it didn't work! I created a new folder in /images/userimages and uploaded the appropriate files there. I then made the changes to functions.php and there was no change on the site. Have you actually confirmed this works? ;)

To explain again, I want user titles under my administrators, senior moderator (super moderator), and moderators - no one else, not regular users. By your method, will it try to create an image for all usergroups or only ones with images uploaded?

Also, am I right that the number of the image (i.e. 5.gif) corresponds to the usergroup ID? How can I find the usergroup ID? I would assume I could hover over the URL in the Admin CP page that lists the groups.

Here is the code I used in function.php:

Code:

$post['userimage'] = '<img src="http://www.sports-central.org/community/boards/images/userimages/'.$post['usergroupid'].'.gif" border="0">';
Note: I didn't get a chance to try your updated code posted on 04/05, will that do it? Also, I tried to reply earlier via e-mail and it didn't work!

Any help is appreciated!

Admin 04-07-2002 03:24 PM

Re getting usergroup ID's, yes that's how.

Hmm, have you added $post[userimage] to your postbit template? I should've mentioned that! ;)

mjames 04-07-2002 03:41 PM

Nope! :) I'll try it later today and see how it goes. I'm crossing my fingers. :)


All times are GMT. The time now is 05:56 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.01148 seconds
  • Memory Usage 1,735KB
  • 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
  • (6)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete