Seite 1 von 1

Template zerschossen

Verfasst: 08.10.2002 19:42
von Sumi
Hi
Kann meine Seite nicht mehr öffnen ,weil PHPBB das Template nicht öffnen kann...
Wie kann ich wieder auf ein funtionierendes Template umschalten...

Danke

Seid nachsichtig,wenn es so ähnlich schon mal gepostet wurde...

Verfasst: 08.10.2002 22:10
von Acid

Code: Alles auswählen

<?php 
/*************************************************************************** 
*                                revert_style.php 
*                            ------------------- 
* 
***************************************************************************/ 

/*************************************************************************** 
* 
*   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', true); 
$phpbb_root_path = './'; 
include($phpbb_root_path . 'extension.inc'); 
include($phpbb_root_path . 'common.'.$phpEx); 

$style_id = ( !empty($HTTP_GET_VARS['style_id']) ) ? $HTTP_GET_VARS['style_id'] : -1; 
$username = ( !empty($HTTP_GET_VARS['username']) ) ? $HTTP_GET_VARS['username'] : ''; 

if ($style_id == -1) 
{ 
   die("Please specify a style id to be set... extend ?style_id=your_style_id to the URL"); 
} 

// 
// Check if it's a valid style id 
// 
$style_id = intval($style_id); 

$sql = "SELECT themes_id FROM " . THEMES_TABLE . " WHERE themes_id = " . $style_id; 

if ( !($result = $db->sql_query($sql) )) 
{ 
   die("Could not query themes table"); 
} 

if ($db->sql_numrows($result) == 0) 
{ 
   die ("The style id " . $style_id . " does not exist in your database."); 
} 

// 
// Update Style in Configs Table 
// 
$sql = "UPDATE " . CONFIG_TABLE . " SET config_value = '" . $style_id . "' WHERE config_name = 'default_style'"; 

if ( !($result = $db->sql_query($sql) )) 
{ 
   die ("Could not update config table"); 
} 

if ($username != '') 
{ 
   $sql = "UPDATE " . USERS_TABLE . " SET user_style = " . $style_id . " WHERE username = '" . $username . "'"; 

   if ( !($result = $db->sql_query($sql) )) 
   { 
      message_die(GENERAL_ERROR, "Could not update users table", "", __LINE__, __FILE__, $sql); 
   } 
} 

message_die(GENERAL_MESSAGE, "Finished updating the default style"); 

?> 
..speichere das in eine whatever.php, uploade sie auf Deinen Server und gib dann folgendes in der Adresszeile Deines Browser ein:

http://www.domain.de/phpbb/whatever.php?style_id=1 ...wenn Du das Standardtemplate mit der ID 1 wiederherstellen willst.
http://www.domain.de/phpbb/whatever.php ... n_username
...wenn Du nur Dein persönliches Template umstellen willst.

(c) by Acyd Burn

Verfasst: 09.10.2002 01:17
von Sumi
Vielen Dank Acid

PS:Sorry fürs das Posting im falschen Forum :roll: :oops: