]> git.vanrenterghem.biz Git - www.vanrenterghem.biz.git/blobdiff - phpBB2/admin/xs_export_data.php
Verwijder verouderde bestanden.
[www.vanrenterghem.biz.git] / phpBB2 / admin / xs_export_data.php
diff --git a/phpBB2/admin/xs_export_data.php b/phpBB2/admin/xs_export_data.php
deleted file mode 100644 (file)
index f965f0e..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-<?php\r
-\r
-/***************************************************************************\r
- *                             xs_export_data.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_export_data.'.$phpEx) . '">' . $lang['xs_edit_styles_data'] . '</a>'));\r
-\r
-$lang['xs_export_data_back'] = str_replace('{URL}', append_sid('xs_export_data.'.$phpEx), $lang['xs_export_data_back']);\r
-\r
-//\r
-// export style\r
-//\r
-if(isset($HTTP_GET_VARS['export']))\r
-{\r
-       $export = str_replace(array('\\', '/'), array('',''), stripslashes($HTTP_GET_VARS['export']));\r
-       // get list of themes for style\r
-       $sql = "SELECT themes_id, style_name FROM " . THEMES_TABLE . " WHERE template_name = '$export' ORDER BY style_name ASC";\r
-       if(!$result = $db->sql_query($sql))\r
-       {\r
-               xs_error($lang['xs_no_theme_data'] . '<br /><br />' . $lang['xs_export_data_back']);\r
-       }\r
-       $theme_rowset = $db->sql_fetchrowset($result);\r
-       if(count($theme_rowset) == 0)\r
-       {\r
-               xs_error($lang['xs_no_themes'] . '<br /><br />' . $lang['xs_export_data_back']);\r
-       }\r
-       if(count($theme_rowset) == 1)\r
-       {\r
-               $HTTP_POST_VARS['export'] = $HTTP_GET_VARS['export'];\r
-               $HTTP_POST_VARS['export_total'] = '1';\r
-               $HTTP_POST_VARS['export_id_0'] = $theme_rowset[0]['themes_id'];\r
-               $HTTP_POST_VARS['export_check_0'] = 'checked';\r
-       }\r
-       else\r
-       {\r
-               $template->set_filenames(array('body' => XS_TPL_PATH . 'export_data2.tpl'));\r
-               $template->assign_vars(array(\r
-                       'TOTAL'         => count($theme_rowset),\r
-                       'EXPORT'        => htmlspecialchars($export),\r
-                       'U_ACTION'      => append_sid("xs_export_data.{$phpEx}")\r
-                       )\r
-               );\r
-               for($i=0; $i<count($theme_rowset); $i++)\r
-               {\r
-                       $row_class = $xs_row_class[$i % 2];\r
-                       $template->assign_block_vars('styles', array(\r
-                               'ROW_CLASS'             => $row_class,\r
-                               'NUM'                   => $i,\r
-                               'ID'                    => $theme_rowset[$i]['themes_id'],\r
-                               'STYLE'                 => htmlspecialchars($theme_rowset[$i]['style_name'])\r
-                               )\r
-                       );\r
-               }\r
-               $template->pparse('body');\r
-               xs_exit();\r
-       }\r
-}\r
-\r
-if(!empty($HTTP_POST_VARS['export']) && !defined('DEMO_MODE'))\r
-{\r
-       $export = xs_tpl_name($HTTP_POST_VARS['export']);\r
-       // get ftp configuration\r
-       $params = array('export' => $export);\r
-       $total = intval($HTTP_POST_VARS['export_total']);\r
-       $count = 0;\r
-       for($i=0; $i<$total; $i++)\r
-       {\r
-               if(!empty($HTTP_POST_VARS['export_check_'.$i]))\r
-               {\r
-                       $params['export_id_'.$count] = intval($HTTP_POST_VARS['export_id_'.$i]);\r
-                       $params['export_check_'.$count] = 'checked';\r
-                       $count ++;\r
-               }\r
-       }\r
-       $params['export_total'] = $count;\r
-       if(!$count)\r
-       {\r
-               xs_error($lang['xs_export_noselect_themes'] . '<br /><br />' . $lang['xs_export_data_back']);\r
-       }\r
-       $write_local = false;\r
-       if(!get_ftp_config(append_sid('xs_export_data.'.$phpEx), $params, true))\r
-       {\r
-               xs_exit();\r
-       }\r
-       xs_ftp_connect(append_sid('xs_export_data.'.$phpEx), $params, true);\r
-       if($ftp === XS_FTP_LOCAL)\r
-       {\r
-               $write_local = true;\r
-               $local_filename = '../templates/'. $export . '/theme_info.cfg';\r
-       }\r
-       else\r
-       {\r
-               $local_filename = XS_TEMP_DIR . 'export_' . time() . '.tmp';\r
-       }\r
-       // get all themes for style\r
-       $export_list = array();\r
-       for($i=0; $i<$total; $i++)\r
-       {\r
-               if(!empty($HTTP_POST_VARS['export_check_'.$i]))\r
-               {\r
-                       $export_list[] = intval($HTTP_POST_VARS['export_id_'.$i]);\r
-               }\r
-       }\r
-       $sql = "SELECT * FROM " . THEMES_TABLE . " WHERE themes_id IN (" . implode(', ', $export_list) . ") ORDER BY style_name ASC";\r
-       if(!$result = $db->sql_query($sql))\r
-       {\r
-               xs_error($lang['xs_no_style_info'] . '<br /><br />' . $lang['xs_export_data_back'], __LINE__, __FILE__);\r
-       }\r
-       $style_rowset = $db->sql_fetchrowset($result);\r
-       if(!count($style_rowset))\r
-       {\r
-               xs_error($lang['xs_no_style_info'] . '<br /><br />' . $lang['xs_export_data_back'], __LINE__, __FILE__);\r
-       }\r
-       $data = xs_generate_themeinfo($style_rowset, $export, $export, 0);\r
-       $f = @fopen($local_filename, 'wb');\r
-       if(!$f)\r
-       {\r
-               xs_error(str_replace('{FILE}', $local_filename, $lang['xs_error_cannot_create_file']) . '<br /><br />' . $lang['xs_export_data_back']);\r
-       }\r
-       fwrite($f, $data);\r
-       fclose($f);\r
-       if($write_local)\r
-       {\r
-               xs_message($lang['Information'], $lang['xs_export_data_saved'] . '<br /><br />' . $lang['xs_export_data_back']);\r
-       }\r
-       // generate ftp actions\r
-       $actions = array();\r
-       // chdir to template directory\r
-       $actions[] = array(\r
-                       'command'       => 'chdir',\r
-                       'dir'           => 'templates'\r
-               );\r
-       $actions[] = array(\r
-                       'command'       => 'chdir',\r
-                       'dir'           => $export\r
-               );\r
-       $actions[] = array(\r
-                       'command'       => 'upload',\r
-                       'local'         => $local_filename,\r
-                       'remote'        => 'templates/' . $export . '/theme_info.cfg'\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
-       @unlink($local_filename);\r
-       if($res)\r
-       {\r
-               xs_message($lang['Information'], $lang['xs_export_data_saved'] . '<br /><br />' . $lang['xs_export_data_back']);\r
-       }\r
-       xs_error($ftp_error . '<br /><br />' . $lang['xs_export_data_back']);\r
-}\r
-\r
-\r
-\r
-\r
-$template->set_filenames(array('body' => XS_TPL_PATH . 'export_data.tpl'));\r
-//\r
-// get list of installed styles\r
-//\r
-$sql = 'SELECT themes_id, template_name, style_name FROM ' . THEMES_TABLE . ' ORDER BY template_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
-$prev_id = -1;\r
-$prev_tpl = '';\r
-$style_names = array();\r
-$j = 0;\r
-for($i=0; $i<count($style_rowset); $i++)\r
-{\r
-       $item = $style_rowset[$i];\r
-       if($item['template_name'] === $prev_tpl)\r
-       {\r
-               $style_names[] = htmlspecialchars($item['style_name']);\r
-       }\r
-       else\r
-       {\r
-               if($prev_id > 0)\r
-               {\r
-                       $str = implode('<br />', $style_names);\r
-                       $str2 = urlencode($prev_tpl);\r
-                       $row_class = $xs_row_class[$j % 2];\r
-                       $j++;\r
-                       $template->assign_block_vars('styles', array(\r
-                                       'ROW_CLASS'     => $row_class,\r
-                                       'TPL'           => $prev_tpl,\r
-                                       'STYLES'        => $str,\r
-                                       'U_EXPORT'      => "xs_export_data.{$phpEx}?export={$str2}&sid={$userdata['session_id']}",\r
-                               )\r
-                       );\r
-               }\r
-               $prev_id = $item['themes_id'];\r
-               $prev_tpl = $item['template_name'];\r
-               $style_names = array(htmlspecialchars($item['style_name']));\r
-       }\r
-}\r
-\r
-if($prev_id > 0)\r
-{\r
-       $str = implode('<br />', $style_names);\r
-       $str2 = urlencode($prev_tpl);\r
-       $row_class = $xs_row_class[$j % 2];\r
-       $j++;\r
-       $template->assign_block_vars('styles', array(\r
-                       'ROW_CLASS'     => $row_class,\r
-                       'TPL'           => $prev_tpl,\r
-                       'STYLES'        => $str,\r
-                       'U_EXPORT'      => "xs_export_data.{$phpEx}?export={$str2}&sid={$userdata['session_id']}",\r
-               )\r
-       );\r
-}\r
-\r
-$template->pparse('body');\r
-xs_exit();\r
-\r
-?>
\ No newline at end of file