vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   VB Login on a Non-VB Page vB3 RC3 (https://vborg.vbsupport.ru/showthread.php?t=61112)

Umpakati 04-17-2005 07:54 PM

To redirect a user back to where he was when he logged in (instead of to the main forum page)...

Find:
PHP Code:

print("<align='center'><span class='sectionheader'>Welcome back, $username!<br>"); 

Add Below:
PHP Code:

foreach($_GET as $option => $value){ 
     if(
$add_to_link != NULL){ 
     
$add_to_link .= "&$option=$value"
     } else { 
     
$add_to_link "?$option=$value"
     } 



Find:
PHP Code:

<input type='hidden' name='vb_login_md5password' /> 

Add Below:
PHP Code:

<input type="hidden" name="url" value="<?php echo $_SERVER[PHP_SELF].$add_to_link;?>"/>


Paul_Hollibone 04-18-2005 01:26 PM

Hey all, with this script, I have it currently on my site of www.defunction.net

And want to know, is there anyway of adding a link for looged in members to logout?

As of yet, I have tried putting an <a href> link in there, but haven't been very sucsessfull. Any help, or advice would be great.

Paul_Hollibone 04-20-2005 01:13 PM

Bump!

Umpakati 04-26-2005 09:55 PM

I have a problem with the include part at the top of the script... it takes me to the forum index.php instead of my regular homepage!

Six-Out 05-09-2005 05:35 AM

I get a parse error

Unexpected $ in line 170

when line 170 is </html>

any ideas on that?

theinz 05-18-2005 12:24 AM

MCAHill - This works excellent for me. Thank you so much for posting this. Solved a lot of my problems.

Question: How do you address the page when you enter a false ID or pass. I can't get it to go back to my homepage. thank you!

T.H.

psychonaut 06-07-2005 12:35 AM

I was having trouble using this method without generating errors. I found the solution and thought I would share it.

The code at the begining:
<?php
chdir("forum/");
require('./global.php');
chdir("../");
?>

This can cause problems if your vB uses a different DB since it connects to that DB and then returns but never reconnects to the orginial DB. This cause mysql fetch array errors for me.

Add this line after the last chdir:
mysql_select_db("your_mainDB_name_goes_here");

Should look like this now:
<?php
chdir("forum/");
require('./global.php');
chdir("../");
mysql_select_db("your_mainDB_name_goes_here");
?>


Next, make sure you have the same admin user for the forum DB also listed as a user in the main DB will all permissions. If not, create a matching forum admin account in your main DB.

This should clear up any issues when using this with 2 DB's.

Enjoy! :ninja:

L3e 06-08-2005 08:22 AM

Hey, I installed this script, and it worked fine on the same domain... but I want this to work on a different domain than what the forum is on.

I have tried changing the directory for it to find the global.php like this:
<?
chdir("/home/vgcorec/public_html/forum");
require('./global.php');
chdir("/home/xbcore/public_html/");
?>

and I have also tried just running it on the vgcorec site and then using a php include on the xbcore site and it does not work right.

It shows the login forms, but it will not detect that you are already logged in if you are.

Also, the two sites are on the same server.

Please help! :)

mismatch 06-24-2005 12:57 PM

this is great THANKS!! works lovely!

Xtremist 06-26-2005 01:07 PM

any idea how to fix this error i get

this is what the code looks like on my page

PHP Code:

<?php 
  chdir
("forum/"); 
require(
'./global.php');   
chdir("../); 
?> 


<? 


if (
$bbuserinfo['userid']!=0) { 
$username=$bbuserinfo['username']; 
   
print("
<align='center'><span class='sectionheader'>Welcome back$username!<br>"); 

} else { 
    


?> 
<form action='/forum/login.php' method='post' onsubmit='md5hash(vb_login_password,vb_login_md5password)'> 
        <script type='text/javascript' src='/forum/clientscript/vbulletin_md5.js'></script> 
         
         <span class="
sectionheader">Username:</span> 
            <input type='text' class='button' name='vb_login_username' id='navbar_username' size='15' accesskey='u' tabindex='1' value='' onfocus='if (this.value == 'username') this.value = '';' /><br> 
             
            <span class="
sectionheader">Password:&nbsp;</span> 
            <input type='password' class='button' name='vb_login_password' size='15' accesskey='p' tabindex='2' /><br> 
            <input type='checkbox' name='cookieuser' value='1' tabindex='3' id='cb_cookieuser_navbar' accesskey='c' checked='checked' /><span class='sectionheader'>Remember Me</span><br> 
         
         
         
        <input name="
submit" type='submit' class='button' accesskey='s' tabindex='4' title='Log In' value='Log In' /> 
        <input type='hidden' name='do' value='login' /> 
        <input type='hidden' name='forceredirect' value='1' />             
        <input type='hidden' name='vb_login_md5password' /> 
        </form> 
                        <? 



?>

This is the error i get

Code:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/ross/public_html/login.php on line 11


All times are GMT. The time now is 12:37 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.01319 seconds
  • Memory Usage 1,757KB
  • 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
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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