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

DrkFusion 10-29-2002 08:21 PM

Lol@Satan

Conditionals with vb3 is gonna be awesome :)
It will make our lives much easier.

-Arun

Chris M 10-29-2002 08:29 PM

Or harder, cos we'll have to learn Java:cry:

Satan

N!ck 10-30-2002 12:24 PM

huh? java?

Xenon 10-30-2002 12:51 PM

yes, the've included more java in vb3 :(

@satan: well his hack is, good, but i don't use it myself.
i've made another implementation of conditionals in templates, just a small little codehack, nothing important so it's not released.

but it made my live on template editing really really easy

NTLDR 10-30-2002 01:04 PM

Quote:

Originally posted by Xenon
yes, the've included more java in vb3 :(
Please say your joking? Thats put me off vB3 even more, I can't stand Java, nor the Java layout for code they are using, Ick.

Chris M 10-30-2002 01:04 PM

Uhuh:)

Thats what i feared about vB3:(

I found the fix that Logician posted on the 7th of October, so hopefully that fixed my problem;)

Satan

Xenon 10-30-2002 01:11 PM

no no joke...

but as long as i don't see the code with my own eyes i can't exactly say how much and what and so on...

i hope not much, i hate java :)

NTLDR 10-30-2002 01:47 PM

Thanks for the info Xenon, Best get reading that Java book now ;)

Chris M 10-30-2002 02:36 PM

I hate Java too:(

Satan

Freddie Bingham 10-30-2002 06:24 PM

What are you guys talking about? Java? There is no Java in vb3. Now there is javascript, just as there always has been. WYSIWYG, of course, relies on it greatly but nothing else does.

And what does javascript have to do with the conditionals?

Erwin 10-30-2002 06:30 PM

I was thinking the same thing. Java relates to OS-independent java applets. Javascript is totally different, and is just part of the template's regular HTML-assisting arsenal.

Chris M 10-30-2002 08:16 PM

:p

I dont like anything not PHP / HTML / MySQL...

There...Happy now? I think I covered Java/Javascript/Javahello or whatever is in vB3:p

Satan

Xenon 10-31-2002 10:23 AM

java means javascript here, just faster to write ;)

and we've jsut heard there would be much mor javascript in templates as it is now, that's why we are scared ;)

Chris M 10-31-2002 01:24 PM

Indeed...

If you look at vB3, alot of the templates involved Java/Javascript...

Satan

Erwin 10-31-2002 06:02 PM

Java is VERY different to Javascript. :) Just use JS as a short-form for Javascript.

Chris M 10-31-2002 07:02 PM

Fine then...

JS...

But its still in vB3:(

Satan

N9ne 10-31-2002 07:04 PM

JS is required for the WYSIWYG...isn't it...:confused:

Erwin 11-01-2002 01:22 AM

vB2 is full of JS - the popups are JS based eg. PM Popup, the smilie and vBCode panel are JS based.

Chris M 11-01-2002 07:42 AM

Yeh...But apparently alot more of vB3's functionality comes from the surplus of JS used...

Satan

Xenon 11-02-2002 01:22 PM

damn, JS, why didn't i use this ^^

nevertheless, vb2 can be run, nearly without JS, personally i've disabled the use of JS (don't need popups ;)) and everything works....

but vb3 i fear this wouldn't be soo easy ;)
but, well as said, we will see how much js would be in and what of this is really needed ;)
Who needs WYSIWYG? ^^ I like the pure old method ;)

Chris M 11-02-2002 01:38 PM

Exactly...

Good old vBcode;)

Satan

NTLDR 11-02-2002 06:15 PM

Quote:

Originally posted by Xenon
Who needs WYSIWYG? ^^ I like the pure old method ;)
I agree, I perfer using the standard vB2 posting interface too.


All times are GMT. The time now is 06:39 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.01379 seconds
  • Memory Usage 1,777KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (32)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete