vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Code De-Bug / cahnge for VB4 (https://vborg.vbsupport.ru/showthread.php?t=251271)

Jinkasu 09-28-2010 02:19 AM

Code De-Bug / cahnge for VB4
 
Greetings fellow VB'ers.

I used a SQL database previously on VB3, and have just updated to 4 but now I am having issues with it :(

The page checks to see whether people are logged into Vbulletin before granting them access to the database.

Previously I had ~

if ($HTTP_COOKIE_VARS['bbsessionhash']) {
$hash = $HTTP_COOKIE_VARS['bbsessionhash'];
$a1 = mysql_db_query($phpdb,"select username from vbuser u inner join vbsession s on (u.userid = s.userid) where s.sessionhash = '$hash'");
if (mysql_num_rows($a1) == 1) {
$username = strtolower(mysql_result($a1,0,"username"));
$charNameField = mysql_result(mysql_db_query($phpdb,"select replace(varname,'_title','') as field_name from vbphrase where text = 'Character Name' and fieldname = 'cprofilefield'"),0,"field_name");

Set up to check the cookie, from the errors I am receiving, I think this is whats causing the errors.

This whole system was wrote by someone else, who I dont have contact with anymore, so any help on the matter would be greatly appreciated, I'm thinking its something to do with the tables or cookies being changed from VB3 - VB4 but am not sure

4AM now and I have been trying to get it working since 10PM last night, please Halp!

Many Thanks

J

Lynne 09-28-2010 03:35 AM

Where was this code? And where do you have it now? And what is the error you are getting?

Jinkasu 09-28-2010 09:33 AM

Good Morning Lynne,

thanks for your reply, the code is on the main page for the Database pages, the page is setup so if it doesntr successfully connect to the database and read the username, it goes to an error page, this is what its doing, so i'm sure that the page is not reading the vb database properly.

Lynne 09-28-2010 01:39 PM

I still have no sense of where you have added that code - is it added to a vbulletin page? And external page?

I think you are just going to have to do some debugging steps to figure out what is going on. Like spit out the $username as soon as it's defined so you know if it is getting that far without error. Little things like that.


All times are GMT. The time now is 08:21 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.02374 seconds
  • Memory Usage 1,706KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete