📄 admin.config.php
字号:
if (!strcasecmp(substr($file,-4),".php") && $file <> "." && $file <> ".." && strcasecmp(substr($file,-11),".ignore.php") && strcasecmp(substr($file,0,6),"admin_")){ $langs[] = mosHTML::makeOption( substr($file,0,-4) ); } if (!strcasecmp(substr($file,0,6),"admin_")) { $alangs[] = mosHTML::makeOption( substr(substr($file,6),0,-4) ); } } } // sort list of languages sort($langs); reset($langs); sort($alangs); reset($alangs); // compile list of the editors $query = "SELECT id AS value, name AS text" . "\n FROM #__mambots" . "\n WHERE folder='editors' AND published >= 0" . "\n ORDER BY ordering, name" ; $database->setQuery( $query ); $edits = $database->loadObjectList(); $query = "SELECT id" . "\n FROM #__mambots" . "\n WHERE folder='editors' AND published = 1" . "\n LIMIT 1" ; $database->setQuery( $query ); $editor = $database->loadResult(); $lists = array(); // build the html select list $lists['editor'] = mosHTML::selectList( $edits, 'editor', 'class="inputbox" size="1"', 'value', 'text', $editor ); // build the html select list $lists['lang'] = mosHTML::selectList( $langs, 'config_lang', 'class="inputbox" size="1"', 'value', 'text', $row->config_lang ); //adminLanguage select language $lists['alang'] = mosHTML::selectList( $alangs, 'config_alang', 'class="inputbox" size="1"', 'value', 'text', $row->config_alang ); // make a generic -24 - 24 list for ($i=-24;$i<=24;$i++) { $timeoffset[] = mosHTML::makeOption( $i, $i ); } // get list of menuitems $query = "SELECT id AS value, name AS text FROM #__menu" . "\n WHERE (type='content_section' OR type='components' OR type='content_typed')" . "\n AND published=1" . "\n AND access=0" . "\n ORDER BY name" ; $database->setQuery( $query ); $menuitems = array_merge( $menuitems, $database->loadObjectList() ); $show_hide = array( mosHTML::makeOption( 1, $adminLanguage->A_COMP_CONF_HIDE ), mosHTML::makeOption( 0, $adminLanguage->A_COMP_CONF_SHOW ), ); $show_hide_r = array( mosHTML::makeOption( 0, $adminLanguage->A_COMP_CONF_HIDE ), mosHTML::makeOption( 1, $adminLanguage->A_COMP_CONF_SHOW ), ); $list_length = array( mosHTML::makeOption( 5, 5 ), mosHTML::makeOption( 10, 10 ), mosHTML::makeOption( 15, 15 ), mosHTML::makeOption( 20, 20 ), mosHTML::makeOption( 25, 25 ), mosHTML::makeOption( 30, 30 ), mosHTML::makeOption( 50, 50 ), ); $errors = array( mosHTML::makeOption( -1, $adminLanguage->A_COMP_CONF_DEFAULT ), mosHTML::makeOption( 0, $adminLanguage->A_COMP_NONE ), mosHTML::makeOption( E_ERROR|E_WARNING|E_PARSE, $adminLanguage->A_COMP_CONF_SIMPLE ), mosHTML::makeOption( E_ALL , $adminLanguage->A_COMP_CONF_MAX ) ); $mailer = array( mosHTML::makeOption( 'mail', $adminLanguage->A_COMP_CONF_MAIL_FC, true ), mosHTML::makeOption( 'sendmail', $adminLanguage->A_COMP_CONF_SEND, true ), mosHTML::makeOption( 'smtp', $adminLanguage->A_COMP_CONF_SMTP, true ) ); // build the html select lists $lists['offline'] = mosHTML::yesnoRadioList( 'config_offline', 'class="inputbox"', $row->config_offline ); $lists['auth'] = mosHTML::yesnoRadioList( 'config_auth', 'class="inputbox"', $row->config_auth ); $lists['metaauthor'] = mosHTML::yesnoRadioList( 'config_metaauthor', 'class="inputbox"', $row->config_metaauthor ); $lists['metatitle'] = mosHTML::yesnoRadioList( 'config_metatitle', 'class="inputbox"', $row->config_metatitle ); $lists['useractivation'] = mosHTML::yesnoRadioList( 'config_useractivation', 'class="inputbox"', $row->config_useractivation ); $lists['uniquemail'] = mosHTML::yesnoRadioList( 'config_uniquemail', 'class="inputbox"', $row->config_uniquemail ); $lists['allowuserregistration'] = mosHTML::yesnoRadioList( 'config_allowUserRegistration', 'class="inputbox"', $row->config_allowUserRegistration ); $lists['debug'] = mosHTML::yesnoRadioList( 'config_debug', 'class="inputbox"', $row->config_debug ); $lists['offset'] = mosHTML::selectList( $timeoffset, 'config_offset', 'class="inputbox" size="1"', 'value', 'text', $row->config_offset ); $lists['hideauthor'] = mosHTML::RadioList( $show_hide, 'config_hideauthor', 'class="inputbox"', $row->config_hideauthor, 'value', 'text' ); $lists['hidecreate'] = mosHTML::RadioList( $show_hide, 'config_hidecreate', 'class="inputbox"', $row->config_hidecreate, 'value', 'text' ); $lists['hidemodify'] = mosHTML::RadioList( $show_hide, 'config_hidemodify', 'class="inputbox"', $row->config_hidemodify, 'value', 'text' ); if (is_writable( "$mosConfig_absolute_path/media/" )) { $lists['hidepdf'] = mosHTML::RadioList( $show_hide, 'config_hidepdf', 'class="inputbox"', $row->config_hidepdf, 'value', 'text' ); } else { $lists['hidepdf'] = '<input type="hidden" name="config_hidepdf" value="1" /><strong>Yes</strong>'; } $lists['hideprint'] = mosHTML::RadioList( $show_hide, 'config_hideprint', 'class="inputbox"', $row->config_hideprint, 'value', 'text' ); $lists['hideemail'] = mosHTML::RadioList( $show_hide, 'config_hideemail', 'class="inputbox"', $row->config_hideemail, 'value', 'text' ); $lists['log_items'] = mosHTML::yesnoRadioList( 'config_enable_log_items', 'class="inputbox"', $row->config_enable_log_items ); $lists['log_searches'] = mosHTML::yesnoRadioList( 'config_enable_log_searches', 'class="inputbox"', $row->config_enable_log_searches ); $lists['enable_stats'] = mosHTML::yesnoRadioList( 'config_enable_stats', 'class="inputbox"', $row->config_enable_stats ); $lists['sef'] = mosHTML::yesnoRadioList( 'config_sef', 'class="inputbox" onclick="javascript: if (document.adminForm.config_sef[1].checked) { alert(\'Remember to rename htaccess.txt to .htaccess\') }"', $row->config_sef ); $lists['vote'] = mosHTML::RadioList( $show_hide_r, 'config_vote', 'class="inputbox"', $row->config_vote, 'value', 'text' ); $lists['gzip'] = mosHTML::yesnoRadioList( 'config_gzip', 'class="inputbox"', $row->config_gzip ); $lists['multipage_toc'] = mosHTML::RadioList( $show_hide_r, 'config_multipage_toc', 'class="inputbox"', $row->config_multipage_toc, 'value', 'text' ); $lists['pagetitles'] = mosHTML::yesnoRadioList( 'config_pagetitles', 'class="inputbox"', $row->config_pagetitles ); $lists['error_reporting'] = mosHTML::selectList( $errors, 'config_error_reporting', 'class="inputbox" size="1"', 'value', 'text', $row->config_error_reporting ); $lists['link_titles'] = mosHTML::yesnoRadioList( 'config_link_titles', 'class="inputbox"', $row->config_link_titles ); $lists['caching'] = mosHTML::yesnoRadioList( 'config_caching', 'class="inputbox"', $row->config_caching ); $lists['mailer'] = mosHTML::selectList( $mailer, 'config_mailer', 'class="inputbox" size="1"', 'value', 'text', $row->config_mailer ); $lists['smtpauth'] = mosHTML::yesnoRadioList( 'config_smtpauth', 'class="inputbox"', $row->config_smtpauth ); $lists['list_length'] = mosHTML::selectList( $list_length, 'config_list_limit', 'class="inputbox" size="1"', 'value', 'text', ( $row->config_list_limit ? $row->config_list_limit : 50 ) ); $lists['back_button'] = mosHTML::RadioList( $show_hide_r, 'config_back_button', 'class="inputbox"', $row->config_back_button, 'value', 'text' ); $lists['item_navigation'] = mosHTML::RadioList( $show_hide_r, 'config_item_navigation', 'class="inputbox"', $row->config_item_navigation, 'value', 'text' ); $lists['ml_support'] = mosHTML::yesnoRadioList( 'config_ml_support', 'class="inputbox" onclick="javascript: if (document.adminForm.config_ml_support[1].checked) { alert(\'Remember to install the MambelFish component.\') }"', $row->config_ml_support ); $lists['readmore'] = mosHTML::RadioList( $show_hide_r, 'config_readmore', 'class="inputbox"', $row->config_readmore, 'value', 'text' ); $lists['hits'] = mosHTML::RadioList( $show_hide_r, 'config_hits', 'class="inputbox"', $row->config_hits, 'value', 'text' ); $lists['icons'] = mosHTML::RadioList( $show_hide_r, 'config_icons', 'class="inputbox"', $row->config_icons, 'value', 'text' );// $lists['favicon'] = mosHTML::RadioList( $show_hide_r, 'config_icons', 'class="inputbox"', $row->config_icons, 'value', 'text' ); $confightml->showconfig( $row, $lists, $option );}function saveconfig( $task ) { global $database, $mosConfig_absolute_path, $adminLanguage; $row = new mosConfig(); if (!$row->bind( $_POST )) { mosRedirect( "index2.php", $row->getError() ); } $editor = intval( mosGetParam( $_POST, 'editor', 0 ) ); if ($editor > 0) { $query = "UPDATE #__mambots" . "\n SET published = 0" . "\n WHERE published >= 0 AND folder='editors'" ; $database->setQuery( $query ); $database->query() or die( $database->getErrorMsg() ); $query = "UPDATE #__mambots" . "\n SET published = 1" . "\n WHERE id = $editor" ; $database->setQuery( $query ); $database->query() or die( $database->getErrorMsg() ); } $config = "<?php \n"; $config .= $row->getVarText(); $config .= "setlocale (LC_TIME, \$mosConfig_locale);\n"; $config .= '?>'; $fname = '../configuration.php'; $enable_write = mosGetParam($_POST,'enable_write',0); $oldperms = fileperms($fname); if ($enable_write) @chmod($fname, $oldperms | 0222); if ( $fp = fopen($fname, 'w') ) { fputs($fp, $config, strlen($config)); fclose($fp); if ($enable_write) { @chmod($fname, $oldperms); } else { if (mosGetParam($_POST,'disable_write',0)) @chmod($fname, $oldperms & 0777555); } // if $msg = $adminLanguage->A_COMP_CONF_UPDATED; // apply file and directory permissions if requested by user $applyFilePerms = mosGetParam($_POST,'applyFilePerms',0) && $row->config_fileperms!=''; $applyDirPerms = mosGetParam($_POST,'applyDirPerms',0) && $row->config_dirperms!=''; if ($applyFilePerms || $applyDirPerms) { $mosrootfiles = array( 'administrator', 'cache', 'components', 'editor', 'help', 'images', 'includes', 'installation', 'language', 'mambots', 'media', 'modules', 'templates', 'CHANGELOG', 'configuration.php-dist', 'configuration.php', 'globals.php', 'htaccess.txt', 'index.php', 'index2.php', 'INSTALL', 'LICENSE', 'mainbody.php', 'offline.php', 'pathway.php', 'robots.txt' ); $filemode = NULL; if ($applyFilePerms) $filemode = octdec($row->config_fileperms); $dirmode = NULL; if ($applyDirPerms) $dirmode = octdec($row->config_dirperms); foreach ($mosrootfiles as $file) mosChmodRecursive($mosConfig_absolute_path.'/'.$file, $filemode, $dirmode); } // if switch ( $task ) { case 'apply': mosRedirect( 'index2.php?option=com_config&hidemainmenu=1', $msg ); break; case 'save': default: mosRedirect( 'index2.php', $msg ); break; } } else { if ($enable_write) @chmod($fname, $oldperms); mosRedirect( 'index2.php', $adminLanguage->A_COMP_CONF_ERR_OCC ); }}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -