vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Register link for guests, User CP link (or button) for members. (https://vborg.vbsupport.ru/showthread.php?t=38416)

Dark Odin 05-08-2002 10:23 PM

First attempt at posting anything. :D

scsa20 05-08-2002 10:43 PM

I did mine an easyer way (find this out by looking around the template mod. forum ;) ) and here's how I did mine (2 different ways)....for the buttons (I used this on 2 template sets), I just added the following to the "phpinclude" template:

PHP Code:

if ($bbuserinfo['userid']<"1") {
    
$regcp "<a href=\"register.php?s=$session[sessionhash]&action=signup\"><img src=\"{imagesfolder }/top_register.gif\" alt=\"Registration is free!\" border=\"0\"></a>";
} else {
    
$regcp "<a href=\"usercp.php?s=$session[sessionhash]\"><img src=\"{imagesfolder }/top_profile.gif\" alt=\"Here you can view your subscribed threads, work with private messages and edit your profile and preferences\" border=\"0\"></a>";
        
$vlogout "<a href=\"member.php?s=$session[sessionhash]&&action=logout\"><img src=\"{imagesfolder }/top_logout.gif\" alt=\"Log Out\" border=\"0\"></a>";
}
if (
$bbuserinfo['usergroupid']==6) {
    
$vadminbutton "<a href=\"/admin/index.php?s=$session[sessionhash]\" target=\"_blank\"><img src=\"{imagesfolder }/top_admin.gif\" alt=\"Go to your Admin Panel\" border=\"0\"></a>";
}

if (
$bbuserinfo['usergroupid']==7) {
    
$vmodbutton "<a href=\"/mod/index.php?s=$session[sessionhash]\" target=\"_blank\"><img src=\"{imagesfolder }/top_mod.gif\" alt=\"Go to your Mod Panel\" border=\"0\"></a>";


and then just replace <!-- toplinks --> down to <!-- /toplinks --> with:

Code:

  <!-- toplinks -->
  $vadminbutton
  $vmodbutton
  $regcp
  <a href="calendar.php?s=$session[sessionhash]"><img src="{imagesfolder }/top_calendar.gif" alt="Calendar" border="0"></a>
  <a href="memberlist.php?s=$session[sessionhash]"><img src="{imagesfolder }/top_members.gif" alt="Find other members" border="0"></a>
  <a href="misc.php?s=$session[sessionhash]&action=faq"><img src="{imagesfolder }/top_faq.gif" alt="Frequently Asked Questions" border="0"></a>
  <a href="search.php?s=$session[sessionhash]"><img src="{imagesfolder }/top_search.gif" alt="Search" border="0"></a>
  <a href="index.php?s=$session[sessionhash]"><img src="{imagesfolder }/top_home.gif" alt="Home" border="0"></a>
  $vlogout
  &nbsp;
  <!-- /toplinks -->

(make sure you remove the spaces between from {imagesfolder and })

or you can put this in the "phpinclude" template:

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 

then just add $adminlogin anywhere in the footer template..and remember, you can always play around with the code ;)

Takara 05-08-2002 11:00 PM

Quote:

Originally posted by KuraFire
Takara, actually, my hack said { imagesfolder } but if I type it without the spaces, it gets parsed... o_O

But it all looks commented out fine on _my_ screen, nonetheless.... o.o

Oooohhhhh, lol. I uploaded what mine looked like.

Anyway ^-^

KuraFire 05-08-2002 11:03 PM

scsa20: sure, that works too, but it's totally not necessary on my board (how the hell you found that "an easier way" is beyond me, though. :p ).
I have my Admin Panel on my Personal Bookmark Folder, so I just have to click on one link to get there, no matter _what_ site or page I'm browsing (so I can be on this forum and still jump there with 1 click). As for the Mod panel, they don't have anything to do there on my board except ban users, and that's something they don't often have to do at all, and usually I'm the one doing it anyhow.

But, thanks for the addition anyway, some other people might well appreciate it. :):up:

KuraFire 05-08-2002 11:06 PM

Takara, as a suggestion: export images as .GIF if they don't use a lot of colors (ie. forum screenshots, for instance) - top quality and very small filesizes. Much better than these horrid, horrid .jpg's :)

Birdie501 05-10-2002 02:50 PM

Hi,

does somebody know how i can put these function in a javascript coded menu?

I use the xmenu hack
https://vborg.vbsupport.ru/showthrea...ighlight=xmenu

and want to use this function?

Thanks alot!

KuraFire 05-14-2002 10:03 AM

I can't help you with that, if you still _need_ help, even.... :/

Birdie501 05-21-2002 11:27 AM

thanks, i found another solution, thanks!

FleaBag 05-21-2002 10:03 PM

Well for starters I'm using version 2.2.5, and nowhere in my global.php do I see the above mentioned reference. I tried putting this...

PHP Code:

if ($bbuserinfo['userid'] != 0) {
          eval(
"\$reglinks = \"".gettemplate("reglinks_on")."\";");
        }else{
eval(
"\$reglinks = \"".gettemplate("reglinks_off")."\";");


...in my phpinclude template, created the templates reglinks_on and reglinks_off, and put $reglinks in my HTML - but nothing happens. Anyone have any ideas?

KuraFire 05-22-2002 06:45 AM

Your root/global.php should have these two lines, somewhere around line 270-280:

PHP Code:

// ###################### Start templates #######################
//prepare default templates ********************** 

If they aren't in it, you're using some weird unoffical version of vB, OR a different language version.

If you can't find that, try finding this:

PHP Code:

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]);
  }


And add this below it:

PHP Code:

// guest/member register/usercp hack

if($bbuserinfo['userid'] != 0) {

    
$reg_ucp "<a href=\"usercp.php?s=$session[sessionhash]\">".

        
"<img src=\"{imagesfolder }/usercp.gif\" ".

        
"alt=\"Here you can view your subscribed threads, work with private messages and edit your profile and preferences\" ".

        
"border=\"0\"></a>";

}else{

    
$reg_ucp "<a href=\"register.php?s=$session[sessionhash]&action=signup\">".

        
"<img src=\"{imagesfolder }/register.gif\" ".

        
"alt=\"Registration is free!\" border=\"0\"></a>";



It won't work through templates, since you'd have to have a global-in-global template, which doesn't exist in vB.


All times are GMT. The time now is 06:18 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.01182 seconds
  • Memory Usage 1,768KB
  • 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
  • (6)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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