]> git.vanrenterghem.biz Git - www.vanrenterghem.biz.git/blobdiff - phpBB2/admin/xs_uninstall.php
Verwijder verouderde bestanden.
[www.vanrenterghem.biz.git] / phpBB2 / admin / xs_uninstall.php
diff --git a/phpBB2/admin/xs_uninstall.php b/phpBB2/admin/xs_uninstall.php
deleted file mode 100644 (file)
index 89cb1c6..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-<?php\r
-\r
-/***************************************************************************\r
- *                             xs_uninstall.php\r
- *                             ----------------\r
- *   copyright            : (C) 2003 - 2005 CyberAlien\r
- *   support              : http://www.phpbbstyles.com\r
- *\r
- *   version              : 2.3.1\r
- *\r
- *   file revision        : 72\r
- *   project revision     : 78\r
- *   last modified        : 05 Dec 2005  13:54:54\r
- *\r
- ***************************************************************************/\r
-\r
-/***************************************************************************\r
- *\r
- *   This program is free software; you can redistribute it and/or modify\r
- *   it under the terms of the GNU General Public License as published by\r
- *   the Free Software Foundation; either version 2 of the License, or\r
- *   (at your option) any later version.\r
- *\r
- ***************************************************************************/\r
-\r
-define('IN_PHPBB', 1);\r
-$phpbb_root_path = "./../";\r
-$no_page_header = true;\r
-require($phpbb_root_path . 'extension.inc');\r
-require('./pagestart.' . $phpEx);\r
-\r
-// check if mod is installed\r
-if(empty($template->xs_version) || $template->xs_version !== 8)\r
-{\r
-       message_die(GENERAL_ERROR, isset($lang['xs_error_not_installed']) ? $lang['xs_error_not_installed'] : 'eXtreme Styles mod is not installed. You forgot to upload includes/template.php');\r
-}\r
-\r
-define('IN_XS', true);\r
-include_once('xs_include.' . $phpEx);\r
-\r
-$template->assign_block_vars('nav_left',array('ITEM' => '&raquo; <a href="' . append_sid('xs_uninstall.'.$phpEx) . '">' . $lang['xs_uninstall_styles'] . '</a>'));\r
-\r
-$lang['xs_uninstall_back'] = str_replace('{URL}', append_sid('xs_uninstall.'.$phpEx), $lang['xs_uninstall_back']);\r
-$lang['xs_goto_default'] = str_replace('{URL}', append_sid('xs_styles.'.$phpEx), $lang['xs_goto_default']);\r
-\r
-//\r
-// uninstall style\r
-//\r
-if(isset($HTTP_GET_VARS['remove']) && !defined('DEMO_MODE'))\r
-{\r
-       $remove_id = intval($HTTP_GET_VARS['remove']);\r
-       if($board_config['default_style'] == $remove_id)\r
-       {\r
-               xs_error(str_replace('{URL}', append_sid('xs_styles.'.$phpEx), $lang['xs_uninstall_default']) . '<br /><br />' . $lang['xs_uninstall_back']);\r
-       }\r
-       $sql = "SELECT themes_id, template_name, style_name FROM " . THEMES_TABLE . " WHERE themes_id='{$remove_id}'";\r
-       if(!$result = $db->sql_query($sql))\r
-       {\r
-               xs_error($lang['xs_no_style_info'] . '<br /><br />' . $lang['xs_uninstall_back'], __LINE__, __FILE__);\r
-       }\r
-       $row = $db->sql_fetchrow($result);\r
-       if(empty($row['themes_id']))\r
-       {\r
-               xs_error($lang['xs_no_style_info'] . '<br /><br />' . $lang['xs_uninstall_back'], __LINE__, __FILE__);\r
-       }\r
-       $sql = "UPDATE " . USERS_TABLE . " SET user_style=NULL WHERE user_style='{$remove_id}'";\r
-       $db->sql_query($sql);\r
-       $sql = "DELETE FROM " . THEMES_TABLE . " WHERE themes_id='{$remove_id}'";\r
-       $db->sql_query($sql);\r
-       $template->assign_block_vars('removed', array());\r
-       // remove files\r
-       if(!empty($HTTP_GET_VARS['dir']))\r
-       {\r
-               $HTTP_POST_VARS['remove'] = addslashes($row['template_name']);\r
-       }\r
-       // remove config\r
-       if(empty($HTTP_GET_VARS['nocfg']) && isset($board_config['xs_style_'.$row['template_name']]))\r
-       {\r
-               $sql = "DELETE FROM " . CONFIG_TABLE . " WHERE config_name='" . addslashes("xs_style_{$row['template_name']}") . "'";\r
-               $db->sql_query($sql);\r
-               $template->assign_block_vars('left_refresh', array(\r
-                               'ACTION'        => append_sid('index.' . $phpEx . '?pane=left')\r
-                       ));\r
-               // recache config table for cat_hierarchy 2.1.0\r
-               if(isset($GLOBALS['config']) && is_object($GLOBALS['config']))\r
-               {\r
-                       global $config;\r
-                       $config->read(true);\r
-               }\r
-       }\r
-       // recache themes table\r
-       if(defined('XS_MODS_CATEGORY_HIERARCHY210'))\r
-       {\r
-               if ( empty($themes) )\r
-               {\r
-                       $themes = new themes();\r
-               }\r
-               if ( !empty($themes) )\r
-               {\r
-                       $themes->read(true);\r
-               }\r
-       }\r
-}\r
-\r
-function remove_all($dir)\r
-{\r
-       $res = opendir($dir);\r
-       if(!$res)\r
-       {\r
-               return false;\r
-       }\r
-       while(($file = readdir($res)) !== false)\r
-       {\r
-               if($file !== '.' && $file !== '..')\r
-               {\r
-                       $str = $dir . '/' . $file;\r
-                       if(is_dir($str))\r
-                       {\r
-                               remove_all($str);\r
-                               @rmdir($str);\r
-                       }\r
-                       else\r
-                       {\r
-                               @unlink($str);\r
-                       }\r
-               }\r
-       }\r
-       closedir($res);\r
-}\r
-\r
-//\r
-// remove files\r
-//\r
-if(isset($HTTP_POST_VARS['remove']) && !defined('DEMO_MODE'))\r
-{\r
-       $remove = stripslashes($HTTP_POST_VARS['remove']);\r
-       $params = array('remove' => $remove);\r
-       if(!get_ftp_config(append_sid('xs_uninstall.'.$phpEx), $params, true))\r
-       {\r
-               xs_exit();\r
-       }\r
-       xs_ftp_connect(append_sid('xs_uninstall.'.$phpEx), $params, true);\r
-       $write_local = false;\r
-       if($ftp === XS_FTP_LOCAL)\r
-       {\r
-               $write_local = true;\r
-               $write_local_dir = '../templates/';\r
-       }\r
-       if(!$write_local)\r
-       {\r
-               //\r
-               // Generate actions list\r
-               //\r
-               $actions = array();\r
-               // chdir to templates directory\r
-               $actions[] = array(\r
-                               'command'       => 'chdir',\r
-                               'dir'           => 'templates'\r
-                       );\r
-               // chdir to template\r
-               $actions[] = array(\r
-                               'command'       => 'chdir',\r
-                               'dir'           => $remove\r
-                       );\r
-               // remove all files\r
-               $actions[] = array(\r
-                               'command'       => 'removeall',\r
-                               'ignore'        => true\r
-                       );\r
-               $actions[] = array(\r
-                               'command'       => 'cdup'\r
-                       );\r
-               $actions[] = array(\r
-                               'command'       => 'rmdir',\r
-                               'dir'           => $remove\r
-                       );\r
-               $ftp_log = array();\r
-               $ftp_error = '';\r
-               $res = ftp_myexec($actions);\r
-/*             echo "<!--\n\n";\r
-               echo "\$actions dump:\n\n";\r
-               print_r($actions);\r
-               echo "\n\n\$ftp_log dump:\n\n";\r
-               print_r($ftp_log);\r
-               echo "\n\n -->"; */\r
-       }\r
-       else\r
-       {\r
-               remove_all('../templates/'.$remove);\r
-               @rmdir('../templates/'.$remove);\r
-       }\r
-       $template->assign_block_vars('removed', array());\r
-}\r
-\r
-\r
-\r
-//\r
-// get list of installed styles\r
-//\r
-$sql = 'SELECT themes_id, template_name, style_name FROM ' . THEMES_TABLE . ' ORDER BY template_name, style_name';\r
-if(!$result = $db->sql_query($sql))\r
-{\r
-       xs_error($lang['xs_no_style_info'], __LINE__, __FILE__);\r
-}\r
-$style_rowset = $db->sql_fetchrowset($result);\r
-\r
-$tpl = array();\r
-for($i=0; $i<count($style_rowset); $i++)\r
-{\r
-       $item = $style_rowset[$i];\r
-       $tpl[$item['template_name']][] = $item;\r
-}\r
-\r
-$j = 0;\r
-foreach($tpl as $tpl => $styles)\r
-{\r
-       $row_class = $xs_row_class[$j % 2];\r
-       $j++;\r
-       $template->assign_block_vars('styles', array(\r
-                       'ROW_CLASS'     => $row_class,\r
-                       'TPL'           => htmlspecialchars($tpl),\r
-                       'ROWS'          => count($styles),\r
-               )\r
-       );\r
-       if(count($styles) > 1)\r
-       {\r
-               for($i=0; $i<count($styles); $i++)\r
-               {\r
-                       $template->assign_block_vars('styles.item', array(\r
-                                       'ID'            => $styles[$i]['themes_id'],\r
-                                       'THEME'         => htmlspecialchars($styles[$i]['style_name']),\r
-                                       'U_DELETE'      => append_sid('xs_uninstall.'.$phpEx.'?remove='.$styles[$i]['themes_id'].'&nocfg=1'),\r
-                               )\r
-                       );\r
-                       $template->assign_block_vars('styles.item.nodelete', array());\r
-               }\r
-       }\r
-       else\r
-       {\r
-               $i = 0;\r
-               $template->assign_block_vars('styles.item', array(\r
-                               'ID'            => $styles[$i]['themes_id'],\r
-                               'THEME'         => htmlspecialchars($styles[$i]['style_name']),\r
-                               'U_DELETE'      => append_sid('xs_uninstall.'.$phpEx.'?remove='.$styles[$i]['themes_id']),\r
-                       )\r
-               );\r
-               $template->assign_block_vars('styles.item.delete', array(\r
-                               'U_DELETE'      => append_sid('xs_uninstall.'.$phpEx.'?dir=1&remove='.$styles[$i]['themes_id']),\r
-                       )\r
-               );\r
-       }\r
-}\r
-\r
-$template->set_filenames(array('body' => XS_TPL_PATH . 'uninstall.tpl'));\r
-$template->pparse('body');\r
-xs_exit();\r
-\r
-?>
\ No newline at end of file