[Split from] [phpBB Debug] PHP Notice...

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Anti-Spam Guide
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
User avatar
Saldash
Registered User
Posts: 619
Joined: Mon Nov 10, 2008 8:08 am
Location: Flintshire, UK
Name: Stuart Jackson
Contact:

[Split from] [phpBB Debug] PHP Notice...

Post by Saldash »

I seem to get this error as well..but only if i havent been to the forum before viewing the existing site page..
It will work fine for a while, then suddenly not.. as if the session had a timeout period..

Im going to try something and see what happens... but i dont hold out much hope..
World Recoded UK - DreamHost Site of the Month winner February 2011!
User avatar
Phil
Former Team Member
Posts: 10403
Joined: Sat Nov 25, 2006 4:11 am
Name: Phil Crumm
Contact:

Re: [Split from] [phpBB Debug] PHP Notice...

Post by Phil »

What is the exact error you are getting?
Moving on, with the wind. | My Corner of the Web
User avatar
ric323
Former Team Member
Posts: 22910
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: [Split from] [phpBB Debug] PHP Notice...

Post by ric323 »

Saldash wrote:I seem to get this error as well..but only if i havent been to the forum before viewing the existing site page..
It will work fine for a while, then suddenly not.. as if the session had a timeout period..

Im going to try something and see what happens... but i dont hold out much hope..
Please paste you exact error message here when you get it.
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions
User avatar
Saldash
Registered User
Posts: 619
Joined: Mon Nov 10, 2008 8:08 am
Location: Flintshire, UK
Name: Stuart Jackson
Contact:

Re: [Split from] [phpBB Debug] PHP Notice...

Post by Saldash »

Ok folks, cheers for keeping tabs on the topic..

As soon as i get that error again ill post it..
Just to test the change i made can someone visit my website via this URL:
http://www.world-recoded.co.uk/sandbox.php

its a page with random content used for testing,

What should happen is that if you are not logged in via my forum, you SHOULD get "Login | Register" top right...
If you are logged in then it should say "Logged in as: username."

If you get anything else.. its likely to be the error i have been getting..

If you dont see anything at all top right, it means i screwed up a path somewhere..

EDIT::
Whie im here, is there a way to display a logout link with the username?
I can get a hyperlink there no problem.. its just that the logout link on the forum uses a session ID in the logout script, and i have no idea how to do that in PHP
World Recoded UK - DreamHost Site of the Month winner February 2011!
User avatar
Saldash
Registered User
Posts: 619
Joined: Mon Nov 10, 2008 8:08 am
Location: Flintshire, UK
Name: Stuart Jackson
Contact:

[Confirmed Working Method] PHP Notice...

Post by Saldash »

[Confirmed Working!]
Ok, I seem to have found a solution to the timeout problem (that fits my needs at least)

To set the scene, the site structure for the examples below is this:

Code: Select all

 - Website Root
     |- Index.php
     |- forum/
          |- Index.php
          |- pull_status.php
          |- pull_session.php
     |- rest-of-site
I created two PHP files and uploaded them to the forum root directory, then call these files using include functions from my main Index.php
The first file - pull_session.php - change "forum/" to the forums root folder on your server..
example: site.co.uk/forum/ -- so i put forum/ where bold just below..

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
$user->session_begin();
$auth->acl($user->data);
$user->setup();
?>
The above file is pulled from the existing webpage via an include ( eg.. Include("forum/pull_session.php"); )
That now seems to solve the time out issue for me as its not happened since i made that change..

Next, i want to check user status, for this i created the second file - pull_status.php - customise as you wish..

Code: Select all

<?php
if ($user->data['user_id'] == ANONYMOUS)
{
   include("login_open.php");
}
else
{
   echo 'Logged in as: ' . $user->data['username'];
}
?>
Where is has login_open.php above.. thats the file i used to put the Login | Register links in.. (its just a regular HTML file really.. just with .php extension..

The second file get called also via using Include("forum/pull_status.php"); where i want the user status showing..

Make sure you put the includes into <?PHP ?> tags if you havent included them in an existing tag already.
Just need to know how to get a button to check user name before allowing a download and thats it!
World Recoded UK - DreamHost Site of the Month winner February 2011!
Locked

Return to “[3.0.x] Support Forum”