vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Administrative Login (https://vborg.vbsupport.ru/showthread.php?t=37426)

Unknown553 04-14-2002 07:24 PM

Administrative Login
 
1 Attachment(s)
I edit my forums a lot, and I got tired of changing my url and adding /admin to access the admin cp, but I didn't want a new link to the admin cp be seen by everyone, so I wrote thie little modification.

What it does: Adds a link to the admin CP and moderator CP in your footer, but only shows up for admins/mods respectively.

Enjoy :)

Apcr 04-14-2002 07:37 PM

Been done before but this is a very tidy way to do it..

Thanx :)

Unknown553 04-14-2002 07:47 PM

I thought the last one involved hacking, this is just two minor template changes :)

wooolF[RM] 04-14-2002 08:25 PM

]nice template modification... :) usefull

scsa20 04-17-2002 11:46 PM

hmm....yeah, I made 2 buttons (one says "Admin CP" and another one says "MOD CP")...how can I add those buttons into the header using that code?? I tryed it one way but just got some error :( please help me out here.

Psychdrone 04-19-2002 12:05 AM

I am soooo stupid

how can I change the font color to white
<font color="ffffff"></font> dosn't work for me, please help thanks!

Crazy Mofo 04-19-2002 12:11 AM

<font color=#ffffff>hgfh</font>

Unknown553 04-19-2002 03:23 AM

Quote:

Originally posted by scsa20
hmm....yeah, I made 2 buttons (one says "Admin CP" and another one says "MOD CP")...how can I add those buttons into the header using that code?? I tryed it one way but just got some error :( please help me out here.
Then where it says $adminlogin, just change the text to your image.

Example: $adminlogin="<img src=\"{imagesfolder}/admincp.gif\" border=\"0\">";

Make sure you have those backslashes before all quotation marks, or else you'll get a parse error.

Unknown553 04-19-2002 03:24 AM

Quote:

Originally posted by Psychdrone
I am soooo stupid

how can I change the font color to white
<font color="ffffff"></font> dosn't work for me, please help thanks!

Try <smallfont color="#FFFFFF">Your Text</smallfont>

scsa20 04-19-2002 11:02 PM

1 Attachment(s)
ok, I was able to get the pictures working now, and I added the $adminlogin code to the header template, but now how do I get it to one line with the other images?? (see picture to get what I'm trying to say).

EchoHype.com 04-19-2002 11:26 PM

For the "Moderator Login" link, would it just be $moderatorlogin?

Unknown553 04-19-2002 11:27 PM

Edit your header template and put $adminlogin right after <!-- toplinks -->

That should be it....

Unknown553 04-19-2002 11:28 PM

Quote:

Originally posted by EchoHype.com
For the "Moderator Login" link, would it just be $moderatorlogin?
No, it's still $adminlogin. There is no need to change it.

scsa20 04-20-2002 12:35 AM

Quote:

Originally posted by Unknown553
Edit your header template and put $adminlogin right after <!-- toplinks -->

That should be it....

I did before I asked and I still get that :eek:

Unknown553 04-20-2002 01:40 AM

Ok, remove the "<br>" from the $adminlogin ;)

scsa20 04-20-2002 02:22 AM

ahh...all fixed...thank you :D

Psychdrone 04-20-2002 04:40 AM

heres what my code looks like
<font color="ffffff">$adminlogin</font>
and I tried <smallfont color="ffffff">$adminlogin</smallfont>

nothing happens
please help

scsa20 04-20-2002 06:03 AM

Quote:

Originally posted by Psychdrone
heres what my code looks like
<font color="ffffff">$adminlogin</font>
and I tried <smallfont color="ffffff">$adminlogin</smallfont>

nothing happens
please help

there's your problem...go back to phpinclude and replace

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 

with

PHP Code:

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

that should work ;)

SaintDog 04-20-2002 07:18 AM

Tested on my private forums just for confirmation, the above works (of course, I used different colors)...

- SaintDog

Chris M 04-20-2002 01:31 PM

Cool Mod...

I like it...

Satan

voogru 04-21-2002 06:55 PM

i did something like this too, www.voogru.com/vb/top_buttons

Psychdrone 04-21-2002 08:34 PM

O thats right php and " don't like each other:P! Well more then a couple in a statment

thanks!

scsa20 04-21-2002 08:50 PM

Quote:

Originally posted by Psychdrone
O thats right php and " don't like each other:P! Well more then a couple in a statment

thanks!

lol, yeah, I had that same type of problem when I was trying to get my images to work :D ;)

Boofo 04-22-2002 06:50 PM

Please bear with me here, this is still all new to me (I just got started on vBulletin a few days ago). I want to link the Admin logon to my titleimage so it's hidden if I am ever anywhere else and have to log on to my board. This way no one will even know the Admin Login is even on the board unless they are an Admin or Moderator. What do I need to do to change it for the whole site so I can just click on the titleimage to use it? Can I do it all in one place or do I need to edit everything that has the titleimage in it? And no one else would be able to get to it except the Admins and Mods, right? Thanks and sorry to sound so stupid at all of this. :-)

BTW: Great time saver! Thanks!

Unknown553 04-22-2002 09:38 PM

It already works like that, only admins and mods see it, to change it from a simple link to your title image, just change it to fit your titleimage, or logo. It would be easier to just add a lnk or button in the header, but if you want to change it around you're more than welcome.

I think this would work:

Use this code in your phpinclude template

Code:

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

Then you'd have to change { titleimage} to $adminlogin. (Admin CP -> Templates -> Search -> Search and replace ALL templates. Be careful!) ....Seach for { titleimage} and replace it with $adminlogin.

Remember to remove the space between { and titleimage}

Boofo 04-22-2002 10:05 PM

Sorry to sound so new at this, but I have learned alot just from reading in here. Hopefully, one of these days, I can start to understand more of this. :-)

Is there any way just to link it to my titleimage instead of changing it? Because if I do it this way (now that I (DOH!!) think of it), the registered users won't see my titleimage when they log on, will they? I just want to hide it from site but still be able to use it, you know what I mean?

scsa20 04-22-2002 11:56 PM

Quote:

Originally posted by Boogo
Sorry to sound so new at this, but I have learned alot just from reading in here. Hopefully, one of these days, I can start to understand more of this. :-)

Is there any way just to link it to my titleimage instead of changing it? Because if I do it this way (now that I (DOH!!) think of it), the registered users won't see my titleimage when they log on, will they? I just want to hide it from site but still be able to use it, you know what I mean?

just put what he said, and remove the space between "{" and "titleimage}"

the reason why he puted that space there is because if you don't, you won't get that, but you get the actuly title image from the server :eek: (well..the path anyways)

Boofo 04-23-2002 12:54 AM

I did it just lkike he said and this is how it looks now. I must have missed something somehwere. You will also notice that I am having a problem with the forums being listed at the top of every message area. Any help on that will help too. :-)

Message Board Problems

scsa20 04-23-2002 12:59 AM

if you looks at the image soruce for where the path is going, it shows it's going to:

http://www.jamcomputerservices.com/vbulletin/<img%20src=

hmm...let me see what code you used in phpinclude file

Boofo 04-23-2002 01:14 AM

Here is my whole phpinclude file

// This code is PHP4 only:
// ob_start();
// require("yourheader.html");
// $header = ob_get_contents();
// ob_end_clean();

//Administrative/Moderator Login
if ($bbuserinfo[usergroupid]==6) { //Admins
$adminlogin = "<a href=\"admin/index.php\"><img src=\"https://vborg.vbsupport.ru/images/vBulletin_logo.gif\" border=\"0\"></a>";
} elseif (($bbuserinfo[usergroupid]==5) or ($bbuserinfo[usergroupid]==7)) { //Mods
$adminlogin = "<a href=\"mod/index.php\"><img src=\"https://vborg.vbsupport.ru/images/vBulletin_logo.gif\" border=\"0\"></a>";
} else { //Everyone else
$adminlogin = "<img src=\"https://vborg.vbsupport.ru/images/vBulletin_logo.gif\" border=\"0\">";
}
//End Login Code

I put it all there just in case I meesed something up adding the code. Thanks!

Boofo 04-23-2002 01:20 AM

I forgot to tell you that the titleimage doesn't show up at all for the unregsitered user but it does show up for the Admin and Mod. It just reloads the page after you click it. Don't know if that will mean anything to you but thought I'd better tell you.

Unknown553 04-23-2002 03:10 PM

Hmmm....And you switched everything that said { titleimage} to $adminlogin, right??

Boofo 04-23-2002 03:52 PM

Yes, exactly like you told me to. I went ahead and changed it back for now until I can find a way to just link the image somehow without it disappearing. Can you tell me how I can get rid of all of the extra Forum headers on my site? I seem to have one before every message area instead of just before each category. I used a hack called "Spaces between categories", but it must be messing with another hack I have installed somehwhere. Check it out and tell me what you think, would you?

Forum headaches

BTW: Am I supposed to delete the upgrade13.php and the other upgrade phps if I don't need them?

Unknown553 04-24-2002 09:17 PM

Ok, well I'm not sure what went wrong, I highly suggest just settling with a simple link instead of me rewriting most of the mod for something only a few people are going to use. If you or someone else wants to do it, go ahead and do it, I have decided not to.

And about your categories, I think you added code into the wrong template, but please take your problem into that thread, those "forum headaches" have nothing to with this thread, so don't cross-post please.

And yes, after you upgrade you need to remove all upgradex.php files off of the server.

Boofo 04-25-2002 03:24 AM

Why is it that when someone says they have "decided not to do it", they leave someone else in the middle of a mess up? That's fine, I'll get the code that you gave me out of there somehow. As far as asking you about the other thing, if you don't know the answer (which is probably the way it really is) or you don't want to help, that's fine also. I can see that there are only a few real hack developers here that are helpful and understanding in any way. Glad I found out now. Thanks for nothing Unknown553.

Unknown553 04-25-2002 08:06 PM

This is why I don't post many hacks, cuz people want me to bend over backwards and make it work exactly the way people want, even if it's different from what it's posted. I'm open to suggestions, but I will not take "I want this hack to do this and that for me, thanks." Take the hack as is or leave it, I tried my best to help you out, but clearly it still is not working for you. So, in order for me to make it work exactly how you want it, I'd have to customize it and completely redo the whole dang script, which I will not do for one person that I don't even know. Take the modification as is or don't use it, it's that simple. Thank you for your lack of gratitude.

Boofo 04-25-2002 09:41 PM

I guess I need to apologize for that last message. There is really no excuse for the way I reacted. I ended up doing a complete re-install of vBulletin and I modified Admin login it to fit in between the Contact Us and the board URL. It works great there and looks normal with a regular user. It really is a good hack and I'm sorry I reacted the way I did. I'm working on my first hack (actually, I need to thank you for steering me in the right direction with your code for Admin login). It is basically a combination of a couple of previous hacks redone in box like Quick Stats and is for the Admin Panel. If you'd be interested in checking it out, let me know. I could use someone who knows what to look for in it. It works GREAT here! Again, sorry for the last message.

Unknown553 04-26-2002 10:06 PM

Apology accepted. I'm interested in checking out any hack, so go ahead and share it when you finish :)

!!!cyr0n_k0r 10-28-2002 05:11 AM

ive tried this hack on one domain and its worked fine.. but I am trying to use it on a subdomain and it wont work. Help please.

chrisvonc 10-18-2003 03:04 PM

Nice little and easy hack. Thank you! Installed without problem on 2.3.2

Chris


All times are GMT. The time now is 10:32 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.01225 seconds
  • Memory Usage 1,830KB
  • 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
  • (2)bbcode_php_printable
  • (7)bbcode_quote_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
  • (40)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