vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Help with very small hack? (https://vborg.vbsupport.ru/showthread.php?t=35987)

SaintDog 03-11-2002 05:24 AM

Help with very small hack?
 
I am pretty sure this would be a small if/then/else statement, but since I totally suck at php, I am hoping another member at this forum will be willing to help me out here.

What I would like to have is something that will display the member count for Admins & Mods only and will just take the whole line "Currently Registered: ..." out for members.

If anyone could help, I would appreciate it very much, I don't think it would be too much to do, but then again as I said, I really and totally suck at PHP.

Thanks in advance,

SaintDog

Neo 03-11-2002 12:25 PM

Ok. In index.php Find.

PHP Code:

$numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
$numbermembers=number_format($numbersmembers['users']); 

and replace with

PHP Code:

if (in_array($bbuserinfo['usergroupid'], array(567))) {
$numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
$numbermembers=number_format($numbersmembers['users']);


:rambo:

SaintDog 03-11-2002 01:20 PM

Thanks for the response, sorry to say though, that does not work. I am running 2.2.4, when I am logged in, it works fine, I can see it, but when I log out to check it, it states there is a problem with the database (does not show any errors).

Any help is appreciated,

Thanks.

SaintDog

Neo 03-11-2002 01:43 PM

ok, try

PHP Code:

if (in_array($bbuserinfo['usergroupid'], array(567))) {
$numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
$numbermembers=number_format($numbersmembers['users']);
} else {
$numbermembers="";


ohh and I am using 2.2.4 aswell ;)

SaintDog 03-11-2002 02:38 PM

That does not work either.

SaintDog

Scott MacVicar 03-11-2002 03:15 PM

open index.php

look for
PHP Code:

$numbermembers=number_format($numbersmembers['users']); 

below it add

PHP Code:

unset($membertotal);
if(
ismoderator("","",$bbuserinfo[userid])) {
  
$membertotal "Members: $numbermembers,";


open up your forum home template and replace
Code:

Members: $numbermembers,
with $membertotal

SaintDog 03-11-2002 03:31 PM

Thanks PPN, worked like a charm. :)

Thank you for your help Neo, I appreciate you trying to help me out :)

SaintDog

Scott MacVicar 03-11-2002 04:09 PM

No problem, it really only lets moderators view it, but i'm presuming that your admins have super mod access :)

Admin 03-11-2002 04:14 PM

You realize people will be able to see the number of people from the memberlist, right? :)

Scott MacVicar 03-11-2002 04:24 PM

lol good point :) but it will require a tiny bit more effort to get to it hehe


All times are GMT. The time now is 02:44 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.01854 seconds
  • Memory Usage 1,740KB
  • 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
  • (1)bbcode_code_printable
  • (5)bbcode_php_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