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 » Mon May 23, 2011 2:13 pm

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 » Mon May 23, 2011 3:00 pm

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

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

Re: Extra page help

Post by battye » Mon May 23, 2011 3:42 pm

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 » Mon May 23, 2011 7:54 pm

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: 51882
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Extra page help

Post by Brf » Mon May 23, 2011 7:59 pm

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 » Mon May 23, 2011 8:05 pm

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: 51882
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Extra page help

Post by Brf » Mon May 23, 2011 8:08 pm

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 » Mon May 23, 2011 8:13 pm

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 » Wed May 25, 2011 10:08 am

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: 51882
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Extra page help

Post by Brf » Wed May 25, 2011 11:14 am

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 » Wed May 25, 2011 1:47 pm

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: 51882
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Extra page help

Post by Brf » Wed May 25, 2011 2:22 pm

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 » Wed May 25, 2011 3:08 pm

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 » Wed May 25, 2011 3:11 pm

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: 51882
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Extra page help

Post by Brf » Wed May 25, 2011 3:14 pm

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

Locked

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