vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Integration with vBulletin - Simple vB User login and access control on non vB pages (https://vborg.vbsupport.ru/showthread.php?t=132996)

djbaxter 02-20-2007 02:34 AM

Uninstall vBSEO. :)

Billspaintball 02-20-2007 04:05 AM

Quote:

Originally Posted by Mastar (Post 1186473)
How to get this to work wid vbseo?
Code:

Unable to add cookies, header already sent.
File: /home/XXXXX/public_html/index.php
Line: 1
 

 



Search Engine Optimization by vBSEO 3


Usually means you have some white space up the top of your page.

Post the first few lines of that page so we can see whats happening.

Skeezster 02-20-2007 04:26 PM

Hi,

I'm trying to use this in a page which contains other variables, but they're all being wiped. I've done some general reading on the VBulletin variable cleaning utility, but can't for the life of me figure out what I'm doing wrong.

Basically an "id" variable is passed (using the "request" function) with the URL for a simple news script (news.php?action=viewnews&id=5)
But with global.php (thus init.php) being used the variable is being wiped. How can I get around that?

Code:

        switch($_REQUEST['action']) {
    case 'viewnews':
            viewNews($id);
                break;
}


Thanks

Skeezster 02-20-2007 05:32 PM

Nevermind, I discovered just how stupid I was being!

Billspaintball 02-20-2007 11:08 PM

Quote:

Originally Posted by Skeezster (Post 1186822)
Hi,

I'm trying to use this in a page which contains other variables, but they're all being wiped.

At a guess your using the same variable names that vB uses.

Skeezster 02-21-2007 01:40 AM

I ended up putting the variable through the vbulletin variable cleaner which sorted things out nicely.

I'm able to log-in and out fine from any page with the includes, but when I attempt to use the user's name/id in the page then I don't get any result. I'm using the following code in the page:
Code:

                $member_name = $vbulletin->userinfo['username'];
                echo 'Hello there ' . $member_name;

And this is up at the top of the page:
Code:

<?php
$curdir = getcwd ();
chdir('/home/######/public_html/forum');
require_once('global.php');
chdir ($curdir);
include 'db.php';
global $db;
?>


Skeezster 02-21-2007 01:59 AM

Found the problem - it doesn't like being inside a function. Think I'm sorted now!

SocomNego 02-21-2007 02:52 AM

Ok well I keep on getting an error...here it is

Quote:

Fatal error: Call to a member function on a non-object in /home/gamesoga/public_html/forums/includes/functions.php on line 1154
Here is my functions.php file from line 1154 to 1174
PHP Code:

    $user $vbulletin->db->query_first_slave("
        SELECT " 
.
            
iif(($option 16), ' administrator.*, ') . "
            userfield.*, usertextfield.*, user.*, UNIX_TIMESTAMP(passworddate) AS passworddate,
            IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid" 
.
            
iif(($option 2) AND $vbulletin->options['avatarenabled'], ', avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline, customavatar.width AS avwidth, customavatar.height AS avheight').
            
iif(($option 8), ', customprofilepic.userid AS profilepic, customprofilepic.dateline AS profilepicdateline, customprofilepic.width AS ppwidth, customprofilepic.height AS ppheight') .
            
iif(($option 32), ', sigpic.userid AS sigpic, sigpic.dateline AS sigpicdateline, sigpic.width AS sigpicwidth, sigpic.height AS sigpicheight') .
            
iif(!isset($vbphrase), fetch_language_fields_sql(), '') . "
            
$hook_query_fields
        FROM " 
TABLE_PREFIX "user AS user
        LEFT JOIN " 
TABLE_PREFIX "userfield AS userfield ON (user.userid = userfield.userid)
        LEFT JOIN " 
TABLE_PREFIX "usertextfield AS usertextfield ON (usertextfield.userid = user.userid) " .
        
iif(($option 2) AND $vbulletin->options['avatarenabled'], "LEFT JOIN " TABLE_PREFIX "avatar AS avatar ON (avatar.avatarid = user.avatarid) LEFT JOIN " TABLE_PREFIX "customavatar AS customavatar ON (customavatar.userid = user.userid) ") .
        
iif(($option 8), "LEFT JOIN " TABLE_PREFIX "customprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid) ") .
        
iif(($option 16), "LEFT JOIN " TABLE_PREFIX "administrator AS administrator ON (administrator.userid = user.userid) ") .
        
iif(($option 32), "LEFT JOIN " TABLE_PREFIX "sigpic AS sigpic ON (user.userid = sigpic.userid) ") .
        
iif(!isset($vbphrase), "LEFT JOIN " TABLE_PREFIX "language AS language ON (language.languageid = " . (!empty($languageid) ? $languageid "IF(user.languageid = 0, " intval($vbulletin->options['languageid']) . ", user.languageid)") . ") ") . "
        
$hook_query_joins
        WHERE user.userid = 
$userid
    "
); 


I have tried to check it out, but I don't have a clue what it could be...
Any help would be much appreciated!!!

Billspaintball 02-22-2007 03:02 AM

There should be nothing wrong with the functions.php file, the problem will be in the page that has called it.

Have you followed the steps in the troubleshooting guide? https://vborg.vbsupport.ru/showpost....79&postcount=2
Including step 5 with the test code.

If you still have problems after this, please post the first few lines of the page you are trying to use this hack on.

HoG 02-23-2007 12:19 PM

Is it possible to redirect back to the page you accessed the login form from? if so can someone please give me the code to edit?

Thnx


All times are GMT. The time now is 03:04 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.01619 seconds
  • Memory Usage 1,763KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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