vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   I need this itsy-bitsy-(not spider), but hack please :D (https://vborg.vbsupport.ru/showthread.php?t=45166)

Pancreas Paul 10-29-2002 06:56 PM

I need this itsy-bitsy-(not spider), but hack please :D
 
Ok, its not really even a hack. Its just a code to put on the forum homepage that decides weather your a admin, and if so, give a link to the admin CP. And if your a mod, give a link to the mod CP. I would really appreciate this. Thanx alot.

Chris M 10-29-2002 07:02 PM

open root/global.php
Find:
PHP Code:

// Referer stuff
if ($bbuserinfo['userid']==and $usereferrer and !$bbreferrerid and $referrerid) {
  if (
$r_id $DB_site->query_first("SELECT userid FROM user WHERE userid = '".addslashes($referrerid)."'")) {
    
vbsetcookie("bbreferrerid",$r_id[userid]);
  }


Add below:
PHP Code:

//Administrative/Moderator Login
if ($bbuserinfo[usergroupid]==6) { //Admins
$adminlogin "<a href=\"admin/index.php\">Administrative Login</a><br>";
} elseif ((
$bbuserinfo[usergroupid]==5) or ($bbuserinfo[usergroupid]==7)) { //Mods
$adminlogin "<a href=\"mod/index.php\">Moderator Login</a><br>";
} else { 
//Everyone else
$adminlogin "";
}
//End Login Code 

Now just place "$adminlogin" in your footer or header template, and it will appear on every page!:)

Satan

NTLDR 10-29-2002 07:07 PM

You can also add the code there for global.php in the phpinclude template so its not lost during upgrades ;)

Erwin 10-29-2002 07:13 PM

I was just about to say that - most of the time, if it's for permissions, put the code in the phpinclude template - much easier, and no need to hack.

Chris M 10-29-2002 07:14 PM

Yeh...

I prefer the global.php way personally;)

Satan

Pancreas Paul 10-29-2002 07:27 PM

Ok, thaxn for replying so quick.. Thats why I love this board :p

Chris M 10-29-2002 07:40 PM

Lol...Your welcome:)

You reminded me actually to update my phpinclude template, and put all the extra stuff into global.php:)

Satan

Xenon 10-29-2002 08:07 PM

i'd advice you to install logicians dynamic templates hack

with conditional templates those things are much easier

Erwin 10-29-2002 08:10 PM

And when vB3 comes out with conditional templates, all this hacking will be unnecessary! :)

Chris M 10-29-2002 08:18 PM

I wouldnt say unnecessary;)

@Xenon - After a mishap earlier today with Logician's Advanced Templates Hack, I decided against using it for a while;)

Satan


All times are GMT. The time now is 08:03 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.01008 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
  • (2)bbcode_php_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