Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 08-24-2000 Last Update: Never Installs: 0
 
No support by the author.

Here is an update to my stars hack - this one allows you different colored stars for admins/moderators

edit showthread.php

find:
Code:
$userinfo=$DB_site->query_first("SELECT userid,email,username,usertitle,signature,showemail,homepage,icq,aim,yahoo,joindate,posts FROM user WHERE userid=$userid");
If you have installed the avatar hack, this line will be modified. Just look for ' $userid=$post[userid]; ' and the line listed above will be 3-4 lines below that.

Edit that line listed above and add

Code:
usergroupid,
after the "SELECT" in that line. Make sure there is a space between the word you added and "SELECT". Make sure there is a comma after the word you added and before the next. It looks like this:

Code:
$userinfo=$DB_site->query_first("SELECT usergroupid,userid, (...) etc etr
find:

Code:
$userpostcount=$userinfo[posts];
Add this after it:

Code:
    // --- Stars Hack by rangersfan

     $stars = "";
     $s_usergroup = $userinfo[usergroupid];
     $moderator=$DB_site->query_first("SELECT usergroupid FROM forumpermission WHERE usergroupid = $s_usergroup AND canadminedit=1");
     if ($moderator[usergroupid] == $s_usergroup)  // This is a Normal Mod!
     {
        $starsgif = "<img src=\"images/star2.gif\" border=\"0\" width=\"15\" height=\"15\">";
     }
     else if ($s_usergroup==6) // This is an Admin!
     {
        $starsgif = "<img src=\"images/star2.gif\" border=\"0\" width=\"15\" height=\"15\">";
     }
     else if ($s_usergroup==5) // This is a SuperMod!
     {
        $starsgif = "<img src=\"images/star2.gif\" border=\"0\" width=\"15\" height=\"15\">";
     }
     else
     {
        $starsgif = "<img src=\"images/star.gif\" border=\"0\" width=\"15\" height=\"15\">";
     }
     if ($userpostcount > 1999)
     {      $stars .= $starsgif . $starsgif . $starsgif . $starsgif . $starsgif;   }
     elseif ($userpostcount > 999)
     {      $stars .= $starsgif . $starsgif . $starsgif . $starsgif;   }
     elseif ($userpostcount > 399)
     {      $stars .= $starsgif . $starsgif . $starsgif;   }
     elseif ($userpostcount > 99)
     {      $stars .= $starsgif . $starsgif;   }
     elseif ($userpostcount > 19) 
     {      $stars .= $starsgif;   }
     if ($stars == "")
     {   
        $stars .= "<br>";
     }   
     else
     {      
        $stars .= "<br><br>";
     }  
   // - Stars Hack

You need to supply your own stars names "star.gif" and "star2.gif". "star2.gif" is for admins/moderators. Put them in forums/images.

To modify how many stars correspond to how many posts you will need to change the if ($userpostcount > ..) parts. If you don't want stars, but galagas or such, change the parts that say '$stars .= $starsgif . $starsgif . $starsgif . $starsgif . $starsgif;' to something like '$stars .= (path to my image for x number of posts);'

Edit the postbit template and put $stars where you want them to appear.

[Edited by freddie on 11-04-2000 at 04:56 PM]

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 09-16-2000, 03:32 AM
Guest
 
Posts: n/a
Default

Doh! Feeling pretty dumb now...

Hehehe. Thanks RangersFan

-Tom
Reply With Quote
  #13  
Old 09-16-2000, 03:53 AM
Guest
 
Posts: n/a
Default

Hm... I've run into another problem, and I'm not quite sure what's wrong. I changed the code a little so if the user is Admin/Mod it automatically gives them 5 yellow stars, and if it's just a regular user, it gives them blue stars depending on how many posts they have. For some reason though, it's only giving the Administrator the yellow stars, and not the moderators (who are actually Super Moderators). Does it not work with Super Moderators?

-Tom
Reply With Quote
  #14  
Old 09-16-2000, 05:21 AM
Guest
 
Posts: n/a
Default

Change this line

if (($moderator[usergroupid] == $s_usergroup)||($s_usergroup==6))

to

if (($moderator[usergroupid] == $s_usergroup)||($s_usergroup==6)||($s_usergroup==5 ))
Reply With Quote
  #15  
Old 09-25-2000, 11:51 PM
Guest
 
Posts: n/a
Default

I have installed this hack and it works great! thanks a lot.
But I want to have it do mods get 9 silver stars and supper mods get 9 gold stars and admins get 10 gold

how can I do this? I have beed trying and i can't get it to work.
Reply With Quote
  #16  
Old 11-04-2000, 07:57 PM
Guest
 
Posts: n/a
Default

Con_Man I have changed the code above and if check you will see it now has sections of Mod/SuperMod and Admin. Just put the stars you want for each into each section.

I will optimize the SQL in this hack when v2.0 is released if there are no stars in v2.0 by default.

[Edited by freddie on 11-04-2000 at 05:03 PM]
Reply With Quote
  #17  
Old 11-05-2000, 11:10 AM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by freddie


I will optimize the SQL in this hack when v2.0 is released if there are no stars in v2.0 by default.

[Edited by freddie on 11-04-2000 at 05:03 PM]
I sure hope there is, should be
Reply With Quote
  #18  
Old 12-02-2000, 06:15 PM
Guest
 
Posts: n/a
Default

thanx.
great hack. i changed it a little. i added that admins get 8 stars and mods 7, no matter how many posts they have.
Reply With Quote
  #19  
Old 12-04-2000, 10:05 AM
Guest
 
Posts: n/a
Default

i get this when i upload the updated showthread.php

There seems to have been a slight problem with the database. Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.

any ideas?
Reply With Quote
  #20  
Old 02-06-2001, 06:52 PM
Guest
 
Posts: n/a
Default

Throughout the entire showthread.php file I did not find

Code:
$userinfo=$DB_site->query_first("SELECT userid,email,username,usertitle,signature,showemail,homepage,icq,aim,yahoo,joindate,posts FROM user WHERE userid=$userid");
Nor anything close
Reply With Quote
  #21  
Old 02-06-2001, 07:01 PM
Guest
 
Posts: n/a
Default

Line changed in 1.1.5.

Look for $posts=$DB_site->query_first..........

Hope I'm correct.
Reply With Quote
Reply

Thread Tools

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 08:53 PM.


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.04376 seconds
  • Memory Usage 2,269KB
  • Queries Executed 25 (?)
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
  • (6)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)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
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete