本文整理汇总了PHP中apache_mod_loaded函数的典型用法代码示例。如果您正苦于以下问题:PHP apache_mod_loaded函数的具体用法?PHP apache_mod_loaded怎么用?PHP apache_mod_loaded使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了apache_mod_loaded函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: got_mod_rewrite
/**
* Returns whether the server is running Apache with the mod_rewrite module loaded.
*
* @since 2.0.0
*
* @return bool
*/
function got_mod_rewrite()
{
$got_rewrite = apache_mod_loaded('mod_rewrite', true);
/**
* Filter whether Apache and mod_rewrite are present.
*
* This filter was previously used to force URL rewriting for other servers,
* like nginx. Use the got_url_rewrite filter in got_url_rewrite() instead.
*
* @see got_url_rewrite()
*
* @since 2.5.0
* @param bool $got_rewrite Whether Apache and mod_rewrite are present.
*/
return apply_filters('got_rewrite', $got_rewrite);
}
示例2: bogo_post_rewrite_rules
function bogo_post_rewrite_rules($post_rewrite)
{
global $wp_rewrite;
$permastruct = $wp_rewrite->permalink_structure;
// from wp-admin/includes/misc.php
$got_rewrite = apply_filters('got_rewrite', apache_mod_loaded('mod_rewrite', true));
$got_url_rewrite = apply_filters('got_url_rewrite', $got_rewrite || $GLOBALS['is_nginx'] || iis7_supports_permalinks());
if (!$got_url_rewrite) {
$permastruct = preg_replace('#^/index\\.php#', '/index.php/%lang%', $permastruct);
} elseif (is_multisite() && !is_subdomain_install() && is_main_site()) {
$permastruct = preg_replace('#^/blog#', '/%lang%/blog', $permastruct);
} else {
$permastruct = preg_replace('#^/#', '/%lang%/', $permastruct);
}
$extra = bogo_generate_rewrite_rules($permastruct, array('ep_mask' => EP_PERMALINK, 'paged' => false));
return array_merge($extra, $post_rewrite);
}
示例3: gp_set_htaccess
/**
* Sets the mod_rewrite rules
*
* @return bool Returns true on success and false on failure
*/
function gp_set_htaccess($path)
{
// The server doesn't support mod rewrite
if (!apache_mod_loaded('mod_rewrite', true)) {
//return false;
}
if (file_exists('.htaccess') && !is_writeable('.htaccess')) {
return false;
}
// check if the .htaccess is in place or try to write it
$htaccess_file = @fopen('.htaccess', 'c+');
//error opening htaccess, inform user!
if (false === $htaccess_file) {
return false;
}
//'# BEGIN GlotPress' not found, write the access rules
if (false === strpos(stream_get_contents($htaccess_file), '# BEGIN GlotPress')) {
fwrite($htaccess_file, gp_mod_rewrite_rules($path));
}
fclose($htaccess_file);
return true;
}
示例4: anno_media_upload_form
function anno_media_upload_form()
{
if (!anno_current_user_can_edit()) {
echo '<div style="text-align:center;">' . _x('You do not have proper permissions to upload a new image', 'Permissions warning for image uplaod', 'anno') . '</div>';
return;
}
global $type, $tab, $pagenow;
$flash_action_url = admin_url('async-upload.php');
// If Mac and mod_security, no Flash. :(
$flash = true;
if (false !== stripos($_SERVER['HTTP_USER_AGENT'], 'mac') && apache_mod_loaded('mod_security')) {
$flash = false;
}
$flash = apply_filters('flash_uploader', $flash);
$post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0;
$upload_size_unit = $max_upload_size = wp_max_upload_size();
$sizes = array('KB', 'MB', 'GB');
for ($u = -1; $upload_size_unit > 1024 && $u < count($sizes) - 1; $u++) {
$upload_size_unit /= 1024;
}
if ($u < 0) {
$upload_size_unit = 0;
$u = 0;
} else {
$upload_size_unit = (int) $upload_size_unit;
}
?>
<script type="text/javascript">
//<![CDATA[
var uploaderMode = 0;
jQuery(document).ready(function($){
uploaderMode = getUserSetting('uploader');
$('.upload-html-bypass a').click(function(){deleteUserSetting('uploader');uploaderMode=0;swfuploadPreLoad();return false;});
$('.upload-flash-bypass a').click(function(){setUserSetting('uploader', '1');uploaderMode=1;swfuploadPreLoad();return false;});
});
//]]>
</script>
<div id="media-upload-notice">
<?php
if (isset($errors['upload_notice'])) {
?>
<?php
echo $errors['upload_notice'];
?>
<?php
}
?>
</div>
<div id="media-upload-error">
<?php
if (isset($errors['upload_error']) && is_wp_error($errors['upload_error'])) {
?>
<?php
echo $errors['upload_error']->get_error_message();
?>
<?php
}
?>
</div>
<?php
// Check quota for this blog if multisite
if (is_multisite() && !is_upload_space_available()) {
echo '<p>' . sprintf(_x('Sorry, you have filled your storage quota (%s MB).', 'Media upload error text', 'anno'), get_space_allowed()) . '</p>';
return;
}
do_action('pre-upload-ui');
if ($flash) {
// Set the post params, which SWFUpload will post back with the file, and pass
// them through a filter.
$post_params = array('post_id' => anno_get_post_id(), 'auth_cookie' => is_ssl() ? $_COOKIE[SECURE_AUTH_COOKIE] : $_COOKIE[AUTH_COOKIE], 'logged_in_cookie' => $_COOKIE[LOGGED_IN_COOKIE], '_wpnonce' => wp_create_nonce('media-form'), 'type' => $type, 'tab' => $tab, 'short' => '1', 'action' => 'tinymce_upload');
$post_params = apply_filters('swfupload_post_params', $post_params);
$p = array();
foreach ($post_params as $param => $val) {
$p[] = "\t\t'{$param}' : '{$val}'";
}
$post_params_str = implode(", \n", $p);
// #8545. wmode=transparent cannot be used with SWFUpload
if ('media-new.php' == $pagenow) {
$upload_image_path = get_user_option('admin_color');
if ('classic' != $upload_image_path) {
$upload_image_path = 'fresh';
}
$upload_image_path = admin_url('images/upload-' . $upload_image_path . '.png?ver=20101205');
} else {
$upload_image_path = includes_url('images/upload.png?ver=20100531');
}
?>
<script type="text/javascript">
//<![CDATA[
var swfu;
SWFUpload.onload = function() {
var settings = {
button_text: '<span class="button"><?php
_ex('Select Files', 'Media upload text', 'anno');
?>
<\/span>',
button_text_style: '.button { text-align: center; font-weight: bold; font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif; font-size: 11px; text-shadow: 0 1px 0 #FFFFFF; color:#464646;}',
button_height: "23",
button_width: "132",
button_text_top_padding: 3,
//.........这里部分代码省略.........
示例5: do_action
?>
</div>
</div>
<div class="clear"> </div>
</div> <!-- #poststuff -->
</form>
</div>
<?php
do_action('shopp_product_editor_templates');
?>
<script type="text/javascript">
/* <![CDATA[ */
jQuery('.hide-if-no-js').removeClass('hide-if-no-js');
var flashuploader = <?php
echo $uploader == 'flash' && !(false !== strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'mac') && apache_mod_loaded('mod_security')) ? 'true' : 'false';
?>
,
product = <?php
echo !empty($Product->id) ? $Product->id : 'false';
?>
,
prices = <?php
echo json_encode($Product->prices);
?>
,
specs = <?php
$specs = array();
foreach ($Product->specs as $Spec) {
$specs[] = $Spec->json(array('context', 'type', 'numeral', 'sortorder', 'created', 'modified'));
}
示例6: doModel
//.........这里部分代码省略.........
$this->doView('settings/permalinks.php');
break;
case 'permalinks_post':
// updating permalinks option
$htaccess_file = osc_base_path() . '.htaccess';
$rewriteEnabled = Params::getParam('rewrite_enabled') ? true : false;
if ($rewriteEnabled) {
Preference::newInstance()->update(array('s_value' => '1'), array('s_name' => 'rewriteEnabled'));
$rewrite_base = REL_WEB_URL;
$htaccess = <<<HTACCESS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase {$rewrite_base}
RewriteRule ^index\\.php\$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . {$rewrite_base}index.php [L]
</IfModule>
HTACCESS;
// 1. OK (ok)
// 2. OK no apache module detected (warning)
// 3. No se puede crear + apache
// 4. No se puede crear + no apache
$status = 3;
if (file_exists($htaccess_file)) {
if (is_writable($htaccess_file) && file_put_contents($htaccess_file, $htaccess)) {
$status = 1;
}
} else {
if (is_writable(osc_base_path()) && file_put_contents($htaccess_file, $htaccess)) {
$status = 1;
}
}
if (!@apache_mod_loaded('mod_rewrite')) {
$status++;
}
$errors = 0;
$item_url = substr(str_replace('//', '/', Params::getParam('rewrite_item_url') . '/'), 0, -1);
if (!osc_validate_text($item_url)) {
$errors += 1;
} else {
Preference::newInstance()->update(array('s_value' => $item_url), array('s_name' => 'rewrite_item_url'));
}
$page_url = substr(str_replace('//', '/', Params::getParam('rewrite_page_url') . '/'), 0, -1);
if (!osc_validate_text($page_url)) {
$errors += 1;
} else {
Preference::newInstance()->update(array('s_value' => $page_url), array('s_name' => 'rewrite_page_url'));
}
$cat_url = substr(str_replace('//', '/', Params::getParam('rewrite_cat_url') . '/'), 0, -1);
if (!osc_validate_text($cat_url)) {
$errors += 1;
} else {
Preference::newInstance()->update(array('s_value' => $cat_url), array('s_name' => 'rewrite_cat_url'));
}
$search_url = substr(str_replace('//', '/', Params::getParam('rewrite_search_url') . '/'), 0, -1);
if (!osc_validate_text($search_url)) {
$errors += 1;
} else {
Preference::newInstance()->update(array('s_value' => $search_url), array('s_name' => 'rewrite_search_url'));
}
if (!osc_validate_text(Params::getParam('rewrite_search_country'))) {
$errors += 1;
} else {
Preference::newInstance()->update(array('s_value' => Params::getParam('rewrite_search_country')), array('s_name' => 'rewrite_search_country'));
}
示例7: bb_update_option
if ($value) {
bb_update_option($option, $value);
} else {
bb_delete_option($option);
}
}
}
$mod_rewrite = (string) bb_get_option('mod_rewrite');
$goback = remove_query_arg(array('updated', 'notapache', 'notmodrewrite'), wp_get_referer());
// Make sure mod_rewrite is possible on the server
if (!$is_apache) {
bb_delete_option('mod_rewrite_writable');
$goback = add_query_arg('notapache', 'true', $goback);
bb_safe_redirect($goback);
exit;
} elseif ('0' !== $mod_rewrite && !apache_mod_loaded('mod_rewrite', true)) {
bb_delete_option('mod_rewrite_writable');
bb_update_option('mod_rewrite', '0');
$goback = add_query_arg('notmodrewrite', 'true', $goback);
bb_safe_redirect($goback);
exit;
}
$file_target_rules = array();
$file_target_exists = false;
$file_target_writable = true;
if (file_exists($file_target)) {
if (is_readable($file_target)) {
$file_target_rules = explode("\n", implode('', file($file_target)));
}
$file_target_exists = true;
if (!is_writable($file_target)) {
示例8: doModel
//.........这里部分代码省略.........
$htaccess = Params::getParam('htaccess_status');
$file = Params::getParam('file_status');
$this->_exportVariableToView('htaccess', $htaccess);
$this->_exportVariableToView('file', $file);
$this->doView('settings/permalinks.php');
break;
case 'permalinks_post':
// updating permalinks option
$htaccess_status = 0;
$file_status = 0;
$rewriteEnabled = Params::getParam('rewrite_enabled');
$rewriteEnabled = $rewriteEnabled ? true : false;
if ($rewriteEnabled) {
Preference::newInstance()->update(array('s_value' => '1'), array('s_name' => 'rewriteEnabled'));
require_once ABS_PATH . 'generate_rules.php';
$htaccess = '
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase ' . REL_WEB_URL . '
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . ' . REL_WEB_URL . 'index.php [L]
</IfModule>';
if (file_exists(osc_base_path() . '.htaccess')) {
$file_status = 1;
} else {
if (file_put_contents(osc_base_path() . '.htaccess', $htaccess)) {
$file_status = 2;
} else {
$file_status = 3;
}
}
if (apache_mod_loaded('mod_rewrite')) {
$htaccess_status = 1;
Preference::newInstance()->update(array('s_value' => '1'), array('s_name' => 'mod_rewrite_loaded'));
} else {
$htaccess_status = 2;
Preference::newInstance()->update(array('s_value' => '0'), array('s_name' => 'mod_rewrite_loaded'));
}
} else {
$modRewrite = apache_mod_loaded('mod_rewrite');
Preference::newInstance()->update(array('s_value' => '0'), array('s_name' => 'rewriteEnabled'));
Preference::newInstance()->update(array('s_value' => '0'), array('s_name' => 'mod_rewrite_loaded'));
}
$redirectUrl = osc_admin_base_url(true) . '?page=settings&action=permalinks&htaccess_status=';
$redirectUrl .= $htaccess_status . '&file_status=' . $file_status;
$this->redirectTo($redirectUrl);
break;
case 'spamNbots':
// calling the spam and bots view
$this->doView('settings/spamNbots.php');
break;
case 'spamNbots_post':
// updating spam and bots option
$iUpdated = 0;
$akismetKey = Params::getParam('akismetKey');
$akismetKey = trim($akismetKey);
$recaptchaPrivKey = Params::getParam('recaptchaPrivKey');
$recaptchaPrivKey = trim($recaptchaPrivKey);
$recaptchaPubKey = Params::getParam('recaptchaPubKey');
$recaptchaPubKey = trim($recaptchaPubKey);
$iUpdated += Preference::newInstance()->update(array('s_value' => $akismetKey), array('s_name' => 'akismetKey'));
$iUpdated += Preference::newInstance()->update(array('s_value' => $recaptchaPrivKey), array('s_name' => 'recaptchaPrivKey'));
$iUpdated += Preference::newInstance()->update(array('s_value' => $recaptchaPubKey), array('s_name' => 'recaptchaPubKey'));
if ($iUpdated > 0) {
示例9: wpsc_product_image_forms
function wpsc_product_image_forms($product_data = '')
{
global $closed_postboxes;
if ($product_data == 'empty') {
$display = "style='display:none;'";
}
//echo "<pre>".print_r($product_data,true)."</pre>";
//As in WordPress, If Mac and mod_security, no Flash
$flash = true;
if (false !== strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'mac') && apache_mod_loaded('mod_security')) {
$flash = false;
}
$flash_action_url = admin_url('async-upload.php');
$flash = apply_filters('flash_uploader', $flash);
?>
<div id='wpsc_product_image_forms' class='postbox <?php
echo array_search('wpsc_product_image_forms', $product_data['closed_postboxes']) !== false ? 'closed' : '';
?>
' <?php
echo array_search('wpsc_product_image_forms', $product_data['hidden_postboxes']) !== false ? 'style="display: none;"' : '';
?>
>
<h3 class='hndle'> <?php
echo TXT_WPSC_PRODUCTIMAGES;
?>
</h3>
<div class='inside'>
<?php
if ($flash) {
?>
<script type="text/javascript" >
/* <![CDATA[ */
jQuery("span#spanButtonPlaceholder").livequery(function() {
swfu = new SWFUpload({
button_text: '<span class="button"><?php
_e('Select Files');
?>
</span>',
button_text_style: '.button { text-align: center; font-weight: bold; font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif; }',
button_height: "24",
button_width: "132",
button_image_url: '<?php
echo includes_url('images/upload.png');
?>
',
button_placeholder_id: "spanButtonPlaceholder",
upload_url : "<?php
echo attribute_escape($flash_action_url);
?>
",
flash_url : "<?php
echo includes_url('js/swfupload/swfupload.swf');
?>
",
file_post_name: "async-upload",
file_types: "<?php
echo apply_filters('upload_file_glob', '*.*');
?>
",
post_params : {
"product_id" : parseInt(jQuery('#product_id').val()),
"auth_cookie" : "<?php
if (is_ssl()) {
echo $_COOKIE[SECURE_AUTH_COOKIE];
} else {
echo $_COOKIE[AUTH_COOKIE];
}
?>
",
"_wpnonce" : "<?php
echo wp_create_nonce('product-swfupload');
?>
",
"wpsc_admin_action" : "wpsc_add_image"
},
file_size_limit : "<?php
echo wp_max_upload_size();
?>
b",
file_dialog_start_handler : wpsc_fileDialogStart,
file_queued_handler : wpsc_fileQueued,
upload_start_handler : wpsc_uploadStart,
upload_progress_handler : wpsc_uploadProgress,
upload_error_handler : wpsc_uploadError,
upload_success_handler : wpsc_uploadSuccess,
upload_complete_handler : wpsc_uploadComplete,
file_queue_error_handler : wpsc_fileQueueError,
file_dialog_complete_handler : wpsc_fileDialogComplete,
swfupload_pre_load_handler: wpsc_swfuploadPreLoad,
swfupload_load_failed_handler: wpsc_swfuploadLoadFailed,
custom_settings : {
degraded_element_id : "browser-image-uploader", // id of the element displayed when swfupload is unavailable
swfupload_element_id : "flash-image-uploader" // id of the element displayed when swfupload is available
},
<?php
if (defined('WPSC_ADD_DEBUG_PAGE') && constant('WPSC_ADD_DEBUG_PAGE') == true) {
?>
debug: true
<?php
//.........这里部分代码省略.........
示例10: media_upload_form
function media_upload_form($errors = null)
{
global $type, $tab;
$flash_action_url = get_option('siteurl') . "/wp-admin/async-upload.php";
// If Mac and mod_security, no Flash. :(
$flash = true;
if (false !== strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'mac') && apache_mod_loaded('mod_security')) {
$flash = false;
}
$flash = apply_filters('flash_uploader', $flash);
$post_id = intval($_REQUEST['post_id']);
?>
<input type='hidden' name='post_id' value='<?php
echo (int) $post_id;
?>
' />
<div id="media-upload-notice">
<?php
if (isset($errors['upload_notice'])) {
?>
<?php
echo $errors['upload_notice'];
}
?>
</div>
<div id="media-upload-error">
<?php
if (isset($errors['upload_error']) && is_wp_error($errors['upload_error'])) {
?>
<?php
echo $errors['upload_error']->get_error_message();
}
?>
</div>
<?php
if ($flash) {
?>
<script type="text/javascript">
<!--
jQuery(function($){
swfu = new SWFUpload({
upload_url : "<?php
echo attribute_escape($flash_action_url);
?>
",
flash_url : "<?php
echo get_option('siteurl') . '/wp-includes/js/swfupload/swfupload_f9.swf';
?>
",
file_post_name: "async-upload",
file_types: "<?php
echo apply_filters('upload_file_glob', '*.*');
?>
",
post_params : {
"post_id" : "<?php
echo $post_id;
?>
",
"auth_cookie" : "<?php
echo $_COOKIE[AUTH_COOKIE];
?>
",
"_wpnonce" : "<?php
echo wp_create_nonce('media-form');
?>
",
"type" : "<?php
echo $type;
?>
",
"tab" : "<?php
echo $tab;
?>
",
"short" : "1"
},
file_size_limit : "<?php
echo wp_max_upload_size();
?>
b",
swfupload_element_id : "flash-upload-ui", // id of the element displayed when swfupload is available
degraded_element_id : "html-upload-ui", // when swfupload is unavailable
file_dialog_start_handler : fileDialogStart,
file_queued_handler : fileQueued,
upload_start_handler : uploadStart,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler : uploadComplete,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
debug: false
});
$("#flash-browse-button").bind( "click", function(){swfu.selectFiles();});
});
//-->
</script>
//.........这里部分代码省略.........
示例11: media_upload_form
/**
* {@internal Missing Short Description}}
*
* @since unknown
*
* @param unknown_type $errors
*/
function media_upload_form($errors = null)
{
global $type, $tab;
$flash_action_url = admin_url('async-upload.php');
// If Mac and mod_security, no Flash. :(
$flash = true;
if (false !== strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'mac') && apache_mod_loaded('mod_security')) {
$flash = false;
}
$flash = apply_filters('flash_uploader', $flash);
$post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0;
?>
<script type="text/javascript">
//<![CDATA[
var uploaderMode = 0;
jQuery(document).ready(function($){
uploaderMode = getUserSetting('uploader');
$('.upload-html-bypass a').click(function(){deleteUserSetting('uploader');uploaderMode=0;swfuploadPreLoad();return false;});
$('.upload-flash-bypass a').click(function(){setUserSetting('uploader', '1');uploaderMode=1;swfuploadPreLoad();return false;});
});
//]]>
</script>
<div id="media-upload-notice">
<?php
if (isset($errors['upload_notice'])) {
?>
<?php
echo $errors['upload_notice'];
}
?>
</div>
<div id="media-upload-error">
<?php
if (isset($errors['upload_error']) && is_wp_error($errors['upload_error'])) {
?>
<?php
echo $errors['upload_error']->get_error_message();
}
?>
</div>
<?php
do_action('pre-upload-ui');
?>
<?php
if ($flash) {
?>
<script type="text/javascript">
//<![CDATA[
var swfu;
SWFUpload.onload = function() {
var settings = {
button_text: '<span class="button"><?php
_e('Select Files');
?>
</span>',
button_text_style: '.button { text-align: center; font-weight: bold; font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif; }',
button_height: "24",
button_width: "132",
button_text_top_padding: 2,
button_image_url: '<?php
echo includes_url('images/upload.png');
?>
',
button_placeholder_id: "flash-browse-button",
upload_url : "<?php
echo esc_attr($flash_action_url);
?>
",
flash_url : "<?php
echo includes_url('js/swfupload/swfupload.swf');
?>
",
file_post_name: "async-upload",
file_types: "<?php
echo apply_filters('upload_file_glob', '*.*');
?>
",
post_params : {
"post_id" : "<?php
echo $post_id;
?>
",
"auth_cookie" : "<?php
if (is_ssl()) {
echo $_COOKIE[SECURE_AUTH_COOKIE];
} else {
echo $_COOKIE[AUTH_COOKIE];
}
?>
",
"_wpnonce" : "<?php
//.........这里部分代码省略.........
示例12: network_step1
/**
* Prints step 1 for Network installation process.
*
* @todo Realistically, step 1 should be a welcome screen explaining what a Network is and such. Navigating to Tools > Network
* should not be a sudden "Welcome to a new install process! Fill this out and click here." See also contextual help todo.
*
* @since 3.0.0
*/
function network_step1($errors = false)
{
if (get_option('siteurl') != get_option('home')) {
echo '<div class="error"><p><strong>' . __('Error:') . '</strong> ' . sprintf(__('Your <strong>WordPress address</strong> must match your <strong>Site address</strong> before creating a Network. See <a href="%s">General Settings</a>.'), esc_url(admin_url('options-general.php'))) . '</strong></p></div>';
include './admin-footer.php';
die;
}
$active_plugins = get_option('active_plugins');
if (!empty($active_plugins)) {
echo '<div class="updated"><p><strong>' . __('Warning:') . '</strong> ' . sprintf(__('Please <a href="%s">deactivate</a> your plugins before enabling the Network feature.'), admin_url('plugins.php')) . '</p></div><p>' . __(' Once the network is created, you may reactivate your plugins.') . '</p>';
include './admin-footer.php';
die;
}
$hostname = get_clean_basedomain();
$has_ports = strstr($hostname, ':');
if (false !== $has_ports && !in_array($has_ports, array(':80', ':443')) || ($no_ip = preg_match('|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+|', $hostname))) {
echo '<div class="error"><p><strong>' . __('Error:') . '</strong> ' . __('You cannot install a network of sites with your server address.') . '</strong></p></div>';
if ($no_ip) {
echo '<p>' . __('You cannot use an IP address such as <code>127.0.0.1</code>.') . '</p>';
} else {
echo '<p>' . sprintf(__('You cannot use port numbers such as <code>%s</code>.'), $has_ports) . '</p>';
}
echo '<a href="' . esc_url(admin_url()) . '">' . __('Return to Dashboard') . '</a>';
include './admin-footer.php';
die;
}
wp_nonce_field('install-network-1');
$error_codes = array();
if (is_wp_error($errors)) {
echo '<div class="error"><p><strong>' . __('ERROR: The network could not be created.') . '</strong></p>';
foreach ($errors->get_error_messages() as $error) {
echo "<p>{$error}</p>";
}
echo '</div>';
$error_codes = $errors->get_error_codes();
}
$site_name = !empty($_POST['sitename']) && !in_array('empty_sitename', $error_codes) ? $_POST['sitename'] : sprintf(_x('%s Sites', 'Default network name'), get_option('blogname'));
$admin_email = !empty($_POST['email']) && !in_array('invalid_email', $error_codes) ? $_POST['email'] : get_option('admin_email');
?>
<p><?php
_e('Welcome to the Network installation process!');
?>
</p>
<p><?php
_e('Fill in the information below and you’ll be on your way to creating a network of WordPress sites. We will create configuration files in the next step.');
?>
</p>
<?php
// @todo IIS and ! $is_apache
if (isset($_POST['subdomain_install'])) {
$subdomain_install = (bool) $_POST['subdomain_install'];
} elseif (apache_mod_loaded('mod_rewrite')) {
// assume nothing
$subdomain_install = true;
} else {
$subdomain_install = false;
if (got_mod_rewrite()) {
// dangerous assumptions
echo '<div class="updated inline"><p><strong>' . __('Note:') . '</strong> ' . __('Please make sure the Apache <code>mod_rewrite</code> module is installed as it will be used at the end of this installation.') . '</p>';
} else {
echo '<div class="error inline"><p><strong>' . __('Warning!') . '</strong> ' . __('It looks like the Apache <code>mod_rewrite</code> module is not installed.') . '</p>';
}
echo '<p>' . __('If <code>mod_rewrite</code> is disabled, ask your administrator to enable that module, or look at the <a href="http://httpd.apache.org/docs/mod/mod_rewrite.html">Apache documentation</a> or <a href="http://www.google.com/search?q=apache+mod_rewrite">elsewhere</a> for help setting it up.') . '</p></div>';
}
if (allow_subdomain_install()) {
?>
<h3><?php
esc_html_e('Addresses of Sites in your Network');
?>
</h3>
<p><?php
_e('Please choose whether you would like sites in your WordPress network to use sub-domains or sub-directories. <strong>You cannot change this later.</strong>');
?>
</p>
<p><?php
_e('You will need a wildcard DNS record if you are going to use the virtual host (sub-domain) functionality.');
?>
</p>
<?php
// @todo: Link to an MS readme?
?>
<table class="form-table">
<tr>
<th><label><input type='radio' name='subdomain_install' value='1'<?php
checked($subdomain_install);
?>
/> Sub-domains</label></th>
<td><?php
printf(_x('like <code>site1.%1$s</code> and <code>site2.%1$s</code>', 'subdomain examples'), $hostname);
?>
</td>
</tr>
//.........这里部分代码省略.........
示例13: uploadbox
/**
* LazyestAdminFolder::uploadbox()
* Show the box with the uploader(s)
*
* @return void
*/
function uploadbox()
{
global $lg_gallery;
// get and set flash uploader preferences
$flash = 'TRUE' == $lg_gallery->get_option('flash_upload') || isset($_REQUEST['flash']) && $_REQUEST['flash'] == 1;
if (false !== stripos($_SERVER['HTTP_USER_AGENT'], 'mac') && apache_mod_loaded('mod_security')) {
$flash = false;
}
$lg_gallery->update_option('flash_upload', $flash ? 'TRUE' : 'FALSE');
// urls and text based on flash uploader
$action_url = add_query_arg(array('action' => 'lg_media', 'folder' => lg_nice_link($this->curdir), 'width' => 640, 'TB_iframe' => 1), wp_nonce_url('admin-ajax.php'));
$action_url = add_query_arg(array('flash' => $flash ? 1 : 0), $action_url);
$switch_url = add_query_arg(array('flash' => $flash ? 0 : 1), $action_url);
$flashbypass = sprintf(__('You are using the Flash uploader. Problems? Try the <a href="%s">Browser uploader</a> instead', 'lazyest-gallery'), $switch_url);
$htmlbypass = sprintf(__('You are using the Browser uploader. Use the <a href="%s">Flash uploader</a> instead', 'lazyest-gallery'), $switch_url);
$flashstyle = $flash ? 'display:block' : 'display:none';
$htmlstyle = $flash ? 'display:none' : 'display:block';
$upload_size_unit = $max_upload_size = wp_max_upload_size();
// text for allowed types
$filetypes = '*.' . str_replace(' ', ';*.', strtolower($lg_gallery->get_option('fileupload_allowedtypes')));
$allowed_types = explode(' ', trim(strtolower($lg_gallery->get_option('fileupload_allowedtypes'))));
foreach ($allowed_types as $type) {
$type_tags[] = "<code>{$type}</code>";
}
// text for maximum file uplaod
$sizes = array('KB', 'MB', 'GB');
for ($u = -1; $upload_size_unit > 1024 && $u < count($sizes) - 1; $u++) {
$upload_size_unit /= 1024;
}
if ($u < 0) {
$upload_size_unit = 0;
$u = 0;
} else {
$upload_size_unit = (int) $upload_size_unit;
}
$i = implode(', ', $type_tags);
$show_image = '';
if (isset($_POST['newname']) || $lg_gallery->success && isset($lg_gallery->message)) {
$uploaded = isset($_POST['newname']) ? $_POST['newname'] : $lg_gallery->message;
$show_image = sprintf('<div id="media-item-lg" class="media-item">
<div class="progress"><div class="bar" style="width:100%%">100%%</div></div>
<div id="media-upload-error-lg"></div>
<div class="filename new">%s</div>
</div>', $uploaded);
unset($lg_gallery->message);
}
if ($flash) {
$user = wp_get_current_user();
$uid = (int) $user->ID;
$ajax_nonce = wp_create_nonce();
?>
<script type="text/javascript">
//<! [CDATA[
var folder_id = <?php
echo $this->id;
?>
;
var swfu;
SWFUpload.onload = function() {
var settings = {
button_text: '<?php
esc_html_e('Select Files');
?>
',
button_text_style: '.select-upload { text-align:center; font-weight:bold; font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif; }',
button_height: "23",
button_width: "132",
button_text_top_padding: 3,
button_text_left_padding: 5,
button_image_url: '<?php
echo $lg_gallery->plugin_url . '/images/upload.png';
?>
',
button_placeholder_id: "flash-browse-button",
upload_url : "<?php
echo esc_attr(admin_url('admin-ajax.php'));
?>
",
flash_url : "<?php
echo includes_url('js/swfupload/swfupload.swf');
?>
",
file_post_name: "async-upload",
file_types: "*.jpg;*.jpeg;*.gif;*.png",
file_types_description : "<?php
esc_html_e('Image files', 'lazyest-gallery');
?>
",
post_params : {
"_ajax_nonce" : "<?php
echo $ajax_nonce;
?>
",
"short" : "1",
//.........这里部分代码省略.........
示例14: doModel
function doModel()
{
switch ($this->action) {
case 'permalinks':
// calling the permalinks view
$htaccess = Params::getParam('htaccess_status');
$file = Params::getParam('file_status');
$this->_exportVariableToView('htaccess', $htaccess);
$this->_exportVariableToView('file', $file);
$this->doView('settings/permalinks.php');
break;
case 'permalinks_post':
// updating permalinks option
osc_csrf_check();
$htaccess_file = osc_base_path() . '.htaccess';
$rewriteEnabled = Params::getParam('rewrite_enabled') ? true : false;
$rewrite_base = REL_WEB_URL;
$htaccess = <<<HTACCESS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase {$rewrite_base}
RewriteRule ^index\\.php\$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . {$rewrite_base}index.php [L]
</IfModule>
HTACCESS;
if ($rewriteEnabled) {
osc_set_preference('rewriteEnabled', '1');
// 1. OK (ok)
// 2. OK no apache module detected (warning)
// 3. No se puede crear + apache
// 4. No se puede crear + no apache
// 5. .htaccess exists, no overwrite
$status = 3;
if (file_exists($htaccess_file)) {
$status = 5;
} else {
if (is_writable(osc_base_path()) && file_put_contents($htaccess_file, $htaccess)) {
$status = 1;
}
}
if (!@apache_mod_loaded('mod_rewrite')) {
$status++;
}
$errors = 0;
$item_url = substr(str_replace('//', '/', Params::getParam('rewrite_item_url') . '/'), 0, -1);
if (!osc_validate_text($item_url)) {
$errors += 1;
} else {
osc_set_preference('rewrite_item_url', $item_url);
}
$page_url = substr(str_replace('//', '/', Params::getParam('rewrite_page_url') . '/'), 0, -1);
if (!osc_validate_text($page_url)) {
$errors += 1;
} else {
osc_set_preference('rewrite_page_url', $page_url);
}
$cat_url = substr(str_replace('//', '/', Params::getParam('rewrite_cat_url') . '/'), 0, -1);
// DEPRECATED: backward compatibility, remove in 3.4
$cat_url = str_replace('{CATEGORY_SLUG}', '{CATEGORY_NAME}', $cat_url);
if (!osc_validate_text($cat_url)) {
$errors += 1;
} else {
osc_set_preference('rewrite_cat_url', $cat_url);
}
$search_url = substr(str_replace('//', '/', Params::getParam('rewrite_search_url') . '/'), 0, -1);
if (!osc_validate_text($search_url)) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_url', $search_url);
}
if (!osc_validate_text(Params::getParam('rewrite_search_country'))) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_country', Params::getParam('rewrite_search_country'));
}
if (!osc_validate_text(Params::getParam('rewrite_search_region'))) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_region', Params::getParam('rewrite_search_region'));
}
if (!osc_validate_text(Params::getParam('rewrite_search_city'))) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_city', Params::getParam('rewrite_search_city'));
}
if (!osc_validate_text(Params::getParam('rewrite_search_city_area'))) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_city_area', Params::getParam('rewrite_search_city_area'));
}
if (!osc_validate_text(Params::getParam('rewrite_search_category'))) {
$errors += 1;
} else {
osc_set_preference('rewrite_search_category', Params::getParam('rewrite_search_category'));
}
if (!osc_validate_text(Params::getParam('rewrite_search_user'))) {
$errors += 1;
} else {
//.........这里部分代码省略.........
示例15: _e
" />
<?php
_e('Options: blank, ssl or tls');
?>
<?php
if (php_sapi_name() == 'cgi-fcgi' || php_sapi_name() == 'cgi') {
?>
<div class="flashmessage flashmessage-inline warning">
<p><?php
_e("Cannot be sure that Apache Module <b>mod_ssl</b> is loaded.");
?>
</p>
</div>
<?php
} else {
if (!@apache_mod_loaded('mod_ssl')) {
?>
<div class="flashmessage flashmessage-inline warning">
<p><?php
_e("Apache Module <b>mod_ssl</b> is not loaded");
?>
</p>
</div>
<?php
}
}
?>
</div>
</div>
<div class="form-row">
<div class="form-label"><?php