Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-06-2012, 03:30 AM
SavSin SavSin is offline
 
Join Date: Jan 2012
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Login issue

When i view the forums i am logged in fine but anytime I hit my home button which goes to my custom home page (Software is forum only no CMS) it shows me logged out.

any ideas on how to fix this..

it seems to happen on all my custom pages. (The home button on the footer and the small house keep me logged in its the tab that logs me out)

Here is the PHP and HTML for my page.

PHP Code:
<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################

define('THIS_SCRIPT''NcBHomePage');
define('CSRF_PROTECTION'true);  
// change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array('NcBHomePage');

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
// if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line
//chdir ('forums/');
require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits construct_navbits(array('http://www.norcalbots.com' => 'Home'));
$navbar render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle 'NcB Home';

$output '<table class="servers">

        <tr class="servers">
            <td class="servers" align="left" colspan="10"><img src="ncb_images/cscz_servers.png" height="30" width="300" /></td>
        </tr>
        
        <tr class="servers">        
            <td class="servers"><iframe src="http://cache.www.gametracker.com/components/html0/?host=69.62.252.50:27016&bgColor=555555&fontColor=eeeeee&titleBgColor=333333&titleColor=ffffcc&borderColor=222222&linkColor=ffffcc&borderLinkColor=eeeeee&showMap=0&showCurrPlayers=0&topPlayersHeight=100&showTopPlayers=1&showBlogs=0&width=240" frameborder="0" scrolling="no" width="240" height="288"></iframe></td>
            
            <td class="servers"><iframe src="http://cache.www.gametracker.com/components/html0/?host=69.62.252.50:27018&bgColor=555555&fontColor=eeeeee&titleBgColor=333333&titleColor=ffffcc&borderColor=222222&linkColor=ffffcc&borderLinkColor=eeeeee&showMap=0&showCurrPlayers=0&topPlayersHeight=100&showTopPlayers=1&showBlogs=0&width=240" frameborder="0" scrolling="no" width="240" height="288"></iframe></td>
            
            <td class="servers"><iframe src="http://cache.www.gametracker.com/components/html0/?host=69.62.252.50:27019&bgColor=555555&fontColor=eeeeee&titleBgColor=333333&titleColor=ffffcc&borderColor=222222&linkColor=ffffcc&borderLinkColor=eeeeee&showMap=0&showCurrPlayers=0&topPlayersHeight=100&showTopPlayers=1&showBlogs=0&width=240" frameborder="0" scrolling="no" width="240" height="288"></iframe></td>
            
            <td class="servers"><iframe src="http://cache.www.gametracker.com/components/html0/?host=69.62.252.50:27017&bgColor=555555&fontColor=eeeeee&titleBgColor=333333&titleColor=ffffcc&borderColor=222222&linkColor=ffffcc&borderLinkColor=eeeeee&showMap=0&showCurrPlayers=0&topPlayersHeight=100&showTopPlayers=1&showBlogs=0&width=240" frameborder="0" scrolling="no" width="240" height="288"></iframe></td>
        </tr>
        
        <tr class="servers">        
            <td class="servers">
                &nbsp;
            </td>            
        </tr>
        
        <tr class="servers">
            <td class="servers" align="left" colspan="10"><img src="ncb_images/csgo_servers.png" height="30" width="300" /></td>
        </tr>
        
        <tr class="servers">
            <td class="servers"><iframe src="http://cache.www.gametracker.com/components/html0/?host=69.62.252.50:27020&bgColor=555555&fontColor=eeeeee&titleBgColor=333333&titleColor=ffffcc&borderColor=222222&linkColor=ffffcc&borderLinkColor=eeeeee&showMap=0&showCurrPlayers=0&topPlayersHeight=100&showTopPlayers=1&showBlogs=0&width=240" frameborder="0" scrolling="no" width="240" height="288"></iframe></td>
            
            <td class="servers"><iframe src="http://cache.www.gametracker.com/components/html0/?host=69.62.252.50:27020&bgColor=555555&fontColor=eeeeee&titleBgColor=333333&titleColor=ffffcc&borderColor=222222&linkColor=ffffcc&borderLinkColor=eeeeee&showMap=0&showCurrPlayers=0&topPlayersHeight=100&showTopPlayers=1&showBlogs=0&width=240" frameborder="0" scrolling="no" width="240" height="288"></iframe></td>
            
            <td class="servers"><iframe src="http://cache.www.gametracker.com/components/html0/?host=69.62.252.50:27020&bgColor=555555&fontColor=eeeeee&titleBgColor=333333&titleColor=ffffcc&borderColor=222222&linkColor=ffffcc&borderLinkColor=eeeeee&showMap=0&showCurrPlayers=0&topPlayersHeight=100&showTopPlayers=1&showBlogs=0&width=240" frameborder="0" scrolling="no" width="240" height="288"></iframe></td>
            
            <td class="servers"><iframe src="http://cache.www.gametracker.com/components/html0/?host=69.62.252.50:27020&bgColor=555555&fontColor=eeeeee&titleBgColor=333333&titleColor=ffffcc&borderColor=222222&linkColor=ffffcc&borderLinkColor=eeeeee&showMap=0&showCurrPlayers=0&topPlayersHeight=100&showTopPlayers=1&showBlogs=0&width=240" frameborder="0" scrolling="no" width="240" height="288"></iframe></td>
        </tr>
        
    </table>'
;


// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######

$templater vB_Template::create('NcBHomePage');
$templater->register_page_templates();
$templater->register('navbar'$navbar);
$templater->register('pagetitle'$pagetitle);

//Home Page Outline
$templater->register('output'$output);

print_output($templater->render());
?>
Code:
{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml"<vb:if condition="$vboptions['enablefacebookconnect']"> xmlns:fb="http://www.facebook.com/2008/fbml"</vb:if>  dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
<head>
	
	<LINK REL=StyleSheet HREF="games/stats/player_stats.css" TYPE="text/css">
		
	{vb:raw headinclude}
	<title>{vb:raw pagetitle}</title>

	<vb:if condition="$includecss">
		<vb:if condition="$vboptions['storecssasfile']">
			<vb:each from="includecss" value="file">
				{vb:cssfile {vb:raw file}}
			</vb:each>
		<vb:else />
			{vb:cssfile {vb:raw includecss}}
		</vb:if>
	</vb:if>
        {vb:raw headinclude_bottom}
</head>
<body>

	{vb:raw header}
	
	{vb:raw navbar}
	
	<center>
			{vb:raw output}
	</center>
	{vb:raw footer}
	
</body>
</html>
Attached Images
File Type: jpg loginIssue.jpg (139.2 KB, 0 views)
Reply With Quote
  #2  
Old 06-06-2012, 10:08 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think the problem is that your custom page has "www" on the url while the vb page doesn't (or was it the other way around), so the cookies aren't getting sent to your custom page. You could try going to Cookies and HTTP Header Options > Cookie Domain and setting a domain, but you might find you'll have fewer problems overall if you choose one domain (either with or without the www) and set up an htaccess command to send all requests to that one.
Reply With Quote
  #3  
Old 06-06-2012, 06:10 PM
SavSin SavSin is offline
 
Join Date: Jan 2012
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
I think the problem is that your custom page has "www" on the url while the vb page doesn't (or was it the other way around), so the cookies aren't getting sent to your custom page. You could try going to Cookies and HTTP Header Options > Cookie Domain and setting a domain, but you might find you'll have fewer problems overall if you choose one domain (either with or without the www) and set up an htaccess command to send all requests to that one.
Thanks that worked great.. haha

Ill have to look into the htaccess i haven't played with that so i will check it out.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:49 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.03519 seconds
  • Memory Usage 2,225KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (1)postbit_attachment
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete