D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
blackhat.pw
:
/
homepages
/
oneclick
/
MediaWiki
/
1.22.3
/
2
/
scripts
/
Filename :
custom.php
back
Copy
<?php function aps_set_current_locale() { global $argv, $psa_modify_hash, $settings_enum_modify_hash; if($argv[1] != "install") { if ( !isset($settings_enum_modify_hash['@@LOCALE@@']) || !$settings_enum_modify_hash['@@LOCALE@@']){ $config_content = read_file($psa_modify_hash['@@ROOT_DIR@@'].'/LocalSettings.php'); if (preg_match('/wgLanguageCode.*=.*"(.*)"/', $config_content, $matches)) { $settings_enum_modify_hash['@@LOCALE@@']= $matches[1]; } } } } function aps_set_degault_logo() { global $psa_modify_hash, $settings_modify_hash; if($settings_modify_hash['@@LOGO_URL@@']=='default-logo') { if($psa_modify_hash['@@BASE_URL_PATH@@'] && $psa_modify_hash['@@BASE_URL_PATH@@'] != '/'){ $settings_modify_hash['@@LOGO_URL@@'] = '/'.$psa_modify_hash['@@BASE_URL_PATH@@'].'/skins/common/images/wiki.png'; } else{ $settings_modify_hash['@@LOGO_URL@@'] = '/skins/common/images/wiki.png'; } } } function aps_removeBaseUrlPathBar() { global $psa_modify_hash; //When app is intalled in safe mode, the base_url_path is / but in trial mode, base_url_path has / at the beginning, and we have to remove that / if($psa_modify_hash['@@BASE_URL_PATH@@']){ if( $psa_modify_hash['@@BASE_URL_PATH@@'] != '/' && $psa_modify_hash['@@BASE_URL_PATH@@'][0] == '/' ){ $psa_modify_hash['@@BASE_URL_PATH@@'] = substr($psa_modify_hash['@@BASE_URL_PATH@@'] , 1); } } } function aps_getRandomString($length=8) { $source = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; if($length>0){ $rstr = ""; $source = str_split($source,1); for($i=1; $i<=$length; $i++){ mt_srand((double)microtime() * 1000000); $num = mt_rand(1,count($source)); $rstr .= $source[$num-1]; } } return $rstr; } function aps_delete_phpini_files($path){ if (is_dir($path) ) { $dh = opendir($path); while (($file = readdir($dh)) !== false) { if($file != '.' && $file != '..') { $fullpath = $path.'/'.$file; if (is_dir($fullpath) ) { aps_delete_phpini_files($fullpath); } else{ if($file=='php.ini'){ unlink($path.'/'.$file); } } } } closedir($dh); } } ?>