[61] | 1 | <?php
|
---|
| 2 | // $Id: xoops_version.php,v 1.8 2005/06/03 01:35:02 phppp Exp $
|
---|
| 3 | // ------------------------------------------------------------------------ //
|
---|
| 4 | // XOOPS - PHP Content Management System //
|
---|
| 5 | // Copyright (c) 2000 XOOPS.org //
|
---|
| 6 | // <http://www.xoops.org/> //
|
---|
| 7 | // ------------------------------------------------------------------------ //
|
---|
| 8 | // This program is free software; you can redistribute it and/or modify //
|
---|
| 9 | // it under the terms of the GNU General Public License as published by //
|
---|
| 10 | // the Free Software Foundation; either version 2 of the License, or //
|
---|
| 11 | // (at your option) any later version. //
|
---|
| 12 | // //
|
---|
| 13 | // You may not change or alter any portion of this comment or credits //
|
---|
| 14 | // of supporting developers from this source code or any supporting //
|
---|
| 15 | // source code which is considered copyrighted (c) material of the //
|
---|
| 16 | // original comment or credit authors. //
|
---|
| 17 | // //
|
---|
| 18 | // This program is distributed in the hope that it will be useful, //
|
---|
| 19 | // but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
---|
| 20 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
---|
| 21 | // GNU General Public License for more details. //
|
---|
| 22 | // //
|
---|
| 23 | // You should have received a copy of the GNU General Public License //
|
---|
| 24 | // along with this program; if not, write to the Free Software //
|
---|
| 25 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
|
---|
| 26 | // ------------------------------------------------------------------------ //
|
---|
| 27 | // Author: phppp (D.J.) //
|
---|
| 28 | // URL: http://xoopsforge.com, http://xoops.org.cn //
|
---|
| 29 | // ------------------------------------------------------------------------- //
|
---|
| 30 | //include_once 'cp_functions.php';
|
---|
[199] | 31 |
|
---|
[200] | 32 | function admin_check_user_meta_prefix($is_report = false){
|
---|
| 33 | global $xoopsModule;
|
---|
| 34 | $xoopsDB =& Database::getInstance();
|
---|
| 35 |
|
---|
| 36 | $mydirname = basename(dirname(dirname(__FILE__)));
|
---|
| 37 | $my_dirpath = dirname(dirname(__FILE__));
|
---|
| 38 | $wp_prefix_only = $mydirname;
|
---|
| 39 | if ($wp_prefix_only == 'wordpress') $wp_prefix_only ='wp';
|
---|
| 40 | $db_prefix = $xoopsDB->prefix($wp_prefix_only);
|
---|
[199] | 41 |
|
---|
[200] | 42 | $usermeta_tbl = $db_prefix . '_usermeta';
|
---|
| 43 | $meta_key_pattern = '_' . $wp_prefix_only . '_';
|
---|
| 44 |
|
---|
| 45 | $sql = "SELECT count(umeta_id) as data_count ,meta_key FROM $usermeta_tbl GROUP BY meta_key HAVING meta_key LIKE '%" . $meta_key_pattern ."%'" ;
|
---|
| 46 | $res = $xoopsDB->query($sql, 0, 0);
|
---|
| 47 |
|
---|
| 48 | if ($res === false){
|
---|
| 49 | $check_str = _AM_XP2_USER_META_NONE . "<br />\n";
|
---|
| 50 | } else {
|
---|
| 51 | $error =false;
|
---|
| 52 | $check_str = '';
|
---|
| 53 | while($row = $xoopsDB->fetchArray($res)){
|
---|
| 54 | $data_count = $row['data_count'];
|
---|
| 55 | $meta_key = $row['meta_key'];
|
---|
| 56 | if ( !preg_match('/^'.$db_prefix. '_.*/',$meta_key , $maches)){
|
---|
| 57 | $check_str .= sprintf(_AM_XP2_USER_META_ERR , $meta_key,$data_count) ."<br /> \n";
|
---|
| 58 | $error = true;
|
---|
| 59 | }
|
---|
| 60 | }
|
---|
| 61 | if (!$error)
|
---|
| 62 | $check_str = _AM_XP2_USER_META_OK ;
|
---|
| 63 | }
|
---|
| 64 | if ($is_report) {
|
---|
| 65 | echo "******** " . _AM_XP2_USER_META_KEY . "********" . "<br />\n";
|
---|
| 66 | echo $check_str . "<br />\n<br />\n";
|
---|
| 67 | } else {
|
---|
| 68 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_USER_META_KEY . "</legend>";
|
---|
| 69 | echo "<div style='padding: 8px;'>";
|
---|
| 70 | echo $check_str;
|
---|
| 71 | echo "</div>";
|
---|
[511] | 72 | echo '</legend>';
|
---|
| 73 | echo "</fieldset><br />";
|
---|
[200] | 74 | }
|
---|
| 75 |
|
---|
| 76 | }
|
---|
| 77 |
|
---|
[160] | 78 | function get_xpress_plugin_data( $plugin_file, $markup = true, $translate = true ) {
|
---|
| 79 | // We don't need to write to the file, so just open for reading.
|
---|
| 80 | $fp = fopen($plugin_file, 'r');
|
---|
| 81 |
|
---|
| 82 | // Pull only the first 8kiB of the file in.
|
---|
| 83 | $plugin_data = fread( $fp, 8192 );
|
---|
| 84 |
|
---|
| 85 | // PHP will close file handle, but we are good citizens.
|
---|
| 86 | fclose($fp);
|
---|
| 87 |
|
---|
| 88 | preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $name );
|
---|
| 89 | preg_match( '|Plugin URI:(.*)$|mi', $plugin_data, $uri );
|
---|
| 90 | preg_match( '|Version:(.*)|i', $plugin_data, $version );
|
---|
| 91 | preg_match( '|Description:(.*)$|mi', $plugin_data, $description );
|
---|
| 92 | preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name );
|
---|
| 93 | preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri );
|
---|
| 94 | preg_match( '|Text Domain:(.*)$|mi', $plugin_data, $text_domain );
|
---|
| 95 | preg_match( '|Domain Path:(.*)$|mi', $plugin_data, $domain_path );
|
---|
| 96 |
|
---|
| 97 | foreach ( array( 'name', 'uri', 'version', 'description', 'author_name', 'author_uri', 'text_domain', 'domain_path' ) as $field ) {
|
---|
| 98 | if ( !empty( ${$field} ) )
|
---|
| 99 | ${$field} = trim(${$field}[1]);
|
---|
| 100 | else
|
---|
| 101 | ${$field} = '';
|
---|
| 102 | }
|
---|
| 103 |
|
---|
| 104 | $plugin_data = array(
|
---|
| 105 | 'Name' => $name, 'Title' => $name, 'PluginURI' => $uri, 'Description' => $description,
|
---|
| 106 | 'Author' => $author_name, 'AuthorURI' => $author_uri, 'Version' => $version,
|
---|
| 107 | 'TextDomain' => $text_domain, 'DomainPath' => $domain_path
|
---|
| 108 | );
|
---|
| 109 | // if ( $markup || $translate )
|
---|
| 110 | // $plugin_data = _get_plugin_data_markup_translate($plugin_data, $markup, $translate);
|
---|
| 111 | return $plugin_data;
|
---|
| 112 | }
|
---|
| 113 |
|
---|
| 114 |
|
---|
| 115 | function get_xpress_active_plugin_list($before_str = '')
|
---|
| 116 | {
|
---|
| 117 | global $xoopsModule;
|
---|
| 118 | $xoopsDB =& Database::getInstance();
|
---|
| 119 |
|
---|
| 120 | $mydirname = basename(dirname(dirname(__FILE__)));
|
---|
| 121 | $my_dirpath = dirname(dirname(__FILE__));
|
---|
| 122 | $prefix = $mydirname;
|
---|
| 123 | if ($prefix == 'wordpress') $prefix ='wp';
|
---|
| 124 | $wp_prefix = $xoopsDB->prefix($prefix);
|
---|
| 125 |
|
---|
| 126 | $option_table = $wp_prefix . '_options';
|
---|
| 127 |
|
---|
| 128 | $sql = "SELECT option_value FROM $option_table WHERE option_name = 'active_plugins'";
|
---|
| 129 | $res = $xoopsDB->query($sql, 0, 0);
|
---|
| 130 | if ($res === false){
|
---|
| 131 | return ;
|
---|
| 132 | } else {
|
---|
| 133 | $row = $xoopsDB->fetchArray($res);
|
---|
| 134 | $active_plugins = @unserialize($row['option_value']);
|
---|
| 135 | $output = '';
|
---|
| 136 | foreach($active_plugins as $active_plugin_path){
|
---|
| 137 | $file_name = $my_dirpath . '/wp-content/plugins/' . $active_plugin_path;
|
---|
| 138 | $active_plugin = get_xpress_plugin_data($file_name);
|
---|
| 139 | $output .= $before_str . $active_plugin['Name'] . ': Version ' . $active_plugin['Version'] . ': (' .$active_plugin['PluginURI'] . ')<br />';
|
---|
| 140 | }
|
---|
| 141 |
|
---|
| 142 |
|
---|
| 143 | return $output;
|
---|
| 144 | }
|
---|
| 145 |
|
---|
| 146 |
|
---|
| 147 | }
|
---|
| 148 |
|
---|
| 149 | function xpress_active_plugin_list($is_report = false)
|
---|
| 150 | {
|
---|
| 151 | if ($is_report) {
|
---|
[183] | 152 | echo "******** " . _AM_XP2_PLUGIN . "********" . "<br />\n";
|
---|
[191] | 153 | echo get_xpress_active_plugin_list('') . "<br />\n";
|
---|
[160] | 154 | } else {
|
---|
[183] | 155 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_PLUGIN . "</legend>";
|
---|
[160] | 156 | echo "<div style='padding: 8px;'>";
|
---|
| 157 | echo get_xpress_active_plugin_list();
|
---|
| 158 | echo "</div>";
|
---|
[511] | 159 | echo '</legend>';
|
---|
| 160 | echo "</fieldset><br />";
|
---|
[160] | 161 | }
|
---|
| 162 | }
|
---|
| 163 |
|
---|
| 164 | function xpress_sys_info($is_report = false)
|
---|
| 165 | {
|
---|
| 166 | global $xoopsModule;
|
---|
| 167 | include(dirname(__FILE__) . '/../wp-includes/version.php');
|
---|
[491] | 168 | require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ;
|
---|
| 169 |
|
---|
[160] | 170 | if ($is_report) {
|
---|
[183] | 171 | echo "******** " . _AM_XP2_SYSTEM_INFO . "********" . "<br />\n";
|
---|
[191] | 172 | echo "SERVER: ". $_SERVER['SERVER_SOFTWARE']. "<br />\n";
|
---|
| 173 | echo "PHP Version: " . phpversion() . "<br />\n";
|
---|
[395] | 174 | echo 'libxml Version: ';
|
---|
| 175 | if (defined('LIBXML_DOTTED_VERSION')) echo LIBXML_DOTTED_VERSION ; else echo "Can't detect.";
|
---|
| 176 | echo "<br />\n";;
|
---|
[191] | 177 | echo "MySQL Version: " . mysql_get_server_info() . "</text><br />";
|
---|
| 178 | echo "XOOPS Version: " . XOOPS_VERSION . "</text><br />";
|
---|
| 179 | echo "XPressME Version: " . $xoopsModule->getInfo('version') . ' ' . $xoopsModule->getInfo('codename') . "<br />\n";
|
---|
| 180 | echo "WordPress Version: " . $wp_version . "<br />\n";
|
---|
| 181 | echo "WP DB Version: " . $wp_db_version . "<br />\n";
|
---|
[160] | 182 | echo "<br />\n";
|
---|
[191] | 183 | echo "safemode: " ;
|
---|
[160] | 184 | echo ( ini_get( 'safe_mode' ) ) ? "ON" : "OFF";
|
---|
| 185 | echo "<br />\n";
|
---|
[191] | 186 | echo "register_globals: " ;
|
---|
[160] | 187 | echo ( ini_get( 'register_globals' )) ? "ON" : "OFF" ;
|
---|
| 188 | echo "<br />\n";
|
---|
[191] | 189 | echo "magic_quotes_gpc: " ;
|
---|
[160] | 190 | echo ( ini_get( 'magic_quotes_gpc' )) ? "ON" : "OFF";
|
---|
| 191 | echo "<br />\n";
|
---|
[191] | 192 | echo "XML extension: " ;
|
---|
[160] | 193 | echo ( extension_loaded( 'xml' )) ? "ON" : "OFF";
|
---|
| 194 | echo "<br />\n";
|
---|
[491] | 195 | echo "default memory_limit: " ;
|
---|
[160] | 196 | echo ini_get( 'memory_limit' );
|
---|
| 197 | echo "<br />\n";
|
---|
[491] | 198 | $xoops_config = new ConfigFromXoops;
|
---|
| 199 | $xoops_config->xpress_set_memory_limmit();
|
---|
| 200 | echo "change memory_limit: " ;
|
---|
| 201 | echo ini_get( 'memory_limit' );
|
---|
| 202 | echo "<br />\n";
|
---|
| 203 |
|
---|
[191] | 204 | echo "post_max_size: " ;
|
---|
[160] | 205 | echo ini_get( 'post_max_size' );
|
---|
| 206 | echo "<br />\n";
|
---|
[191] | 207 | echo "upload_max_filesize: " ;
|
---|
[160] | 208 | echo ini_get( 'upload_max_filesize' );
|
---|
| 209 | echo "<br />\n";
|
---|
[191] | 210 | echo "display_errors: " ;
|
---|
[160] | 211 | echo ( ini_get( 'display_errors' )) ? "ON" : "OFF";
|
---|
| 212 | echo "<br />\n";
|
---|
[191] | 213 | echo "MB extension: " ;
|
---|
[160] | 214 | echo ( extension_loaded( 'mbstring' )) ? "ON" : "OFF";
|
---|
| 215 | echo "<br />\n";
|
---|
[191] | 216 | echo "mbstring.language: " ;
|
---|
[160] | 217 | echo ini_get( 'mbstring.language' );
|
---|
| 218 | echo "<br />\n";
|
---|
[191] | 219 | echo "mbstring.encoding_translation: " ;
|
---|
[160] | 220 | echo ( ini_get( 'mbstring.encoding_translation' )) ? "ON" : "OFF";
|
---|
| 221 | echo "<br />\n";
|
---|
[191] | 222 | echo "mbstring.internal_encoding: " ;
|
---|
[160] | 223 | echo ini_get( 'mbstring.internal_encoding' );
|
---|
| 224 | echo "<br />\n";
|
---|
[191] | 225 | echo "mbstring.http_input: " ;
|
---|
[160] | 226 | echo ini_get( 'mbstring.http_input' );
|
---|
| 227 | echo "<br />\n";
|
---|
[191] | 228 | echo "mbstring.http_output: " ;
|
---|
[160] | 229 | echo ini_get( 'mbstring.http_output' );
|
---|
| 230 | echo "<br />\n";
|
---|
[191] | 231 | echo "mbstring.detect_order: " ;
|
---|
[160] | 232 | echo ini_get( 'mbstring.detect_order' );
|
---|
| 233 | echo "<br />\n";
|
---|
[191] | 234 | echo "mbstring.substitute_character: " ;
|
---|
[160] | 235 | echo ini_get( 'mbstring.substitute_character' );
|
---|
| 236 | echo "<br />\n";
|
---|
[191] | 237 | echo "mbstring.func_overload: " ;
|
---|
[160] | 238 | echo ( ini_get( 'mbstring.func_overload' )) ? "ON" : "OFF";
|
---|
| 239 | echo "<br />\n";
|
---|
| 240 | echo "<br />\n";
|
---|
| 241 | } else {
|
---|
[183] | 242 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_SYSTEM_INFO . "</legend>";
|
---|
[160] | 243 | echo "<div style='padding: 8px;'>";
|
---|
| 244 | echo "<label>" . "<strong>SERVER:</strong>" . ":</label><text>" . $_SERVER['SERVER_SOFTWARE'] . "</text><br />";
|
---|
| 245 | echo "<label>" . "<strong>PHP Version:</strong>" . ":</label><text>" . phpversion() . "</text><br />";
|
---|
[395] | 246 | echo "<label>" . "<strong>libxml Version:</strong>" . ":</label><text>";
|
---|
| 247 | if (defined('LIBXML_DOTTED_VERSION')) echo LIBXML_DOTTED_VERSION ; else echo "Can't detect.";
|
---|
| 248 | echo "</text><br />";
|
---|
[160] | 249 | echo "<label>" . "<strong>MySQL Version:</strong>" . ":</label><text>" . mysql_get_server_info() . "</text><br />";
|
---|
| 250 | echo "<label>" . "<strong>XOOPS Version:</strong>" . ":</label><text>" . XOOPS_VERSION . "</text><br />";
|
---|
| 251 | echo "<label>" . "<strong>XPressME Version:</strong>" . ":</label><text>" . $xoopsModule->getInfo('version') . ' ' . $xoopsModule->getInfo('codename') . "</text><br />";
|
---|
| 252 | echo "<label>" . "<strong>WordPress Version:</strong>" . ":</label><text>" . $wp_version . "</text><br />";
|
---|
| 253 | echo "<label>" . "<strong>WP DB Version:</strong>" . ":</label><text>" . $wp_db_version . "</text><br />";
|
---|
| 254 |
|
---|
| 255 | echo "</div>";
|
---|
| 256 | echo "<div style='padding: 8px;'>";
|
---|
| 257 | echo "<label>safemode:</label><text>";
|
---|
| 258 | echo ( ini_get( 'safe_mode' ) ) ? "ON" : "OFF";
|
---|
| 259 | echo "</text><br />";
|
---|
| 260 | echo "<label>register_globals:</label><text>";
|
---|
| 261 | echo ( ini_get( 'register_globals' )) ? "ON" : "OFF";
|
---|
| 262 | echo "</text><br />";
|
---|
| 263 | echo "<label>magic_quotes_gpc:</label><text>";
|
---|
| 264 | echo ( ini_get( 'magic_quotes_gpc' )) ? "ON" : "OFF";
|
---|
| 265 | echo "</text><br />";
|
---|
| 266 | echo "<label>XML extension:</label><text>";
|
---|
| 267 | echo ( extension_loaded( 'xml' )) ? "ON" : "OFF";
|
---|
| 268 | echo "</text><br />";
|
---|
[491] | 269 | echo "<label>default memory_limit:</label><text>";
|
---|
[160] | 270 | echo ini_get( 'memory_limit' );
|
---|
| 271 | echo "</text><br />";
|
---|
[491] | 272 | $xoops_config = new ConfigFromXoops;
|
---|
| 273 | $xoops_config->xpress_set_memory_limmit();
|
---|
| 274 | echo "<label>change memory_limit:</label><text>";
|
---|
| 275 | echo ini_get( 'memory_limit' );
|
---|
| 276 | echo "</text><br />";
|
---|
| 277 |
|
---|
[160] | 278 | echo "<label>post_max_size:</label><text>";
|
---|
| 279 | echo ini_get( 'post_max_size' );
|
---|
| 280 | echo "</text><br />";
|
---|
| 281 | echo "<label>upload_max_filesize:</label><text>";
|
---|
| 282 | echo ini_get( 'upload_max_filesize' );
|
---|
| 283 | echo "</text><br />";
|
---|
| 284 | echo "<label>display_errors:</label><text>";
|
---|
| 285 | echo ( ini_get( 'display_errors' )) ? "ON" : "OFF";
|
---|
| 286 | echo "</text><br />";
|
---|
| 287 | echo "<label>MB extension:</label><text>";
|
---|
| 288 | echo ( extension_loaded( 'mbstring' )) ? "ON" : "OFF";
|
---|
| 289 | echo "</text><br />";
|
---|
| 290 | echo "<label>mbstring.language:</label><text>";
|
---|
| 291 | echo ini_get( 'mbstring.language' );
|
---|
| 292 | echo "</text><br />";
|
---|
| 293 | echo "<label>mbstring.encoding_translation:</label><text>";
|
---|
| 294 | echo ( ini_get( 'mbstring.encoding_translation' )) ? "ON" : "OFF";
|
---|
| 295 | echo "</text><br />";
|
---|
| 296 | echo "<label>mbstring.internal_encoding:</label><text>";
|
---|
| 297 | echo ini_get( 'mbstring.internal_encoding' );
|
---|
| 298 | echo "</text><br />";
|
---|
| 299 | echo "<label>mbstring.http_input:</label><text>";
|
---|
| 300 | echo ini_get( 'mbstring.http_input' );
|
---|
| 301 | echo "</text><br />";
|
---|
| 302 | echo "<label>mbstring.http_output:</label><text>";
|
---|
| 303 | echo ini_get( 'mbstring.http_output' );
|
---|
| 304 | echo "</text><br />";
|
---|
| 305 | echo "<label>mbstring.detect_order:</label><text>";
|
---|
| 306 | echo ini_get( 'mbstring.detect_order' );
|
---|
| 307 | echo "</text><br />";
|
---|
| 308 | echo "<label>mbstring.substitute_character:</label><text>";
|
---|
| 309 | echo ini_get( 'mbstring.substitute_character' );
|
---|
| 310 | echo "</text><br />";
|
---|
| 311 | echo "<label>mbstring.func_overload:</label><text>";
|
---|
| 312 | echo ( ini_get( 'mbstring.func_overload' )) ? "ON" : "OFF";
|
---|
| 313 | echo "</text><br />";
|
---|
| 314 | echo "</div>";
|
---|
[511] | 315 | echo '</legend>';
|
---|
[160] | 316 | echo "</fieldset><br />";
|
---|
| 317 | }
|
---|
| 318 | }
|
---|
| 319 |
|
---|
[507] | 320 |
|
---|
| 321 | function xpress_config_report_view()
|
---|
[160] | 322 | {
|
---|
| 323 | require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ;
|
---|
| 324 | $xoops_config = new ConfigFromXoops;
|
---|
[507] | 325 | echo 'XOOPS_ROOT_PATH: ' ;
|
---|
| 326 | if(XOOPS_ROOT_PATH !== $xoops_config->xoops_root_path)
|
---|
| 327 | echo 'ERROR ';
|
---|
| 328 | else
|
---|
| 329 | echo 'OK ';
|
---|
| 330 | echo "<br />\n";
|
---|
[160] | 331 |
|
---|
[507] | 332 | echo 'XOOPS_TRUST_PATH: ' ;
|
---|
| 333 | if(XOOPS_TRUST_PATH !== $xoops_config->xoops_trust_path)
|
---|
| 334 | echo 'ERROR ';
|
---|
| 335 | else
|
---|
| 336 | echo 'OK ';
|
---|
| 337 | echo "<br />\n";
|
---|
| 338 |
|
---|
| 339 | echo 'XOOPS_URL: ' ;
|
---|
| 340 | if(XOOPS_URL !== $xoops_config->xoops_url)
|
---|
| 341 | echo 'ERROR ';
|
---|
| 342 | else
|
---|
| 343 | echo 'OK ';
|
---|
| 344 | echo "<br />\n";
|
---|
| 345 |
|
---|
| 346 | if (defined('XOOPS_SALT')){
|
---|
| 347 | echo 'XOOPS_SALT: ' ;
|
---|
| 348 | if(XOOPS_SALT !== $xoops_config->xoops_salt)
|
---|
[160] | 349 | echo 'ERROR ';
|
---|
| 350 | else
|
---|
| 351 | echo 'OK ';
|
---|
| 352 | echo "<br />\n";
|
---|
[507] | 353 | }
|
---|
[160] | 354 |
|
---|
[507] | 355 | if (defined('XOOPS_DB_SALT')){
|
---|
| 356 | echo 'XOOPS_DB_SALT: ' ;
|
---|
| 357 | if(XOOPS_DB_SALT !== $xoops_config->xoops_db_salt)
|
---|
[160] | 358 | echo 'ERROR ';
|
---|
| 359 | else
|
---|
| 360 | echo 'OK ';
|
---|
| 361 | echo "<br />\n";
|
---|
[507] | 362 | }
|
---|
[160] | 363 |
|
---|
[507] | 364 | echo 'XOOPS_DB_HOST: ' ;
|
---|
| 365 | if(XOOPS_DB_HOST !== $xoops_config->xoops_db_host)
|
---|
| 366 | echo 'ERROR ';
|
---|
| 367 | else
|
---|
| 368 | echo 'OK ';
|
---|
| 369 | echo "<br />\n";
|
---|
[160] | 370 |
|
---|
[507] | 371 | echo 'XOOPS_DB_USER: ' ;
|
---|
| 372 | if(XOOPS_DB_USER !== $xoops_config->xoops_db_user)
|
---|
| 373 | echo 'ERROR ';
|
---|
| 374 | else
|
---|
| 375 | echo 'OK ';
|
---|
| 376 | echo "<br />\n";
|
---|
[160] | 377 |
|
---|
[507] | 378 | echo 'XOOPS_DB_PASS: ' ;
|
---|
| 379 | if(XOOPS_DB_PASS !== $xoops_config->xoops_db_pass)
|
---|
| 380 | echo 'ERROR ';
|
---|
| 381 | else
|
---|
| 382 | echo 'OK ';
|
---|
| 383 | echo "<br />\n";
|
---|
[160] | 384 |
|
---|
[507] | 385 | echo 'XOOPS_DB_NAME: ' ;
|
---|
| 386 | if(XOOPS_DB_NAME !== $xoops_config->xoops_db_name)
|
---|
| 387 | echo 'ERROR ';
|
---|
| 388 | else
|
---|
| 389 | echo 'OK ';
|
---|
| 390 | echo "<br />\n";
|
---|
[160] | 391 |
|
---|
[507] | 392 | echo 'XOOPS_DB_PREFIX: ' ;
|
---|
| 393 | if(XOOPS_DB_PREFIX !== $xoops_config->xoops_db_prefix)
|
---|
| 394 | echo 'ERROR ';
|
---|
| 395 | else
|
---|
| 396 | echo 'OK ';
|
---|
| 397 | echo "<br />\n";
|
---|
| 398 | }
|
---|
[160] | 399 |
|
---|
[507] | 400 | function xpress_config_nomal_view()
|
---|
| 401 | {
|
---|
| 402 | require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ;
|
---|
| 403 | $xoops_config = new ConfigFromXoops;
|
---|
| 404 |
|
---|
| 405 | echo '<table width="400" cellspacing="1" cellpadding="1" border="1">';
|
---|
| 406 | echo '<tbody>';
|
---|
| 407 | echo '<tr>';
|
---|
| 408 | echo '<td>Define item</td>';
|
---|
| 409 | echo '<td>XOOPS setting value</td>';
|
---|
| 410 | echo '<td>xoops_config get value</td>';
|
---|
| 411 | echo '</tr>';
|
---|
| 412 | echo '<tr>';
|
---|
| 413 | if(XOOPS_ROOT_PATH !== $xoops_config->xoops_root_path)
|
---|
| 414 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_ROOT_PATH</span></strong></td>';
|
---|
| 415 | else
|
---|
| 416 | echo '<td>XOOPS_ROOT_PATH</td>';
|
---|
| 417 | echo '<td>' . XOOPS_ROOT_PATH . '</td>';
|
---|
| 418 | echo '<td>' . $xoops_config->xoops_root_path . '</td>';
|
---|
| 419 | echo '</tr>';
|
---|
[160] | 420 |
|
---|
[507] | 421 | echo '<tr>';
|
---|
| 422 | if(XOOPS_TRUST_PATH !== $xoops_config->xoops_trust_path)
|
---|
| 423 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_TRUST_PATH</span></strong></td>';
|
---|
| 424 | else
|
---|
| 425 | echo '<td>XOOPS_TRUST_PATH</td>';
|
---|
| 426 | echo '<td>' . XOOPS_TRUST_PATH . '</td>';
|
---|
| 427 | echo '<td>' . $xoops_config->xoops_trust_path . '</td>';
|
---|
| 428 | echo '</tr>';
|
---|
[160] | 429 |
|
---|
[507] | 430 | echo '<tr>';
|
---|
| 431 | if(XOOPS_URL !== $xoops_config->xoops_url)
|
---|
| 432 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_URL</span></strong></td>';
|
---|
| 433 | else
|
---|
| 434 | echo '<td>XOOPS_URL</td>';
|
---|
| 435 | echo '<td>' . XOOPS_URL . '</td>';
|
---|
| 436 | echo '<td>' . $xoops_config->xoops_url . '</td>';
|
---|
| 437 | echo '</tr>';
|
---|
[160] | 438 |
|
---|
[507] | 439 | if (defined('XOOPS_SALT')){
|
---|
[160] | 440 | echo '<tr>';
|
---|
[507] | 441 | if(XOOPS_SALT !== $xoops_config->xoops_salt)
|
---|
| 442 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_SALT</span></strong></td>';
|
---|
[160] | 443 | else
|
---|
[507] | 444 | echo '<td>XOOPS_SALT</td>';
|
---|
| 445 | echo '<td>' . XOOPS_SALT . '</td>';
|
---|
| 446 | echo '<td>' . $xoops_config->xoops_salt . '</td>';
|
---|
[160] | 447 | echo '</tr>';
|
---|
[507] | 448 | }
|
---|
[160] | 449 |
|
---|
[507] | 450 | if (defined('XOOPS_DB_SALT')){
|
---|
[160] | 451 | echo '<tr>';
|
---|
[507] | 452 | if(XOOPS_DB_SALT !== $xoops_config->xoops_db_salt)
|
---|
| 453 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_SALT</span></strong></td>';
|
---|
[160] | 454 | else
|
---|
[507] | 455 | echo '<td>XOOPS_DB_SALT</td>';
|
---|
| 456 | echo '<td>' . XOOPS_DB_SALT . '</td>';
|
---|
| 457 | echo '<td>' . $xoops_config->xoops_db_salt . '</td>';
|
---|
[160] | 458 | echo '</tr>';
|
---|
[507] | 459 | }
|
---|
[160] | 460 |
|
---|
[507] | 461 | echo '<tr>';
|
---|
| 462 | if(XOOPS_DB_HOST !== $xoops_config->xoops_db_host)
|
---|
| 463 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_HOST</span></strong></td>';
|
---|
| 464 | else
|
---|
| 465 | echo '<td>XOOPS_DB_HOST</td>';
|
---|
| 466 | echo '<td>' . XOOPS_DB_HOST . '</td>';
|
---|
| 467 | echo '<td>' . $xoops_config->xoops_db_host . '</td>';
|
---|
| 468 | echo '</tr>';
|
---|
[160] | 469 |
|
---|
[507] | 470 | echo '<tr>';
|
---|
| 471 | if(XOOPS_DB_USER !== $xoops_config->xoops_db_user)
|
---|
| 472 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_USER</span></strong></td>';
|
---|
| 473 | else
|
---|
| 474 | echo '<td>XOOPS_DB_USER</td>';
|
---|
| 475 | echo '<td>' . XOOPS_DB_USER . '</td>';
|
---|
| 476 | echo '<td>' . $xoops_config->xoops_db_user . '</td>';
|
---|
| 477 | echo '</tr>';
|
---|
[160] | 478 |
|
---|
[507] | 479 | echo '<tr>';
|
---|
| 480 | if(XOOPS_DB_PASS !== $xoops_config->xoops_db_pass)
|
---|
| 481 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_PASS</span></strong></td>';
|
---|
| 482 | else
|
---|
| 483 | echo '<td>XOOPS_DB_PASS</td>';
|
---|
| 484 | echo '<td>' . XOOPS_DB_PASS . '</td>';
|
---|
| 485 | echo '<td>' . $xoops_config->xoops_db_pass . '</td>';
|
---|
| 486 | echo '</tr>';
|
---|
[160] | 487 |
|
---|
[507] | 488 | echo '<tr>';
|
---|
| 489 | if(XOOPS_DB_NAME !== $xoops_config->xoops_db_name)
|
---|
| 490 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_NAME</span></strong></td>';
|
---|
| 491 | else
|
---|
| 492 | echo '<td>XOOPS_DB_NAME</td>';
|
---|
| 493 | echo '<td>' . XOOPS_DB_NAME . '</td>';
|
---|
| 494 | echo '<td>' . $xoops_config->xoops_db_name . '</td>';
|
---|
| 495 | echo '</tr>';
|
---|
[160] | 496 |
|
---|
[507] | 497 | echo '<tr>';
|
---|
| 498 | if(XOOPS_DB_PREFIX !== $xoops_config->xoops_db_prefix)
|
---|
| 499 | echo '<td><strong><span style="color: rgb(255, 0, 0);">XOOPS_DB_PREFIX</span></strong></td>';
|
---|
| 500 | else
|
---|
| 501 | echo '<td>XOOPS_DB_PREFIX</td>';
|
---|
| 502 | echo '<td>' . XOOPS_DB_PREFIX . '</td>';
|
---|
| 503 | echo '<td>' . $xoops_config->xoops_db_prefix . '</td>';
|
---|
| 504 | echo '</tr>';
|
---|
| 505 | echo '</tbody>';
|
---|
| 506 | echo '</table>';
|
---|
| 507 | }
|
---|
| 508 | function xpress_config_from_xoops_view($is_report = false)
|
---|
| 509 | {
|
---|
[510] | 510 | global $xoopsUserIsAdmin,$xoopsUser;
|
---|
[160] | 511 |
|
---|
[510] | 512 | $user_groups = $xoopsUser->_groups;
|
---|
| 513 | $is_admin_group = in_array('1',$user_groups);
|
---|
| 514 |
|
---|
[507] | 515 | require_once dirname(dirname( __FILE__ )).'/class/config_from_xoops.class.php' ;
|
---|
| 516 | $xoops_config = new ConfigFromXoops;
|
---|
| 517 | if ($is_report) {
|
---|
| 518 | echo "******** " . _AM_XP2_XOOPS_CONFIG_INFO . "********" . "<br />\n";
|
---|
| 519 | xpress_config_report_view();
|
---|
| 520 | echo "<br />\n";
|
---|
| 521 | } else {
|
---|
| 522 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_XOOPS_CONFIG_INFO . "</legend>";
|
---|
| 523 | echo "<div style='padding: 8px;'>";
|
---|
[510] | 524 | if ($xoopsUserIsAdmin && $is_admin_group){
|
---|
[507] | 525 | xpress_config_nomal_view();
|
---|
| 526 | } else {
|
---|
| 527 | xpress_config_report_view();
|
---|
| 528 | }
|
---|
[160] | 529 | echo "</div>";
|
---|
[511] | 530 | echo '</legend>';
|
---|
[160] | 531 | echo "</fieldset><br />";
|
---|
| 532 | }
|
---|
| 533 | }
|
---|
| 534 |
|
---|
| 535 | function xpress_state($is_report = false)
|
---|
| 536 | {
|
---|
| 537 | global $xoopsModule;
|
---|
| 538 | include(dirname(__FILE__) . '/../wp-includes/version.php');
|
---|
[416] | 539 | include_once(dirname(__FILE__) . '/../include/general_functions.php');
|
---|
[160] | 540 |
|
---|
| 541 | $xoopsDB =& Database::getInstance();
|
---|
| 542 |
|
---|
| 543 | $xp_prefix = $GLOBALS['xoopsModule']->getInfo('dirname');
|
---|
| 544 | if ($xp_prefix == 'wordpress'){
|
---|
| 545 | $xp_prefix = 'wp';
|
---|
| 546 | }
|
---|
| 547 |
|
---|
| 548 | $prefix = $xoopsDB->prefix($xp_prefix . '_');
|
---|
[414] | 549 |
|
---|
| 550 | $posts_tables = get_table_list($prefix,'posts');
|
---|
| 551 | $blogname = array();
|
---|
| 552 | $count_article = array();
|
---|
| 553 | $count_author = array();
|
---|
| 554 | $count_category = array();
|
---|
| 555 | $array_index = 0;
|
---|
| 556 | foreach( $posts_tables as $posts_table){
|
---|
| 557 | $sql = "SELECT COUNT(DISTINCT post_author) AS count_author, COUNT(*) AS count_article FROM ". $posts_table . " WHERE post_type = 'post' AND (post_status = 'publish' OR post_status = 'private')";
|
---|
| 558 | $result = $xoopsDB->query($sql);
|
---|
| 559 | if($myrow = $xoopsDB->fetchArray($result)){
|
---|
| 560 | $count_article[$array_index] = $myrow["count_article"];
|
---|
| 561 | $count_author[$array_index] = $myrow["count_author"];
|
---|
| 562 | } else {
|
---|
| 563 | $count_article[$array_index] = 0;
|
---|
| 564 | $count_author[$array_index] = 0;
|
---|
| 565 | }
|
---|
| 566 | $mid_prefix = get_multi_mid_prefix($prefix,'posts' , $posts_table);
|
---|
| 567 |
|
---|
| 568 | $sql = "SELECT option_value AS blogname FROM ".$prefix. $mid_prefix . "options" . " WHERE option_name = 'blogname'";
|
---|
| 569 | $result = $xoopsDB->query($sql);
|
---|
| 570 | if($myrow = $xoopsDB->fetchArray($result)){
|
---|
| 571 | $blogname[$array_index] = $myrow["blogname"];
|
---|
| 572 | } else {
|
---|
| 573 | $blogname[$array_index] = 'none name';
|
---|
| 574 | }
|
---|
| 575 |
|
---|
| 576 | if ($wp_db_version < 6124){
|
---|
| 577 |
|
---|
| 578 | $sql = "SELECT COUNT(*) AS count_category FROM ".$prefix. $mid_prefix . "categories";
|
---|
| 579 | } else {
|
---|
| 580 | $sql = "SELECT COUNT(*) AS count_category FROM ".$prefix. $mid_prefix . "term_taxonomy" . " WHERE taxonomy = 'category'";
|
---|
| 581 | }
|
---|
| 582 | $result = $xoopsDB->query($sql);
|
---|
| 583 | if($myrow = $xoopsDB->fetchArray($result)){
|
---|
| 584 | $count_category[$array_index] = $myrow["count_category"];
|
---|
| 585 | } else {
|
---|
| 586 | $count_category[$array_index] = 0;
|
---|
| 587 | }
|
---|
| 588 | $array_index++;
|
---|
[160] | 589 | }
|
---|
[414] | 590 | for ($i = 0 ; $i < $array_index ; $i++){
|
---|
| 591 | if ($is_report){
|
---|
| 592 | echo "******** " . $blogname[$i] . _AM_XP2_STATS . "********" . "<br />\n";
|
---|
| 593 | echo _AM_XP2_CATEGORIES .": ".@$count_category[$i]. "<br />\n";
|
---|
| 594 | echo _AM_XP2_ARTICLES .": ". $count_article[$i]. "<br />\n";
|
---|
| 595 | echo _AM_XP2_AUTHORS .": ". $count_author[$i]. "<br />\n";
|
---|
| 596 |
|
---|
| 597 | } else {
|
---|
| 598 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . $blogname[$i] . _AM_XP2_STATS . "</legend>";
|
---|
| 599 | echo "<div style='padding: 8px;'>";
|
---|
| 600 | echo "<label>" . _AM_XP2_CATEGORIES .":</label><text>".@$count_category[$i];
|
---|
| 601 | echo "</text><br />";
|
---|
| 602 | echo "<label>" . _AM_XP2_ARTICLES .":</label><text>". $count_article[$i];
|
---|
| 603 | echo "</text><br />";
|
---|
| 604 | echo "<label>" . _AM_XP2_AUTHORS .":</label><text>". $count_author[$i];
|
---|
| 605 | echo "</text>";
|
---|
| 606 | echo "</div>";
|
---|
[511] | 607 | echo '</legend>';
|
---|
[414] | 608 | echo "</fieldset>";
|
---|
| 609 | }
|
---|
[160] | 610 | }
|
---|
| 611 | }
|
---|
[517] | 612 | function xpress_group_role_state($is_report = false)
|
---|
| 613 | {
|
---|
| 614 | global $xoopsModule;
|
---|
| 615 | $xoopsDB =& Database::getInstance();
|
---|
| 616 | $xp_prefix = $GLOBALS['xoopsModule']->getInfo('dirname');
|
---|
| 617 | if ($xp_prefix == 'wordpress'){
|
---|
| 618 | $xp_prefix = 'wp';
|
---|
| 619 | }
|
---|
| 620 | $prefix = $xoopsDB->prefix($xp_prefix . '_');
|
---|
| 621 | $group_role_tables = $prefix.'group_role';
|
---|
| 622 | $sql = "SELECT groupid , name AS xoops_groupe ,group_type, role , login_all FROM ". $group_role_tables;
|
---|
| 623 | $result = $xoopsDB->query($sql);
|
---|
| 624 | if ($is_report){
|
---|
| 625 | echo "******** " . _AM_XP2_GROUP_ROLE . "********" . "<br />\n";
|
---|
| 626 | } else {
|
---|
| 627 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_GROUP_ROLE . "</legend>";
|
---|
| 628 | echo "<div style='padding: 8px;'>";
|
---|
| 629 | echo '<table width="400" cellspacing="1" cellpadding="1" border="1">';
|
---|
| 630 | echo '<tbody>';
|
---|
| 631 | echo '<tr>';
|
---|
| 632 | echo '<td>GROUP</td>';
|
---|
| 633 | echo '<td>GROUPE TYPE</td>';
|
---|
| 634 | echo '<td>ROLE</td>';
|
---|
| 635 | echo '<td>Allways Check</td>';
|
---|
| 636 | echo '</tr>';
|
---|
| 637 | }
|
---|
| 638 | $groupe_list = '';
|
---|
| 639 | while ($myrow = $xoopsDB->fetchArray($result)){
|
---|
| 640 | $xoops_groupe = $myrow["xoops_groupe"] ;
|
---|
| 641 | $group_type = empty($myrow["group_type"]) ? "None" : $myrow["group_type"] ;
|
---|
| 642 | $role = empty($myrow["role"]) ? "inhibit register" : $myrow["role"] ;
|
---|
| 643 | $login_all = empty($myrow["login_all"]) ? 'No' : 'Yes' ;
|
---|
| 644 | if (!empty($groupe_list)) $groupe_list .= ',';
|
---|
| 645 | $groupe_list .= $myrow["groupid"];
|
---|
| 646 | if ($is_report){
|
---|
| 647 | echo $xoops_groupe . ' : ';
|
---|
| 648 | echo '(' . $group_type. ') : ';
|
---|
| 649 | echo $role;
|
---|
| 650 | echo '(' . $login_all. ') : ';
|
---|
| 651 | echo '<br />';
|
---|
| 652 | } else {
|
---|
| 653 | echo '<tr>';
|
---|
| 654 | echo '<td>' . $xoops_groupe . '</td>';
|
---|
| 655 | echo '<td>' . $group_type . '</td>';
|
---|
| 656 | echo '<td>' . $role . '</td>';
|
---|
| 657 | echo '<td>' . $login_all . '</td>';
|
---|
| 658 | echo '</tr>';
|
---|
| 659 | }
|
---|
| 660 | }
|
---|
| 661 | $group_tables = $xoopsDB->prefix('groups');
|
---|
| 662 | $where = ' WHERE groupid NOT IN (' . $groupe_list . ')';
|
---|
| 663 | $sql = "SELECT groupid , name AS xoops_groupe ,group_type FROM ". $group_tables . $where;
|
---|
| 664 | $result = $xoopsDB->query($sql);
|
---|
| 665 | while ($myrow = $xoopsDB->fetchArray($result)){
|
---|
| 666 | $xoops_groupe = $myrow["xoops_groupe"] ;
|
---|
| 667 | $group_type = empty($myrow["group_type"]) ? 'inhibit(None)' : 'inhibit(' .$myrow["group_type"].')' ;
|
---|
| 668 | $role = "No set";
|
---|
| 669 | $login_all = 'No Set';
|
---|
| 670 | if ($is_report){
|
---|
| 671 | echo $xoops_groupe . ' : ';
|
---|
| 672 | echo '[' . $group_type. '] : ';
|
---|
| 673 | echo $role;
|
---|
| 674 | echo '(' . $login_all. ') : ';
|
---|
| 675 | echo '<br />';
|
---|
| 676 | } else {
|
---|
| 677 | echo '<tr>';
|
---|
| 678 | echo '<td>' . $xoops_groupe . '</td>';
|
---|
| 679 | echo '<td>' . $group_type . '</td>';
|
---|
| 680 | echo '<td>' . $role . '</td>';
|
---|
| 681 | echo '<td>' . $login_all . '</td>';
|
---|
| 682 | echo '</tr>';
|
---|
| 683 | }
|
---|
| 684 | }
|
---|
| 685 | if ($is_report){
|
---|
| 686 | echo "<br />";
|
---|
| 687 | } else {
|
---|
| 688 | echo '</tbody>';
|
---|
| 689 | echo '</table>';
|
---|
| 690 | echo "</div>";
|
---|
| 691 | echo '</legend>';
|
---|
| 692 | echo "</fieldset><br />";
|
---|
| 693 | }
|
---|
| 694 | }
|
---|
[199] | 695 | function xpress_block_state($is_report = false)
|
---|
| 696 | {
|
---|
[491] | 697 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
| 698 |
|
---|
[199] | 699 | include_once(dirname(dirname(__FILE__) ). '/class/check_blocks_class.php');
|
---|
| 700 | $xoops_block_check =& xoops_block_check::getInstance();
|
---|
[491] | 701 | $xoops_block_check->check_blocks($mydirname);
|
---|
[199] | 702 | if ($is_report){
|
---|
| 703 | echo "******** " . _AM_XP2_BLOCK_STATS . "********" . "<br />\n";
|
---|
| 704 | echo $xoops_block_check->get_message();
|
---|
| 705 | echo "<br />\n";
|
---|
| 706 | echo "<br />\n";
|
---|
| 707 | } else {
|
---|
| 708 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_BLOCK_STATS . "</legend>";
|
---|
| 709 | echo "<div style='padding: 8px;'>";
|
---|
| 710 | echo $xoops_block_check->get_message();
|
---|
| 711 | echo "</div>";
|
---|
[511] | 712 | echo '</legend>';
|
---|
| 713 | echo "</fieldset><br />";
|
---|
[199] | 714 | }
|
---|
| 715 | }
|
---|
[511] | 716 |
|
---|
| 717 | function xpress_block_options($is_report = false)
|
---|
| 718 | {
|
---|
| 719 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
| 720 |
|
---|
| 721 | $module_objs = & get_module_objects($mydirname);
|
---|
| 722 | $module_obj = $module_objs[0];
|
---|
| 723 | $mod_id = $module_obj->getVar('mid', 'n');
|
---|
| 724 | $blocks = & get_block_object_orber_num_bymodule_id( $mod_id );
|
---|
| 725 | $infos =& $module_obj->getInfo('blocks');
|
---|
| 726 | if ($is_report){
|
---|
| 727 | echo "******** " . _AM_XP2_BLOCK_OPTIONS . "********" . "<br />\n";
|
---|
| 728 | foreach ( $blocks as $block )
|
---|
| 729 | {
|
---|
| 730 | echo $block->getVar('title') . ' : ' . $block->getVar('options') . '<br />';
|
---|
| 731 | }
|
---|
| 732 | echo "<br />\n";
|
---|
| 733 | } else {
|
---|
| 734 | echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _AM_XP2_BLOCK_OPTIONS . "</legend>";
|
---|
| 735 | echo "<div style='padding: 8px;'>";
|
---|
| 736 | echo '<table width="400" cellspacing="1" cellpadding="1" border="1">';
|
---|
| 737 | echo '<tbody>';
|
---|
| 738 | echo '<tr>';
|
---|
| 739 | echo '<td>Title</td>';
|
---|
| 740 | echo '<td>Options</td>';
|
---|
| 741 | echo '</tr>';
|
---|
| 742 | foreach ( $blocks as $block )
|
---|
| 743 | {
|
---|
| 744 | echo '<tr>';
|
---|
| 745 | echo '<td>' . $block->getVar('title') . '</td>';
|
---|
| 746 | echo '<td>' . $block->getVar('options') . '</td>';
|
---|
| 747 | echo '</tr>';
|
---|
| 748 | }
|
---|
| 749 | echo '</tbody>';
|
---|
| 750 | echo '</table>';
|
---|
| 751 | echo '</div>';
|
---|
| 752 | echo '</legend>';
|
---|
| 753 | echo "</fieldset><br />";
|
---|
| 754 | }
|
---|
| 755 |
|
---|
| 756 | }
|
---|
| 757 | //--------------------------------------------------------
|
---|
| 758 | // module handler
|
---|
| 759 | //--------------------------------------------------------
|
---|
| 760 | function &get_module_objects($module_dir)
|
---|
| 761 | {
|
---|
| 762 | $criteria = new CriteriaCompo();
|
---|
| 763 | $criteria->add( new Criteria('isactive', '1', '=') );
|
---|
| 764 | $criteria->add( new Criteria('dirname', $module_dir, '=') );
|
---|
| 765 |
|
---|
| 766 | $module_handler =& xoops_gethandler('module');
|
---|
| 767 | $objs =& $module_handler->getObjects( $criteria );
|
---|
| 768 | return $objs;
|
---|
| 769 | }
|
---|
| 770 |
|
---|
| 771 | //--------------------------------------------------------
|
---|
| 772 | // block handler
|
---|
| 773 | //--------------------------------------------------------
|
---|
| 774 | function &get_block_object_orber_num_bymodule_id( $mid )
|
---|
| 775 | {
|
---|
| 776 | $arr = array();
|
---|
| 777 | $objs =& get_block_object_bymodule_id( $mid );
|
---|
| 778 | foreach ( $objs as $obj )
|
---|
| 779 | {
|
---|
| 780 | $arr[ $obj->getVar('func_num', 'n') ] = $obj;
|
---|
| 781 | }
|
---|
| 782 | return $arr;
|
---|
| 783 | }
|
---|
| 784 |
|
---|
| 785 | function &get_block_object_bymodule_id( $mid, $asobject=true )
|
---|
| 786 | {
|
---|
| 787 | if ( defined('ICMS_VERSION_BUILD') && ICMS_VERSION_BUILD > 27 ) { /* ImpressCMS 1.2+ */
|
---|
| 788 | $block_handler =& xoops_gethandler ('block');
|
---|
| 789 | $objs =& $block_handler->getByModule( $mid, $asobject );
|
---|
| 790 | } else { /* legacy support */
|
---|
| 791 | $objs =& XoopsBlock::getByModule( $mid, $asobject ) ; /* from class/xoopsblock.php */
|
---|
| 792 | }
|
---|
| 793 | return $objs;
|
---|
| 794 | }
|
---|
| 795 |
|
---|
| 796 |
|
---|
| 797 |
|
---|
[299] | 798 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
| 799 | $mydirpath = dirname( dirname( __FILE__ ) ) ;
|
---|
[308] | 800 | //require_once($mydirpath.'/wp-config.php');
|
---|
[199] | 801 |
|
---|
[170] | 802 | require_once '../../../include/cp_header.php' ;
|
---|
| 803 | //require_once '../include/gtickets.php' ;
|
---|
[308] | 804 | //define( '_MYMENU_CONSTANT_IN_MODINFO' , '_MI_XP2_NAME' ) ;
|
---|
[160] | 805 |
|
---|
[170] | 806 | // branch for altsys
|
---|
| 807 | if( defined( 'XOOPS_TRUST_PATH' ) && ! empty( $_GET['lib'] ) ) {
|
---|
| 808 |
|
---|
| 809 | // common libs (eg. altsys)
|
---|
| 810 | $lib = preg_replace( '/[^a-zA-Z0-9_-]/' , '' , $_GET['lib'] ) ;
|
---|
| 811 | $page = preg_replace( '/[^a-zA-Z0-9_-]/' , '' , @$_GET['page'] ) ;
|
---|
| 812 |
|
---|
| 813 | if( file_exists( XOOPS_TRUST_PATH.'/libs/'.$lib.'/'.$page.'.php' ) ) {
|
---|
| 814 | include XOOPS_TRUST_PATH.'/libs/'.$lib.'/'.$page.'.php' ;
|
---|
| 815 | } else if( file_exists( XOOPS_TRUST_PATH.'/libs/'.$lib.'/index.php' ) ) {
|
---|
| 816 | include XOOPS_TRUST_PATH.'/libs/'.$lib.'/index.php' ;
|
---|
| 817 | } else {
|
---|
| 818 | die( 'wrong request' ) ;
|
---|
| 819 | }
|
---|
| 820 | exit ;
|
---|
| 821 | }
|
---|
| 822 |
|
---|
[308] | 823 | // beggining of Output
|
---|
[61] | 824 | xoops_cp_header();
|
---|
[170] | 825 | include( './mymenu.php' ) ;
|
---|
[308] | 826 |
|
---|
[107] | 827 | echo "
|
---|
| 828 | <style type=\"text/css\">
|
---|
| 829 | label,text {
|
---|
| 830 | display: block;
|
---|
| 831 | float: left;
|
---|
| 832 | margin-bottom: 2px;
|
---|
| 833 | }
|
---|
| 834 | label {
|
---|
| 835 | text-align: right;
|
---|
| 836 | width: 200px;
|
---|
| 837 | padding-right: 20px;
|
---|
| 838 | }
|
---|
| 839 | br {
|
---|
| 840 | clear: left;
|
---|
| 841 | }
|
---|
| 842 | </style>
|
---|
| 843 | ";
|
---|
| 844 |
|
---|
[160] | 845 | if (!empty($_POST['submit_report'])) $report = true; else $report = false;
|
---|
| 846 | xpress_sys_info($report);
|
---|
| 847 | xpress_config_from_xoops_view($report);
|
---|
| 848 | xpress_active_plugin_list($report);
|
---|
[199] | 849 | xpress_block_state($report);
|
---|
[511] | 850 | xpress_block_options($report);
|
---|
[517] | 851 | xpress_group_role_state($report);
|
---|
[200] | 852 | admin_check_user_meta_prefix($report);
|
---|
[160] | 853 | xpress_state($report);
|
---|
| 854 | echo '<form method="POST">'."\n";
|
---|
[183] | 855 | echo '<input type="submit" name="submit_report" value="' . _AM_XP2_SYS_REPORT .' " />'.' ';
|
---|
| 856 | echo '<input type="submit" name="submit_normal" value="' . _AM_XP2_SYS_NORMAL .' " />'."<br />\n";
|
---|
[160] | 857 | echo "</form>\n";
|
---|
[107] | 858 |
|
---|
[160] | 859 | xoops_cp_footer();
|
---|
[107] | 860 |
|
---|
[61] | 861 |
|
---|
| 862 | ?> |
---|