So stehts in der Anleitung
Code: Alles auswählen
global $db, $board_config, $template, $images, $phpbb_root_path;
$sql = "SELECT *
FROM " . THEMES_TABLE . "
WHERE themes_id = $style";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not query database for theme info');
}
if ( !($row = $db->sql_fetchrow($result)) )
{
message_die(CRITICAL_ERROR, "Could not get theme data for themes_id [$style]");
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
global $db, $board_config, $template, $images, $phpbb_root_path, $userdata;
while ( $theme_ok == FALSE )
{
$sql = "SELECT *
FROM " . THEMES_TABLE . "
WHERE themes_id = $style";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not query database for theme info');
}
if ( !($row = $db->sql_fetchrow($result)) )
{
message_die(CRITICAL_ERROR, "Could not get theme data for themes_id [$style]");
}
if ( $row['theme_public'] == TRUE || in_array($row['theme_usergroup'], $userdata['usergroups']) || $userdata['user_level'] == ADMIN || $style == $board_config['default_style'] )
{
$theme_ok = TRUE;
} else {
$style = $board_config['default_style'];
}
}
Das steht in meiner funtions.php
Code: Alles auswählen
global $db, $board_config, $template, $images, $phpbb_root_path;
//-- mod : categories hierarchy ------------------------------------------------
//-- delete
/*
$sql = "SELECT *
FROM " . THEMES_TABLE . "
WHERE themes_id = $style";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not query database for theme info');
}
if ( !($row = $db->sql_fetchrow($result)) )
{
message_die(CRITICAL_ERROR, "Could not get theme data for themes_id [$style]");
}
$template_path = 'templates/' ;
$template_name = $row['template_name'] ;
$template = new Template($phpbb_root_path . $template_path . $template_name);
*/
//-- add
global $config, $user, $themes;
$themes_exists = true;
if ( empty($themes) )
{
$themes = new themes();
$themes->read();
$themes_exists = false;
}
$row = $themes->data[$style];
// force the main css when in admin
$head_stylesheet = $row['template_name'] . '.css';
if ( defined('IN_ADMIN') && ($row['head_stylesheet'] != $head_stylesheet) )
{
foreach ( $themes->data as $style_id => $style_data )
{
if ( $style_data['head_stylesheet'] == $head_stylesheet )
{
$row = $style_data;
break;
}
}
}
// clean up if themes didn't exists
if ( !$themes_exists )
{
unset($themes);
}
// get main parameters
$template_path = 'templates/';
$template_name = $row['template_name'];
// intantiate the template
$template = new template_class($config->root . $template_path . $template_name, $row['custom_tpls']);
//-- fin mod : categories hierarchy --------------------------------------------
if ( $template )
{
$current_template_path = $template_path . $template_name;
@include($phpbb_root_path . $template_path . $template_name . '/' . $template_name . '.cfg');
if ( !defined('TEMPLATE_CONFIG') )
{
message_die(CRITICAL_ERROR, "Could not open $template_name template config file", '', __LINE__, __FILE__);
}
$img_lang = ( file_exists(@phpbb_realpath($phpbb_root_path . $current_template_path . '/images/lang_' . $board_config['default_lang'])) ) ? $board_config['default_lang'] : 'english';
while( list($key, $value) = @each($images) )
{
if ( !is_array($value) )
{
$images[$key] = str_replace('{LANG}', 'lang_' . $img_lang, $value);
}
}
//-- mod : categories hierarchy ------------------------------------------------
//-- add
Ich hoffe es kann mir dabei jemand helfen da der Rest vom mod normal einzubauen ist und es das einzige Problem dabei ist.