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

Re: External pages logging users out

Post by zoobie »

Sorry...I didn't answer it because I don't understand it.
I was wondering if this mod is what I'm looking for even though the user is coming from the same domain?
I'm just a videographer looking for answers and help.
User avatar
GanstaZ
Registered User
Posts: 804
Joined: Wed Oct 11, 2017 10:29 pm
Location: Zverse

Re: External pages logging users out

Post by GanstaZ »

How do you get/enter from forum to your page or from your page to forum?
"When answer lies in the question,.. question becomes redundant!"
zoobie
Registered User
Posts: 297
Joined: Wed Dec 01, 2004 1:02 am

Re: External pages logging users out

Post by zoobie »

I used to use to code below but it doesn't work with php v5.6
I was told there's a mod/extension that works with v5.6 that keeps users logged in external pages but can't find it.

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();
if ($user->data['user_id'] == ANONYMOUS){
?>
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52062
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: External pages logging users out

Post by Brf »

Your users click on a link to get to your new page.
How do you make that link?
User avatar
GanstaZ
Registered User
Posts: 804
Joined: Wed Oct 11, 2017 10:29 pm
Location: Zverse

Re: External pages logging users out

Post by GanstaZ »

That code will work with php 7.x.+ . It's not about php or code that you have posted more than once.
Answer a simple question, how you navigate/move/jump to that external page from your board or vise-versa?
"When answer lies in the question,.. question becomes redundant!"
zoobie
Registered User
Posts: 297
Joined: Wed Dec 01, 2004 1:02 am

Re: External pages logging users out

Post by zoobie »

From the site's index, they click on a menu button.
Or, they click on a menu button I've inserted in the board's overall header.
The page checks to see if user is logged in and displays accordingly.
It used to work until a migration.
That's why I thought it's a php version problem.
User avatar
GanstaZ
Registered User
Posts: 804
Joined: Wed Oct 11, 2017 10:29 pm
Location: Zverse

Re: External pages logging users out

Post by GanstaZ »

This brings back a question about sid:
Are you also using append_sid() for URIs pointing to those external pages?
If those menu links don't use append_sid function, then we have found a culprit.
"When answer lies in the question,.. question becomes redundant!"
zoobie
Registered User
Posts: 297
Joined: Wed Dec 01, 2004 1:02 am

Re: External pages logging users out

Post by zoobie »

Here's my button code in my overall_header.html for my board's gallery.
How would I include append_sid() ?

Code: Select all

<a href="../../buskers/gallery/index.php" title="Busker Photo Gallery"><img src="../../img/buttons/new/photo_gallery1.gif" class="button"></a><br>
User avatar
GanstaZ
Registered User
Posts: 804
Joined: Wed Oct 11, 2017 10:29 pm
Location: Zverse

Re: External pages logging users out

Post by GanstaZ »

Here you go, this is one example and reason why members get signed off.
There are 2 ways: one is to make a small extension that connects to an event or add a custom code to includes/functions.php page_header function around line 4506:

Code: Select all

'U_GALLERY'			=> append_sid('path_to_your_file'),
And in template

Code: Select all

<a href="{U_GALLERY}" title="Busker Photo Gallery"><img src="../../img/buttons/new/photo_gallery1.gif" class="button"></a><br>
"When answer lies in the question,.. question becomes redundant!"
zoobie
Registered User
Posts: 297
Joined: Wed Dec 01, 2004 1:02 am

Re: External pages logging users out

Post by zoobie »

OK...So far, so good. I used full URLs in case the user was in a mod's folder.
Now, I need the user login globally in every page in the site root's menu.
Thanks
zoobie
Registered User
Posts: 297
Joined: Wed Dec 01, 2004 1:02 am

Re: External pages logging users out

Post by zoobie »

Maybe I don't need to keep a persistent login...just for the board and it's mods.
Thanks
phpbb 3.0.2, Users Blog, phpbb gallery, Who Was Here, Anti-bot Question
Post Reply

Return to “phpBB Custom Coding”