• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP nxt_nonce_url函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中nxt_nonce_url函数的典型用法代码示例。如果您正苦于以下问题:PHP nxt_nonce_url函数的具体用法?PHP nxt_nonce_url怎么用?PHP nxt_nonce_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了nxt_nonce_url函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: activate

 /**
  * Activate plugin action
  */
 function activate()
 {
     require_once W3TC_INC_DIR . '/functions/activation.php';
     if ($this->_config->get_boolean('pgcache.enabled') && $this->_config->get_string('pgcache.engine') == 'file_generic') {
         /**
          * Disable enhanced mode if permalink structure is disabled
          */
         $permalink_structure = get_option('permalink_structure');
         if ($permalink_structure == '') {
             $this->_config->set('pgcache.engine', 'file');
             $this->_config->save();
         } else {
             if (w3_can_modify_rules(w3_get_pgcache_rules_core_path())) {
                 $this->write_rules_core();
             }
             if (w3_can_modify_rules(w3_get_pgcache_rules_cache_path())) {
                 $this->write_rules_cache();
             }
         }
     }
     if (!$this->locked()) {
         if (!@copy(W3TC_INSTALL_FILE_ADVANCED_CACHE, W3TC_ADDIN_FILE_ADVANCED_CACHE)) {
             w3_writable_error(W3TC_ADDIN_FILE_ADVANCED_CACHE);
         }
         if ((!defined('nxt_CACHE') || !nxt_CACHE) && !$this->enable_nxt_cache()) {
             $reactivate_url = nxt_nonce_url('plugins.php?action=activate&plugin=' . W3TC_FILE, 'activate-plugin_' . W3TC_FILE);
             $reactivate_button = sprintf('<input type="button" value="re-activate plugin" onclick="top.location.href = \'%s\'" />', addslashes($reactivate_url));
             $error = sprintf('<strong>%snxt-config.php</strong> could not be written, please edit config and add:<br /><strong style="color:#f00;">define(\'nxt_CACHE\', true);</strong> before <strong style="color:#f00;">require_once(ABSPATH . \'nxt-settings.php\');</strong><br />then %s.', ABSPATH, $reactivate_button);
             w3_activate_error($error);
         }
     }
     $this->schedule();
     $this->schedule_prime();
 }
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:37,代码来源:PgCacheAdmin.php


示例2: handle_repair_panel

    function handle_repair_panel()
    {
        global $action, $page, $M_options;
        nxt_reset_vars(array('action', 'page'));
        ?>
		<div class='wrap nosubsub'>
			<div class="icon32" id="icon-tools"><br></div>
			<h2><?php 
        _e('Repair Membership', 'membership');
        ?>
</h2>

			<?php 
        if (isset($_GET['msg'])) {
            echo '<div id="message" class="updated fade"><p>' . $messages[(int) $_GET['msg']] . '</p></div>';
            $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
        }
        ?>

			<p><?php 
        _e('If you are having problems with your membership site, or have recently upgraded and are seeing strange behaviour then try the membership check below to see if there are any issues with your table structure. Click on the repair button if you want to repair any issues found (back up your database first).', 'membership');
        ?>
</p>
			<p>
			<?php 
        echo "<a href='" . nxt_nonce_url("?page=" . $page . "&amp;verify=yes", 'verify-membership') . "' class='button'>" . __('Verify Membership Tables', 'membership') . "</a>&nbsp;&nbsp;";
        ?>
			<?php 
        echo "<a href='" . nxt_nonce_url("?page=" . $page . "&amp;repair=yes", 'repair-membership') . "' class='button'>" . __('Repair Membership Tables', 'membership') . "</a>";
        ?>
			</p>

			<?php 
        if (isset($_GET['verify'])) {
            check_admin_referer('verify-membership');
            include_once membership_dir('membershipincludes/classes/upgrade.php');
            ?>
					<p><strong><?php 
            _e('Verifying', 'membership');
            ?>
</strong></p>
					<?php 
            M_verify_tables();
        }
        if (isset($_GET['repair'])) {
            check_admin_referer('repair-membership');
            include_once membership_dir('membershipincludes/classes/upgrade.php');
            ?>
					<p><strong><?php 
            _e('Verifying and Repairing', 'membership');
            ?>
</strong></p>
					<?php 
            M_repair_tables();
        }
        ?>
		</div> <!-- wrap -->
		<?php 
    }
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:59,代码来源:repairmembership.php


示例3: w3_writable_error

/**
 * W3 writable error
 *
 * @param string $path
 * @return string
 */
function w3_writable_error($path)
{
    $reactivate_url = nxt_nonce_url('plugins.php?action=activate&plugin=' . W3TC_FILE, 'activate-plugin_' . W3TC_FILE);
    $reactivate_button = sprintf('<input type="button" value="re-activate plugin" onclick="top.location.href = \'%s\'" />', addslashes($reactivate_url));
    require_once W3TC_INC_DIR . '/functions/file.php';
    if (w3_check_open_basedir($path)) {
        $error = sprintf('<strong>%s</strong> could not be created, please run following command:<br /><strong style="color: #f00;">chmod 777 %s</strong><br />then %s.', $path, file_exists($path) ? $path : dirname($path), $reactivate_button);
    } else {
        $error = sprintf('<strong>%s</strong> could not be created, <strong>open_basedir</strong> restriction in effect, please check your php.ini settings:<br /><strong style="color: #f00;">open_basedir = "%s"</strong><br />then %s.', $path, ini_get('open_basedir'), $reactivate_button);
    }
    w3_activate_error($error);
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:18,代码来源:activation.php


示例4: sprintf

    $message = sprintf(_n('Media attachment permanently deleted.', '%d media attachments permanently deleted.', $deleted), number_format_i18n($_GET['deleted']));
    $_SERVER['REQUEST_URI'] = remove_query_arg(array('deleted'), $_SERVER['REQUEST_URI']);
}
if (!empty($_GET['trashed']) && ($trashed = absint($_GET['trashed']))) {
    $message = sprintf(_n('Media attachment moved to the trash.', '%d media attachments moved to the trash.', $trashed), number_format_i18n($_GET['trashed']));
    $message .= ' <a href="' . esc_url(nxt_nonce_url('upload.php?doaction=undo&action=untrash&ids=' . (isset($_GET['ids']) ? $_GET['ids'] : ''), "bulk-media")) . '">' . __('Undo') . '</a>';
    $_SERVER['REQUEST_URI'] = remove_query_arg(array('trashed'), $_SERVER['REQUEST_URI']);
}
if (!empty($_GET['untrashed']) && ($untrashed = absint($_GET['untrashed']))) {
    $message = sprintf(_n('Media attachment restored from the trash.', '%d media attachments restored from the trash.', $untrashed), number_format_i18n($_GET['untrashed']));
    $_SERVER['REQUEST_URI'] = remove_query_arg(array('untrashed'), $_SERVER['REQUEST_URI']);
}
$messages[1] = __('Media attachment updated.');
$messages[2] = __('Media permanently deleted.');
$messages[3] = __('Error saving media attachment.');
$messages[4] = __('Media moved to the trash.') . ' <a href="' . esc_url(nxt_nonce_url('upload.php?doaction=undo&action=untrash&ids=' . (isset($_GET['ids']) ? $_GET['ids'] : ''), "bulk-media")) . '">' . __('Undo') . '</a>';
$messages[5] = __('Media restored from the trash.');
if (!empty($_GET['message']) && isset($messages[$_GET['message']])) {
    $message = $messages[$_GET['message']];
    $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
}
if (!empty($message)) {
    ?>
<div id="message" class="updated"><p><?php 
    echo $message;
    ?>
</p></div>
<?php 
}
?>
开发者ID:nxtclass,项目名称:NXTClass,代码行数:30,代码来源:upload.php


示例5: unset

    }
    if (isset($_REQUEST['skipped']) && (int) $_REQUEST['skipped']) {
        unset($_REQUEST['skipped']);
    }
    if (isset($_REQUEST['locked']) && (int) $_REQUEST['locked']) {
        $messages[] = sprintf(_n('%s item not updated, somebody is editing it.', '%s items not updated, somebody is editing them.', $_REQUEST['locked']), number_format_i18n($_REQUEST['locked']));
        unset($_REQUEST['locked']);
    }
    if (isset($_REQUEST['deleted']) && (int) $_REQUEST['deleted']) {
        $messages[] = sprintf(_n('Item permanently deleted.', '%s items permanently deleted.', $_REQUEST['deleted']), number_format_i18n($_REQUEST['deleted']));
        unset($_REQUEST['deleted']);
    }
    if (isset($_REQUEST['trashed']) && (int) $_REQUEST['trashed']) {
        $messages[] = sprintf(_n('Item moved to the Trash.', '%s items moved to the Trash.', $_REQUEST['trashed']), number_format_i18n($_REQUEST['trashed']));
        $ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
        $messages[] = '<a href="' . esc_url(nxt_nonce_url("edit.php?post_type={$post_type}&doaction=undo&action=untrash&ids={$ids}", "bulk-posts")) . '">' . __('Undo') . '</a>';
        unset($_REQUEST['trashed']);
    }
    if (isset($_REQUEST['untrashed']) && (int) $_REQUEST['untrashed']) {
        $messages[] = sprintf(_n('Item restored from the Trash.', '%s items restored from the Trash.', $_REQUEST['untrashed']), number_format_i18n($_REQUEST['untrashed']));
        unset($_REQUEST['undeleted']);
    }
    if ($messages) {
        echo join(' ', $messages);
    }
    unset($messages);
    $_SERVER['REQUEST_URI'] = remove_query_arg(array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI']);
    ?>
</p></div>
<?php 
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:31,代码来源:edit.php


示例6: dm_manage_page

function dm_manage_page()
{
    global $nxtdb, $parent_file;
    if (isset($_GET['updated'])) {
        do_action('dm_echo_updated_msg');
    }
    dm_sunrise_warning();
    echo "<div class='wrap'><h2>" . __('Domain Mapping', 'nxtclass-mu-domain-mapping') . "</h2>";
    if (false == get_site_option('dm_ipaddress') && false == get_site_option('dm_cname')) {
        if (dm_site_admin()) {
            _e("Please set the IP address or CNAME of your server in the <a href='nxtmu-admin.php?page=dm_admin_page'>site admin page</a>.", 'nxtclass-mu-domain-mapping');
        } else {
            _e("This plugin has not been configured correctly yet.", 'nxtclass-mu-domain-mapping');
        }
        echo "</div>";
        return false;
    }
    if (false == isset($_SERVER['HTTPS'])) {
        $_SERVER['HTTPS'] = 'Off';
    }
    $protocol = 'on' == strtolower($_SERVER['HTTPS']) ? 'https://' : 'http://';
    $domains = $nxtdb->get_results("SELECT * FROM {$nxtdb->dmtable} WHERE blog_id = '{$nxtdb->blogid}'", ARRAY_A);
    if (is_array($domains) && !empty($domains)) {
        $orig_url = parse_url(get_original_url('siteurl'));
        $domains[] = array('domain' => $orig_url['host'], 'path' => $orig_url['path'], 'active' => 0);
        echo "<h3>" . __('Active domains on this blog', 'nxtclass-mu-domain-mapping') . "</h3>";
        echo '<form method="POST">';
        echo "<table><tr><th>" . __('Primary', 'nxtclass-mu-domain-mapping') . "</th><th>" . __('Domain', 'nxtclass-mu-domain-mapping') . "</th><th>" . __('Delete', 'nxtclass-mu-domain-mapping') . "</th></tr>\n";
        $primary_found = 0;
        $del_url = add_query_arg(array('page' => 'domainmapping', 'action' => 'delete'), admin_url($parent_file));
        foreach ($domains as $details) {
            if (0 == $primary_found && $details['domain'] == $orig_url['host']) {
                $details['active'] = 1;
            }
            echo "<tr><td>";
            echo "<input type='radio' name='domain' value='{$details['domain']}' ";
            if ($details['active'] == 1) {
                echo "checked='1' ";
            }
            echo "/>";
            $url = "{$protocol}{$details['domain']}{$details['path']}";
            echo "</td><td><a href='{$url}'>{$url}</a></td><td style='text-align: center'>";
            if ($details['domain'] != $orig_url['host'] && $details['active'] != 1) {
                echo "<a href='" . nxt_nonce_url(add_query_arg(array('domain' => $details['domain']), $del_url), "delete" . $details['domain']) . "'>Del</a>";
            }
            echo "</td></tr>";
            if (0 == $primary_found) {
                $primary_found = $details['active'];
            }
        }
        ?>
</table><?php 
        echo '<input type="hidden" name="action" value="primary" />';
        echo "<p><input type='submit' class='button-primary' value='" . __('Set Primary Domain', 'nxtclass-mu-domain-mapping') . "' /></p>";
        nxt_nonce_field('domain_mapping');
        echo "</form>";
        echo "<p>" . __("* The primary domain cannot be deleted.", 'nxtclass-mu-domain-mapping') . "</p>";
        if (get_site_option('dm_no_primary_domain') == 1) {
            echo __('<strong>Warning!</strong> Primary domains are currently disabled.', 'nxtclass-mu-domain-mapping');
        }
    }
    echo "<h3>" . __('Add new domain', 'nxtclass-mu-domain-mapping') . "</h3>";
    echo '<form method="POST">';
    echo '<input type="hidden" name="action" value="add" />';
    echo "<p>http://<input type='text' name='domain' value='' />/<br />";
    nxt_nonce_field('domain_mapping');
    echo "<input type='checkbox' name='primary' value='1' /> " . __('Primary domain for this blog', 'nxtclass-mu-domain-mapping') . "</p>";
    echo "<p><input type='submit' class='button-secondary' value='" . __("Add", 'nxtclass-mu-domain-mapping') . "' /></p>";
    echo "</form><br />";
    if (get_site_option('dm_cname')) {
        $dm_cname = get_site_option('dm_cname');
        echo "<p>" . sprintf(__('If you want to redirect a domain you will need to add a DNS "CNAME" record pointing to the following domain name for this server: <strong>%s</strong>', 'nxtclass-mu-domain-mapping'), $dm_cname) . "</p>";
        echo "<p>" . __('Google have published <a href="http://www.google.com/support/blogger/bin/answer.py?hl=en&answer=58317" target="_blank">instructions</a> for creating CNAME records on various hosting platforms such as GoDaddy and others.', 'nxtclass-mu-domain-mapping') . "</p>";
    } else {
        echo "<p>" . __('If your domain name includes a hostname like "www", "blog" or some other prefix before the actual domain name you will need to add a CNAME for that hostname in your DNS pointing at this blog URL.', 'nxtclass-mu-domain-mapping') . "</p>";
        $dm_ipaddress = get_site_option('dm_ipaddress', 'IP not set by admin yet.');
        if (strpos($dm_ipaddress, ',')) {
            echo "<p>" . sprintf(__('If you want to redirect a domain you will need to add DNS "A" records pointing at the IP addresses of this server: <strong>%s</strong>', 'nxtclass-mu-domain-mapping'), $dm_ipaddress) . "</p>";
        } else {
            echo "<p>" . sprintf(__('If you want to redirect a domain you will need to add a DNS "A" record pointing at the IP address of this server: <strong>%s</strong>', 'nxtclass-mu-domain-mapping'), $dm_ipaddress) . "</p>";
        }
    }
    echo '<p>' . sprintf(__('<strong>Note:</strong> %s', 'nxtclass-mu-domain-mapping'), dm_idn_warning()) . "</p>";
    echo "</div>";
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:85,代码来源:domain_mapping.php


示例7: bp_get_the_topic_post_admin_links

function bp_get_the_topic_post_admin_links($args = '')
{
    global $topic_template;
    // Never show for the first post in a topic.
    if (0 == $topic_template->current_post && 1 == $topic_template->pag_page) {
        return;
    }
    $defaults = array('separator' => ' | ');
    $r = nxt_parse_args($args, $defaults);
    extract($r, EXTR_SKIP);
    $query_vars = '';
    if ($_SERVER['QUERY_STRING']) {
        $query_vars = '?' . $_SERVER['QUERY_STRING'];
    }
    $links = array();
    $links[] = '<a href="' . nxt_nonce_url(bp_get_the_topic_permalink() . 'edit/post/' . $topic_template->post->post_id . '/' . $query_vars, 'bp_forums_edit_post') . '">' . __('Edit', 'buddypress') . '</a>';
    $links[] .= '<a class="confirm" id="post-delete-link" href="' . nxt_nonce_url(bp_get_the_topic_permalink() . 'delete/post/' . $topic_template->post->post_id, 'bp_forums_delete_post') . '">' . __('Delete', 'buddypress') . '</a>';
    return apply_filters('bp_get_the_topic_post_admin_links', implode($separator, $links), $links, $r);
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:19,代码来源:bp-forums-template.php


示例8: get_media_item

/**
 * Retrieve HTML form for modifying the image attachment.
 *
 * @since 2.5.0
 *
 * @param int $attachment_id Attachment ID for modification.
 * @param string|array $args Optional. Override defaults.
 * @return string HTML form for attachment.
 */
function get_media_item($attachment_id, $args = null)
{
    global $redir_tab;
    if (($attachment_id = intval($attachment_id)) && ($thumb_url = nxt_get_attachment_image_src($attachment_id, 'thumbnail', true))) {
        $thumb_url = $thumb_url[0];
    } else {
        $thumb_url = false;
    }
    $post = get_post($attachment_id);
    $current_post_id = !empty($_GET['post_id']) ? (int) $_GET['post_id'] : 0;
    $default_args = array('errors' => null, 'send' => $current_post_id ? post_type_supports(get_post_type($current_post_id), 'editor') : true, 'delete' => true, 'toggle' => true, 'show_title' => true);
    $args = nxt_parse_args($args, $default_args);
    $args = apply_filters('get_media_item_args', $args);
    extract($args, EXTR_SKIP);
    $toggle_on = __('Show');
    $toggle_off = __('Hide');
    $filename = esc_html(basename($post->guid));
    $title = esc_attr($post->post_title);
    if ($_tags = get_the_tags($attachment_id)) {
        foreach ($_tags as $tag) {
            $tags[] = $tag->name;
        }
        $tags = esc_attr(join(', ', $tags));
    }
    $post_mime_types = get_post_mime_types();
    $keys = array_keys(nxt_match_mime_types(array_keys($post_mime_types), $post->post_mime_type));
    $type = array_shift($keys);
    $type_html = "<input type='hidden' id='type-of-{$attachment_id}' value='" . esc_attr($type) . "' />";
    $form_fields = get_attachment_fields_to_edit($post, $errors);
    if ($toggle) {
        $class = empty($errors) ? 'startclosed' : 'startopen';
        $toggle_links = "\n\t<a class='toggle describe-toggle-on' href='#'>{$toggle_on}</a>\n\t<a class='toggle describe-toggle-off' href='#'>{$toggle_off}</a>";
    } else {
        $class = '';
        $toggle_links = '';
    }
    $display_title = !empty($title) ? $title : $filename;
    // $title shouldn't ever be empty, but just in case
    $display_title = $show_title ? "<div class='filename new'><span class='title'>" . nxt_html_excerpt($display_title, 60) . "</span></div>" : '';
    $gallery = isset($_REQUEST['tab']) && 'gallery' == $_REQUEST['tab'] || isset($redir_tab) && 'gallery' == $redir_tab;
    $order = '';
    foreach ($form_fields as $key => $val) {
        if ('menu_order' == $key) {
            if ($gallery) {
                $order = "<div class='menu_order'> <input class='menu_order_input' type='text' id='attachments[{$attachment_id}][menu_order]' name='attachments[{$attachment_id}][menu_order]' value='" . esc_attr($val['value']) . "' /></div>";
            } else {
                $order = "<input type='hidden' name='attachments[{$attachment_id}][menu_order]' value='" . esc_attr($val['value']) . "' />";
            }
            unset($form_fields['menu_order']);
            break;
        }
    }
    $media_dims = '';
    $meta = nxt_get_attachment_metadata($post->ID);
    if (is_array($meta) && array_key_exists('width', $meta) && array_key_exists('height', $meta)) {
        $media_dims .= "<span id='media-dims-{$post->ID}'>{$meta['width']}&nbsp;&times;&nbsp;{$meta['height']}</span> ";
    }
    $media_dims = apply_filters('media_meta', $media_dims, $post);
    $image_edit_button = '';
    if (gd_edit_image_support($post->post_mime_type)) {
        $nonce = nxt_create_nonce("image_editor-{$post->ID}");
        $image_edit_button = "<input type='button' id='imgedit-open-btn-{$post->ID}' onclick='imageEdit.open( {$post->ID}, \"{$nonce}\" )' class='button' value='" . esc_attr__('Edit Image') . "' /> <img src='" . esc_url(admin_url('images/nxtspin_light.gif')) . "' class='imgedit-wait-spin' alt='' />";
    }
    $attachment_url = get_permalink($attachment_id);
    $item = "\n\t{$type_html}\n\t{$toggle_links}\n\t{$order}\n\t{$display_title}\n\t<table class='slidetoggle describe {$class}'>\n\t\t<thead class='media-item-info' id='media-head-{$post->ID}'>\n\t\t<tr valign='top'>\n\t\t\t<td class='A1B1' id='thumbnail-head-{$post->ID}'>\n\t\t\t<p><a href='{$attachment_url}' target='_blank'><img class='thumbnail' src='{$thumb_url}' alt='' /></a></p>\n\t\t\t<p>{$image_edit_button}</p>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t<p><strong>" . __('File name:') . "</strong> {$filename}</p>\n\t\t\t<p><strong>" . __('File type:') . "</strong> {$post->post_mime_type}</p>\n\t\t\t<p><strong>" . __('Upload date:') . "</strong> " . mysql2date(get_option('date_format'), $post->post_date) . '</p>';
    if (!empty($media_dims)) {
        $item .= "<p><strong>" . __('Dimensions:') . "</strong> {$media_dims}</p>\n";
    }
    $item .= "</td></tr>\n";
    $item .= "\n\t\t</thead>\n\t\t<tbody>\n\t\t<tr><td colspan='2' class='imgedit-response' id='imgedit-response-{$post->ID}'></td></tr>\n\t\t<tr><td style='display:none' colspan='2' class='image-editor' id='image-editor-{$post->ID}'></td></tr>\n";
    $defaults = array('input' => 'text', 'required' => false, 'value' => '', 'extra_rows' => array());
    if ($send) {
        $send = get_submit_button(__('Insert into Post'), 'button', "send[{$attachment_id}]", false);
    }
    if ($delete && current_user_can('delete_post', $attachment_id)) {
        if (!EMPTY_TRASH_DAYS) {
            $delete = "<a href='" . nxt_nonce_url("post.php?action=delete&amp;post={$attachment_id}", 'delete-attachment_' . $attachment_id) . "' id='del[{$attachment_id}]' class='delete'>" . __('Delete Permanently') . '</a>';
        } elseif (!MEDIA_TRASH) {
            $delete = "<a href='#' class='del-link' onclick=\"document.getElementById('del_attachment_{$attachment_id}').style.display='block';return false;\">" . __('Delete') . "</a>\n\t\t\t <div id='del_attachment_{$attachment_id}' class='del-attachment' style='display:none;'>" . sprintf(__('You are about to delete <strong>%s</strong>.'), $filename) . "\n\t\t\t <a href='" . nxt_nonce_url("post.php?action=delete&amp;post={$attachment_id}", 'delete-attachment_' . $attachment_id) . "' id='del[{$attachment_id}]' class='button'>" . __('Continue') . "</a>\n\t\t\t <a href='#' class='button' onclick=\"this.parentNode.style.display='none';return false;\">" . __('Cancel') . "</a>\n\t\t\t </div>";
        } else {
            $delete = "<a href='" . nxt_nonce_url("post.php?action=trash&amp;post={$attachment_id}", 'trash-attachment_' . $attachment_id) . "' id='del[{$attachment_id}]' class='delete'>" . __('Move to Trash') . "</a>\n\t\t\t<a href='" . nxt_nonce_url("post.php?action=untrash&amp;post={$attachment_id}", 'untrash-attachment_' . $attachment_id) . "' id='undo[{$attachment_id}]' class='undo hidden'>" . __('Undo') . "</a>";
        }
    } else {
        $delete = '';
    }
    $thumbnail = '';
    $calling_post_id = 0;
    if (isset($_GET['post_id'])) {
        $calling_post_id = absint($_GET['post_id']);
    } elseif (isset($_POST) && count($_POST)) {
        // Like for async-upload where $_GET['post_id'] isn't set
//.........这里部分代码省略.........
开发者ID:nxtclass,项目名称:NXTClass,代码行数:101,代码来源:media.php


示例9: bp_members_adminbar_admin_menu

/**
 * Adds an admin bar menu to any profile page providing site moderator actions
 * that allow capable users to clean up a users account.
 *
 * @package BuddyPress XProfile
 * @global $bp BuddyPress
 */
function bp_members_adminbar_admin_menu()
{
    global $bp;
    // Only show if viewing a user
    if (!$bp->displayed_user->id) {
        return false;
    }
    // Don't show this menu to non site admins or if you're viewing your own profile
    if (!current_user_can('edit_users') || bp_is_my_profile()) {
        return false;
    }
    ?>

	<li id="bp-adminbar-adminoptions-menu">

		<a href=""><?php 
    _e('Admin Options', 'buddypress');
    ?>
</a>

		<ul>
			<?php 
    if (bp_is_active('xprofile')) {
        ?>

				<li><a href="<?php 
        bp_members_component_link('profile', 'edit');
        ?>
"><?php 
        printf(__("Edit %s's Profile", 'buddypress'), esc_attr($bp->displayed_user->fullname));
        ?>
</a></li>

			<?php 
    }
    ?>

			<li><a href="<?php 
    bp_members_component_link('profile', 'change-avatar');
    ?>
"><?php 
    printf(__("Edit %s's Avatar", 'buddypress'), esc_attr($bp->displayed_user->fullname));
    ?>
</a></li>

			<?php 
    if (!bp_core_is_user_spammer($bp->displayed_user->id)) {
        ?>

				<li><a href="<?php 
        echo nxt_nonce_url($bp->displayed_user->domain . 'admin/mark-spammer/', 'mark-unmark-spammer');
        ?>
" class="confirm"><?php 
        printf(__("Mark as Spammer", 'buddypress'), esc_attr($bp->displayed_user->fullname));
        ?>
</a></li>

			<?php 
    } else {
        ?>

				<li><a href="<?php 
        echo nxt_nonce_url($bp->displayed_user->domain . 'admin/unmark-spammer/', 'mark-unmark-spammer');
        ?>
" class="confirm"><?php 
        _e("Not a Spammer", 'buddypress');
        ?>
</a></li>

			<?php 
    }
    ?>

			<li><a href="<?php 
    echo nxt_nonce_url($bp->displayed_user->domain . 'admin/delete-user/', 'delete-user');
    ?>
" class="confirm"><?php 
    printf(__("Delete %s's Account", 'buddypress'), esc_attr($bp->displayed_user->fullname));
    ?>
</a></li>

			<?php 
    do_action('bp_members_adminbar_admin_menu');
    ?>

		</ul>
	</li>

	<?php 
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:97,代码来源:bp-members-buddybar.php


示例10: bp_get_the_thread_delete_link

function bp_get_the_thread_delete_link()
{
    global $bp;
    return apply_filters('bp_get_message_thread_delete_link', nxt_nonce_url($bp->loggedin_user->domain . $bp->messages->slug . '/inbox/delete/' . bp_get_the_thread_id(), 'messages_delete_thread'));
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:5,代码来源:bp-messages-template.php


示例11: nxt_list_post_revisions

/**
 * Display list of a post's revisions.
 *
 * Can output either a UL with edit links or a TABLE with diff interface, and
 * restore action links.
 *
 * Second argument controls parameters:
 *   (bool)   parent : include the parent (the "Current Revision") in the list.
 *   (string) format : 'list' or 'form-table'.  'list' outputs UL, 'form-table'
 *                     outputs TABLE with UI.
 *   (int)    right  : what revision is currently being viewed - used in
 *                     form-table format.
 *   (int)    left   : what revision is currently being diffed against right -
 *                     used in form-table format.
 *
 * @package NXTClass
 * @subpackage Post_Revisions
 * @since 2.6.0
 *
 * @uses nxt_get_post_revisions()
 * @uses nxt_post_revision_title()
 * @uses get_edit_post_link()
 * @uses get_the_author_meta()
 *
 * @todo split into two functions (list, form-table) ?
 *
 * @param int|object $post_id Post ID or post object.
 * @param string|array $args See description {@link nxt_parse_args()}.
 * @return null
 */
function nxt_list_post_revisions($post_id = 0, $args = null)
{
    if (!($post = get_post($post_id))) {
        return;
    }
    $defaults = array('parent' => false, 'right' => false, 'left' => false, 'format' => 'list', 'type' => 'all');
    extract(nxt_parse_args($args, $defaults), EXTR_SKIP);
    switch ($type) {
        case 'autosave':
            if (!($autosave = nxt_get_post_autosave($post->ID))) {
                return;
            }
            $revisions = array($autosave);
            break;
        case 'revision':
            // just revisions - remove autosave later
        // just revisions - remove autosave later
        case 'all':
        default:
            if (!($revisions = nxt_get_post_revisions($post->ID))) {
                return;
            }
            break;
    }
    /* translators: post revision: 1: when, 2: author name */
    $titlef = _x('%1$s by %2$s', 'post revision');
    if ($parent) {
        array_unshift($revisions, $post);
    }
    $rows = $right_checked = '';
    $class = false;
    $can_edit_post = current_user_can('edit_post', $post->ID);
    foreach ($revisions as $revision) {
        if (!current_user_can('read_post', $revision->ID)) {
            continue;
        }
        if ('revision' === $type && nxt_is_post_autosave($revision)) {
            continue;
        }
        $date = nxt_post_revision_title($revision);
        $name = get_the_author_meta('display_name', $revision->post_author);
        if ('form-table' == $format) {
            if ($left) {
                $left_checked = $left == $revision->ID ? ' checked="checked"' : '';
            } else {
                $left_checked = $right_checked ? ' checked="checked"' : '';
            }
            // [sic] (the next one)
            $right_checked = $right == $revision->ID ? ' checked="checked"' : '';
            $class = $class ? '' : " class='alternate'";
            if ($post->ID != $revision->ID && $can_edit_post) {
                $actions = '<a href="' . nxt_nonce_url(add_query_arg(array('revision' => $revision->ID, 'action' => 'restore')), "restore-post_{$post->ID}|{$revision->ID}") . '">' . __('Restore') . '</a>';
            } else {
                $actions = '';
            }
            $rows .= "<tr{$class}>\n";
            $rows .= "\t<th style='white-space: nowrap' scope='row'><input type='radio' name='left' value='{$revision->ID}'{$left_checked} /></th>\n";
            $rows .= "\t<th style='white-space: nowrap' scope='row'><input type='radio' name='right' value='{$revision->ID}'{$right_checked} /></th>\n";
            $rows .= "\t<td>{$date}</td>\n";
            $rows .= "\t<td>{$name}</td>\n";
            $rows .= "\t<td class='action-links'>{$actions}</td>\n";
            $rows .= "</tr>\n";
        } else {
            $title = sprintf($titlef, $date, $name);
            $rows .= "\t<li>{$title}</li>\n";
        }
    }
    if ('form-table' == $format) {
        ?>

//.........这里部分代码省略.........
开发者ID:nxtclass,项目名称:NXTClass,代码行数:101,代码来源:post-template.php


示例12: submit_button

								<?php 
}
?>
								<br class="clear" />
								<div class="publishing-action">
									<?php 
submit_button(empty($nav_menu_selected_id) ? __('Create Menu') : __('Save Menu'), 'button-primary menu-save', 'save_menu', false, array('id' => 'save_menu_header'));
?>
								</div><!-- END .publishing-action -->

								<?php 
if (!empty($nav_menu_selected_id)) {
    ?>
								<div class="delete-action">
									<a class="submitdelete deletion menu-delete" href="<?php 
    echo esc_url(nxt_nonce_url(admin_url('nav-menus.php?action=delete&amp;menu=' . $nav_menu_selected_id), 'delete-nav_menu-' . $nav_menu_selected_id));
    ?>
"><?php 
    _e('Delete Menu');
    ?>
</a>
								</div><!-- END .delete-action -->
								<?php 
}
?>
							</div><!-- END .major-publishing-actions -->
						</div><!-- END #submitpost .submitbox -->
						<?php 
nxt_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
nxt_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
nxt_nonce_field('update-nav_menu', 'update-nav-menu-nonce');
开发者ID:nxtclass,项目名称:NXTClass,代码行数:31,代码来源:nav-menus.php


示例13: display_rows

    function display_rows()
    {
        $themes = $this->items;
        $theme_names = array_keys($themes);
        natcasesort($theme_names);
        foreach ($theme_names as $theme_name) {
            $class = array('available-theme');
            ?>
	<div class="<?php 
            echo join(' ', $class);
            ?>
">
	<?php 
            if (!empty($theme_name)) {
                $template = $themes[$theme_name]['Template'];
                $stylesheet = $themes[$theme_name]['Stylesheet'];
                $title = $themes[$theme_name]['Title'];
                $version = $themes[$theme_name]['Version'];
                $description = $themes[$theme_name]['Description'];
                $author = $themes[$theme_name]['Author'];
                $screenshot = $themes[$theme_name]['Screenshot'];
                $stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
                $template_dir = $themes[$theme_name]['Template Dir'];
                $parent_theme = $themes[$theme_name]['Parent Theme'];
                $theme_root = $themes[$theme_name]['Theme Root'];
                $theme_root_uri = $themes[$theme_name]['Theme Root URI'];
                $preview_link = esc_url(get_option('home') . '/');
                if (is_ssl()) {
                    $preview_link = str_replace('http://', 'https://', $preview_link);
                }
                $preview_link = htmlspecialchars(add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => true, 'TB_iframe' => 'true'), $preview_link));
                $preview_text = esc_attr(sprintf(__('Preview of &#8220;%s&#8221;'), $title));
                $tags = $themes[$theme_name]['Tags'];
                $thickbox_class = 'thickbox thickbox-preview';
                $activate_link = nxt_nonce_url("themes.php?action=activate&amp;template=" . urlencode($template) . "&amp;stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);
                $activate_text = esc_attr(sprintf(__('Activate &#8220;%s&#8221;'), $title));
                $actions = array();
                $actions[] = '<a href="' . $activate_link . '" class="activatelink" title="' . $activate_text . '">' . __('Activate') . '</a>';
                $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $theme_name)) . '">' . __('Preview') . '</a>';
                if (!is_multisite() && current_user_can('delete_themes')) {
                    $actions[] = '<a class="submitdelete deletion" href="' . nxt_nonce_url("themes.php?action=delete&amp;template={$stylesheet}", 'delete-theme_' . $stylesheet) . '" onclick="' . "return confirm( '" . esc_js(sprintf(__("You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete."), $theme_name)) . "' );" . '">' . __('Delete') . '</a>';
                }
                $actions = apply_filters('theme_action_links', $actions, $themes[$theme_name]);
                $actions = implode(' | ', $actions);
                ?>
		<a href="<?php 
                echo $preview_link;
                ?>
" class="<?php 
                echo $thickbox_class;
                ?>
 screenshot">
<?php 
                if ($screenshot) {
                    ?>
			<img src="<?php 
                    echo $theme_root_uri . '/' . $stylesheet . '/' . $screenshot;
                    ?>
" alt="" />
<?php 
                }
                ?>
		</a>
<h3><?php 
                /* translators: 1: theme title, 2: theme version, 3: theme author */
                printf(__('%1$s %2$s by %3$s'), $title, $version, $author);
                ?>
</h3>
<p class="description"><?php 
                echo $description;
                ?>
</p>
<span class='action-links'><?php 
                echo $actions;
                ?>
</span>
	<?php 
                if (current_user_can('edit_themes') && $parent_theme) {
                    /* translators: 1: theme title, 2:  template dir, 3: stylesheet_dir, 4: theme title, 5: parent_theme */
                    ?>
	<p><?php 
                    printf(__('The template files are located in <code>%2$s</code>. The stylesheet files are located in <code>%3$s</code>. <strong>%4$s</strong> uses templates from <strong>%5$s</strong>. Changes made to the templates will affect both themes.'), $title, str_replace(nxt_CONTENT_DIR, '', $template_dir), str_replace(nxt_CONTENT_DIR, '', $stylesheet_dir), $title, $parent_theme);
                    ?>
</p>
<?php 
                } else {
                    ?>
	<p><?php 
                    printf(__('All of this theme&#8217;s files are located in <code>%2$s</code>.'), $title, str_replace(nxt_CONTENT_DIR, '', $template_dir), str_replace(nxt_CONTENT_DIR, '', $stylesheet_dir));
                    ?>
</p>
<?php 
                }
                if ($tags) {
                    ?>
<p><?php 
                    _e('Tags:');
                    ?>
 <?php 
                    echo join(', ', $tags);
//.........这里部分代码省略.........
开发者ID:nxtclass,项目名称:NXTClass,代码行数:101,代码来源:class-nxt-themes-list-table.php


示例14: HtmlShowOptionsPage

    /**
     * Displays the option page
     *
     * @since 3.0
     * @access public
     * @author Arne Brachhold
     */
    function HtmlShowOptionsPage()
    {
        global $nxt_version;
        $snl = false;
        //SNL
        $this->sg->Initate();
        $message = "";
        if (!empty($_REQUEST["sm_rebuild"])) {
            //Pressed Button: Rebuild Sitemap
            check_admin_referer('sitemap');
            //Clear any outstanding build cron jobs
            if (function_exists('nxt_clear_scheduled_hook')) {
                nxt_clear_scheduled_hook('sm_build_cron');
            }
            if (isset($_GET["sm_do_debug"]) && $_GET["sm_do_debug"] == "true") {
                //Check again, just for the case that something went wrong before
                if (!current_user_can("administrator")) {
                    echo '<p>Please log in as admin</p>';
                    return;
                }
                $oldErr = error_reporting(E_ALL);
                $oldIni = ini_set("display_errors", 1);
                echo '<div class="wrap">';
                echo '<h2>' . __('XML Sitemap Generator for NXTClass', 'sitemap') . " " . $this->sg->GetVersion() . '</h2>';
                echo '<p>This is the debug mode of the XML Sitemap Generator. It will show all PHP notices and warnings as well as the internal logs, messages and configuration.</p>';
                echo '<p style="font-weight:bold; color:red; padding:5px; border:1px red solid; text-align:center;">DO NOT POST THIS INFORMATION ON PUBLIC PAGES LIKE SUPPORT FORUMS AS IT MAY CONTAIN PASSWORDS OR SECRET SERVER INFORMATION!</p>';
                echo "<h3>NXTClass and PHP Information</h3>";
                echo '<p>NXTClass ' . $GLOBALS['nxt_version'] . ' with ' . ' DB ' . $GLOBALS['nxt_db_version'] . ' on PHP ' . phpversion() . '</p>';
                echo '<p>Plugin version: ' . $this->sg->GetVersion() . ' (' . $this->sg->_svnVersion . ')';
                echo '<h4>Environment</h4>';
                echo "<pre>";
                $sc = $_SERVER;
                unset($sc["HTTP_COOKIE"]);
                print_r($sc);
                echo "</pre>";
                echo "<h4>NXTClass Config</h4>";
                echo "<pre>";
                $opts = array();
                if (function_exists('nxt_load_alloptions')) {
                    $opts = nxt_load_alloptions();
                } else {
                    global $nxtdb;
                    $os = $nxtdb->get_results("SELECT option_name, option_value FROM {$nxtdb->options}");
                    foreach ((array) $os as $o) {
                        $opts[$o->option_name] = $o->option_value;
                    }
                }
                $popts = array();
                foreach ($opts as $k => $v) {
                    //Try to filter out passwords etc...
                    if (preg_match("/pass|login|pw|secret|user|usr|key|auth|token/si", $k)) {
                        continue;
                    }
                    $popts[$k] = htmlspecialchars($v);
                }
                print_r($popts);
                echo "</pre>";
                echo '<h4>Sitemap Config</h4>';
                echo "<pre>";
                print_r($this->sg->_options);
                echo "</pre>";
                echo '<h3>Errors, Warnings, Notices</h3>';
                echo '<div>';
                $status = $this->sg->BuildSitemap();
                echo '</div>';
                echo '<h3>MySQL Queries</h3>';
                if (defined('SAVEQUERIES') && SAVEQUERIES) {
                    echo '<pre>';
                    var_dump($GLOBALS['nxtdb']->queries);
                    echo '</pre>';
                    $total = 0;
                    foreach ($GLOBALS['nxtdb']->queries as $q) {
                        $total += $q[1];
                    }
                    echo '<h4>Total Query Time</h4>';
                    echo '<pre>' . count($GLOBALS['nxtdb']->queries) . ' queries in ' . round($total, 2) . ' seconds.</pre>';
                } else {
                    echo '<p>Please edit nxt-db.inc.php in nxt-includes and set SAVEQUERIES to true if you want to see the queries.</p>';
                }
                echo "<h3>Build Process Results</h3>";
                echo "<pre>";
                print_r($status);
 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP nxt_parse_args函数代码示例发布时间:2022-05-15
下一篇:
PHP nxt_nonce_field函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap