https://www.icyphoenix.com/viewtopic.php?f=30&t=4518 ----------------------------------- Lopalong Mon 11 Aug, 2008 07:21 CUSTOMIZATION - Create New Pages And Add Custom Vars. IP V1.2.027* ----------------------------------- [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]The Instructions for IP v....27c:[/b] [spoiler][code linenumbers=false] ############################################################## ## 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.2.0.27b By Lopalong < http://icythemes.com. > 31st July 2008. ## ## 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: root/template.php ## root/templates/mg_themes/template.tpl ## ## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 ## ############################################################## ## Author Notes: ## ## READ THIS!!! Wherever you see TEMPLATE or Template or 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_TEMPLATE} ## ############################################################## ## Before Adding your OWN .php files To Your Forum, You Should Back Up All Related Files. ############################################################## # # Rename template.php and template.tpl to whatever your new page will be called. # # Edit the following lines in template.php to point to whatever you called templates/mg_themes/template.tpl: # // assign template # $template->set_filenames(array( 'body' => 'template.tpl') ); # # edit templates/mg_themes/template.tpl to have whatever content you want to display. # # copy root/template.php to template.php copy root/templates/mg_themes/template.tpl to /templates/mg_themes/template.tpl # #-----[ OPEN ]------------------------------------------ # includes/page_header.php # # This is useful if you want to use VARS for the URL and LANG_VARS of your own. You DON'T have to use it otherwise. ;-) # # #-----[ FIND ]------------------------------------------ # 'U_DRAFTS' => append_sid('drafts.' . $phpEx), # #-----[ AFTER, ADD ]------------------------------------------ # 'L_TEMPLATE' => $lang['Template'], 'U_TEMPLATE' => append_sid('template.' . $phpEx), # #-----[ OPEN ]------------------------------------------ # includes/functions_mg_online.php # # Indicates where the User is, when "Who's Online is Opened". :P # # #-----[ FIND ]------------------------------------------ # elseif (strpos($page_id, 'faq.' . $phpEx) !== false) { $location['lang'] = $lang['Viewing_FAQ']; $location['url'] = 'faq.' . $phpEx; return $location; } # #-----[ AFTER, ADD ]------------------------------------------ # elseif (strpos($page_id, 'template.' . $phpEx) !== false) { $location['lang'] = $lang['template']; $location['url'] = 'template.' . $phpEx; return $location; } # #-----[ OPEN ]------------------------------------------ # language/lang_english/lang_main.php # #-----[ FIND ]------------------------------------------ # ?> # #-----[ BEFORE, ADD ]------------------------------------------ # $lang['Template'] = 'Template'; # #-----[ OPEN ]------------------------------------------ # includes/constants.php # # MG: This is NOT used anymore... but left here for backward compatibility! # # #-----[ FIND ]------------------------------------------ # define('PAGE_GROUPCP', -11); # #-----[ AFTER, ADD ]------------------------------------------ # define('PAGE_TEMPLATE', -1045); # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM [/code][/spoiler] [b]The Sample template.php File:[/b] [spoiler][code linenumbers=false]. * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * READ THIS! Wherever you see TEMPLATE or Template or template, replace with whatever you * want to call your new page. * ***************************************************************************/ define('IN_PHPBB', true); $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); /***** If you create VARS (Custom) that do not already exist in Icy Phoenix, then you will also need to create the file "variables.php" for variable-transition to the .tpl file(s). So you will need to uncomment the line below. *****/ // include($phpbb_root_path . 'variables.'.$phpEx); // standard session management $userdata = session_pagestart($user_ip, PAGE_TEMPLATE); init_userprefs($userdata); // set page title $page_title = 'Template'; // standard page header include($phpbb_root_path . 'includes/page_header.'.$phpEx); // assign template $template->set_filenames(array('body' => 'template.tpl')); // This is where you would add a new VARS Array if you intend to use your own custom VARS. $template->pparse('body'); // standard page footer include($phpbb_root_path . 'includes/page_tail.'.$phpEx); ?>[/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.
Valid XHTML 1.0 Strict Valid CSS!
[/code][/spoiler] :shock: ----------------------------------- TheSteffen Wed 13 Aug, 2008 23:39 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- Nice and useful documentation [b]Lopalong[/b], thanks a lot. ----------------------------------- bloke Tue 21 Oct, 2008 11:26 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- hi again Lopalong does this work with icy 27c and would it be possible to make another links page if you could would you have the control panel for it in acp i want to turn another links page into like this one i made on my test forum so i can advertise peoples banner ads for them [img]http://www.icyphoenix.com/files/images/5614/shot.jpg[/img] thanks bloke ----------------------------------- bloke Fri 24 Oct, 2008 13:07 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- hi found add a page in icy 27c :oops: and you can change settings to do what i wanted and have the best of both worlds mighty gordan your icy 27c is tops mate! im always finding something new and you can change things to suit yourself, i got a banner and link script from changing a couple of your settings and adding a site page the only problem is i can only add banners to your exact sizes , but i can work with that for now. i would like to know if banners could stay there original size if under site size because admin has to add all links as banners have to be sized first so they dont streach thanks bloke new page called advertisers with static banners [img]http://www.icyphoenix.com/files/images/5614/advertiser.jpg[/img] home page scrolling banners which can also be put global on your forum page or any new page you make [img]http://www.icyphoenix.com/files/images/5614/portal.jpg[/img] thanks bloke ----------------------------------- Mighty Gorgon Thu 30 Oct, 2008 11:47 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- What you can do is removing image size so images will be automatically sized. Remove this twice from links_block.tpl [code linenumbers=false] width="{SITE_LOGO_WIDTH}" height="{SITE_LOGO_HEIGHT}"[/code] ----------------------------------- bloke Fri 31 Oct, 2008 09:25 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- thanks Mighty Gorgon works just how i wanted it cheers bloke :wink: ----------------------------------- FedericoBiccheddu Sat 01 Nov, 2008 23:21 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- I have a relative problem to the operation of the script that I am creating! This guide is indeed most useful. The first problem is like can make so that, since I manage all way variable $_GET[] when the URL is template.php visualizes me a menu and not the tpl without data. According to problem he is the following one. Since the script opens a directory and all print me to video the rows to its inside as I can make that stamps me all rows and not only one? template.php [spoiler][code linenumbers=false syntax=php]. * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * READ THIS! Wherever you see TEMPLATE or Template or template, replace with whatever you * want to call your new page. * ***************************************************************************/ define('IN_PHPBB', true); $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); // If you create VARS (Custom) that do not already exist in Icy Phoenix, then you will also need to create the file "variables.php" for variable-transition to the .tpl file(s). So you will need to uncomment the line below. //include($phpbb_root_path . 'includes/variables_banners.'.$phpEx); // standard session management $userdata = session_pagestart($user_ip, PAGE_TEMPLATE); init_userprefs($userdata); // set page title $page_title = $lang['Banners_MakingArt']; // standard page header include($phpbb_root_path . 'includes/page_header.'.$phpEx); switch ($_GET['size']){ case "80x15": $banner_image_path = '80x15'; break; case "88x31": $banner_image_path = '88x31'; break; case "120x60": $banner_image_path = '120x60'; break; case "350x70": $banner_image_path = '350x70'; break; case "468x60": $banner_image_path = '468x60'; break; case "blinkie": $banner_image_path = 'blinkie'; break; case "stamp": $banner_image_path = 'stamp'; break; case "userbars": $banner_image_path = 'userbars'; break; default : print $lang['Select_Banner_Size']; } // assign template $template->set_filenames(array('body' => 'banners_body.tpl')); $dir = '/web/htdocs/www.makingart.org/home/linkaci/' . $banner_image_path . '/'; $image_path = 'http://' . $board_config['server_name'] . $board_config['script_path'] . 'linkaci/' . $banner_image_path . '/'; $file_path = 'linkaci/' . $banner_image_path . '/'; if ($open_dir = opendir($dir)) { while (false !== ($file = readdir($open_dir))) { if ($file != "." && $file != "..") { $url_image = $image_path . $file; $image = ""; $image_size = filesize("$file_path" . "$file"); $timetable = date("d-m-Y", filectime("$file_path" . "$file")); $date_upload = date("H:i", filectime("$file_path" . "$file")); $bbcode_code = '[url=http://' . $board_config['server_name'] . '][img]' . $url_image . '[/img]'; $html_code = '' . $board_config['site_desc'] . ' - ' . $board_config['sitename'] . ''; $direct_code = $url_image; } } closedir($open_dir); } // This is where you would add a new VARS Array if you intend to use your own custom VARS. $template->assign_vars(array( 'L_SELECT_BANNER_CODE_URL' => $lang['Select_Banner_Url'], 'L_SELECT_BANNER_CODE_HTML' => $lang['Select_Banner_Html'], 'L_SELECT_BANNER_CODE_BBCODE' => $lang['Select_Banner_Bbcode'], 'L_SIZE' => $lang['Image_Banner_Size'], 'L_DATE_UPLOAD' => $lang['Date_upload'], 'L_AT' => $lang['At'], 'TIMETABLE' => $timetable, 'DATE_UPLOAD' => $date_upload, 'BBCODE_CODE' => $bbcode_code, 'DIRECT_CODE' => $direct_code, 'HTML_CODE' => $html_code, 'IMAGE' => $image, 'IMAGE_SIZE' => $image_size, 'SIZE' => $banner_image_path, 'TEXTAREA_ID' => $textarea_id, ) ); $template->pparse('body'); // standard page footer include($phpbb_root_path . 'includes/page_tail.'.$phpEx); ?>[/code][/spoiler] template_body.tpl [spoiler][code linenumbers=false syntax=php]{IMG_THL}{IMG_THC}{SIZE}{IMG_THR}
{IMAGE} {L_SIZE}: {IMAGE_SIZE} Byte
{L_DATE_UPLOAD} : {TIMETABLE} {L_AT} {DATE_UPLOAD}
{IMG_TFL}{IMG_TFC}{IMG_TFR}[/code][/spoiler] [url=http://www.postimage.org/image.php?v=aV2s02KS][img]http://www.postimage.org/aV2s02KS.jpg[/img] Thanks to all! :cry: ----------------------------------- AndyGpy Sun 16 Nov, 2008 00:53 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- Nice , But how can i get the menu to appear in the left like all my other pages ? ----------------------------------- bloke Sun 16 Nov, 2008 08:06 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- go in your cms to the page you made and add blocks you can add extral blocks to some of the other original pages as well ----------------------------------- borbo Thu 23 Apr, 2009 16:34 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- Hello there... I'm currently testing the rc version and this mod does not work... The error: Fatal error: Call to undefined function phpdefine() in /home....blah blah/template.php on line 1 Any suggestions please? Thanks in advance ! ----------------------------------- New Player Thu 23 Apr, 2009 18:06 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- [quote user="borbo" post="38727"]Hello there... I'm currently testing the rc version and this mod does not work... The error: Fatal error: Call to undefined function phpdefine() in /home....blah blah/template.php on line 1 Any suggestions please? Thanks in advance ![/quote] this mod can't work in the rc and next release are some core variables of icy phoenix changed you have to wait till lopalong release this mod for rc ----------------------------------- borbo Fri 24 Apr, 2009 12:02 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- Thank you for answering... i guess i'll wait then... Regards alex ----------------------------------- Lopalong Sun 26 Apr, 2009 04:38 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- Instructions for RC1 - Onwards, Have been added to the first post. ;) I think I got it right! :P ----------------------------------- borbo Sun 26 Apr, 2009 12:22 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- Thank you very much [b]Lopalong[/b] you saved us a lot of time... :up: ----------------------------------- Lopalong Sun 26 Apr, 2009 14:27 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- You're welcome, But also be aware that if you opt to use "variables.php" you will divorce all var strings from Icy Phoenix and in fact create a stand-alone page that runs under Icy Phoenix. [b]For example:[/b] If you want to add the location to [b]functions_mg_online.php[/b], then you would have to include some language strings in my_template.php and add those vars to either the lang_main.php or preferably create a new file "lang_extend_my_template.php" and add the lang vars to that. The whole exercise of adding / creating a .php file as per the instructions, is that it should work with any .php application providing the access vars and permission strings etc, are changed to suit where ever you try to add it; and that includes the lang vars. ;) ----------------------------------- christmanrd Tue 18 Aug, 2009 17:37 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- Which one of this do I use for Icy Phoenix: 1.3.0.53? Thanks, Dave ----------------------------------- FedericoBiccheddu Tue 18 Aug, 2009 17:48 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- [code linenumbers=false]set_filenames(array('body' => 'page_body.tpl')); $template->assign_vars(array( 'KEY' => 'Value', )); $page_title = 'Page Title'; $meta_description = ''; $meta_keywords = ''; include(IP_ROOT_PATH . 'includes/page_header.' . PHP_EXT); $template->pparse('body'); include(IP_ROOT_PATH . 'includes/page_tail.' . PHP_EXT);[/code] ;) ----------------------------------- Lopalong Wed 19 Aug, 2009 00:35 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- [quote user="christmanrd" post="43132"]Which one of this do I use for Icy Phoenix: 1.3.0.53? Thanks, Dave[/quote] I've updated the first post. ;) ----------------------------------- spydie Wed 19 Aug, 2009 00:44 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- Thx Lopa. You help the noop´s a lot with your Instructions. Even the advanced listen to your Tip´s whenever they´re needed ----------------------------------- Lopalong Wed 19 Aug, 2009 00:49 Re: Create New Forum Pages And Add Custom Vars. ----------------------------------- Thanks Spydie, I usually see little sense in answering a question with half an answer. ;) That's of course if it's NOT half a question. :mryellow: ----------------------------------- novice programmer Wed 09 Sep, 2009 03:34 Re: CUSTOMIZATION - Create New Pages And Add Custom Vars. IP V1.2.027* ----------------------------------- How-to updated on [url=viewtopic.php?f=4&t=6436]this thread Moving to docs archive ;)