Adding A Simple Php Page »  Show posts from    to     

Icy Phoenix


Old Support Topics - Adding A Simple Php Page



redrumm101 [ Sat 10 Jan, 2009 15:56 ]
Post subject: Adding A Simple Php Page
Spoiler: [ Show ]


I tryed to add this simple php coded page and it shows exactlly what i wrote. Is there a way to put php into a block.
Im trying to add alot more complex php but i figured i would start with this to see if it even works.. Sorry i am new to icy pheonix but use phpbb3 and my own php web site. Im just getting ready to migrate to icy pheonix but there is alot of things i need to do that is php based.. Thanks for your help

Here is an example page from my current site.. this is a little more complex than hello world LOL

My donation page

Here is the code for that page

Spoiler: [ Show ]


Chaotic [ Sat 10 Jan, 2009 23:56 ]
Post subject: Re: Adding A Simple Php Page
You can do just about anything with Icy Phoenix.

To add a new page to your site, try going to your CMS (cms.php) and click Add Site Page at the very bottom. You can also add it manually by making a copy of index_empty.php, editing it, and renaming it.

About adding more php into a block, try looking through the files in ip_root/blocks and ip_root/templates/mg_themes/blocks. Use their setup as an example of the basics needed to create a new block.


redrumm101 [ Fri 16 Jan, 2009 20:51 ]
Post subject: Re: Adding A Simple Php Page
Ok i was able to get this to work somewhat with my server info page

http://www.getcis.com/~redrum/server.php#22

But of course i doesnt look right.. I used the rules page to copy most of the code and put my code inbetween.. Its just a standard echo iframe. Any help would be greatly appreciated.. Here is the code i used like i said most of it is rules.php because thats the only way i can seem to get it to work.

If there is a much simpler way to do this and have the correct borders around it and top and bottom title bar.

Code: [Hide] [Select]
<?php
/***************************************************************************
* rules.php
* -------------------
* begin : 26.10.2003, 19:29
* copyright : (C) 2003 Dimitri Seitz
* email : dwing@weingarten-net.de
*
* $Id: admin_rules.php,v 2.0,
*
*
***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.' . $phpEx);
require "/home/redrum/bin/CON-Config.php";

// Start session management
$userdata = session_pagestart($user_ip);
init_userprefs($userdata);
// End session management

$cms_page_id = '22';
$cms_page_name = 'server info';
$auth_level_req = $board_config['auth_view_rules'];
if ($auth_level_req > AUTH_ALL)
{
if ( ($auth_level_req == AUTH_REG) && (!$userdata['session_logged_in']) )
{
message_die(GENERAL_MESSAGE, $lang['Not_Auth_View']);
}
if ($userdata['user_level'] != ADMIN)
{
if ( $auth_level_req == AUTH_ADMIN )
{
message_die(GENERAL_MESSAGE, $lang['Not_Auth_View']);
}
if ( ($auth_level_req == AUTH_MOD) && ($userdata['user_level'] != MOD) )
{
message_die(GENERAL_MESSAGE, $lang['Not_Auth_View']);
}
}
}
$cms_wide_blocks = ($board_config['wide_blocks_rules'] == 1) ? true : false;

// Load the appropriate Rules file
$lang_file = 'lang_rules';
$l_title = $lang['BoardRules'];

// Include the rules settings
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx);


// Lets build a page ...
$page_title = $lang['BoardRules'];
$meta_description = '';
$meta_keywords = '';
include($phpbb_root_path . 'includes/page_header.' . $phpEx);

$template->set_filenames(array('body' => 'rules_body.tpl'));
make_jumpbox(VIEWFORUM_MG, $forum_id);

$template->assign_vars(array(
'L_RULES_TITLE' => $l_title,
'L_BACK_TO_TOP' => $lang['Back_to_top'])
);

for($i = 0; $i < count($rules_block); $i++)
{
if( count($rules_block[$i]) )
{
$template->assign_block_vars('rules_block', array(
'BLOCK_TITLE' => $rules_block_titles[$i])
);
$template->assign_block_vars('rules_block_link', array(
'BLOCK_TITLE' => $rules_block_titles[$i])
);

for($j = 0; $j < count($rules_block[$i]); $j++)
{
$row_color = ( !($j % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($j % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

$template->assign_block_vars('rules_block.rules_row', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'RULES_QUESTION' => $rules_block[$i][$j]['question'],
'RULES_ANSWER' => $rules_block[$i][$j]['answer'],

'U_RULES_ID' => $rules_block[$i][$j]['id'])
);

$template->assign_block_vars('rules_block_link.rules_row_link', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'RULES_LINK' => $rules_block[$i][$j]['question'],

'U_RULES_LINK' => '#f' . $rules_block[$i][$j]['id'])
);
}
}
}
echo "<iframe name="remote" width="700" height="800" src ="http://www.cisclan.com/server/lgsl/lgsl_server.php?ip=$cssserverip&port=$cssserverport&type=halflife2" frameborder="0">
</iframe>
";
$template->pparse('body');


include($phpbb_root_path . 'includes/page_tail.' . $phpEx);

?>




Powered by Icy Phoenix