Icy Phoenix

     
 

CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0

CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0

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

    $cms_page['page_id'] = 'mypage';

    // 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 -->


    Then in CMS => Standard Pages create the new page so you can add blocks and specify other features:
    Code: [Download] [Hide] [Select]
    Name: My Fantastic Page
    PageID: mypage
    filename: mypage.php



Enjoy your newly created pages!



 
Mighty Gorgon - View user's profile Send private message  
Mighty Gorgon [ Thu 02 Aug, 2012 22:49 ]
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us


CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0

Comments
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....

   



 
DWho - View user's profile Send private message  
DWho [ Sat 04 Aug, 2012 13:14 ]
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 profile Send private message  
Gianni PB [ Sat 04 Aug, 2012 15:11 ]
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 - View user's profile Send private message  
ThE KuKa [ Sat 04 Aug, 2012 22:21 ]
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. ;(



 
mort - View user's profile Send private message  
mort [ Sun 05 Aug, 2012 05:29 ]
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 profile Send private message  
Gianni PB [ Mon 06 Aug, 2012 10:39 ]
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.



 
mort - View user's profile Send private message  
mort [ Tue 07 Aug, 2012 05:19 ]
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 - View user's profile Send private message  
ThE KuKa [ Tue 07 Aug, 2012 12:45 ]
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.



 
Mighty Gorgon - View user's profile Send private message  
Mighty Gorgon [ Tue 07 Aug, 2012 16:49 ]
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 profile Send private message  
My4ECGI7p19Y [ Wed 29 Aug, 2012 10:07 ]
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



 
Limun - View user's profile Send private message  
Limun [ Fri 08 Feb, 2013 10:41 ]
Reply with quote    Download Post  
Post Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0 
 
Which error do you have?



 
Mighty Gorgon - View user's profile Send private message  
Mighty Gorgon [ Tue 19 Feb, 2013 23:13 ]
Reply with quote    Download Post  
Post Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0 
 
What would I need to add to get new pages in method 2 to show blocks defined in the CMS?



 
Silverman - View user's profile Send private message  
Silverman [ Wed 21 Aug, 2013 12:48 ]
Reply with quote    Download Post  
Post Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0 
 
If you add the page to "Standard Pages" you should then be able to add CMS blocks in standard positions... let me know if you succeed.



 
Mighty Gorgon - View user's profile Send private message  
Mighty Gorgon [ Wed 21 Aug, 2013 18:26 ]
Reply with quote    Download Post  
Post Re: CUSTOMIZATION - Create A Custom Page In Icy Phoenix 2.0 
 
I did and added the blocks in the cms like normal, I see the "My Fantastic Page" but the blocks don't show.

(I kept the files retrying it as is until I get it sorted.)



 
Silverman - View user's profile Send private message  
Silverman [ Thu 22 Aug, 2013 05:18 ]
Display posts from previous:    

HideWas this topic useful?

Post new topic  Reply to topic  Page 1 of 2
Goto page 1, 2  Next
 




 


 

  cron