Seite 1 von 1

usercp dev => prob jemand idee ?

Verfasst: 01.02.2003 15:22
von Morbold
ich versuch mir gerade ein user-cp zu bauen aber leider hab ich da noch ein kleines prob
das ganze klappt schon recht gut nur leider schaff ichs nicht das script die usercp_***.php datein im ordner (phpbb_root/usercp/ suchen zulassen.. es sucht immer im root und egal wo ich $phpbb_usercp_path bei der functon anbringe gibts nen error ...... hat jemand ne idee ?

Code: Alles auswählen

<?php
/***************************************************************************
 *                             (admin) index.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: index.php,v 1.40.2.3 2003/01/07 20:51:34 psotfx Exp $
 *
 *
 ***************************************************************************/

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

define('IN_PHPBB', 1);

//
// Load default header
//
$no_page_header = TRUE;
$phpbb_root_path = "";
$phpbb_usercp_path = "/usercp/";
require($phpbb_root_path . 'extension.inc');
require($phpbb_usercp_path . 'pagestart.' . $phpEx);

// ---------------
// Begin functions
//
function inarray($needle, $haystack)
{
	for($i = 0; $i < sizeof($haystack); $i++ )
	{
		if( $haystack[$i] == $needle )
		{
			return true;
		}
	}
	return false;
}
//
// End functions
// -------------

//
// Generate relevant output
//
if( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'left' )
{
	$dir = @opendir(".");

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

	@closedir($dir);

	unset($setmodules);

	include($phpbb_usercp_path . 'page_header_usercp.'.$phpEx);

	$template->set_filenames(array(
		"body" => "usercp/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('usercp/page_footer_usercp.'.$phpEx);
}
elseif( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'right' )
{

	include($phpbb_root_path . 'index.'.$phpEx);

}
else
{
	//
	// Generate frameset
	//
	$template->set_filenames(array(
		"body" => "usercp/index_frameset.tpl")
	);

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

	$template->pparse("body");
}

?>
das ganze kam aus nem request bei Phpbb.com heraus...

das ganze soll alle pannels zusammenbringen ala:

if user = admin = usercp +link to admin & group cp

if user = supermod = usercp+link to supermod cp & group cp

if user = mod = usercp + modcp (maybe auch group cp)

If user = user = usercp (maybe auch groupcp obwohl ich das nicht mag)

if user = guest = no cp


das cp wird über nen link im header aktiviert / deaktiviert

wenn irgend jemand ne idee hat oder irgend etwas dazu sagen will soll ers hier posten oder mir ne mail schreiben (philippt@hotmail.com <= ab und an schau ich bei der vorbei)

Verfasst: 02.02.2003 10:18
von saerdnaer
ersetze mal folgendes

Code: Alles auswählen

$phpbb_root_path = ""; 
$phpbb_usercp_path = "/usercp/"; 
durch

Code: Alles auswählen

$phpbb_root_path = "../"; 
$phpbb_usercp_path = "../usercp/"; 
ah

Verfasst: 02.02.2003 17:51
von Morbold
war eigentlich andersgedacht aber geht so auch

das ganze ist jetzt in dev....

http://www.phpbb.com/phpBB/viewtopic.php?t=73642