If you are thinking about adding Custom Pages - Be strongly advised NOT to make any Typo's while you are doing it.
Instructions for IP 1.3.0*
Spoiler: [ Show ]
Spoiler: [ Hide ]
Code: [Show]
##############################################################
##
## @package Icy Phoenix
## @version $Id$
## @copyright (c) 2008 Icy Phoenix
## @license http://opensource.org/licenses/GPL-license.php GNU Public License
##
##
## How to create a .php Page the easy way.
##
## Description: An easy way to add a blank page to your forum that uses session management
##
## Instructions for Icy Phoenix v1.3* By Lopalong 8th September 2009.
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: includes/page_header.php
## includes/constants.php
## includes/functions_mg_online.php
## language/lang_english/lang_main.php
##
## Included Files: None:
##
## License: http://opensource.org/licenses/GPL-license.php GNU General Public License v2
##
##############################################################
## Author Notes:
##
## READ THIS!!! Wherever you see MY_TEMPLATE or My_Template or my_template, replace with whatever you
## want to call your new page. Add a link to the page if you want to in your overall header.
##
## You can also use this example as the link you would use to call your "New" page if you add the VARS to
## page_header.php: <a href="{U_MY_TEMPLATE}">{L_MY_TEMPLATE}</a>
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
# Rename my_template.php and my_template.tpl to whatever your new page will be called.
#
# Edit the following lines in template.php to point to whatever you called templates/default/my_template.tpl:
# // assign template
# $template->set_filenames(array( 'body' => 'my_template.tpl') );
#
# edit templates/default/my_template.tpl to have whatever content you want to display.
#
#
Once you have created your .php and .tpl file.
copy root/my_template.php to my_template.php
copy root/templates/default/my_template.tpl to /templates/default/my_template.tpl
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
# You need this if you want to use SESSION and VARS for the URL and LANG_VARS of your own. You DON'T have to use it otherwise. ;-)
#
#
#-----[ FIND ]------------------------------------------
#
'U_DRAFTS' => append_sid('drafts.' . PHP_EXT),
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_MY_TEMPLATE' => $lang['My_Template'],
'U_MY_TEMPLATE' => append_sid('my_template.' . PHP_EXT),
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_mg_online.php
#
# Indicates where the User is, when "Who's Online is Opened". :P
#
#
#-----[ FIND ]------------------------------------------
#
elseif (strpos($page_id, 'faq.' . PHP_EXT) !== false)
{
$location['lang'] = $lang['Viewing_FAQ'];
$location['url'] = 'faq.' . PHP_EXT;
return $location;
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
elseif (strpos($page_id, 'my_template.' . PHP_EXT) !== false)
{
$location['lang'] = $lang['My_Template'];
$location['url'] = 'my_template.' . PHP_EXT;
return $location;
}
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['My_Template'] = 'My Template';
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
v1.3.0* MOD Sample template.php File:
Spoiler: [ Show ]
Spoiler: [ Hide ]
Code: [Show]
<?php
/***************************************************************************
*
* @package Icy Phoenix
* @version $Id$
* @copyright (c) 2008 Icy Phoenix
* @license http://opensource.org/licenses/GPL-license.php GNU Public License
*
* my template.php
* -------------------
* Instructions by Lopalong 8th September 2009 < http://www.lopalong.com >.
*
***************************************************************************/
/***************************************************************************
*
* READ THIS! Wherever you see MY_TEMPLATE or My_Template or my_template, replace with whatever you
* want to call your new page.
*
***************************************************************************/
// CTracker_Ignore: File checked by human
define('IN_ICYPHOENIX', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
include(IP_ROOT_PATH . 'common.' . PHP_EXT);
/***** If you want to create VARS (Custom) that do not already exist in Icy Phoenix, you can add them to this page, or create the file "variables.php" for variable-transition of your own "Stand-Alone VARS" to the .tpl file(s). So you will need to uncomment the line below.
*****/
// include(IP_ROOT_PATH . 'variables.' . PHP_EXT);
// standard session management
$userdata = session_pagestart($user_ip);
init_userprefs($userdata);
// set the page title
$page_title = 'My Template';
// The standard page header
include(IP_ROOT_PATH . 'includes/page_header.' . PHP_EXT);
// assign the template
$template->set_filenames(array('body' => 'my_template.tpl'));
$template->assign_vars(array(
// This is where you would add a new VARS Array and any of your own if you intend to use your OWN custom VARS with a variables.php file.
));
$template->pparse('body');
// standard page footer
include(IP_ROOT_PATH . 'includes/page_tail.' . PHP_EXT);
?>
/***************************************************************************
*
* @package Icy Phoenix
* @version $Id$
* @copyright (c) 2008 Icy Phoenix
* @license http://opensource.org/licenses/GPL-license.php GNU Public License
*
* my template.php
* -------------------
* Instructions by Lopalong 8th September 2009 < http://www.lopalong.com >.
*
***************************************************************************/
/***************************************************************************
*
* READ THIS! Wherever you see MY_TEMPLATE or My_Template or my_template, replace with whatever you
* want to call your new page.
*
***************************************************************************/
// CTracker_Ignore: File checked by human
define('IN_ICYPHOENIX', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
include(IP_ROOT_PATH . 'common.' . PHP_EXT);
/***** If you want to create VARS (Custom) that do not already exist in Icy Phoenix, you can add them to this page, or create the file "variables.php" for variable-transition of your own "Stand-Alone VARS" to the .tpl file(s). So you will need to uncomment the line below.
*****/
// include(IP_ROOT_PATH . 'variables.' . PHP_EXT);
// standard session management
$userdata = session_pagestart($user_ip);
init_userprefs($userdata);
// set the page title
$page_title = 'My Template';
// The standard page header
include(IP_ROOT_PATH . 'includes/page_header.' . PHP_EXT);
// assign the template
$template->set_filenames(array('body' => 'my_template.tpl'));
$template->assign_vars(array(
// This is where you would add a new VARS Array and any of your own if you intend to use your OWN custom VARS with a variables.php file.
));
$template->pparse('body');
// standard page footer
include(IP_ROOT_PATH . 'includes/page_tail.' . PHP_EXT);
?>
Sample variables.php:
Spoiler: [ Show ]
Spoiler: [ Hide ]
Code: [Show]
<?php
// Image handling
$MYV['ZURL'] = 'smilies/smiley';
$MYV['ZIMAGES'] = '<img src="smilies/images';
$MYV['ZTOPREF'] = '<a href="#top">';
$MYV['ZTOPB'] = '/gotop.gif" alt="';
$MYV['ZBOTREF'] = '<a href="#bottom">';
$MYV['ZBOTB'] = '/gobot.gif" alt="';
$MYV['ZENDA'] = '" /></a>';
$MYV['ZENDB'] = '" />';
$MYV['ZGIF'] = '.gif"';
$MYV['ZPNG'] = '.png"';
$MYV['ZJPG'] = '.jpg"';
## Etc, etc until you have all the custom VARS you need.
?>
// Image handling
$MYV['ZURL'] = 'smilies/smiley';
$MYV['ZIMAGES'] = '<img src="smilies/images';
$MYV['ZTOPREF'] = '<a href="#top">';
$MYV['ZTOPB'] = '/gotop.gif" alt="';
$MYV['ZBOTREF'] = '<a href="#bottom">';
$MYV['ZBOTB'] = '/gobot.gif" alt="';
$MYV['ZENDA'] = '" /></a>';
$MYV['ZENDB'] = '" />';
$MYV['ZGIF'] = '.gif"';
$MYV['ZPNG'] = '.png"';
$MYV['ZJPG'] = '.jpg"';
## Etc, etc until you have all the custom VARS you need.
?>
Sample Finished template.tpl:
You ARE of course allowed to use Normal Markup as well. :woot:
Spoiler: [ Show ]
Spoiler: [ Hide ]
Code: [Show]
{ZDIV_GLOBAL}
{ZSHADTOP}
{ZCLA}
{ZBUTA} {ZBUTB} {ZBUTC} {ZBUTD} {ZBUTE} {ZBUTF} {ZBUTG} {ZBUTH} {ZBUTI} {ZBUTJ}
{ZCLB}
{ZDIVA}{L_ZIDXSM}{ZDIVZ}
<div class="forum-buttons2"><div class="gen"><strong><em>{L_ZWELCOME_ONE}</em></strong></div></div>
<div class="row1">{L_ZWELCOME_TWO}</div>
{ZDIVC}<div class="gensmall" style="padding: 6px 0 6px 0;">{L_ZWELCOME_THREE}</div>{ZDIVY}
{ZSHADBOT}
{ZDIV_END_GLOBAL}
{ZHTML} {ZCSS}
{ZSHADTOP}
{ZCLA}
{ZBUTA} {ZBUTB} {ZBUTC} {ZBUTD} {ZBUTE} {ZBUTF} {ZBUTG} {ZBUTH} {ZBUTI} {ZBUTJ}
{ZCLB}
{ZDIVA}{L_ZIDXSM}{ZDIVZ}
<div class="forum-buttons2"><div class="gen"><strong><em>{L_ZWELCOME_ONE}</em></strong></div></div>
<div class="row1">{L_ZWELCOME_TWO}</div>
{ZDIVC}<div class="gensmall" style="padding: 6px 0 6px 0;">{L_ZWELCOME_THREE}</div>{ZDIVY}
{ZSHADBOT}
{ZDIV_END_GLOBAL}
{ZHTML} {ZCSS}
What the Finished template.tpl Translates to:
Spoiler: [ Show ]
Spoiler: [ Hide ]
Code: [Show]
<div align="center"><div style="width: 95%;padding-top:15px;">
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="right" width="11px"><img src="smilies/images/tbl_top_l.png" width="11px" alt="" /></td>
<td class="ztbl_top_c" width="100%"></td>
<td width="11px" align="left"><img src="smilies/images/tbl_top_r.png" width="11px" alt="" /></td>
</tr>
<tr>
<td class="ztbl_l_s" width="11px"></td>
<td>
<div align="center" class="forum-buttons2" style="padding: 4px 0 6px 0;"> <a href="smilies_animated_page1.php"><img src="smilies/buttons/animated1a.gif" alt="Animated Smilies" /></a> <a href="smilies_assorted_page1.php"><img src="smilies/buttons/assorted1a.gif" alt="Assorted Smilies" /></a> <a href="smilies_banner_page1.php"><img src="smilies/buttons/banners1a.gif" alt="Banner Smilies" /></a> <a href="smilies_critter_page1.php"><img src="smilies/buttons/critters1a.gif" alt="Critter Smilies" /></a> <a href="smilies_large_page1.php"><img src="smilies/buttons/large1a.gif" alt="Large Smilies" /></a> <a href="smilies_msn_page1.php"><img src="smilies/buttons/msn1a.gif" alt="Msn Smilies" /></a> <a href="smilies_regular_page1.php"><img src="smilies/buttons/regular1a.gif" alt="Regular Smilies" /></a> <a href="smilies_druggy_page1.php"><img src="smilies/buttons/drugs1a.gif" alt="Druggy Smilies" /></a> <a href="smilies_xmas_page1.php"><img src="smilies/buttons/xmas1a.gif" alt="Xmas Smilies" /></a> </div>
<div class="cat"><div style="padding: 5px 0 0 0;"></div><strong>Smilies Index </strong></div>
<div class="forum-buttons2"><div class="gen"><strong><em>You Should Read This Before Proceeding</em></strong></div></div>
<div class="row1"><div style="padding:30px;"><p> Click on any of the above buttons and the pages will open in the same window. Right-Click the image and "Save Picture As" to "My Pictures" or the folder of your choice.
</p>
<br />
<p> Please <b><em>do not</em></b> link directly to these images, as <b><em>"Hot-Linking"</em></b> is disabled and all you will get will be a load of rubbish. You can however "Hot-Link" to them if you are using them within this forum.
</p>
<br />
<p> <b>Note:</b> Most Web-Browsers cannot handle opening all of the images at the same time and may "crash". If you experience this problem, then exit the browser, reload the Smilie Index, and don't try to load "all" of images at the same time.
</p>
<!--
<br /><p> <font color="red"><strong><em>Warning: Though not overly offensive; if you are easily offended, then I suggest that you skip the X-Rated Smilies.</em></strong></font color></p>
-->
</div></div>
<div class="row1g"><div class="gensmall" style="padding: 6px 0 6px 0;"><strong>Latest Statistics:</strong> <em>Total Smilies:</em> 1,284. <em>Volume:</em> 8.43MB -> <em>On Disk:</em> 11.3MB.</div></div>
</td>
<td class="ztbl_r_s" width="11"></td>
</tr>
<tr>
<td width="11"><img src="smilies/images/tbl_f_l.png" width="11" height="10" alt="" /></td>
<td class="ztbl_f_c"></td>
<td width="11"><img src="smilies/images/tbl_f_r.png" width="11" height="10" alt="" /></td>
</tr>
</table></div></div>
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="right" width="11px"><img src="smilies/images/tbl_top_l.png" width="11px" alt="" /></td>
<td class="ztbl_top_c" width="100%"></td>
<td width="11px" align="left"><img src="smilies/images/tbl_top_r.png" width="11px" alt="" /></td>
</tr>
<tr>
<td class="ztbl_l_s" width="11px"></td>
<td>
<div align="center" class="forum-buttons2" style="padding: 4px 0 6px 0;"> <a href="smilies_animated_page1.php"><img src="smilies/buttons/animated1a.gif" alt="Animated Smilies" /></a> <a href="smilies_assorted_page1.php"><img src="smilies/buttons/assorted1a.gif" alt="Assorted Smilies" /></a> <a href="smilies_banner_page1.php"><img src="smilies/buttons/banners1a.gif" alt="Banner Smilies" /></a> <a href="smilies_critter_page1.php"><img src="smilies/buttons/critters1a.gif" alt="Critter Smilies" /></a> <a href="smilies_large_page1.php"><img src="smilies/buttons/large1a.gif" alt="Large Smilies" /></a> <a href="smilies_msn_page1.php"><img src="smilies/buttons/msn1a.gif" alt="Msn Smilies" /></a> <a href="smilies_regular_page1.php"><img src="smilies/buttons/regular1a.gif" alt="Regular Smilies" /></a> <a href="smilies_druggy_page1.php"><img src="smilies/buttons/drugs1a.gif" alt="Druggy Smilies" /></a> <a href="smilies_xmas_page1.php"><img src="smilies/buttons/xmas1a.gif" alt="Xmas Smilies" /></a> </div>
<div class="cat"><div style="padding: 5px 0 0 0;"></div><strong>Smilies Index </strong></div>
<div class="forum-buttons2"><div class="gen"><strong><em>You Should Read This Before Proceeding</em></strong></div></div>
<div class="row1"><div style="padding:30px;"><p> Click on any of the above buttons and the pages will open in the same window. Right-Click the image and "Save Picture As" to "My Pictures" or the folder of your choice.
</p>
<br />
<p> Please <b><em>do not</em></b> link directly to these images, as <b><em>"Hot-Linking"</em></b> is disabled and all you will get will be a load of rubbish. You can however "Hot-Link" to them if you are using them within this forum.
</p>
<br />
<p> <b>Note:</b> Most Web-Browsers cannot handle opening all of the images at the same time and may "crash". If you experience this problem, then exit the browser, reload the Smilie Index, and don't try to load "all" of images at the same time.
</p>
<!--
<br /><p> <font color="red"><strong><em>Warning: Though not overly offensive; if you are easily offended, then I suggest that you skip the X-Rated Smilies.</em></strong></font color></p>
-->
</div></div>
<div class="row1g"><div class="gensmall" style="padding: 6px 0 6px 0;"><strong>Latest Statistics:</strong> <em>Total Smilies:</em> 1,284. <em>Volume:</em> 8.43MB -> <em>On Disk:</em> 11.3MB.</div></div>
</td>
<td class="ztbl_r_s" width="11"></td>
</tr>
<tr>
<td width="11"><img src="smilies/images/tbl_f_l.png" width="11" height="10" alt="" /></td>
<td class="ztbl_f_c"></td>
<td width="11"><img src="smilies/images/tbl_f_r.png" width="11" height="10" alt="" /></td>
</tr>
</table></div></div>