Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Sort of a hack.... Details »»
Sort of a hack....
Version: , by drews drews is offline
Developer Last Online: Jun 2010 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 11-24-2002 Last Update: Never Installs: 0
 
No support by the author.

Ok, I would like add an admin button to the top along with the other buttons (user cp, register, search, etc). So I created a new template called forumhome_loggedin_admin and the added:

Code:
<a href="admin/index.phps=$session[sessionhash]"><img src="https://vborg.vbsupport.ru/images/top_admin.gif"></a>
and then in global.php I replaced:

PHP Code:
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval(
"\$header .= \"".gettemplate('header')."\";");
eval(
"\$footer .= \"".gettemplate('footer')."\";"); 
with

PHP Code:
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval(
"\$header .= \"".gettemplate('header')."\";");
if(
$bbuserinfo['usergroup']==6) {
  eval(
"\$loggedinadmin .= \"".gettemplate('forumhome_loggedin_admin')."\";");
  eval(
"\$footer .= \"".gettemplate('footer')."\";");
} else {
  eval(
"\$footer .= \"".gettemplate('footer')."\";");

And then in the template header I added $loggedinadmin where I wanted it.

However for some reason, it doesn't show up...There are no errors and the other buttons work, I am using vB 2.2.9 if that helps..

Can anyone think of what I am missing, or did I change the code in the wrong spot?

Please help!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 11-25-2002, 04:56 AM
FWC's Avatar
FWC FWC is offline
 
Join Date: Oct 2001
Location: Ontario, CA
Posts: 821
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It should be:
PHP Code:
if($bbuserinfo['usergroupid']==6) { 
Reply With Quote
  #3  
Old 11-25-2002, 06:29 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Btw, if you just want to add an admin button, what you are doing there is way too complicated. You don't even need to hack any PHP files. Just template edits.

Do this:

Open phpinclude template,

Add this to the bottom of the template:

PHP Code:
if($bbuserinfo['usergroupid']==6) {
$adminbutton='<a href="admin/index.phps=$session[sessionhash]"><img src="https://vborg.vbsupport.ru/images/top_admin.gif></a>';
} else {
$adminbutton='';

Then open header template:

Add $adminbutton where you want to show up. It will just show up for admins.

Done! No need file hacking or extra templates!
Reply With Quote
  #4  
Old 11-25-2002, 02:04 PM
drews drews is offline
 
Join Date: Nov 2002
Location: Florida
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

THanks Erwin....that worked....almost perfectly. But now for some reason there is a black border around the button. So what is the big difference between this and all the other buttons??

I attaches the screenshot of the black border.
Attached Files
File Type: (21.3 KB, 10 views)
Reply With Quote
  #5  
Old 11-25-2002, 02:22 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

use this:
PHP Code:
$adminbutton='<a href="admin/index.phps=$session[sessionhash]"><img src="https://vborg.vbsupport.ru/images/top_admin.gif" border=0></a>'
also just a tip, you're first version couldn't work, you have used $loggedinadmin in your headertemplate before this variable has been created ^^
look, it was defined afterwards...

nevertheless, for such things a template conditional hack would help you
look for logician's
Reply With Quote
  #6  
Old 11-25-2002, 04:43 PM
drews drews is offline
 
Join Date: Nov 2002
Location: Florida
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks guys! It works now. I don't know why I didn't think of using Logician's hack. Anyway, thanks for your help
Reply With Quote
  #7  
Old 11-25-2002, 07:53 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, never forget border="0" if you're linking images.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:50 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.04369 seconds
  • Memory Usage 2,287KB
  • Queries Executed 21 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (5)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (1)postbit_attachment
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete