External pages logging users out

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
zoobie
Registered User
Posts: 297
Joined: Wed Dec 01, 2004 1:02 am

External pages logging users out

Post by zoobie »

Hi -
After yet another migration of my hosts doing, this time my external pages do not keep the user logged in. First, I had to go into the CP and select php 5.6 from the php version manager. Then I noticed my external pages weren't keeping the user logged in. I'm using the code below but wondering if the php manager somehow changed it. My host is clueless.

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './buskers/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
//$phpbb_root_path = './buskers/';
if ($user->data['user_id'] == ANONYMOUS){
?>

Non-logged in HTML

<?php
}
else
{
?>

Logged in HTML

<?php
}
?>

Thanks for any insight
User avatar
AmigoJack
Registered User
Posts: 6108
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: External pages logging users out

Post by AmigoJack »

zoobie wrote: Sat Jan 05, 2019 2:58 amexternal pages do not keep the user logged in
Are you also using append_sid() for URIs pointing to those external pages? Your code of the external page looks fine.
zoobie wrote: Sat Jan 05, 2019 2:58 amthe php manager
What is that?
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28
zoobie
Registered User
Posts: 297
Joined: Wed Dec 01, 2004 1:02 am

Re: External pages logging users out

Post by zoobie »

That's all the code I'm using.
Where would the append_sid() go?
Thanks
User avatar
AmigoJack
Registered User
Posts: 6108
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: External pages logging users out

Post by AmigoJack »

To every URI. Look at i.e. /viewtopic.php and see wherever it is used - there's not one URI printed without using it.
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28
zoobie
Registered User
Posts: 297
Joined: Wed Dec 01, 2004 1:02 am

Re: External pages logging users out

Post by zoobie »

I found about register_globals "This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0."
How do I fix the code so it works?

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './buskers/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
//$phpbb_root_path = './buskers/';
if ($user->data['user_id'] == ANONYMOUS){
?>

Non-logged in HTML

<?php
}
else
{
?>

Logged in HTML

<?php
}
?>
zoobie
Registered User
Posts: 297
Joined: Wed Dec 01, 2004 1:02 am

Re: External pages logging users out

Post by zoobie »

Forget it...My phpbb is just too old.
Thanks
User avatar
AmigoJack
Registered User
Posts: 6108
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: External pages logging users out

Post by AmigoJack »

I don't know why you posted the same code again. phpBB's only usage of register_globals is for deactivating it. Search all files for this word and comment out/delete the code using it.
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28
User avatar
warmweer
Jr. Extension Validator
Posts: 11234
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: External pages logging users out

Post by warmweer »

zoobie wrote: Fri Jan 18, 2019 6:01 am Forget it...My phpbb is just too old.
Thanks
Which version of phpBB are you using?
* And if it's too old, what's preventing you from updating/grading?
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
zoobie
Registered User
Posts: 297
Joined: Wed Dec 01, 2004 1:02 am

Re: External pages logging users out

Post by zoobie »

3.0.2
I'm not willing to give up the mods and start all over.
I figured another way around running php5.6 thus saving my board, mods, style, and countless hours.
User avatar
Lumpy Burgertushie
Registered User
Posts: 69223
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: External pages logging users out

Post by Lumpy Burgertushie »

you should at least update your 3.0.2 to 3.0.14

if your external page is the only one not working with php 5.6 then I believe there is a topic about how to do it using 5.6 somewhere here in the archived 3.0 section.


if you are not willing to upgrade to the current version of phpbb then your options for help are greatly limited and pretty much non existent here at phpbb.com


robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.
zoobie
Registered User
Posts: 297
Joined: Wed Dec 01, 2004 1:02 am

Re: External pages logging users out

Post by zoobie »

My cPanel has a php version manager where you can select php5.6 from the default 7.

I read at another forum:
I am aware of the switch from mods to extensions. The day that happened was a bad day for many. It meant that anybody running 3.0 series was going to have to in essence start over if they wanted to update to 3.1 and now 3.2.

phpBB mods are not in any way compatible with any phpBB version past 3.0.* phpBB support is not able to help with this, the only thing they are willing to do is help you upgrade the CORE files of your version 3.0 to CORE 3.2 Many forum owners have tried to convert their mods to extensions and so far there are no success stories posted.

In order for you to get phpBB 3.0 working in 2019 on any server is going to take a lot of tweaking. You really should not be calling out your host because their 2019 servers will not support your extremely outdated software which requires outdated server software to run. phpBB 3.0 is so outdated that even the mods archives has been removed from the public view/download at the phpBB website.

If you want to disable your mods and update to the current version then by all means ask at the phpBB forum, they will help. But only if you are willing to give up the mods.
Fair enough but not for me.

Someone mentioned he hadn't seen a phpbb board in a long time.
User avatar
warmweer
Jr. Extension Validator
Posts: 11234
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: External pages logging users out

Post by warmweer »

zoobie wrote: Fri Jan 18, 2019 4:57 pm 3.0.2
I'm not willing to give up the mods and start all over.
I figured another way around running php5.6 thus saving my board, mods, style, and countless hours.
Have you checked the extension database to see whether someting similar to those mods exists?
Take into account that php versions < 7 will be phased out gradually!

Another thing to take into account is that your statement actually implies that phpBB support stops here!?
Seriously, I updated from 3.0 directly to 3.2 around end 2016 and I have been able to replace all (but 1 of) my mods by extensions, or have transformed them to simple extensions (for 1 I received some seriously good help here), or custom coded them for 3.2. I haven't looked back since.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
warmweer
Jr. Extension Validator
Posts: 11234
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: External pages logging users out

Post by warmweer »

zoobie wrote: Fri Jan 18, 2019 5:45 pm Someone mentioned he hadn't seen a phpbb board in a long time.
I can't help but smile at such a statement. Since when is he/she blind?
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
zoobie
Registered User
Posts: 297
Joined: Wed Dec 01, 2004 1:02 am

Re: External pages logging users out

Post by zoobie »

Don't shoot the messenger.
Looking now at the archives under 3.0.x
I wonder if the "Remember me" checkbox would help.
There's something for Linked accounts but for 3.2.x
User avatar
GanstaZ
Registered User
Posts: 1187
Joined: Wed Oct 11, 2017 10:29 pm
Location: GZOverse

Re: External pages logging users out

Post by GanstaZ »

You haven't answered to one important question. It was asked above by AmigoJack about uris that are pointing to your page/s.
How do you jump from one to another?
I have used external pages since 2.0.x branch and up to master branch and no problems (will switch to front controller soon).
Usus est magister optimus! phpBB pre-Triton & latest php environment.
When answer lies in the question, question becomes redundant!
Post Reply

Return to “phpBB Custom Coding”