Custom page, login

Discussion forum for MOD Writers regarding MOD Development.
Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Custom page, login

Post by Korkel »

Hello,

I have a custom page, you must login to view it but can I want that the Registerd users group and the Guest usergroups get an error if they visit the page and not an login page.
Code:

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();
if ($user->data['user_id'] == ANONYMOUS)
{
    login_box('', $user->lang['LOGIN']);
} 

page_header('Downloads');

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

make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>
Last edited by Mick on Tue Jun 24, 2014 6:39 am, edited 2 times in total.
Reason: Moved from Support
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Custom page, login

Post by Oyabun1 »

                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: Custom page, login

Post by Korkel »

Seems easy, thanks man. :mrgreen:
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: Custom page, login

Post by Korkel »

Ok, not that easy what I was thinking.

If I follow this guide: Creating group template switches. I have the following problem:
I want the following code:

Code: Select all

<!-- IF NOT S_GROUP_N -->some stuff here<!-- ENDIF -->
where the group ID = 15, but I am not sure where I must post that code in the .html file.

This is my .html file:

Code: Select all

<!-- INCLUDE overall_header.html -->

<h2>Downloads</h2>

<div class="panel">
   <div class="inner"><span class="corners-top"><span></span></span>

   <div class="content">
      <p>
         De inhoud van deze downloads is alleen bedoeld voor CorelX en mag niet worden verspreid zonder toestemming. Bij problemen met het downloaden neem je <a href=http://www.cilia1.nl/forum/contact.php target="_blank">contact</a> met ons op.<br /><br />
<ul>
<h3>
<li><a href=fmpatcher.zip>FM Patcher</a> -> De oplossing voor filters die niet (meer) werken met Vista of Windows 7.</li>
</h3>
</ul>
      </p>
   </div>

   <span class="corners-bottom"><span></span></span></div>
</div>

<!-- INCLUDE jumpbox.html -->
<!-- INCLUDE overall_footer.html -->
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Custom page, login

Post by Oyabun1 »

Korkel wrote:

Code: Select all

<!-- IF NOT S_GROUP_N -->some stuff here<!-- ENDIF -->
"some stuff here" is the XHTML markup you want the switch to apply to.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: Custom page, login

Post by Korkel »

Oyabun1 wrote:
Korkel wrote:

Code: Select all

<!-- IF NOT S_GROUP_N -->some stuff here<!-- ENDIF -->
"some stuff here" is the XHTML markup you want the switch to apply to.
Yes I know, but where in the .html must I add it? That is what I'm not sure about it.

Editio: I tried to add it somewhere, but then it gives me a awesome page that is called WHITE. :cry:
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: Custom page, login

Post by Korkel »

Someone? Where I set it, it gives a white page. :cry:
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Custom page, login

Post by Oyabun1 »

Where did you set it?
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: Custom page, login

Post by Korkel »

Somewhere in the .html
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

User avatar
John P
Registered User
Posts: 1237
Joined: Mon Jan 21, 2008 3:55 pm
Location: Netherlands
Name: John
Contact:

Re: Custom page, login

Post by John P »

If you get a white page then you made a typo somewhere.
Image
Webhosting, Custom MODs, Technical management, MOD installation and Webdesign

Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: Custom page, login

Post by Korkel »

John P wrote:If you get a white page then you made a typo somewhere.
I didn't make a typo.
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: Custom page, login

Post by Korkel »

Someone? Oh, maybe remove the topic icon? :$
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

User avatar
tbackoff
Former Team Member
Posts: 7022
Joined: Thu Jun 04, 2009 1:41 am
Location: cheerleading practice
Name: Tabitha Backoff

Re: Custom page, login

Post by tbackoff »

It would be helpful if you posted the code you currently have. The code above doesn't have the switches in place.
Flying is the second best thrill to cheerleaders; being caught is the first.

Korkel
Registered User
Posts: 391
Joined: Mon Jun 02, 2014 7:09 am
Location: ~/home/Liz/Desktop
Name: Liz Aalderink
Contact:

Re: Custom page, login

Post by Korkel »

tmbackoff wrote:It would be helpful if you posted the code you currently have. The code above doesn't have the switches in place.
The current code is without the needed line because I don't know where to add, if I add it somewhere I get a white page.
begles.php

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();
if ($user->data['user_id'] == ANONYMOUS)
{
    login_box('', $user->lang['LOGIN']);
} 

page_header('Beginnerslessen');

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

make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>
begles.html

Code: Select all

<!-- INCLUDE overall_header.html -->

<h2>CorelX Beginnerslessen</h2>

<div class="panel">
   <div class="inner"><span class="corners-top"><span></span></span>

   <div class="content">
      <p>
 <ul>
 <li><a href=/forum/begles/Bles01.rar>Beginnersles 1</a></li><br>
 <li><a href=/forum/begles/Bles02.zip>Beginnersles 2</a></li><br>
 <li><a href=/forum/begles/Bles03.zip>Beginnersles 3</a></li><br>
 <li><a href=/forum/begles/Bles04.zip>Beginnersles 4</a></li><br>
 <li><a href=/forum/begles/Bles05.zip>Beginnersles 5</a></li><br>
 <li><a href=/forum/begles/Bles06.zip>Beginnersles 6</a></li><br>
 <li><a href=/forum/begles/Bles07.zip>Beginnersles 7</a></li><br>
 <li><a href=/forum/begles/Bles08.zip>Beginnersles 8</a></li><br>
 <li><a href=/forum/begles/Bles09.zip>Beginnersles 9</a></li><br>
 <li><a href=/forum/begles/Bles10.zip>Beginnersles 10</a></li><br>
 </ul>
      </p>
   </div>

   <span class="corners-bottom"><span></span></span></div>
</div>
<!-- INCLUDE jumpbox.html -->
<!-- INCLUDE overall_footer.html --> 
When I add this code:

Code: Select all

<!-- IF NOT S_GROUP_15 -->Here comes the text.<!-- ENDIF -->
I get a white page.
"If you lose your left arm, your right arm will be left."
“The most important property of a program is whether it accomplishes the intention of its user.”
Image

User avatar
irdem
Registered User
Posts: 172
Joined: Sat Oct 13, 2007 10:31 pm
Contact:

Re: Custom page, login

Post by irdem »

hi,
recheck your group id if it is correct and try this:

Code: Select all

    <!-- IF not S_GROUP_15 -->Here comes the text.<!-- ENDIF -->

Locked

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