https://www.icyphoenix.com/viewtopic.php?f=4&t=6436 ----------------------------------- Lopalong Tue 08 Sep, 2009 12:47 CUSTOMIZATION - Create New Pages And Add Custom Vars. ----------------------------------- [b]Note:[/b] [i]This is no longer called a "MOD" by any particular Author - All it is are a set of standard instructions for creating a phpBB Page.[/i] :shock: If you are thinking about adding [i]Custom Pages[/i] - Be strongly advised [i][b]NOT[/b][/i] to make any Typo's while you are doing it. :mrorange: [b][i]Instructions for IP 1.3.0* [/i][/b] [spoiler][code linenumbers=false] ############################################################## ## ## @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: {L_MY_TEMPLATE} ## ############################################################## ## 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 [/code][/spoiler] [b]v1.3.0* MOD Sample template.php File:[/b] [spoiler][code linenumbers=false]. * ***************************************************************************/ /*************************************************************************** * * 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); ?>[/code][/spoiler] [b]Sample variables.php:[/b] [spoiler][code linenumbers=false]'; $MYV['ZTOPB'] = '/gotop.gif" alt="'; $MYV['ZBOTREF'] = ''; $MYV['ZBOTB'] = '/gobot.gif" alt="'; $MYV['ZENDA'] = '" />'; $MYV['ZENDB'] = '" />'; $MYV['ZGIF'] = '.gif"'; $MYV['ZPNG'] = '.png"'; $MYV['ZJPG'] = '.jpg"'; ## Etc, etc until you have all the custom VARS you need. ?>[/code][/spoiler] [b]Sample Finished template.tpl:[/b] You [i][b]ARE[/b][/i] of course allowed to use [i]Normal Markup [/i]as well. :woot: [spoiler][code linenumbers=false] {ZDIV_GLOBAL} {ZSHADTOP} {ZCLA} {ZBUTA} {ZBUTB} {ZBUTC} {ZBUTD} {ZBUTE} {ZBUTF} {ZBUTG} {ZBUTH} {ZBUTI} {ZBUTJ} {ZCLB} {ZDIVA}{L_ZIDXSM}{ZDIVZ}
{L_ZWELCOME_ONE}
{L_ZWELCOME_TWO}
{ZDIVC}
{L_ZWELCOME_THREE}
{ZDIVY} {ZSHADBOT} {ZDIV_END_GLOBAL} {ZHTML} {ZCSS}[/code][/spoiler] [b]What the Finished template.tpl Translates to:[/b] [spoiler][code linenumbers=false]
Animated Smilies Assorted Smilies Banner Smilies Critter Smilies Large Smilies Msn Smilies Regular Smilies Druggy Smilies Xmas Smilies
Smilies Index 
You Should Read This Before Proceeding

   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.


   Please do not link directly to these images, as "Hot-Linking" 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.


   Note: 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.

Latest Statistics: Total Smilies: 1,284. Volume: 8.43MB -> On Disk: 11.3MB.
[/code][/spoiler] ----------------------------------- Mighty Gorgon Tue 08 Sep, 2009 12:55 Re: CUSTOMIZATION - Create New Pages And Add Custom Vars. IP V1.3* ----------------------------------- Thanks for sharing, you should update the header with the new version: [codeblock]/** * * @package Icy Phoenix * @version $Id$ * @copyright (c) 2008 Icy Phoenix * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */[/codeblock] But it is a minor issue and doesn't affect at all the page. ----------------------------------- Lopalong Tue 08 Sep, 2009 13:14 Re: CUSTOMIZATION - Create New Pages And Add Custom Vars. IP V1.3* ----------------------------------- [b]Dang![/b] I missed that! :mricy: Normally I would have added a .zip with a "blank" php and tpl, but decided that the user could quite as easily download the script or paste it into an editor. ;) ----------------------------------- novice programmer Tue 08 Sep, 2009 15:27 Re: CUSTOMIZATION - Create New Pages And Add Custom Vars. IP V1.3* ----------------------------------- BTW, Lopalong, you have another topic on [url=viewtopic.php?f=4&t=4518]this page for the same thing. If you want me to add a note linking to this thread, just wish it ;) Or if you want to do it by yourself.... ----------------------------------- Lopalong Tue 08 Sep, 2009 23:08 Re: CUSTOMIZATION - Create New Pages And Add Custom Vars. IP V1.3* ----------------------------------- The old DOC is [b]CUSTOMIZATION - Create New Pages And Add Custom Vars. IP V1.2.0.27*[/b] and that "Doc" could now be removed, as I split the v1.3 stuff out of it to create this topic. ;) ----------------------------------- novice programmer Wed 09 Sep, 2009 03:32 Re: CUSTOMIZATION - Create New Pages And Add Custom Vars. ----------------------------------- [quote user="Lopalong" post="44132"]The old DOC is [b]CUSTOMIZATION - Create New Pages And Add Custom Vars. IP V1.2.0.27*[/b] and that "Doc" could now be removed, as I split the v1.3 stuff out of it to create this topic. ;)[/quote] That is true. I guess getting off from the net all this days have made me get a litlle bill... :oops: ----------------------------------- DWho Wed 09 Sep, 2009 17:14 Re: CUSTOMIZATION - Create New Pages And Add Custom Vars. ----------------------------------- thanks just what i needed... nice one... :mrgreen: :mrgreen: