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)
-   -   Get rid of "register" option if you have registered (https://vborg.vbsupport.ru/showthread.php?t=33051)

James Cridland 12-07-2001 10:00 PM

I'm logged in to your board... so why is there still a link at the top of your board asking me to "register"?

I'm not logged in... so why is there a link to my "control panel"?

This bit of code will remove the pointless links from your forum, leaving it looking neater and using (a bit) less bandwidth.

Details: Two template edits, that's all.
Demo: http://forums.mediauk.com
Use Username: vbulletinorg Password: vbulletinorg so you can see both states. We use text rather than the standard graphics, but you'll find the graphic code enclosed in the hack documentation.

Dalius 12-08-2001 08:14 PM

Ok, for the last step, editing the template, what and where do we exactly edit?

Freddie Bingham 12-08-2001 08:55 PM

I put something in my phpinclude template like this:

if ($bbuserinfo[userid]) { // user is logged in
$pflink = linkto usercp.php
} else {
$pflink = linkto register.php
}

I then put $pflink in the header template in place of the buttons that show user cp/register. Do it this way and you don't have to edit anything when you upgrade.

Modshack 12-08-2001 09:05 PM

In your header simply

Delete this :-

<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>
<a href="register.php?s=$session[sessionhash]&action=signup"><img src="{imagesfolder}/top_register.gif" alt="Registration is free!" border="0"></a>


And replace it with :

$register_or_controlpanel

Tried and tested and works fine and the php edit is hardly brain surgery now is it :)

HM

James Cridland 12-08-2001 09:19 PM

[QUOTE]Originally posted by freddie
Do it this way and you don't have to edit anything when you upgrade.

Psychdrone 12-08-2001 09:26 PM

please do!

James Cridland 12-08-2001 09:58 PM

Have done; hack now updated. Many thanks for that.

grb123 12-09-2001 02:44 PM

So easy! Thanks very much!

nuno 12-09-2001 03:49 PM

ah thank you freddie ;)

DarkReaper 12-09-2001 03:59 PM

Parse error: parse error in /home/serioussam/cgi-bin/forums/global.php(328) : eval()'d code on line 10

James Cridland 12-09-2001 04:05 PM

Please use the code in the hack, not the code in this thread.

bira 12-09-2001 04:07 PM

I like this hack. Thanks :)

Dockaych 12-09-2001 11:26 PM

They ought to build this into the next upgrade of vBulletin, it seems so much more logical.

Perhaps this could be expanded to allow for a logout button too though? (although the logout isn't usually next to register/user cp)

--dock

Freddie Bingham 12-09-2001 11:46 PM

I could make it an option.

DarkReaper 12-09-2001 11:59 PM

Its probably not with vB by default because of the option to allow multiple registrations. But then again, why don't they make that option determine whether this hack is enabled or not? :)

Freddie Bingham 12-10-2001 02:18 AM

Well "they" would include me and I will proabably put this option in v3.

nuno 12-10-2001 02:22 AM

way to go freddie :)

DarkReaper 12-10-2001 02:29 AM

vB3......oohhhhhhhhhhhh :D

Dockaych 12-10-2001 08:23 AM

Would it be possible to make the logout button (or A logout button, i know it's not standard...) also dependant upon whether the user is logged in?

James Cridland 12-10-2001 08:53 AM

Sure it would: in exactly the same way.

SirSteve 12-25-2001 05:19 AM

What about placing the LOGOUT button where REGISTER would be if they are logged in?

Dockaych 12-25-2001 07:47 AM

[QUOTE]Originally posted by SirSteve
What about placing the LOGOUT button where REGISTER would be if they are logged in?

fonzerelli_79 12-25-2001 11:18 PM

dont know whats wrong

installed the hack word for word and it didnt work

no errors but the register and the user cp did not show

oh well!!

nuno 12-26-2001 12:20 AM

[QUOTE]Originally posted by freddie
I put something in my phpinclude template like this:

if ($bbuserinfo[userid]) { // user is logged in
$pflink = linkto usercp.php
} else {
$pflink = linkto register.php
}

I then put $pflink in the header template in place of the buttons that show user cp/register. Do it this way and you don't have to edit anything when you upgrade.

fonzerelli_79 12-26-2001 01:34 AM

yeah i did that

i think its because i use vbportal

my phpinclude is this

if (!isset($mainfile)){
include("../vbp_includes.php");
}

i think this is where the problem is

Smallville 12-26-2001 06:23 AM

This is really confusing. There are codes flying around the thread and the .txt file at the beginning isn't written that well (no offense).

Could somebody rewrite this (take what's there and specify everything for MAJORLY PHP CHALLENGED people like ME) so it tells what exact file to open, what to change, where to change it? Thank you so much. It's confusing when the txt file is not specific at the end, people post coding in their replies, and then somebody says don't use that, bla bla, AAAHHHH.

Thanks for redoing it if anyone does. I'm really illiterate with PHP and coding, so I need it very specific. The hack sounds very cool though.

SystemLogic 12-26-2001 03:56 PM

Works like a charm, thanks! I've been looking for this one ;)

James Cridland 12-30-2001 01:34 PM

[QUOTE]Originally posted by Smallville
This is really confusing. There are codes flying around the thread and the .txt file at the beginning isn't written that well (no offense).

Could somebody rewrite this (take what's there and specify everything for MAJORLY PHP CHALLENGED people like ME) so it tells what exact file to open, what to change, where to change it? Thank you so much. It's confusing when the txt file is not specific at the end, people post coding in their replies, and then somebody says don't use that, bla bla, AAAHHHH.

Thanks for redoing it if anyone does. I'm really illiterate with PHP and coding, so I need it very specific. The hack sounds very cool though.

James Cridland 12-30-2001 01:39 PM

[QUOTE]Originally posted by Dockaych
Perhaps this could be expanded to allow for a logout button too though? (although the logout isn't usually next to register/user cp)

Martin CX 12-30-2001 07:29 PM

If you download the graphic developers kit from vbulletin.com you'll find a log out-button (almost) ready to use.

Thanks for the hack! I've modified this hack somewhat too - having a text menu for users logged in, and having a user name and password text boxes for those not logged in, making it a breeze to log in - even when you are on some obscure page.

voogru 01-05-2002 02:37 AM

i made a small mod that you can replace the entire logout crap with "$vlogout"


just out this in the phpinclude (remove the old code first)

PHP Code:

if ($bbuserinfo['userid']<"1") {
    
//they're a guest
    
$register_or_controlpanel "<a href=\"register.php?s=$session[sessionhash]&action=signup\"><img src=\"{imagesfolder}/top_register.gif\" alt=\"Registration is free!\" border=\"0\"></a>";
} else {
    
//they're registered
    
$register_or_controlpanel "<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>";


and then do this:

open header.php

find
Code:

  <a href="member.php?s=$session[sessionhash]&action=logout"><img src="{imagesfolder}/top_logout.gif" alt="Logout" border="0"></a>
replace with
Code:

$vlogout
this will make it so you dont have to have the logout button next to the usercp (i like mine at the end)

this is the first time i ever modded something that has to do with php so go easy on me! in a n00b!

Arathorn 01-06-2002 01:10 PM

To make this compatible with VBPortal 3, add the code in the instructions into vbp_includes.php, right under:

[QUOTE]
include("../config.php");
global $nukepath,$bbuserinfo,$nukeurl,$foot1,$foot2,$foot 3,$foot4;
global $Allow_Forum_Leftcolumn, $Forum_Default_Leftcolumn,$newsforum,$pollsforum;
chdir($nukepath . "/");

NYI Fan 01-12-2002 02:19 PM

quick, easy and definately a nice touch!
Thanks

Rose 01-12-2002 02:59 PM

I am using this hack and love it.

However, I want to add a new style to the board and change the 'register' and 'profile' buttons in a new style (other than default).

I can't get the replacements to work, I keep getting the default buttons in the new style. If I edit the top 'php parsed code' in the new style settings, it changes my default.

Is there a way I can change this and still use the hack?

Arathorn 01-13-2002 11:32 AM

The Image folder path is a variable that can be changed with each style. Create a new folder for each new set of buttons, and alter the variable ( Admin CP > Styles > at the bottom ). Make sure you keep all the image filenames exactly the same as the original files.

This should work, but someone else could probably give you a better solution.

StarBuG 01-13-2002 08:54 PM

For me it works fine in the vB THANK you!

But in the Portal (I use vBPortal 3.0 beta 8) the buttons are just gone!

I added the code in the vbp_includes.php but nothing happended!

Any suggestions?

Greetings

StarBuG

Erwin 01-14-2002 11:56 PM

The hack works for vBPortal 3 on the Forum home page, but not for the vBPortal Main Home page (following the vBPortal instructions above). Which is a big hassle. I'll see if there's a way around it.

Airwaves 02-01-2002 10:23 AM

can this be modified to put the buttons in this order for a logged out user

calender - members - faq - search - home - register

and for a logged in user

user cp - calender - members - faq - search - home - logout

and for admin or mod

admin/mod cp - user cp - calender - members - faq - search - home - logout

if someone can send me the instructions to do this that i list above, please let me know.

regards

Liam

Lionel 02-02-2002 07:03 AM

if ($thread[open]) {
$replyclose="images/comments.gif";
} else {
$replyclose="{closedthreadimage }";

but it does not work. I wanted to replace the Post Reply image in one template with another one without loosing the "closed" option

Airwaves 02-02-2002 07:46 AM

can anyone answer my question ?


All times are GMT. The time now is 02:45 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.01179 seconds
  • Memory Usage 1,817KB
  • 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_code_printable
  • (1)bbcode_php_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