I got a PHP problem after removing frames in ACP

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
User avatar
Meowmeow
Registered User
Posts: 160
Joined: Wed Mar 21, 2007 1:15 pm
Location: Kaohsiung, Taiwan

I got a PHP problem after removing frames in ACP

Post by Meowmeow » Tue Jun 05, 2007 12:55 pm

I am designing the prosilver for phpBB2, and I created a way to remove frames successfully. Here's the way.

Code: Select all

# 
#-----[ OPEN ]------------------------------------------ 
# 
admin/index.php
# 
#-----[ FIND, LINE 54, DELETE ]------------------------------------------ 
#
if( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'left' )
{
	$dir = @opendir(".");

	$setmodules = 1;
	while( $file = @readdir($dir) )
	{
		if( preg_match("/^admin_.*?\." . $phpEx . "$/", $file) )
		{
			include('./' . $file);
		}
	}

	@closedir($dir);

	unset($setmodules);

	include('./page_header_admin.'.$phpEx);

	$template->set_filenames(array(
		"body" => "admin/index_navigate.tpl")
	);

	$template->assign_vars(array(
		"U_FORUM_INDEX" => append_sid("../index.$phpEx"),
		"U_ADMIN_INDEX" => append_sid("index.$phpEx?pane=right"),

		"L_FORUM_INDEX" => $lang['Main_index'],
		"L_ADMIN_INDEX" => $lang['Admin_Index'], 
		"L_PREVIEW_FORUM" => $lang['Preview_forum'])
	);

	ksort($module);

	while( list($cat, $action_array) = each($module) )
	{
		$cat = ( !empty($lang[$cat]) ) ? $lang[$cat] : preg_replace("/_/", " ", $cat);

		$template->assign_block_vars("catrow", array(
			"ADMIN_CATEGORY" => $cat)
		);

		ksort($action_array);

		$row_count = 0;
		while( list($action, $file)	= each($action_array) )
		{
			$row_color = ( !($row_count%2) ) ? $theme['td_color1'] : $theme['td_color2'];
			$row_class = ( !($row_count%2) ) ? $theme['td_class1'] : $theme['td_class2'];

			$action = ( !empty($lang[$action]) ) ? $lang[$action] : preg_replace("/_/", " ", $action);

			$template->assign_block_vars("catrow.modulerow", array(
				"ROW_COLOR" => "#" . $row_color,
				"ROW_CLASS" => $row_class, 

				"ADMIN_MODULE" => $action,
				"U_ADMIN_MODULE" => append_sid($file))
			);
			$row_count++;
		}
	}

	$template->pparse("body");

	include('./page_footer_admin.'.$phpEx);
}
elseif( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'right' )
{
# 
#-----[ FIND, LINE 632, DELETE ]------------------------------------------ 
#
}
else
{
	//
	// Generate frameset
	//
	$template->set_filenames(array(
		"body" => "admin/index_frameset.tpl")
	);

	$template->assign_vars(array(
		"S_FRAME_NAV" => append_sid("index.$phpEx?pane=left"),
		"S_FRAME_MAIN" => append_sid("index.$phpEx?pane=right"))
	);

	header ("Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
	header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

	$template->pparse("body");

	$db->sql_close();
	exit;

}
# 
#-----[ OPEN ]------------------------------------------ 
# 
admin/page_header_admin.php
# 
#-----[ FIND, LINE 63 ]------------------------------------------ 
#
$template->set_filenames(array(
	'header' => 'admin/page_header.tpl')
);
# 
#-----[ BEFORE ADD ]------------------------------------------ 
#
$dir = @opendir(".");

	$setmodules = 1;
	while( $file = @readdir($dir) )
	{
		if( preg_match("/^admin_.*?\." . $phpEx . "$/", $file) )
		{
			include('./' . $file);
		}
	}

	@closedir($dir);

	unset($setmodules);

	$template->assign_vars(array(
		"U_ADMIN_INDEX" => append_sid("index.$phpEx"),
		"L_FORUM_INDEX" => $lang['Main_index'],
		"L_ADMIN_INDEX" => $lang['Admin_Index'], 
		"L_PREVIEW_FORUM" => $lang['Preview_forum'])
	);

	ksort($module);

	while( list($cat, $action_array) = each($module) )
	{
		$cat = ( !empty($lang[$cat]) ) ? $lang[$cat] : preg_replace("/_/", " ", $cat);

		$template->assign_block_vars("catrow", array(
			"ADMIN_CATEGORY" => $cat)
		);

		ksort($action_array);

		$row_count = 0;
		while( list($action, $file)	= each($action_array) )
		{
			$row_color = ( !($row_count%2) ) ? $theme['td_color1'] : $theme['td_color2'];
			$row_class = ( !($row_count%2) ) ? $theme['td_class1'] : $theme['td_class2'];

			$action = ( !empty($lang[$action]) ) ? $lang[$action] : preg_replace("/_/", " ", $action);

			$template->assign_block_vars("catrow.modulerow", array(
				"ROW_COLOR" => "#" . $row_color,
				"ROW_CLASS" => $row_class, 

				"ADMIN_MODULE" => $action,
				"U_ADMIN_MODULE" => append_sid($file))
			);
			$row_count++;
		}
	}
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
Image

It looks so nice, but I got a serious problem. After doing that, some pages with those there php files cannot display at all. They are:

admin_forums.php - [Forum Admin] Management
admin_db_utilities.php - [General Admin] Backup Database, Restore Database
admin_ug_auth.php - [Group Admin] Permissions, [User Admin] Permissions

I don't know how to solve, and I've tried for a week. Could anyone help me? Please...

Meow

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50805
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: I got a PHP problem after removing frames in ACP

Post by stevemaury » Tue Jun 05, 2007 1:29 pm

Why not just use the standard subSilver templates/subSilver/admin folder for your style. The admin is the only one that sees it.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

User avatar
Meowmeow
Registered User
Posts: 160
Joined: Wed Mar 21, 2007 1:15 pm
Location: Kaohsiung, Taiwan

Re: I got a PHP problem after removing frames in ACP

Post by Meowmeow » Tue Jun 05, 2007 5:31 pm

I want to make a perfect theme.

User avatar
Meowmeow
Registered User
Posts: 160
Joined: Wed Mar 21, 2007 1:15 pm
Location: Kaohsiung, Taiwan

Re: I got a PHP problem after removing frames in ACP

Post by Meowmeow » Fri Jun 08, 2007 12:02 pm

Doesn't anyone know how to solve? :cry:

Locked

Return to “2.0.x Support Forum”