Blank Page Template

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
72
64%
Very Good
21
19%
Good
10
9%
Fair
2
2%
Poor
8
7%
 
Total votes: 113

Josh18657
Registered User
Posts: 425
Joined: Wed Nov 30, 2005 9:55 pm
Contact:

Re: [2.0.6] Blank Page Template

Post by Josh18657 »

Hunter_wow wrote:Have anyone tested if this one works with 3.0.X also? What do you think?
Should work but I haven't tested it

PHP page

Code: Select all

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);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

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

// Dump out the page header and load viewforum template
page_header($user->lang['INDEX']);

$template->set_filenames(array(
	'body' => 'index_body.html') // change index_body.html to your template
);

// your php data here


// end page
page_footer();
include at the top of your template

Code: Select all

<!-- INCLUDE overall_header.html -->
include at the end of your template

Code: Select all

<!-- INCLUDE overall_footer.html -->
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53400
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: [2.0.6] Blank Page Template

Post by Brf »

Josh18657 wrote:Should work but I haven't tested it
No. This mod, like other phpBB2 mods, does not work with phpBB3. You have to use the code that Josh pasted above in phpBB3, instead of the code from this mod.
Hunter_wow
Registered User
Posts: 238
Joined: Wed Sep 14, 2005 11:35 pm
Location: Sweden

Re: [2.0.6] Blank Page Template

Post by Hunter_wow »

Thanks a lot Josh!!!!
There where something wrong with your code but it worked out fine with this. Guess it´s just something small you missed:

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);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

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

// Output page
page_header($user->lang['INDEX']);

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

page_footer();

?>
Tons of thanks once again!
BabyLove
Registered User
Posts: 59
Joined: Tue May 20, 2003 1:19 pm
Location: slovenia / ljubljana
Contact:

Re: [2.0.6] Blank Page Template

Post by BabyLove »

I have installed this mod a while back (on Phpbb 2 plus forum) and it works. The only thing that does not work is the auth access. :roll:

Guest can not see the pages, they need to log in ??? Even if i select "ALL", and i check in the datebase, guest still can't see the new pages. Only registred users can. :shock:

Why?

HELP :oops:
Lana aka BabyLove
www.fu-student.com
User avatar
DizzyDazzle
Registered User
Posts: 39
Joined: Sun Oct 08, 2006 11:50 pm

Re: [2.0.6] Blank Page Template

Post by DizzyDazzle »

BabyLove wrote:I have installed this mod a while back (on Phpbb 2 plus forum) and it works. The only thing that does not work is the auth access. :roll:

Guest can not see the pages, they need to log in ??? Even if i select "ALL", and i check in the datebase, guest still can't see the new pages. Only registred users can. :shock:

Why?

HELP :oops:
You might want to try Page Permissions by drathbun for your custom pages as it makes setting permissions for individual pages very easy (all done throught the ACP) and there is even a built in counter for each individual page so can see which pages are the most popular! You may have to do a few simple alterations to your pages, there is a tutorial in the /contrib folder of the MOD on how to do them.

http://www.phpbb.com/community/viewtopi ... 164&hilit=

Im not sure if it is compatible with phpBB Plus, but you may aswell try as it is a very powerfull mod!

Hope this helps! :)
BabyLove
Registered User
Posts: 59
Joined: Tue May 20, 2003 1:19 pm
Location: slovenia / ljubljana
Contact:

Re: [2.0.6] Blank Page Template

Post by BabyLove »

Thank you!

I will try it out :)
User avatar
tascrafts
Registered User
Posts: 13
Joined: Sun Aug 20, 2006 5:21 am
Contact:

Re: [2.0.6] Blank Page Template

Post by tascrafts »

** Removed as the link was fixed. **
Last edited by tascrafts on Tue Nov 04, 2008 5:41 am, edited 1 time in total.
"Malum consilium quod mutari non potest"

- http://www.tascrafts.com
- http://www.ngbs.co.nr
User avatar
PaulusB
Registered User
Posts: 232
Joined: Sun May 28, 2006 2:08 pm
Location: Holland
Contact:

Re: [2.0.6] Blank Page Template

Post by PaulusB »

PaulusB wrote:Fix

Open viewonline.php & index.php (admin)

Find

Code: Select all

$sql_tpl = "SELECT page_name WHERE page_id = $page_id";
Recplace whit

Code: Select all

 $sql_tpl = "SELECT page_name FROM ". ADD_PAGES_TABLE ." WHERE page_id = $page_id";
This fix is still not included :idea:
User avatar
tascrafts
Registered User
Posts: 13
Joined: Sun Aug 20, 2006 5:21 am
Contact:

Re: [2.0.6] Blank Page Template

Post by tascrafts »

Fixed ;)
"Malum consilium quod mutari non potest"

- http://www.tascrafts.com
- http://www.ngbs.co.nr
inkblob
Registered User
Posts: 3
Joined: Fri May 25, 2007 2:13 am

Re: [2.0.6] Blank Page Template

Post by inkblob »

thanks so much altimaforums, it's made a world of difference being able to have guest, member and mod pages! this mod is indispensible in how I manage forums.
Wyldb
Registered User
Posts: 133
Joined: Sat Jan 03, 2004 1:42 am
Location: Colorado

Re: Blank Template Mod v2.0.0

Post by Wyldb »

While trying to keep the questions within the correct mod category, I have another question that pertains to this mod. What I'm trying to figure out how to do is probably very simple, and I've actually tried looking through the 5,000+ threads, so if I missed it, just point me to the correct one, as time is short.

What I want to do is basically move the index_body.tpl file (coding) to a "blank template" page. That way I can change the index_body.tpl to show other information, instead of the body of the forum.

Unless there is a way to create a new tpl page and have it called up when logged in instead of the index_body.tpl page. (until I hear how to do that, the following is what I'm trying to do):

What I tried doing was taking the index_body.tpl file and copy/paste it within a "new template page" through this mod, but when viewed you get the pleasures of seeing the php content instead of what needs to be seen.

examples of what is seen live on the new template page:

Code: Select all

{LAST_VISIT_DATE}
{PRIVATE_MESSAGE_INFO}
{L_INDEX}
{L_FORUM}
{catrow.CAT_DESC}
example of what it should show live on the new template page:

Code: Select all

You last visited on Thu Mar 13, 2008 11:15 am
You have no new messages
Sentinels MC Chat Room
Forum
Member Only Chit Chat
This is what the template.tpl looks like. It's when any new template page is created it automatically fills in the overall header and footer of the middle section of the site (example would be the index_body.tpl):
The PAGE_CONTENT section is where the new template page is inserted so that all pages have the same stuff on the top and bottom of each new page.

Code: Select all

<table width="100%" border="0" cellpadding="0" cellspacing="0" id="bodytable">
<tr>
<td width="44"><img src="templates/SLEMC_2008/images/L_R1_a.gif" width="44" height="27" /></td>
<td background="templates/SLEMC_2008/images/L_R1_b.gif"></td>
<td width="43"><img src="templates/SLEMC_2008/images/L_R1_c.gif" width="43" height="27" /></td>
</tr>
<tr>
<td width="44" background="templates/SLEMC_2008/images/L_R2_a.gif"></td>
<td background="templates/SLEMC_2008/images/L_body_bk.gif">

<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
  <tr> 
	<td align="left" valign="bottom"><span class="gensmall">
  <!-- BEGIN switch_user_logged_in -->
	{LAST_VISIT_DATE}<br />
	<a href="{U_PRIVATEMSGS}" class="viewlinks">{PRIVATE_MESSAGE_INFO}</a></span><br />
  <!-- END switch_user_logged_in -->
	<span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a></span></td>
	<td align="right" valign="bottom" class="gensmall">
  <!-- BEGIN switch_user_logged_in -->
	<a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br /><a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_SELF}</a><br />
  <a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a>
  <!-- END switch_user_logged_in -->
  </td>
  </tr>
</table>
{PAGE_CONTENT}
</td>
<td width="43" background="templates/SLEMC_2008/images/L_R2_c.gif"></td>
</tr>

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

Re: [2.0.6] Blank Page Template

Post by Brf »

You cannot expect the template tags to be filled in if you do not call the php code which fills them. It looks to me that you have some stuff for the overall_header.tpl and some stuff from index_body.tpl there
Wyldb
Registered User
Posts: 133
Joined: Sat Jan 03, 2004 1:42 am
Location: Colorado

Re: [2.0.6] Blank Page Template

Post by Wyldb »

How do I call up the php tags? Isn't this mod suppose to do that anyway, as it is calling up a TPL file to fill in the "new / blank" page. But when creating a new page via this mod's template maker it only allows normal HTML instead of php tagging even though it's still using the same system, which is where I'm running into the problem, I'd like to be able to use other parts of the forum on a certain page layout that best fits the site that's being created with it. Instead of just an old fashion forum, integrating designs and php the phpBB way.

The parts above and below this section on the template.tpl file, please act like it's not even there. :mrgreen:

Code: Select all

{PAGE_CONTENT}
This is the template.php file

Code: Select all

<?php 

/***************************************************************************
 *                     template.php [ Blank Template MOD ]
 *                            -------------------
 *   Début                : 08-08-2004 
 *   Auteur               : Poupoune < [email protected] >
 *   Contact              : http://php-tools.org/poupoune/
 *    
 *   Bug Reported section : The data are recovered, ALL permission bug
 *   http://www.phpbb.com/community/viewtopic.php?f=15&t=142506 
 *    
 *   Updated By           : altimaforums @ phpbb.com
 *   Updated Date         : Wed Jun 13, 2007 10:30 pm 
 *
 ***************************************************************************/

// standard hack prevent 
define('IN_PHPBB', true); 
$phpbb_root_path = './'; 
include($phpbb_root_path . 'extension.inc'); 
include($phpbb_root_path . 'common.'.$phpEx); 

// standard session management 
$page_template = - (intval($HTTP_GET_VARS['page']) + PAGE_TEMPLATE);
$userdata = session_pagestart($user_ip, $page_template); 
init_userprefs($userdata); 

// On récupère les données aka The data are recovered
    if( $HTTP_GET_VARS['page'] )
    {
      $sql = "SELECT * FROM ". ADD_PAGES_TABLE ."
        WHERE page_id = ". intval($HTTP_GET_VARS['page']);
      if( !$result = $db->sql_query($sql) )
       {
         message_die(GENERAL_ERROR, "Couldn't delete forum information!", "", __LINE__, __FILE__, $sql);
       }
      if( $row = $db->sql_fetchrow($result) )
      {
        if( $userdata['session_logged_in'] ) // if logged in then.. Anonymous = -1 | User = 0 | Admin = 1 | Mod = 2
        {
          if( ( $userdata['user_level'] == ADMIN ) || ( $userdata['user_level'] >= $row['page_auth'] ) ) // check level, if admin or level is > or equal to defined auth level - show content
          {
            $page_title = $row['page_name']; // set page title 
            $page_content = $row['page_content']; // set page content
          }
          else // must be set as mod only level
          {
            $message = sprintf($lang['Not_auth'], $lang['Moderators']);
            message_die(GENERAL_MESSAGE, $message);
          }
        } 
        else // if not logged in (anonymous) and auth is set to ALL (anonymous) then..
        {
          if( $row['page_auth'] == ANONYMOUS ) // if anonymous (guest) and the page has been declared for anonymous (guests) then display content
          {       
            $page_title = $row['page_name']; // set page title 
            $page_content = $row['page_content']; // set page content
          }
         elseif ( $row['page_auth'] == MOD ) // if anonymous (guest) and the page has been declared for moderators then display error
         {
           $message = sprintf($lang['Not_auth'], $lang['Moderators']);
            message_die(GENERAL_MESSAGE, $message);
         }
         else // if anonymous (guest) and the page has been declared for registered users then display error
         {
           $message = sprintf($lang['Not_auth'], $lang['Users']);
            message_die(GENERAL_MESSAGE, $message);
         }
       }
      } 
      else // if no row exists then..
      {
        $page_content = '';
        message_die(GENERAL_MESSAGE, $lang['No_page_exists']);
      }
    }
    else // if page doesnt exists then..
    {
      $page_content = '';
      message_die(GENERAL_MESSAGE, $lang['No_page_exists']);
    }


// standard page header 
include($phpbb_root_path . 'includes/page_header.'.$phpEx); 

// assign template 
$template->set_filenames(array( 
        'body' => 'template.tpl') 
); 

$template->assign_vars( array(
    'PAGE_TITLE' => $page_title,
    'PAGE_CONTENT' => $page_content
  ));

$template->pparse('body'); 

// standard page footer 
include($phpbb_root_path . 'includes/page_tail.'.$phpEx); 

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

Re: [2.0.6] Blank Page Template

Post by Brf »

Most of those tags should be filled in by page_header(). If they are not, you will need to fill them by $template->assign_vars().
Note that some of them, such as last_visit, will not be filled in if you are not logged in.
Wyldb
Registered User
Posts: 133
Joined: Sat Jan 03, 2004 1:42 am
Location: Colorado

Re: [2.0.6] Blank Page Template

Post by Wyldb »

Brf wrote:Most of those tags should be filled in by page_header(). If they are not, you will need to fill them by $template->assign_vars().
Note that some of them, such as last_visit, will not be filled in if you are not logged in.
Your right it "should" be filled in by the page_header() but that's the problem as it doesn't.
So for instance, I created a new page, inside that page, I inserted the code from the index_body.tpl file for testing mostly. The page displayed the layout but all the tags seen on screen where the php tags, not what should have been displaying, from the language file. The overall_header is the same for all pages, whereas the template pages have a little extra including the overall_header that I wanted on all the template pages. I understand logged in tags verses logged out tags. I was just using them as examples as to what I was seeing throughout the page after viewing the new page.
Post Reply

Return to “[2.0.x] MOD Database Releases”