Extra page help

Discussion forum for MOD Writers regarding MOD Development.
Locked
scarhextendedmags
Registered User
Posts: 68
Joined: Wed May 04, 2011 9:18 pm

Extra page help

Post by scarhextendedmags »

I used this guide: http://www.phpbb.com/kb/article/add-a-n ... -to-phpbb/ to add a custom page to my site, but when you visit that custom page it logs you out and you have to sign in again.
Is there any way to keep my users signed in whilst they visit this custom page?

Thanks in advance! :D
Parkour Prologue - The ultimate resource for beginners Parkour and Free Running.

User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: Extra page help

Post by karlsemple »

Can we get a link to the board and the custom page in question?
Image

User avatar
battye
Extension Customisations
Extension Customisations
Posts: 10946
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia
Contact:

Re: Extra page help

Post by battye »

And if it's not sensitive, could you also post between the code tags the PHP code you used? (particularly any parts you might have modified)
Customisations Team Member

https://github.com/battye/php-array-parser - Give it a Star! :D

scarhextendedmags
Registered User
Posts: 68
Joined: Wed May 04, 2011 9:18 pm

Re: Extra page help

Post by scarhextendedmags »

Hi guys, thank for the responses!
Can we get a link to the board and the custom page in question?
Sure, its http://www.forums.pkprologue.com/news.php
And if it's not sensitive, could you also post between the code tags the PHP code you used? (particularly any parts you might have modified)
Not sure what you mean :S This is the code I use in the news.php file (hope this is the code you mean :P) that is located in the root folder of my phpBB installation:

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

page_header('News');

$template->set_filenames(array(
    'body' => 'news_body.html',
));

make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>
Parkour Prologue - The ultimate resource for beginners Parkour and Free Running.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51998
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Extra page help

Post by Brf »

Your cookie domain is: pkprologuecom.ipage.com and it should be .forums.pkprologue.com

scarhextendedmags
Registered User
Posts: 68
Joined: Wed May 04, 2011 9:18 pm

Re: Extra page help

Post by scarhextendedmags »

Brf wrote:Your cookie domain is: pkprologuecom.ipage.com and it should be .forums.pkprologue.com
How did you find this out? And also, how do I change that?
Thanks!
Parkour Prologue - The ultimate resource for beginners Parkour and Free Running.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51998
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Extra page help

Post by Brf »

Browsing around your forum, I could see a SID on the end of your URLs. PhpBB puts those there if you have a bad cookie domain.

You need to go to your ACP Cookie Settings page and fix it.

scarhextendedmags
Registered User
Posts: 68
Joined: Wed May 04, 2011 9:18 pm

Re: Extra page help

Post by scarhextendedmags »

AWESOME!! Thanks man! That's cleared up a whole lot of other issues as well!
Parkour Prologue - The ultimate resource for beginners Parkour and Free Running.

scarhextendedmags
Registered User
Posts: 68
Joined: Wed May 04, 2011 9:18 pm

Re: Extra page help

Post by scarhextendedmags »

Do any of you guys know how to edit the <head> tag of my custom page? I don't want to edit overall header because then the changes take place for the whole forum.
Thanks
Parkour Prologue - The ultimate resource for beginners Parkour and Free Running.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51998
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Extra page help

Post by Brf »

Edit your overall_header.html and put in tags like this:

Code: Select all

<!-- IF SCRIPT_NAME eq 'news' -->
your code
<!-- ENDIF -->

scarhextendedmags
Registered User
Posts: 68
Joined: Wed May 04, 2011 9:18 pm

Re: Extra page help

Post by scarhextendedmags »

Edit your overall_header.html and put in tags like this:

Code: Select all

<!-- IF SCRIPT_NAME eq 'news' -->
your code
<!-- ENDIF -->
So, does this enable me to edit the <head> tag of my custom page only, and not the entire forum? If so, could you please explain more detailed how to do it?
Parkour Prologue - The ultimate resource for beginners Parkour and Free Running.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51998
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Extra page help

Post by Brf »

The code within the IF -- ENDIF would only occur on your news.php page.

scarhextendedmags
Registered User
Posts: 68
Joined: Wed May 04, 2011 9:18 pm

Re: Extra page help

Post by scarhextendedmags »

Nice one, thanks man ;)
Parkour Prologue - The ultimate resource for beginners Parkour and Free Running.

scarhextendedmags
Registered User
Posts: 68
Joined: Wed May 04, 2011 9:18 pm

Re: Extra page help

Post by scarhextendedmags »

Soo the exact code should be:

Code: Select all

<!-- IF SCRIPT_NAME eq 'home.php' -->

 code here

<!-- ENDIF -->
Parkour Prologue - The ultimate resource for beginners Parkour and Free Running.

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51998
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Extra page help

Post by Brf »

No. Just put the file name in there, not the extension.

Locked

Return to “[3.0.x] MOD Writers Discussion”