vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Glowing usernames based on postcount? (https://vborg.vbsupport.ru/showthread.php?t=26163)

Thomas P 08-23-2001 09:03 AM

Hi,
please post that or a reference into the Hack Releases forum,
thx for your work,
-Tom

Reno of Shinra 09-17-2001 04:55 PM

OK... I want to make it so that all my admins have glowing usernames in threads while everyone else doesn't.

Now... the question is...
What am I doing wrong? I've tried this and I still don't get glowing admins.
I know I can make everyone glow... but... aggh.

This is under ### start buildpostbit ###
function getpostbit($post)
in board/admin/functions.php
vB ver 2.0.3

PHP Code:

    // global options
    
global $showdeficon,$showonline,$displayemails,$enablepms,$allowsignatures,$wordwrap,$dateformat,$timeformat,$logip,$replacewords,$postsperday,$avatarenabled,$registereddateformat,$viewattachedimages;
    
// begin glowing admin attempt
    
$post[specialusername] = $post[username];

    
$usergroupid=$bbuserinfo['usergroupid'];
    if (
$usergroupid == 5) { $post[specialusername] = "<table style=\"filter:glow(color=orange, strength=4)\"><tr><td>$post[username]</td></tr></table>"; }

// end attempt 

I'm really scratching my head here... do I need to use someother variable or something to get the poster's usergroupid?

I am a PHP newbie... but I saw $usergroupid=$bbuserinfo['usergroupid']; used further down in functions.php and figured it should work...

But I guess not.

Any suggestions?

dirgotronix 09-17-2001 05:50 PM

looks to me like $bbuserinfo isn't defined in that section (see the global line for what variables are usable)

at least, that's my best guess.

dirgotronix 09-17-2001 05:52 PM

Ah, and you're using an admin function, that I assume is only for the Admin CP. try showthread.php, member.php, or functions.php. Where are you trying to make it glow? In threads, the memberlist, user info...?

Reno of Shinra 09-17-2001 06:01 PM

I was just basing this off the above version which uses postcounts...

I set where the glow effect is displayed through my templates... that isn't related to this.

The function is supposed to set the $post[specialusername] to $post[username] plus html formatting...

I KNOW it work, because if I remove the conditional and just say
PHP Code:

$post[specialusername] = "<table style=\"filter:glow(color=orange, strength=4)\"><tr><td>$post[username]</td></tr></table>"

then ALL usernames glow.

That's not a problem.

My problem is that the if statement that checks the usergroupid does not work.

That's the ONLY thing that needs fixing...

As I asked... do i need a different variable in there or something?

$bbuserinfo is declared a few lines above where I pasted code from...
PHP Code:

// ###################### Start buildpostbit #######################
function getpostbit($post) {
// sorts through all the stuff to return the postbit template

    // user
    
global $bbuserinfo,$ignore;
    
// showthread
    
global $counter,$firstnew,$sigcache,$highlight,$postid,$forum;
    
// global options
    
global $showdeficon,$showonline,$displayemails,$enablepms,$allowsignatures,$wordwrap,$dateformat,$timeformat,$logip,$replacewords,$postsperday,$avatarenabled,$registereddateformat,$viewattachedimages;
    
// begin glowing admin attempt
    
$post[specialusername] = $post[username];

    
$usergroupid=$bbuserinfo['usergroupid'];
    if (
$usergroupid == 5) { $post[specialusername] = "<table style=\"filter:glow(color=orange, strength=4)\"><tr><td>$post[username]</td></tr></table>"; }

// end attempt 


Soul Lord XL 09-17-2001 10:24 PM

I dont have a

############## Start buildpostbit ############

In admin / functions.php and i am running 2.01, any suggestions?

Kier 09-17-2001 10:35 PM

Quote:

Originally posted by Soul Lord XL
I dont have a

############## Start buildpostbit ############

In admin / functions.php and i am running 2.01, any suggestions?

Yes, upgrade to 2.0.3... it's available free to all licenced members.

Soul Lord XL 09-18-2001 01:16 AM

ahh ok, will do!

Baratator 11-09-2001 01:10 PM

Quote:

Originally posted by Reno of Shinra
I was just basing this off the above version which uses postcounts...

I set where the glow effect is displayed through my templates... that isn't related to this.

The function is supposed to set the $post[specialusername] to $post[username] plus html formatting...

I KNOW it work, because if I remove the conditional and just say
PHP Code:

$post[specialusername] = "<table style=\"filter:glow(color=orange, strength=4)\"><tr><td>$post[username]</td></tr></table>"

then ALL usernames glow.

That's not a problem.

My problem is that the if statement that checks the usergroupid does not work.

That's the ONLY thing that needs fixing...

As I asked... do i need a different variable in there or something?

$bbuserinfo is declared a few lines above where I pasted code from...
PHP Code:

// ###################### Start buildpostbit #######################
function getpostbit($post) {
// sorts through all the stuff to return the postbit template

    // user
    
global $bbuserinfo,$ignore;
    
// showthread
    
global $counter,$firstnew,$sigcache,$highlight,$postid,$forum;
    
// global options
    
global $showdeficon,$showonline,$displayemails,$enablepms,$allowsignatures,$wordwrap,$dateformat,$timeformat,$logip,$replacewords,$postsperday,$avatarenabled,$registereddateformat,$viewattachedimages;
    
// begin glowing admin attempt
    
$post[specialusername] = $post[username];

    
$usergroupid=$bbuserinfo['usergroupid'];
    if (
$usergroupid == 5) { $post[specialusername] = "<table style=\"filter:glow(color=orange, strength=4)\"><tr><td>$post[username]</td></tr></table>"; }

// end attempt 


same problem : if i don't put the condition it works but fo all the users... now how can we make it work only for the admins :)

dirgotronix 11-09-2001 05:33 PM

I toyed with the variables that show in postbit, and here's the one I found:

$userinfo[usergroupid]

That displays the number of the usergroup. Try that instead of $bbuserinfo[usergroupid].


All times are GMT. The time now is 04:59 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.01096 seconds
  • Memory Usage 1,773KB
  • 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
  • (5)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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