Problem beim Einbau des "Admin Templates" Mods

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
charlymcfly
Mitglied
Beiträge: 263
Registriert: 05.01.2005 10:34
Wohnort: Aurich
Kontaktdaten:

Problem beim Einbau des "Admin Templates" Mods

Beitrag von charlymcfly »

Ich habe eben versucht den Admin Templates Mod versucht einzubauen aber da ich den Categorie Hierachy mod eingebaut habe ist in der functions.php der zu ändernde Teil schon vom Categorie Mod geändert.

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
Kann man den gewünschten Teil dort irgendwie einfügen?

Ich hoffe es kann mir dabei jemand helfen da der Rest vom mod normal einzubauen ist und es das einzige Problem dabei ist.
Benutzeravatar
Mehrpack
Mitglied
Beiträge: 417
Registriert: 28.02.2004 07:24

Beitrag von Mehrpack »

hi,
ich hab keine ahnung ob das funktionieren wird, aber probiern wir es mal *g*

suche:

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 --------------------------------------------
ersetze mit:

Code: Alles auswählen

   global $db, $board_config, $template, $images, $phpbb_root_path, $userdata; 

//-- 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 
   while ( $theme_ok == FALSE ) 
   {
   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); 
   } 

      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']; 
      } 
   }

   // 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 --------------------------------------------
falls es nicht geht, hab ich leider keine ahnung.

Mehrpack
Nobody is Perfect.
charlymcfly
Mitglied
Beiträge: 263
Registriert: 05.01.2005 10:34
Wohnort: Aurich
Kontaktdaten:

Beitrag von charlymcfly »

Leider funktioniert das nicht. Schade

Aber ich danke dir für deine Mühe

Hat denn niemand anders eine Idee wie ich den trotzdem einfügen kann?
charlymcfly
Mitglied
Beiträge: 263
Registriert: 05.01.2005 10:34
Wohnort: Aurich
Kontaktdaten:

Beitrag von charlymcfly »

hat denn keiner ne Ahnung wie ich den trotzdem einbauen kann?
Antworten

Zurück zu „phpBB 2.0: Mod Support“