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)

seth044_x 10-14-2004 11:52 PM

ok ok i have a beta version of my site and its working like a charm, with a lot of another functions running smooth (avatar, new pms, etc) but in my real site.. its not working!

i get this error.

Code:

Fatal error: Call to a member function on a non-object in /xxxx/foros/includes/functions.php on line 922
and sometimes these other one:

Code:

Fatal error: Call to a member function on a non-object in /xxxx/foros/includes/sessions.php on line 72
functions.php line is:

Code:

$user = $DB_site->query_first("
and sessions.php line is:

Code:

$DB_site->shutdown_query("
Yes, i have included global.php before functions_user.php.

The beta version of the site is vb3.0.0 (working) and real is vb3.0.3 (not working) very strange.

Its kinda urgent, please help!

thanks in advance.

ZeldaUniverse 10-23-2004 06:26 PM

This works perfectly fine for me on http://www.taiteki.net - Check it out if ya don't believe me :p

reach_srinivas 10-30-2004 11:33 AM

HI, I got a problem like
"Unable to add cookies, header already sent.
File: /usr/local/apache/htdocs/dev/i2-042804/test.php
Line: 2"

Pls any one can help me..
Thanks in advance

Blue Moose Aaron 10-30-2004 03:49 PM

Post your PHP code

kelangtri 10-31-2004 07:28 AM

i dont test it with localhost, why??

Neyland 11-02-2004 02:43 AM

Quote:

Originally Posted by seth044_x
ok ok i have a beta version of my site and its working like a charm, with a lot of another functions running smooth (avatar, new pms, etc) but in my real site.. its not working!

i get this error.

Code:

Fatal error: Call to a member function on a non-object in /xxxx/foros/includes/functions.php on line 922
and sometimes these other one:

Code:

Fatal error: Call to a member function on a non-object in /xxxx/foros/includes/sessions.php on line 72
functions.php line is:

Code:

$user = $DB_site->query_first("
and sessions.php line is:

Code:

$DB_site->shutdown_query("
Yes, i have included global.php before functions_user.php.

The beta version of the site is vb3.0.0 (working) and real is vb3.0.3 (not working) very strange.

Its kinda urgent, please help!

thanks in advance.

I get the same exact problem!

sketchy 12-12-2004 10:18 AM

The creator of this script has NEVER repliedto anyones posts, shouldnt this be removed or something as it is clearly not working or maybe a notice in his post saying that it has bugs.

Just a suggestion :p

Splatt_XP 12-19-2004 05:25 PM

Quote:

Originally Posted by sketchy
The creator of this script has NEVER repliedto anyones posts, shouldnt this be removed or something as it is clearly not working or maybe a notice in his post saying that it has bugs.

Just a suggestion :p

Here's how I finally got it to work. I had conflicting database statements so I just read the database right from the index.php file.

I placed this near the top of my index.php file:
PHP Code:

<?
$userid   = $HTTP_COOKIE_VARS['bbuserid'];
$password = $HTTP_COOKIE_VARS['bbpassword'];
$vbhost   = "localhost";
$vbuser   = "your_db_username";
$vbpass   = "your_db_password";
$vbname   = "your_db_name";
$vb=mysql_connect("$vbhost","$vbuser","$vbpass");
mysql_select_db($vbname,$vb) or die ("Forum Database Connectivity Error");

$vbsql=mysql_query("select * from user where userid = '$userid'");
$vbinfo=@mysql_fetch_array($vbsql);

$username=$vbinfo[username];
?>

Then, where I wanted the logon box, I placed the following:
PHP Code:

<?
if ($username) {
    print "<font class=title><b>Welcome back $username!&nbsp;&nbsp;</b></font>";
} else { 
?>
<!-- login form -->
<script type="text/javascript" src="forum/clientscript/vbulletin_global.js"></script>
<script type="text/javascript" src="forum/clientscript/vbulletin_menu.js"></script>
<form action="http://www.yourdomain.com/forum/login.php" method="post" onsubmit="md5hash(vb_login_password,vb_login_md5password)">
<script type="text/javascript" src="forum/clientscript/vbulletin_md5.js"></script>
<table cellpadding="0" cellspacing="3" border="0">
  <tr>
    <td class="title">User Name</td>
    <td><input type="text" class="button" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="1" value="User Name" onfocus="if (this.value == 'User Name') this.value = '';" /></td>
    <td class="title" colspan="2" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="3" id="cb_cookieuser_navbar" accesskey="c" checked="checked" />Remember Me?</label></td>
  </tr>
  <tr>
    <td class="title">Password</td>
    <td><input type="password" class="button" name="vb_login_password" size="10" accesskey="p" tabindex="2" /></td>
    <td><input type="submit" class="button" value="Log in" tabindex="4" accesskey="s" /></td>
  </tr>
</table>
<input type="hidden" name="s" value="" />
<input type="hidden" name="do" value="login" />
<input type="hidden" name="forceredirect" value="0" />            
<input type="hidden" name="vb_login_md5password" />
</form>
<!-- / login form -->

Of course you'll have to change the database info, classes, form action and paths to reflect your set up, but at least this got me working.

T3MEDIA 12-22-2004 09:30 AM

Quote:

Originally Posted by Splatt_XP
Here's how I finally got it to work. I had conflicting database statements so I just read the database right from the index.php file.

I placed this near the top of my index.php file:
PHP Code:

<?
$userid   = $HTTP_COOKIE_VARS['bbuserid'];
$password = $HTTP_COOKIE_VARS['bbpassword'];
$vbhost   = "localhost";
$vbuser   = "your_db_username";
$vbpass   = "your_db_password";
$vbname   = "your_db_name";
$vb=mysql_connect("$vbhost","$vbuser","$vbpass");
mysql_select_db($vbname,$vb) or die ("Forum Database Connectivity Error");

$vbsql=mysql_query("select * from user where userid = '$userid'");
$vbinfo=@mysql_fetch_array($vbsql);

$username=$vbinfo[username];
?>

Then, where I wanted the logon box, I placed the following:
PHP Code:

<?
if ($username) {
    print "<font class=title><b>Welcome back $username!&nbsp;&nbsp;</b></font>";
} else { 
?>
<!-- login form -->
<script type="text/javascript" src="forum/clientscript/vbulletin_global.js"></script>
<script type="text/javascript" src="forum/clientscript/vbulletin_menu.js"></script>
<form action="http://www.yourdomain.com/forum/login.php" method="post" onsubmit="md5hash(vb_login_password,vb_login_md5password)">
<script type="text/javascript" src="forum/clientscript/vbulletin_md5.js"></script>
<table cellpadding="0" cellspacing="3" border="0">
  <tr>
    <td class="title">User Name</td>
    <td><input type="text" class="button" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="1" value="User Name" onfocus="if (this.value == 'User Name') this.value = '';" /></td>
    <td class="title" colspan="2" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="3" id="cb_cookieuser_navbar" accesskey="c" checked="checked" />Remember Me?</label></td>
  </tr>
  <tr>
    <td class="title">Password</td>
    <td><input type="password" class="button" name="vb_login_password" size="10" accesskey="p" tabindex="2" /></td>
    <td><input type="submit" class="button" value="Log in" tabindex="4" accesskey="s" /></td>
  </tr>
</table>
<input type="hidden" name="s" value="" />
<input type="hidden" name="do" value="login" />
<input type="hidden" name="forceredirect" value="0" />            
<input type="hidden" name="vb_login_md5password" />
</form>
<!-- / login form -->

Of course you'll have to change the database info, classes, form action and paths to reflect your set up, but at least this got me working.

umm is that safe putting that info in your index.php?

Splatt_XP 12-22-2004 10:22 PM

Quote:

Originally Posted by T3MEDIA
umm is that safe putting that info in your index.php?

It's no different than putting it in a "config.php" file.

If you feel uncomfortable with it in there then put the database information in another file and then just put an include statement in the index.php file.

somefile.php:
PHP Code:

<? 
$vbhost   = "localhost"; 
$vbuser   = "your_db_username"; 
$vbpass   = "your_db_password"; 
$vbname   = "your_db_name"; 
?>

index.php:
PHP Code:

<? 
$userid   = $HTTP_COOKIE_VARS['bbuserid']; 
$password = $HTTP_COOKIE_VARS['bbpassword']; 
include('somefile.php');
$vb=mysql_connect("$vbhost","$vbuser","$vbpass"); 
mysql_select_db($vbname,$vb) or die ("Forum Database Connectivity Error"); 

$vbsql=mysql_query("select * from user where userid = '$userid'"); 
$vbinfo=@mysql_fetch_array($vbsql); 

$username=$vbinfo[username]; 
?>



All times are GMT. The time now is 11:09 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.01274 seconds
  • Memory Usage 1,771KB
  • 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
  • (8)bbcode_code_printable
  • (6)bbcode_php_printable
  • (4)bbcode_quote_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