Icy Phoenix

     
 


Tags And Keywordscustom pages, customization

Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0 
 
Since many users already asked how to create an empty page into Icy Phoenix 2.0 to insert custom content, I have decided to create this small tutorial.

There several ways to create custom pages, here are 2 different approaches:

  1. Create a CMS page (with the "central_block") and add the content into a custom block, so you can output whatever you like by creating a proper function. Just duplicate a block, and add in the function your content, something like this:
    Code: (block_myblock.php) [Download] [Hide] [Select]
    <?php
    /**
    *
    * @package Icy Phoenix
    * @version $Id$
    * @copyright (c) 2008 Icy Phoenix
    * @license http://opensource.org/licenses/GPL-license.php GNU Public License
    *
    */

    if (!defined('IN_ICYPHOENIX'))
    {
        die(
    'Hacking attempt');
    }

    if(!
    function_exists('cms_block_myblock'))
    {
        function
    cms_block_myblock()
        {
            global
    $db, $cache, $config, $template, $theme, $images, $user, $lang, $table_prefix, $block_id, $cms_config_vars, $cms_config_layouts, $cms_page;

            
    $mycontent = '<b>My Fantastic Page</b>';
            
    $template->assign_vars(array(
                
    'MYCONTENT' => $mycontent,
                )
            );

        }
    }

    cms_block_myblock();

    ?>

    Then you just need to create a tpl called myblock_block.tpl in templates/default/blocks/ with this content:
    Code: (myblock_block.tpl) [Download] [Hide] [Select]
    {MYCONTENT}


    Then just add the block to the page and you are done.
  2. As a second option you can create an empty PHP page like this:
    Code: (mypage.php) [Download] [Hide] [Select]
     <?php
    /**
    *
    * @package Icy Phoenix
    * @version $Id$
    * @copyright (c) 2008 Icy Phoenix
    * @license http://opensource.org/licenses/GPL-license.php GNU Public License
    *
    */

    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);

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

    $mycontent = '<b>My Fantastic Page</b>';

    $template->assign_vars(array(
        
    'MYCONTENT' => $mycontent
        
    )
    );

    full_page_generation('mycontent_body.tpl', $lang['MYCONTENT'], '', '');

    ?>

    Then you just need to create a tpl called mycontent_body.tpl in templates/default/ with this content:
    Code: (mycontent_body.tpl) [Download] [Hide] [Select]
    <!-- INCLUDE overall_header.tpl -->
    {MYCONTENT}
    <!-- INCLUDE overall_footer.tpl -->


Enjoy your newly created pages!
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty Gorgon - View user's profileSend private messageVisit poster's websiteView user's personal gallery 
Back to topPage bottom
Thanks for the useful Topic Mighty Gorgon:
ThE KuKa (03 August), Gianni PB (03 August), odelot (03 August), DWho (04 August), Joshua203 (04 August), Costa (05 August), fucile (06 August), buldo (07 August), Limun (08 August), Trace (22 August) 
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0 
 
Thanks for the tutorial, I am sure it will help a great many users....

   
 




____________
Mods and themes for Icy Phoenix 1.3

IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
 
DWho - View user's profileSend private messageVisit poster's websiteView user's personal gallery 
Back to topPage bottom
Reply with quote Download Post 
Post Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0 
 
Thanks!

How can I set a page title with the second option?
 



 
Gianni PB - View user's profileSend private messageVisit poster's website 
Back to topPage bottom
Reply with quote Download Post 
Post Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0 
 
Gianni PB wrote: [View Post]
Thanks!

How can I set a page title with the second option?


TEST...

FIND:
Code: [Download] [Hide]
  1. $user->setup(); 
  2. // End session management 

AFTER ADD:
Code: [Download] [Hide]
  1. page_header('YOUR TITLE HERE');` 

 




____________
ThE KuKa - www.IcyPhoenix.Es - www.phpBB-Es.COM - www.phpBBMODs.Es
ThE KuKa - Admin Icy Phoenix and Translation Group Leader.
 
ThE KuKa - View user's profileSend private messageVisit poster's website 
Back to topPage bottom
Reply with quote Download Post 
Post Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0 
 
Not sure if it hasn't been changed to this?

Examples?

// Load and process templates

$meta_content['page_title'] = $lang['Group_Control_Panel'];
page_header($meta_content['page_title'], true);

default:

$meta_content['page_title'] = $lang['Mod_CP'];
page_header($meta_content['page_title'], true);

The $lang obviously being the title?

So many changes, its difficult to know for sure without testing them. ;(
 




____________
My advice is freely given on the assumption that you will ignore any part or all of it!
My Hobby
 
mort - View user's profileSend private messageVisit poster's website 
Back to topPage bottom
Reply with quote Download Post 
Post Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0 
 
Kuka it works thanks  

mort you have to add it in your .php files (in case of 2nd option)
 



 
Gianni PB - View user's profileSend private messageVisit poster's website 
Back to topPage bottom
Reply with quote Download Post 
Post Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0 
 
page_header('YOUR TITLE HERE');` doesn't seem to exist any more like it used to with v*53? and looks like it has been replaced or superseded with the alternative I posted. That not only adds the header location/name to the tab, it also adds the page title to the meta data from what I can see.
 




____________
My advice is freely given on the assumption that you will ignore any part or all of it!
My Hobby
 
mort - View user's profileSend private messageVisit poster's website 
Back to topPage bottom
Reply with quote Download Post 
Post Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0 
 
Code: [Download] [Hide]
  1. page_header('YOUR TITLE HERE'); 

Works perfect in custom pages phpBB3 and Icy Phoenix 2.0 (in my test).

Can test other alternative with new var language:
Code: [Download] [Hide]
  1. page_header($user->lang['NEW_LANG_VAR']); 

OPEN ip/languages/lang_english/land_main.php file

FIND:
Code: [Download] [Hide]
  1. //==================================================== 
  2. // Do not insert anything below this line 
  3. //==================================================== 
  4.  
  5. ?> 

BEFORE ADD:
Code: [Download] [Hide]
  1. // NEW PAGE TITLE - START 
  2. $lang = array_merge($lang, array( 
  3.     'NEW_LANG_VAR'                => 'YOUR TILE PAGE', 
  4. )); 
  5. // NEW PAGE TITLE - END 

¡¡¡TEST AGAIN!!!
 




____________
ThE KuKa - www.IcyPhoenix.Es - www.phpBB-Es.COM - www.phpBBMODs.Es
ThE KuKa - Admin Icy Phoenix and Translation Group Leader.
 
ThE KuKa - View user's profileSend private messageVisit poster's website 
Back to topPage bottom
Reply with quote Download Post 
Post Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0 
 
You have at least two options to insert a title:

  1. Define $lang['MYCONTENT'] with the content you need (if you use the lang I added in my example full_page_generation('mycontent_body.tpl', $lang['MYCONTENT'], '', '');)
  2. Define $meta_content['page_title'] with the content you need


Both should produce the same result.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty Gorgon - View user's profileSend private messageVisit poster's websiteView user's personal gallery 
Back to topPage bottom
Reply with quote Download Post 
Post Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0 
 
Thanks man! Had this problem, and didn't know how to deal with it until now!
 



 
My4ECGI7p19Y - View user's profileSend private message 
Back to topPage bottom
Reply with quote Download Post 
Post Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0 
 
option 2 doesnt work for me
where is the problem?

i created mycontent.php with code 2 in first post and puted it to root
than i created mycontent_body.tpl and puted it into templates/default/  with some simple html

i m using IP2.0 on localhost
 




____________
We are the phpBBorg. Lower your Crackers. Your phpological and forumological distinctivness will be added to our own. Resistance if futile!
 
Limun - View user's profileSend private messageView user's personal gallery 
Back to topPage bottom
Reply with quote Download Post 
Post Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0 
 
Which error do you have?
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty Gorgon - View user's profileSend private messageVisit poster's websiteView user's personal gallery 
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events