コード例 #1
0
 /**
  * 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();
 }
コード例 #2
0
    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 
    }
コード例 #3
0
/**
 * 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);
}
コード例 #4
0
ファイル: upload.php プロジェクト: nxtclass/NXTClass
    $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 
}
?>
コード例 #5
0
ファイル: edit.php プロジェクト: nxtclass/NXTClass
    }
    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 
}
コード例 #6
0
ファイル: domain_mapping.php プロジェクト: nxtclass/NXTClass
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>";
}
コード例 #7
0
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);
}
コード例 #8
0
ファイル: media.php プロジェクト: nxtclass/NXTClass
/**
 * 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
        $calling_post_id = $post->post_parent;
    }
    if ('image' == $type && $calling_post_id && current_theme_supports('post-thumbnails', get_post_type($calling_post_id)) && post_type_supports(get_post_type($calling_post_id), 'thumbnail') && get_post_thumbnail_id($calling_post_id) != $attachment_id) {
        $ajax_nonce = nxt_create_nonce("set_post_thumbnail-{$calling_post_id}");
        $thumbnail = "<a class='nxt-post-thumbnail' id='nxt-post-thumbnail-" . $attachment_id . "' href='#' onclick='nxtSetAsThumbnail(\"{$attachment_id}\", \"{$ajax_nonce}\");return false;'>" . esc_html__("Use as featured image") . "</a>";
    }
    if (($send || $thumbnail || $delete) && !isset($form_fields['buttons'])) {
        $form_fields['buttons'] = array('tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>{$send} {$thumbnail} {$delete}</td></tr>\n");
    }
    $hidden_fields = array();
    foreach ($form_fields as $id => $field) {
        if ($id[0] == '_') {
            continue;
        }
        if (!empty($field['tr'])) {
            $item .= $field['tr'];
            continue;
        }
        $field = array_merge($defaults, $field);
        $name = "attachments[{$attachment_id}][{$id}]";
        if ($field['input'] == 'hidden') {
            $hidden_fields[$name] = $field['value'];
            continue;
        }
        $required = $field['required'] ? '<span class="alignright"><abbr title="required" class="required">*</abbr></span>' : '';
        $aria_required = $field['required'] ? " aria-required='true' " : '';
        $class = $id;
        $class .= $field['required'] ? ' form-required' : '';
        $item .= "\t\t<tr class='{$class}'>\n\t\t\t<th valign='top' scope='row' class='label'><label for='{$name}'><span class='alignleft'>{$field['label']}</span>{$required}<br class='clear' /></label></th>\n\t\t\t<td class='field'>";
        if (!empty($field[$field['input']])) {
            $item .= $field[$field['input']];
        } elseif ($field['input'] == 'textarea') {
            if (user_can_richedit()) {
                // textarea_escaped when user_can_richedit() = false
                $field['value'] = esc_textarea($field['value']);
            }
            $item .= "<textarea id='{$name}' name='{$name}' {$aria_required}>" . $field['value'] . '</textarea>';
        } else {
            $item .= "<input type='text' class='text' id='{$name}' name='{$name}' value='" . esc_attr($field['value']) . "' {$aria_required} />";
        }
        if (!empty($field['helps'])) {
            $item .= "<p class='help'>" . join("</p>\n<p class='help'>", array_unique((array) $field['helps'])) . '</p>';
        }
        $item .= "</td>\n\t\t</tr>\n";
        $extra_rows = array();
        if (!empty($field['errors'])) {
            foreach (array_unique((array) $field['errors']) as $error) {
                $extra_rows['error'][] = $error;
            }
        }
        if (!empty($field['extra_rows'])) {
            foreach ($field['extra_rows'] as $class => $rows) {
                foreach ((array) $rows as $html) {
                    $extra_rows[$class][] = $html;
                }
            }
        }
        foreach ($extra_rows as $class => $rows) {
            foreach ($rows as $html) {
                $item .= "\t\t<tr><td></td><td class='{$class}'>{$html}</td></tr>\n";
            }
        }
    }
    if (!empty($form_fields['_final'])) {
        $item .= "\t\t<tr class='final'><td colspan='2'>{$form_fields['_final']}</td></tr>\n";
    }
    $item .= "\t</tbody>\n";
    $item .= "\t</table>\n";
    foreach ($hidden_fields as $name => $value) {
        $item .= "\t<input type='hidden' name='{$name}' id='{$name}' value='" . esc_attr($value) . "' />\n";
    }
    if ($post->post_parent < 1 && isset($_REQUEST['post_id'])) {
        $parent = (int) $_REQUEST['post_id'];
        $parent_name = "attachments[{$attachment_id}][post_parent]";
        $item .= "\t<input type='hidden' name='{$parent_name}' id='{$parent_name}' value='{$parent}' />\n";
    }
    return $item;
}
コード例 #9
0
/**
 * 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 
}
コード例 #10
0
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'));
}
コード例 #11
0
ファイル: post-template.php プロジェクト: nxtclass/NXTClass
/**
 * 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) {
        ?>

<form action="revision.php" method="get">

<div class="tablenav">
	<div class="alignleft">
		<input type="submit" class="button-secondary" value="<?php 
        esc_attr_e('Compare Revisions');
        ?>
" />
		<input type="hidden" name="action" value="diff" />
		<input type="hidden" name="post_type" value="<?php 
        echo esc_attr($post->post_type);
        ?>
" />
	</div>
</div>

<br class="clear" />

<table class="widefat post-revisions" cellspacing="0" id="post-revisions">
	<col />
	<col />
	<col style="width: 33%" />
	<col style="width: 33%" />
	<col style="width: 33%" />
<thead>
<tr>
	<th scope="col"><?php 
        /* translators: column name in revisons */
        _ex('Old', 'revisions column name');
        ?>
</th>
	<th scope="col"><?php 
        /* translators: column name in revisons */
        _ex('New', 'revisions column name');
        ?>
</th>
	<th scope="col"><?php 
        /* translators: column name in revisons */
        _ex('Date Created', 'revisions column name');
        ?>
</th>
	<th scope="col"><?php 
        _e('Author');
        ?>
</th>
	<th scope="col" class="action-links"><?php 
        _e('Actions');
        ?>
</th>
</tr>
</thead>
<tbody>

<?php 
        echo $rows;
        ?>

</tbody>
</table>

</form>

<?php 
    } else {
        echo "<ul class='post-revisions'>\n";
        echo $rows;
        echo "</ul>";
    }
}
コード例 #12
0
ファイル: nav-menus.php プロジェクト: nxtclass/NXTClass
								<?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');
コード例 #13
0
    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);
                    ?>
</p>
<?php 
                }
                ?>
		<?php 
                theme_update_available($themes[$theme_name]);
            }
            // end if not empty theme_name
            ?>
	</div>
<?php 
        }
        // end foreach $theme_names
    }
コード例 #14
0
ファイル: sitemap-ui.php プロジェクト: nxtclass/NXTClass
    /**
     * 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);
                echo "</pre>";
                echo '<p>Done. <a href="' . nxt_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true&sm_do_debug=true", 'sitemap') . '">Rebuild</a> or <a href="' . $this->sg->GetBackLink() . '">Return</a></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 '</div>';
                @error_reporting($oldErr);
                @ini_set("display_errors", $oldIni);
                return;
            } else {
                $this->sg->BuildSitemap();
                $redirURL = $this->sg->GetBackLink() . '&sm_fromrb=true';
                //Redirect so the sm_rebuild GET parameter no longer exists.
                @header("location: " . $redirURL);
                //If there was already any other output, the header redirect will fail
                echo '<script type="text/javascript">location.replace("' . $redirURL . '");</script>';
                echo '<noscript><a href="' . $redirURL . '">Click here to continue</a></noscript>';
                exit;
            }
        } else {
            if (!empty($_POST['sm_update'])) {
                //Pressed Button: Update Config
                check_admin_referer('sitemap');
                if (isset($_POST['sm_b_style']) && $_POST['sm_b_style'] == $this->sg->getDefaultStyle()) {
                    $_POST['sm_b_style_default'] = true;
                    $_POST['sm_b_style'] = '';
                }
                foreach ($this->sg->_options as $k => $v) {
                    //Check vor values and convert them into their types, based on the category they are in
                    if (!isset($_POST[$k])) {
                        $_POST[$k] = "";
                    }
                    // Empty string will get false on 2bool and 0 on 2float
                    //Options of the category "Basic Settings" are boolean, except the filename and the autoprio provider
                    if (substr($k, 0, 5) == "sm_b_") {
                        if ($k == "sm_b_filename" || $k == "sm_b_fileurl_manual" || $k == "sm_b_filename_manual" || $k == "sm_b_prio_provider" || $k == "sm_b_manual_key" || $k == "sm_b_style" || $k == "sm_b_memory") {
                            if ($k == "sm_b_filename_manual" && strpos($_POST[$k], "\\") !== false) {
                                $_POST[$k] = stripslashes($_POST[$k]);
                            }
                            $this->sg->_options[$k] = (string) $_POST[$k];
                        } else {
                            if ($k == "sm_b_location_mode") {
                                $tmp = (string) $_POST[$k];
                                $tmp = strtolower($tmp);
                                if ($tmp == "auto" || ($tmp = "manual")) {
                                    $this->sg->_options[$k] = $tmp;
                                } else {
                                    $this->sg->_options[$k] = "auto";
                                }
                            } else {
                                if ($k == "sm_b_time" || $k == "sm_b_max_posts") {
                                    if ($_POST[$k] == '') {
                                        $_POST[$k] = -1;
                                    }
                                    $this->sg->_options[$k] = intval($_POST[$k]);
                                } else {
                                    if ($k == "sm_i_install_date") {
                                        if ($this->sg->GetOption('i_install_date') <= 0) {
                                            $this->sg->_options[$k] = time();
                                        }
                                    } else {
                                        if ($k == "sm_b_exclude") {
                                            $IDss = array();
                                            $IDs = explode(",", $_POST[$k]);
                                            for ($x = 0; $x < count($IDs); $x++) {
                                                $ID = intval(trim($IDs[$x]));
                                                if ($ID > 0) {
                                                    $IDss[] = $ID;
                                                }
                                            }
                                            $this->sg->_options[$k] = $IDss;
                                        } else {
                                            if ($k == "sm_b_exclude_cats") {
                                                $exCats = array();
                                                if (isset($_POST["post_category"])) {
                                                    foreach ((array) $_POST["post_category"] as $vv) {
                                                        if (!empty($vv) && is_numeric($vv)) {
                                                            $exCats[] = intval($vv);
                                                        }
                                                    }
                                                }
                                                $this->sg->_options[$k] = $exCats;
                                            } else {
                                                $this->sg->_options[$k] = (bool) $_POST[$k];
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        //Options of the category "Includes" are boolean
                    } else {
                        if (substr($k, 0, 6) == "sm_in_") {
                            if ($k == 'sm_in_tax') {
                                $enabledTaxonomies = array();
                                foreach (array_keys((array) $_POST[$k]) as $taxName) {
                                    if (empty($taxName) || !is_taxonomy($taxName)) {
                                        continue;
                                    }
                                    $enabledTaxonomies[] = $taxName;
                                }
                                $this->sg->_options[$k] = $enabledTaxonomies;
                            } else {
                                if ($k == 'sm_in_customtypes') {
                                    $enabledPostTypes = array();
                                    foreach (array_keys((array) $_POST[$k]) as $postTypeName) {
                                        if (empty($postTypeName) || !post_type_exists($postTypeName)) {
                                            continue;
                                        }
                                        $enabledPostTypes[] = $postTypeName;
                                    }
                                    $this->sg->_options[$k] = $enabledPostTypes;
                                } else {
                                    $this->sg->_options[$k] = (bool) $_POST[$k];
                                }
                            }
                            //Options of the category "Change frequencies" are string
                        } else {
                            if (substr($k, 0, 6) == "sm_cf_") {
                                $this->sg->_options[$k] = (string) $_POST[$k];
                                //Options of the category "Priorities" are float
                            } else {
                                if (substr($k, 0, 6) == "sm_pr_") {
                                    $this->sg->_options[$k] = (double) $_POST[$k];
                                }
                            }
                        }
                    }
                }
                //No Mysql unbuffered query for nxt < 2.2
                if (floatval($nxt_version) < 2.2) {
                    $this->sg->SetOption('b_safemode', true);
                }
                //No nxt-Cron for nxt < 2.1
                if (floatval($nxt_version) < 2.1) {
                    $this->sg->SetOption('b_auto_delay', false);
                }
                //Apply page changes from POST
                $this->sg->_pages = $this->sg->HtmlApplyPages();
                if ($this->sg->SaveOptions()) {
                    $message .= __('Configuration updated', 'sitemap') . "<br />";
                } else {
                    $message .= __('Error while saving options', 'sitemap') . "<br />";
                }
                if ($this->sg->SavePages()) {
                    $message .= __("Pages saved", 'sitemap') . "<br />";
                } else {
                    $message .= __('Error while saving pages', 'sitemap') . "<br />";
                }
            } else {
                if (!empty($_POST["sm_reset_config"])) {
                    //Pressed Button: Reset Config
                    check_admin_referer('sitemap');
                    $this->sg->InitOptions();
                    $this->sg->SaveOptions();
                    $message .= __('The default configuration was restored.', 'sitemap');
                }
            }
        }
        //Print out the message to the user, if any
        if ($message != "") {
            ?>
			<div class="updated"><strong><p><?php 
            echo $message;
            ?>
</p></strong></div><?php 
        }
        if (!$snl) {
            if (isset($_GET['sm_hidedonate'])) {
                $this->sg->SetOption('i_hide_donated', true);
                $this->sg->SaveOptions();
            }
            if (isset($_GET['sm_donated'])) {
                $this->sg->SetOption('i_donated', true);
                $this->sg->SaveOptions();
            }
            if (isset($_GET['sm_hide_note'])) {
                $this->sg->SetOption('i_hide_note', true);
                $this->sg->SaveOptions();
            }
            if (isset($_GET['sm_hidedonors'])) {
                $this->sg->SetOption('i_hide_donors', true);
                $this->sg->SaveOptions();
            }
            if (isset($_GET['sm_hide_works'])) {
                $this->sg->SetOption('i_hide_works', true);
                $this->sg->SaveOptions();
            }
            if (isset($_GET['sm_donated']) || $this->sg->GetOption('i_donated') === true && $this->sg->GetOption('i_hide_donated') !== true) {
                ?>
				<div class="updated">
					<strong><p><?php 
                _e('Thank you very much for your donation. You help me to continue support and development of this plugin and other free software!', 'sitemap');
                ?>
 <a href="<?php 
                echo $this->sg->GetBackLink() . "&amp;sm_hidedonate=true";
                ?>
"><small style="font-weight:normal;"><?php 
                _e('Hide this notice', 'sitemap');
                ?>
</small></a></p></strong>
				</div>
				<?php 
            } else {
                if ($this->sg->GetOption('i_donated') !== true && $this->sg->GetOption('i_install_date') > 0 && $this->sg->GetOption('i_hide_note') !== true && time() > $this->sg->GetOption('i_install_date') + 60 * 60 * 24 * 30) {
                    ?>
				<div class="updated">
					<strong><p><?php 
                    echo str_replace("%s", $this->sg->GetRedirectLink("sitemap-donate-note"), __('Thanks for using this plugin! You\'ve installed this plugin over a month ago. If it works and you are satisfied with the results, isn\'t it worth at least a few dollar? <a href="%s">Donations</a> help me to continue support and development of this <i>free</i> software! <a href="%s">Sure, no problem!</a>', 'sitemap'));
                    ?>
 <a href="<?php 
                    echo $this->sg->GetBackLink() . "&amp;sm_donated=true";
                    ?>
" style="float:right; display:block; border:none; margin-left:10px;"><small style="font-weight:normal; "><?php 
                    _e('Sure, but I already did!', 'sitemap');
                    ?>
</small></a> <a href="<?php 
                    echo $this->sg->GetBackLink() . "&amp;sm_hide_note=true";
                    ?>
" style="float:right; display:block; border:none;"><small style="font-weight:normal; "><?php 
                    _e('No thanks, please don\'t bug me anymore!', 'sitemap');
                    ?>
</small></a></p></strong>
					<div style="clear:right;"></div>
				</div>
				<?php 
                } else {
                    if ($this->sg->GetOption('i_install_date') > 0 && $this->sg->GetOption('i_hide_works') !== true && time() > $this->sg->GetOption('i_install_date') + 60 * 60 * 24 * 15) {
                        ?>
				<div class="updated">
					<strong><p><?php 
                        echo str_replace("%s", $this->sg->GetRedirectLink("sitemap-works-note"), __('Thanks for using this plugin! You\'ve installed this plugin some time ago. If it works and your are satisfied, why not <a href="%s">rate it</a> and <a href="%s">recommend it</a> to others? :-)', 'sitemap'));
                        ?>
 <a href="<?php 
                        echo $this->sg->GetBackLink() . "&amp;sm_hide_works=true";
                        ?>
" style="float:right; display:block; border:none;"><small style="font-weight:normal; "><?php 
                        _e('Don\'t show this anymore', 'sitemap');
                        ?>
</small></a></p></strong>
					<div style="clear:right;"></div>
				</div>
				<?php 
                    }
                }
            }
        }
        if (function_exists("nxt_next_scheduled")) {
            $next = nxt_next_scheduled('sm_build_cron');
            if ($next) {
                $diff = (time() - $next) * -1;
                if ($diff <= 0) {
                    $diffMsg = __('Your sitemap is being refreshed at the moment. Depending on your blog size this might take some time!<br /><small>Due to limitations of the NXTClass scheduler, it might take another 60 seconds until the build process is actually started.</small>', 'sitemap');
                } else {
                    $diffMsg = str_replace("%s", $diff, __('Your sitemap will be refreshed in %s seconds. Depending on your blog size this might take some time!', 'sitemap'));
                }
                ?>
				<div class="updated">
					<strong><p><?php 
                echo $diffMsg;
                ?>
</p></strong>
					<div style="clear:right;"></div>
				</div>
				<?php 
            }
        }
        ?>
				
		<style type="text/css">
		
		li.sm_hint {
			color:green;
		}
		
		li.sm_optimize {
			color:orange;
		}
		
		li.sm_error {
			color:red;
		}
		
		input.sm_warning:hover {
			background: #ce0000;
			color: #fff;
		}
		
		a.sm_button {
			padding:4px;
			display:block;
			padding-left:25px;
			background-repeat:no-repeat;
			background-position:5px 50%;
			text-decoration:none;
			border:none;
		}
		
		a.sm_button:hover {
			border-bottom-width:1px;
		}

		a.sm_donatePayPal {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-paypal.gif);
		}
		
		a.sm_donateAmazon {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-amazon.gif);
		}
		
		a.sm_pluginHome {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-arne.gif);
		}
		
		a.sm_pluginList {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-email.gif);
		}
		
		a.sm_pluginSupport {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-nxtclass.gif);
		}
		
		a.sm_pluginBugs {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-trac.gif);
		}
		
		a.sm_resGoogle {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-google.gif);
		}
		
		a.sm_resBing {
			background-image:url(<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/icon-bing.gif);
		}
		
		div.sm-update-nag p {
			margin:5px;
		}
		
		</style>
		
		<?php 
        if ($this->mode == 27) {
            ?>
			<style type="text/css">
		
				.sm-padded .inside {
					margin:12px!important;
				}
				.sm-padded .inside ul {
					margin:6px 0 12px 0;
				}
				
				.sm-padded .inside input {
					padding:1px;
					margin:0;
				}
			</style>
				
			<?php 
        } elseif (version_compare($nxt_version, "2.5", ">=")) {
            ?>
				<style type="text/css">
					div#moremeta {
						float:right;
						width:200px;
						margin-left:10px;
					}
					<?php 
            if (!$snl) {
                ?>
					div#advancedstuff {
						width:770px;
					}
					<?php 
            }
            ?>
					div#poststuff {
						margin-top:10px;
					}
					fieldset.dbx-box {
						margin-bottom:5px;
					}
					
					div.sm-update-nag {
						margin-top:10px!important;
					}
				</style>
				<!--[if lt IE 7]>
					<style type="text/css">
						div#advancedstuff {
							width:735px;
						}
					</style>
				<![endif]-->
				
			<?php 
        } else {
            ?>
				<style type="text/css">
					div.updated-message {
						margin-left:0; margin-right:0;
					}
				</style>
			<?php 
        }
        ?>
		
		<div class="wrap" id="sm_div">
			<form method="post" action="<?php 
        echo $this->sg->GetBackLink();
        ?>
">
				<h2><?php 
        _e('XML Sitemap Generator for NXTClass', 'sitemap');
        echo " " . $this->sg->GetVersion();
        ?>
 </h2>
				<?php 
        if (function_exists("nxt_update_plugins") && (!defined('SM_NO_UPDATE') || SM_NO_UPDATE == false)) {
            nxt_update_plugins();
            $file = GoogleSitemapGeneratorLoader::GetBaseName();
            $plugin_data = get_plugin_data(GoogleSitemapGeneratorLoader::GetPluginFile());
            $current = function_exists('get_transient') ? get_transient('update_plugins') : get_option('update_plugins');
            if (isset($current->response[$file])) {
                $r = $current->response[$file];
                ?>
<div id="update-nag" class="sm-update-nag"><?php 
                if (!current_user_can('edit_plugins') || version_compare($nxt_version, "2.5", "<")) {
                    printf(__('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a>.', 'default'), $plugin_data['Name'], $r->url, $r->new_version);
                } else {
                    if (empty($r->package)) {
                        printf(__('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> <em>automatic upgrade unavailable for this plugin</em>.', 'default'), $plugin_data['Name'], $r->url, $r->new_version);
                    } else {
                        printf(__('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> or <a href="%4$s">upgrade automatically</a>.', 'default'), $plugin_data['Name'], $r->url, $r->new_version, nxt_nonce_url("update.php?action=upgrade-plugin&amp;plugin={$file}", 'upgrade-plugin_' . $file));
                    }
                }
                ?>
</div><?php 
            }
        }
        if (get_option('blog_public') != 1) {
            ?>
<div class="error"><p><?php 
            echo str_replace("%s", "options-privacy.php", __('Your blog is currently blocking search engines! Visit the <a href="%s">privacy settings</a> to change this.', 'sitemap'));
            ?>
</p></div><?php 
        }
        ?>

				<?php 
        if (version_compare($nxt_version, "2.5", "<")) {
            ?>
				<script type="text/javascript" src="../nxt-includes/js/dbx.js"></script>
				<script type="text/javascript">
				//<![CDATA[
				addLoadEvent( function() {
					var manager = new dbxManager('sm_sitemap_meta_33');
					
					//create new docking boxes group
					var meta = new dbxGroup(
						'grabit', 		// container ID [/-_a-zA-Z0-9/]
						'vertical', 	// orientation ['vertical'|'horizontal']
						'10', 			// drag threshold ['n' pixels]
						'no',			// restrict drag movement to container axis ['yes'|'no']
						'10', 			// animate re-ordering [frames per transition, or '0' for no effect]
						'yes', 			// include open/close toggle buttons ['yes'|'no']
						'open', 		// default state ['open'|'closed']
						<?php 
            echo "'" . js_escape(__('open'));
            ?>
', 		// word for "open", as in "open this box"
						<?php 
            echo "'" . js_escape(__('close'));
            ?>
', 		// word for "close", as in "close this box"
						<?php 
            echo "'" . js_escape(__('click-down and drag to move this box'));
            ?>
', // sentence for "move this box" by mouse
						<?php 
            echo "'" . js_escape(__('click to %toggle% this box'));
            ?>
', // pattern-match sentence for "(open|close) this box" by mouse
						<?php 
            echo "'" . js_escape(__('use the arrow keys to move this box'));
            ?>
', // sentence for "move this box" by keyboard
						<?php 
            echo "'" . js_escape(__(', or press the enter key to %toggle% it'));
            ?>
',  // pattern-match sentence-fragment for "(open|close) this box" by keyboard
						'%mytitle%  [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
						);

					var advanced = new dbxGroup(
						'advancedstuff', 		// container ID [/-_a-zA-Z0-9/]
						'vertical', 		// orientation ['vertical'|'horizontal']
						'10', 			// drag threshold ['n' pixels]
						'yes',			// restrict drag movement to container axis ['yes'|'no']
						'10', 			// animate re-ordering [frames per transition, or '0' for no effect]
						'yes', 			// include open/close toggle buttons ['yes'|'no']
						'open', 		// default state ['open'|'closed']
						<?php 
            echo "'" . js_escape(__('open'));
            ?>
', 		// word for "open", as in "open this box"
						<?php 
            echo "'" . js_escape(__('close'));
            ?>
', 		// word for "close", as in "close this box"
						<?php 
            echo "'" . js_escape(__('click-down and drag to move this box'));
            ?>
', // sentence for "move this box" by mouse
						<?php 
            echo "'" . js_escape(__('click to %toggle% this box'));
            ?>
', // pattern-match sentence for "(open|close) this box" by mouse
						<?php 
            echo "'" . js_escape(__('use the arrow keys to move this box'));
            ?>
', // sentence for "move this box" by keyboard
						<?php 
            echo "'" . js_escape(__(', or press the enter key to %toggle% it'));
            ?>
',  // pattern-match sentence-fragment for "(open|close) this box" by keyboard
						'%mytitle%  [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
						);
				});
				//]]>
				</script>
				<?php 
        }
        ?>

				<?php 
        if ($this->mode == 27) {
            ?>
				
					<?php 
            if (!$snl) {
                ?>
						<div id="poststuff" class="metabox-holder has-right-sidebar">
							<div class="inner-sidebar">
								<div id="side-sortables" class="meta-box-sortabless ui-sortable" style="position:relative;">
					<?php 
            } else {
                ?>
						<div id="poststuff" class="metabox-holder">
					<?php 
            }
            ?>
				<?php 
        } else {
            ?>
					<?php 
            if (!$snl) {
                ?>
						<div id="poststuff">
							<div id="moremeta">
								<div id="grabit" class="dbx-group">
					<?php 
            } else {
                ?>
						<div>
					<?php 
            }
            ?>
				<?php 
        }
        ?>
				
					<?php 
        if (!$snl) {
            ?>
				
							<?php 
            $this->HtmlPrintBoxHeader('sm_pnres', __('About this Plugin:', 'sitemap'), true);
            ?>
								<a class="sm_button sm_pluginHome"    href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-home');
            ?>
"><?php 
            _e('Plugin Homepage', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_pluginHome"    href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-feedback');
            ?>
"><?php 
            _e('Suggest a Feature', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_pluginList"    href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-list');
            ?>
"><?php 
            _e('Notify List', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_pluginSupport" href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-support');
            ?>
"><?php 
            _e('Support Forum', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_pluginBugs"    href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-bugs');
            ?>
"><?php 
            _e('Report a Bug', 'sitemap');
            ?>
</a>
								
								<a class="sm_button sm_donatePayPal"  href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-paypal');
            ?>
"><?php 
            _e('Donate with PayPal', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_donateAmazon"  href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-amazon');
            ?>
"><?php 
            _e('My Amazon Wish List', 'sitemap');
            ?>
</a>
								<?php 
            if (__('translator_name', 'sitemap') != 'translator_name') {
                ?>
<a class="sm_button sm_pluginSupport" href="<?php 
                _e('translator_url', 'sitemap');
                ?>
"><?php 
                _e('translator_name', 'sitemap');
                ?>
</a><?php 
            }
            ?>
							<?php 
            $this->HtmlPrintBoxFooter(true);
            ?>
						
						
							<?php 
            $this->HtmlPrintBoxHeader('sm_smres', __('Sitemap Resources:', 'sitemap'), true);
            ?>
								<a class="sm_button sm_resGoogle"    href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-gwt');
            ?>
"><?php 
            _e('Webmaster Tools', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_resGoogle"    href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-gwb');
            ?>
"><?php 
            _e('Webmaster Blog', 'sitemap');
            ?>
</a>

								<a class="sm_button sm_resBing"      href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-lwt');
            ?>
"><?php 
            _e('Webmaster Tools', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_resBing"      href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-lswcb');
            ?>
"><?php 
            _e('Webmaster Center Blog', 'sitemap');
            ?>
</a>
								<br />
								<a class="sm_button sm_resGoogle"    href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-prot');
            ?>
"><?php 
            _e('Sitemaps Protocol', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_resGoogle"    href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-ofaq');
            ?>
"><?php 
            _e('Official Sitemaps FAQ', 'sitemap');
            ?>
</a>
								<a class="sm_button sm_pluginHome"   href="<?php 
            echo $this->sg->GetRedirectLink('sitemap-afaq');
            ?>
"><?php 
            _e('My Sitemaps FAQ', 'sitemap');
            ?>
</a>
							<?php 
            $this->HtmlPrintBoxFooter(true);
            ?>
							
							<?php 
            $this->HtmlPrintBoxHeader('dm_donations', __('Recent Donations:', 'sitemap'), true);
            ?>
								<?php 
            if ($this->sg->GetOption('i_hide_donors') !== true) {
                ?>
									<iframe border="0" frameborder="0" scrolling="no" allowtransparency="yes" style="width:100%; height:80px;" src="<?php 
                echo $this->sg->GetRedirectLink('sitemap-donorlist');
                ?>
">
									<?php 
                _e('List of the donors', 'sitemap');
                ?>
									</iframe><br />
									<a href="<?php 
                echo $this->sg->GetBackLink() . "&amp;sm_hidedonors=true";
                ?>
"><small><?php 
                _e('Hide this list', 'sitemap');
                ?>
</small></a><br /><br />
								<?php 
            }
            ?>
								<a style="float:left; margin-right:5px; border:none;" href="javascript:document.getElementById('sm_donate_form').submit();"><img style="vertical-align:middle; border:none; margin-top:2px;" src="<?php 
            echo $this->sg->GetPluginUrl();
            ?>
img/icon-donate.gif" border="0" alt="PayPal" title="Help me to continue support of this plugin :)" /></a>
								<span><small><?php 
            _e('Thanks for your support!', 'sitemap');
            ?>
</small></span>
								<div style="clear:left; height:1px;"></div>
							<?php 
            $this->HtmlPrintBoxFooter(true);
            ?>
							
						
						</div>
					</div>
					<?php 
        }
        ?>
					
					<?php 
        if ($this->mode == 27) {
            ?>
						<div class="has-sidebar sm-padded" >
					
							<div id="post-body-content" class="<?php 
            if (!$snl) {
                ?>
has-sidebar-content<?php 
            }
            ?>
">
						
								<div class="meta-box-sortabless">
					<?php 
        } else {
            ?>
						<div id="advancedstuff" class="dbx-group" >
					<?php 
        }
        ?>
					
					<!-- Rebuild Area -->
					<?php 
        $status =& GoogleSitemapGeneratorStatus::Load();
        $head = __('The sitemap wasn\'t generated yet.', 'sitemap');
        if ($status != null) {
            $st = $status->GetStartTime();
            $head = str_replace("%date%", date(get_option('date_format'), $st) . " " . date(get_option('time_format'), $st), __("Result of the last build process, started on %date%.", 'sitemap'));
        }
        $this->HtmlPrintBoxHeader('sm_rebuild', $head);
        ?>
						<ul>
							<?php 
        if ($status == null) {
            echo "<li>" . str_replace("%s", nxt_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true&noheader=true", 'sitemap'), __('The sitemap wasn\'t built yet. <a href="%s">Click here</a> to build it the first time.', 'sitemap')) . "</li>";
        } else {
            if ($status->_endTime !== 0) {
                if ($status->_usedXml) {
                    if ($status->_xmlSuccess) {
                        $ft = is_readable($status->_xmlPath) ? filemtime($status->_xmlPath) : false;
                        if ($ft !== false) {
                            echo "<li>" . str_replace("%url%", $status->_xmlUrl, str_replace("%date%", date(get_option('date_format'), $ft) . " " . date(get_option('time_format'), $ft), __("Your <a href=\"%url%\">sitemap</a> was last built on <b>%date%</b>.", 'sitemap'))) . "</li>";
                        } else {
                            echo "<li class=\"sm_error\">" . __("The last build succeeded, but the file was deleted later or can't be accessed anymore. Did you move your blog to another server or domain?", 'sitemap') . "</li>";
                        }
                    } else {
                        echo "<li class=\"sm_error\">" . str_replace("%url%", $this->sg->GetRedirectLink('sitemap-help-files'), __("There was a problem writing your sitemap file. Make sure the file exists and is writable. <a href=\"%url%\">Learn more</a>", 'sitemap')) . "</li>";
                    }
                }
                if ($status->_usedZip) {
                    if ($status->_zipSuccess) {
                        $ft = is_readable($status->_zipPath) ? filemtime($status->_zipPath) : false;
                        if ($ft !== false) {
                            echo "<li>" . str_replace("%url%", $status->_zipUrl, str_replace("%date%", date(get_option('date_format'), $ft) . " " . date(get_option('time_format'), $ft), __("Your sitemap (<a href=\"%url%\">zipped</a>) was last built on <b>%date%</b>.", 'sitemap'))) . "</li>";
                        } else {
                            echo "<li class=\"sm_error\">" . __("The last zipped build succeeded, but the file was deleted later or can't be accessed anymore. Did you move your blog to another server or domain?", 'sitemap') . "</li>";
                        }
                    } else {
                        echo "<li class=\"sm_error\">" . str_replace("%url%", $this->sg->GetRedirectLink('sitemap-help-files'), __("There was a problem writing your zipped sitemap file. Make sure the file exists and is writable. <a href=\"%url%\">Learn more</a>", 'sitemap')) . "</li>";
                    }
                }
                if ($status->_usedGoogle) {
                    if ($status->_gooogleSuccess) {
                        echo "<li>" . __("Google was <b>successfully notified</b> about changes.", 'sitemap') . "</li>";
                        $gt = $status->GetGoogleTime();
                        if ($gt > 4) {
                            echo "<li class=\\sm_optimize\">" . str_replace("%time%", $gt, __("It took %time% seconds to notify Google, maybe you want to disable this feature to reduce the building time.", 'sitemap')) . "</li>";
                        }
                    } else {
                        echo "<li class=\"sm_error\">" . str_replace("%s", nxt_nonce_url($this->sg->GetBackLink() . "&sm_ping_service=google&noheader=true", 'sitemap'), __('There was a problem while notifying Google. <a href="%s">View result</a>', 'sitemap')) . "</li>";
                    }
                }
                if ($status->_usedMsn) {
                    if ($status->_msnSuccess) {
                        echo "<li>" . __("Bing was <b>successfully notified</b> about changes.", 'sitemap') . "</li>";
                        $at = $status->GetMsnTime();
                        if ($at > 4) {
                            echo "<li class=\\sm_optimize\">" . str_replace("%time%", $at, __("It took %time% seconds to notify Bing, maybe you want to disable this feature to reduce the building time.", 'sitemap')) . "</li>";
                        }
                    } else {
                        echo "<li class=\"sm_error\">" . str_replace("%s", nxt_nonce_url($this->sg->GetBackLink() . "&sm_ping_service=msn&noheader=true", 'sitemap'), __('There was a problem while notifying Bing. <a href="%s">View result</a>', 'sitemap')) . "</li>";
                    }
                }
                if ($status->_usedAsk) {
                    if ($status->_askSuccess) {
                        echo "<li>" . __("Ask.com was <b>successfully notified</b> about changes.", 'sitemap') . "</li>";
                        $at = $status->GetAskTime();
                        if ($at > 4) {
                            echo "<li class=\\sm_optimize\">" . str_replace("%time%", $at, __("It took %time% seconds to notify Ask.com, maybe you want to disable this feature to reduce the building time.", 'sitemap')) . "</li>";
                        }
                    } else {
                        echo "<li class=\"sm_error\">" . str_replace("%s", nxt_nonce_url($this->sg->GetBackLink() . "&sm_ping_service=ask&noheader=true", 'sitemap'), __('There was a problem while notifying Ask.com. <a href="%s">View result</a>', 'sitemap')) . "</li>";
                    }
                }
                $et = $status->GetTime();
                $mem = $status->GetMemoryUsage();
                if ($mem > 0) {
                    echo "<li>" . str_replace(array("%time%", "%memory%"), array($et, $mem), __("The building process took about <b>%time% seconds</b> to complete and used %memory% MB of memory.", 'sitemap')) . "</li>";
                } else {
                    echo "<li>" . str_replace("%time%", $et, __("The building process took about <b>%time% seconds</b> to complete.", 'sitemap')) . "</li>";
                }
                if (!$status->_hasChanged) {
                    echo "<li>" . __("The content of your sitemap <strong>didn't change</strong> since the last time so the files were not written and no search engine was pinged.", 'sitemap') . "</li>";
                }
            } else {
                if ($this->sg->GetOption("b_auto_delay")) {
                    $st = ($status->GetStartTime() - time()) * -1;
                    //If the building process runs in background and was started within the last 45 seconds, the sitemap might not be completed yet...
                    if ($st < 45) {
                        echo '<li class="">' . __("The building process might still be active! Reload the page in a few seconds and check if something has changed.", 'sitemap') . '</li>';
                    }
                }
                echo '<li class="sm_error">' . str_replace("%url%", $this->sg->GetRedirectLink('sitemap-help-memtime'), __("The last run didn't finish! Maybe you can raise the memory or time limit for PHP scripts. <a href=\"%url%\">Learn more</a>", 'sitemap')) . '</li>';
                if ($status->_memoryUsage > 0) {
                    echo '<li class="sm_error">' . str_replace(array("%memused%", "%memlimit%"), array($status->GetMemoryUsage(), ini_get('memory_limit')), __("The last known memory usage of the script was %memused%MB, the limit of your server is %memlimit%.", 'sitemap')) . '</li>';
                }
                if ($status->_lastTime > 0) {
                    echo '<li class="sm_error">' . str_replace(array("%timeused%", "%timelimit%"), array($status->GetLastTime(), ini_get('max_execution_time')), __("The last known execution time of the script was %timeused% seconds, the limit of your server is %timelimit% seconds.", 'sitemap')) . '</li>';
                }
                if ($status->GetLastPost() > 0) {
                    echo '<li class="sm_optimize">' . str_replace("%lastpost%", $status->GetLastPost(), __("The script stopped around post number %lastpost% (+/- 100)", 'sitemap')) . '</li>';
                }
            }
            echo "<li>" . str_replace("%s", nxt_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true&noheader=true", 'sitemap'), __('If you changed something on your server or blog, you should <a href="%s">rebuild the sitemap</a> manually.', 'sitemap')) . "</li>";
        }
        echo "<li>" . str_replace("%d", nxt_nonce_url($this->sg->GetBackLink() . "&sm_rebuild=true&sm_do_debug=true", 'sitemap'), __('If you encounter any problems with the build process you can use the <a href="%d">debug function</a> to get more information.', 'sitemap')) . "</li>";
        if (version_compare($nxt_version, "2.9", ">=") && version_compare(PHP_VERSION, "5.1", ">=")) {
            echo "<li class='sm_hint'>" . str_replace("%s", $this->sg->GetRedirectLink('sitemap-info-beta'), __('There is a new beta version of this plugin available which supports the new multi-site feature of NXTClass as well as many other new functions! <a href="%s">More information and download</a>', 'sitemap')) . "</li>";
        }
        ?>

						</ul>
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
						
					<!-- Basic Options -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_basic_options', __('Basic Options', 'sitemap'));
        ?>
					
						<b><?php 
        _e('Sitemap files:', 'sitemap');
        ?>
</b> <a href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-help-options-files');
        ?>
"><?php 
        _e('Learn more', 'sitemap');
        ?>
</a>
						<ul>
							<li>
								<label for="sm_b_xml">
									<input type="checkbox" id="sm_b_xml" name="sm_b_xml" <?php 
        echo $this->sg->GetOption("b_xml") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Write a normal XML file (your filename)', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_b_gzip">
									<input type="checkbox" id="sm_b_gzip" name="sm_b_gzip" <?php 
        if (function_exists("gzencode")) {
            echo $this->sg->GetOption("b_gzip") == true ? "checked=\"checked\"" : "";
        } else {
            echo "disabled=\"disabled\"";
        }
        ?>
 />
									<?php 
        _e('Write a gzipped file (your filename + .gz)', 'sitemap');
        ?>
								</label>
							</li>
						</ul>
						<b><?php 
        _e('Building mode:', 'sitemap');
        ?>
</b> <a href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-help-options-process');
        ?>
"><?php 
        _e('Learn more', 'sitemap');
        ?>
</a>
						<ul>
							<li>
								<label for="sm_b_auto_enabled">
									<input type="checkbox" id="sm_b_auto_enabled" name="sm_b_auto_enabled" <?php 
        echo $this->sg->GetOption("b_auto_enabled") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Rebuild sitemap if you change the content of your blog', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_b_manual_enabled">
									<input type="hidden" name="sm_b_manual_key" value="<?php 
        echo $this->sg->GetOption("b_manual_key");
        ?>
" />
									<input type="checkbox" id="sm_b_manual_enabled" name="sm_b_manual_enabled" <?php 
        echo $this->sg->GetOption("b_manual_enabled") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Enable manual sitemap building via GET Request', 'sitemap');
        ?>
								</label>
								<a href="javascript:void(document.getElementById('sm_manual_help').style.display='');">[?]</a>
								<span id="sm_manual_help" style="display:none;"><br />
								<?php 
        echo str_replace("%1", trailingslashit(get_bloginfo('url')) . "?sm_command=build&amp;sm_key=" . $this->sg->GetOption("b_manual_key"), __('This will allow you to refresh your sitemap if an external tool wrote into the NXTClass database without using the NXTClass API. Use the following URL to start the process: <a href="%1">%1</a> Please check the result box above to see if sitemap was successfully built.', 'sitemap'));
        ?>
								</span>
							</li>
						</ul>
						<b><?php 
        _e('Update notification:', 'sitemap');
        ?>
</b> <a href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-help-options-ping');
        ?>
"><?php 
        _e('Learn more', 'sitemap');
        ?>
</a>
						<ul>
							<li>
								<input type="checkbox" id="sm_b_ping" name="sm_b_ping" <?php 
        echo $this->sg->GetOption("b_ping") == true ? "checked=\"checked\"" : "";
        ?>
 />
								<label for="sm_b_ping"><?php 
        _e('Notify Google about updates of your Blog', 'sitemap');
        ?>
</label><br />
								<small><?php 
        echo str_replace("%s", $this->sg->GetRedirectLink('sitemap-gwt'), __('No registration required, but you can join the <a href="%s">Google Webmaster Tools</a> to check crawling statistics.', 'sitemap'));
        ?>
</small>
							</li>
							<li>
								<input type="checkbox" id="sm_b_pingmsn" name="sm_b_pingmsn" <?php 
        echo $this->sg->GetOption("b_pingmsn") == true ? "checked=\"checked\"" : "";
        ?>
 />
								<label for="sm_b_pingmsn"><?php 
        _e('Notify Bing (formerly MSN Live Search) about updates of your Blog', 'sitemap');
        ?>
</label><br />
								<small><?php 
        echo str_replace("%s", $this->sg->GetRedirectLink('sitemap-lwt'), __('No registration required, but you can join the <a href="%s">Bing Webmaster Tools</a> to check crawling statistics.', 'sitemap'));
        ?>
</small>
							</li>
							<li>
								<input type="checkbox" id="sm_b_pingask" name="sm_b_pingask" <?php 
        echo $this->sg->GetOption("b_pingask") == true ? "checked=\"checked\"" : "";
        ?>
 />
								<label for="sm_b_pingask"><?php 
        _e('Notify Ask.com about updates of your Blog', 'sitemap');
        ?>
</label><br />
								<small><?php 
        _e('No registration required.', 'sitemap');
        ?>
</small>
							</li>
							<li>
								<label for="sm_b_robots">
								<input type="checkbox" id="sm_b_robots" name="sm_b_robots" <?php 
        echo $this->sg->GetOption("b_robots") == true ? "checked=\"checked\"" : "";
        ?>
 />
								<?php 
        _e("Add sitemap URL to the virtual robots.txt file.", 'sitemap');
        ?>
								</label>

								<br />
								<small><?php 
        _e('The virtual robots.txt generated by NXTClass is used. A real robots.txt file must NOT exist in the blog directory!', 'sitemap');
        ?>
</small>
							</li>
						</ul>
						<b><?php 
        _e('Advanced options:', 'sitemap');
        ?>
</b> <a href="<?php 
        echo $this->sg->GetRedirectLink('sitemap-help-options-adv');
        ?>
"><?php 
        _e('Learn more', 'sitemap');
        ?>
</a>
						<ul>
							<li>
								<label for="sm_b_max_posts"><?php 
        _e('Limit the number of posts in the sitemap:', 'sitemap');
        ?>
 <input type="text" name="sm_b_max_posts" id="sm_b_max_posts" style="width:40px;" value="<?php 
        echo $this->sg->GetOption("b_max_posts") <= 0 ? "" : $this->sg->GetOption("b_max_posts");
        ?>
" /></label> (<?php 
        echo __('Newer posts will be included first', 'sitemap');
        ?>
)
							</li>
							<li>
								<label for="sm_b_memory"><?php 
        _e('Try to increase the memory limit to:', 'sitemap');
        ?>
 <input type="text" name="sm_b_memory" id="sm_b_memory" style="width:40px;" value="<?php 
        echo $this->sg->GetOption("b_memory");
        ?>
" /></label> (<?php 
        echo htmlspecialchars(__('e.g. "4M", "16M"', 'sitemap'));
        ?>
)
							</li>
							<li>
								<label for="sm_b_time"><?php 
        _e('Try to increase the execution time limit to:', 'sitemap');
        ?>
 <input type="text" name="sm_b_time" id="sm_b_time" style="width:40px;" value="<?php 
        echo $this->sg->GetOption("b_time") === -1 ? '' : $this->sg->GetOption("b_time");
        ?>
" /></label> (<?php 
        echo htmlspecialchars(__('in seconds, e.g. "60" or "0" for unlimited', 'sitemap'));
        ?>
)
							</li>
							<li>
								<?php 
        $useDefStyle = $this->sg->GetDefaultStyle() && $this->sg->GetOption('b_style_default') === true;
        ?>
								<label for="sm_b_style"><?php 
        _e('Include a XSLT stylesheet:', 'sitemap');
        ?>
 <input <?php 
        echo $useDefStyle ? 'disabled="disabled" ' : '';
        ?>
 type="text" name="sm_b_style" id="sm_b_style"  value="<?php 
        echo $this->sg->GetOption("b_style");
        ?>
" /></label>
								(<?php 
        _e('Full or relative URL to your .xsl file', 'sitemap');
        ?>
) <?php 
        if ($this->sg->GetDefaultStyle()) {
            ?>
<label for="sm_b_style_default"><input <?php 
            echo $useDefStyle ? 'checked="checked" ' : '';
            ?>
 type="checkbox" id="sm_b_style_default" name="sm_b_style_default" onclick="document.getElementById('sm_b_style').disabled = this.checked;" /> <?php 
            _e('Use default', 'sitemap');
            ?>
 <?php 
        }
        ?>
							</li>
							<li>
								<label for="sm_b_safemode">
									<?php 
        $forceSafeMode = floatval($nxt_version) < 2.2;
        ?>
									<input type="checkbox" <?php 
        if ($forceSafeMode) {
            ?>
disabled="disabled"<?php 
        }
        ?>
 id="sm_b_safemode" name="sm_b_safemode" <?php 
        echo $this->sg->GetOption("b_safemode") == true || $forceSafeMode ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Enable MySQL standard mode. Use this only if you\'re getting MySQL errors. (Needs much more memory!)', 'sitemap');
        ?>
									<?php 
        if ($forceSafeMode) {
            ?>
 <br /><small><?php 
            _e("Upgrade NXTClass at least to 2.2 to enable the faster MySQL access", 'sitemap');
            ?>
</small><?php 
        }
        ?>
								</label>
							</li>
							<li>
								<label for="sm_b_auto_delay">
								<?php 
        $forceDirect = floatval($nxt_version) < 2.1;
        ?>
									<input type="checkbox" <?php 
        if ($forceDirect) {
            ?>
disabled="disabled"<?php 
        }
        ?>
 id="sm_b_auto_delay" name="sm_b_auto_delay" <?php 
        echo $this->sg->GetOption("b_auto_delay") == true && !$forceDirect ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Build the sitemap in a background process (You don\'t have to wait when you save a post)', 'sitemap');
        ?>
									<?php 
        if ($forceDirect) {
            ?>
 <br /><small><?php 
            _e("Upgrade NXTClass at least to 2.1 to enable background building", 'sitemap');
            ?>
</small><?php 
        }
        ?>
								</label>
							</li>
						</ul>
						
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					<?php 
        $this->HtmlPrintBoxHeader('sm_pages', __('Additional pages', 'sitemap'));
        ?>
		
						<?php 
        _e('Here you can specify files or URLs which should be included in the sitemap, but do not belong to your Blog/NXTClass.<br />For example, if your domain is www.foo.com and your blog is located on www.foo.com/blog you might want to include your homepage at www.foo.com', 'sitemap');
        echo "<ul><li>";
        echo "<strong>" . __('Note', 'sitemap') . "</strong>: ";
        _e("If your blog is in a subdirectory and you want to add pages which are NOT in the blog directory or beneath, you MUST place your sitemap file in the root directory (Look at the &quot;Location of your sitemap file&quot; section on this page)!", 'sitemap');
        echo "</li><li>";
        echo "<strong>" . __('URL to the page', 'sitemap') . "</strong>: ";
        _e("Enter the URL to the page. Examples: http://www.foo.com/index.html or www.foo.com/home ", 'sitemap');
        echo "</li><li>";
        echo "<strong>" . __('Priority', 'sitemap') . "</strong>: ";
        _e("Choose the priority of the page relative to the other pages. For example, your homepage might have a higher priority than your imprint.", 'sitemap');
        echo "</li><li>";
        echo "<strong>" . __('Last Changed', 'sitemap') . "</strong>: ";
        _e("Enter the date of the last change as YYYY-MM-DD (2005-12-31 for example) (optional).", 'sitemap');
        echo "</li></ul>";
        ?>
						<script type="text/javascript">
							//<![CDATA[
							<?php 
        $freqVals = "'" . implode("','", array_keys($this->sg->_freqNames)) . "'";
        $freqNames = "'" . implode("','", array_values($this->sg->_freqNames)) . "'";
        ?>

							var changeFreqVals = new Array( <?php 
        echo $freqVals;
        ?>
 );
							var changeFreqNames= new Array( <?php 
        echo $freqNames;
        ?>
 );
							
							var priorities= new Array(0 <?php 
        for ($i = 0.1; $i < 1; $i += 0.1) {
            echo "," . number_format($i, 1, ".", "");
        }
        ?>
);
							
							var pages = [ <?php 
        if (count($this->sg->_pages) > 0) {
            for ($i = 0; $i < count($this->sg->_pages); $i++) {
                $v =& $this->sg->_pages[$i];
                if ($i > 0) {
                    echo ",";
                }
                echo '{url:"' . $v->getUrl() . '", priority:' . number_format($v->getPriority(), 1, ".", "") . ', changeFreq:"' . $v->getChangeFreq() . '", lastChanged:"' . ($v != null && $v->getLastMod() > 0 ? date("Y-m-d", $v->getLastMod()) : "") . '"}';
            }
        }
        ?>
 ];
							//]]>
						</script>
						<script type="text/javascript" src="<?php 
        echo $this->sg->GetPluginUrl();
        ?>
img/sitemap.js"></script>
						<table width="100%" cellpadding="3" cellspacing="3" id="sm_pageTable">
							<tr>
								<th scope="col"><?php 
        _e('URL to the page', 'sitemap');
        ?>
</th>
								<th scope="col"><?php 
        _e('Priority', 'sitemap');
        ?>
</th>
								<th scope="col"><?php 
        _e('Change Frequency', 'sitemap');
        ?>
</th>
								<th scope="col"><?php 
        _e('Last Changed', 'sitemap');
        ?>
</th>
								<th scope="col"><?php 
        _e('#', 'sitemap');
        ?>
</th>
							</tr>
							<?php 
        if (count($this->sg->_pages) <= 0) {
            ?>
									<tr>
										<td colspan="5" align="center"><?php 
            _e('No pages defined.', 'sitemap');
            ?>
</td>
									</tr><?php 
        }
        ?>
						</table>
						<a href="javascript:void(0);" onclick="sm_addPage();"><?php 
        _e("Add new page", 'sitemap');
        ?>
</a>
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					
					<!-- AutoPrio Options -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_postprio', __('Post Priority', 'sitemap'));
        ?>
	
						<p><?php 
        _e('Please select how the priority of each post should be calculated:', 'sitemap');
        ?>
</p>
						<ul>
							<li><p><input type="radio" name="sm_b_prio_provider" id="sm_b_prio_provider__0" value="" <?php 
        echo $this->sg->HtmlGetChecked($this->sg->GetOption("b_prio_provider"), "");
        ?>
 /> <label for="sm_b_prio_provider__0"><?php 
        _e('Do not use automatic priority calculation', 'sitemap');
        ?>
</label><br /><?php 
        _e('All posts will have the same priority which is defined in &quot;Priorities&quot;', 'sitemap');
        ?>
</p></li>
							<?php 
        for ($i = 0; $i < count($this->sg->_prioProviders); $i++) {
            echo "<li><p><input type=\"radio\" id=\"sm_b_prio_provider_{$i}\" name=\"sm_b_prio_provider\" value=\"" . $this->sg->_prioProviders[$i] . "\" " . $this->sg->HtmlGetChecked($this->sg->GetOption("b_prio_provider"), $this->sg->_prioProviders[$i]) . " /> <label for=\"sm_b_prio_provider_{$i}\">" . call_user_func(array(&$this->sg->_prioProviders[$i], 'getName')) . "</label><br />" . call_user_func(array(&$this->sg->_prioProviders[$i], 'getDescription')) . "</p></li>";
        }
        ?>
						</ul>
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
				
						
					<!-- Location Options -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_location', __('Location of your sitemap file', 'sitemap'));
        ?>
		
						<div>
							<b><label for="sm_location_useauto"><input type="radio" id="sm_location_useauto" name="sm_b_location_mode" value="auto" <?php 
        echo $this->sg->GetOption("b_location_mode") == "auto" ? "checked=\"checked\"" : "";
        ?>
 /> <?php 
        _e('Automatic detection', 'sitemap');
        ?>
</label></b>
							<ul>
								<li>
									<label for="sm_b_filename">
										<?php 
        _e('Filename of the sitemap file', 'sitemap');
        ?>
										<input type="text" id="sm_b_filename" name="sm_b_filename" value="<?php 
        echo $this->sg->GetOption("b_filename");
        ?>
" />
									</label><br />
									<?php 
        _e('Detected Path', 'sitemap');
        ?>
: <?php 
        echo $this->sg->getXmlPath(true);
        ?>
<br /><?php 
        _e('Detected URL', 'sitemap');
        ?>
: <a href="<?php 
        echo $this->sg->getXmlUrl(true);
        ?>
"><?php 
        echo $this->sg->getXmlUrl(true);
        ?>
</a>
								</li>
							</ul>
						</div>
						<div>
							<b><label for="sm_location_usemanual"><input type="radio" id="sm_location_usemanual" name="sm_b_location_mode" value="manual" <?php 
        echo $this->sg->GetOption("b_location_mode") == "manual" ? "checked=\"checked\"" : "";
        ?>
  /> <?php 
        _e('Custom location', 'sitemap');
        ?>
</label></b>
							<ul>
								<li>
									<label for="sm_b_filename_manual">
										<?php 
        _e('Absolute or relative path to the sitemap file, including name.', 'sitemap');
        echo "<br />";
        _e('Example', 'sitemap');
        echo ": /var/www/htdocs/nxtclass/sitemap.xml";
        ?>
<br />
										<input style="width:70%" type="text" id="sm_b_filename_manual" name="sm_b_filename_manual" value="<?php 
        echo !$this->sg->GetOption("b_filename_manual") ? $this->sg->getXmlPath() : $this->sg->GetOption("b_filename_manual");
        ?>
" />
									</label>
								</li>
								<li>
									<label for="sm_b_fileurl_manual">
										<?php 
        _e('Complete URL to the sitemap file, including name.', 'sitemap');
        echo "<br />";
        _e('Example', 'sitemap');
        echo ": http://www.yourdomain.com/sitemap.xml";
        ?>
<br />
										<input style="width:70%" type="text" id="sm_b_fileurl_manual" name="sm_b_fileurl_manual" value="<?php 
        echo !$this->sg->GetOption("b_fileurl_manual") ? $this->sg->getXmlUrl() : $this->sg->GetOption("b_fileurl_manual");
        ?>
" />
									</label>
								</li>
							</ul>
						</div>
						
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					<!-- Includes -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_includes', __('Sitemap Content', 'sitemap'));
        ?>
						<b><?php 
        _e('NXTClass standard content', 'sitemap');
        ?>
:</b>
						<ul>
							<li>
								<label for="sm_in_home">
									<input type="checkbox" id="sm_in_home" name="sm_in_home"  <?php 
        echo $this->sg->GetOption("in_home") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include homepage', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_in_posts">
									<input type="checkbox" id="sm_in_posts" name="sm_in_posts"  <?php 
        echo $this->sg->GetOption("in_posts") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include posts', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_in_posts_sub">
									<input type="checkbox" id="sm_in_posts_sub" name="sm_in_posts_sub"  <?php 
        echo $this->sg->GetOption("in_posts_sub") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include following pages of multi-page posts (Increases build time and memory usage!)', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_in_pages">
									<input type="checkbox" id="sm_in_pages" name="sm_in_pages"  <?php 
        echo $this->sg->GetOption("in_pages") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include static pages', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_in_cats">
									<input type="checkbox" id="sm_in_cats" name="sm_in_cats"  <?php 
        echo $this->sg->GetOption("in_cats") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include categories', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_in_arch">
									<input type="checkbox" id="sm_in_arch" name="sm_in_arch"  <?php 
        echo $this->sg->GetOption("in_arch") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include archives', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_in_auth">
									<input type="checkbox" id="sm_in_auth" name="sm_in_auth"  <?php 
        echo $this->sg->GetOption("in_auth") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include author pages', 'sitemap');
        ?>
								</label>
							</li>
							<?php 
        if ($this->sg->IsTaxonomySupported()) {
            ?>
							<li>
								<label for="sm_in_tags">
									<input type="checkbox" id="sm_in_tags" name="sm_in_tags"  <?php 
            echo $this->sg->GetOption("in_tags") == true ? "checked=\"checked\"" : "";
            ?>
 />
									<?php 
            _e('Include tag pages', 'sitemap');
            ?>
								</label>
							</li>
							<?php 
        }
        ?>
						</ul>
							
						<?php 
        if ($this->sg->IsTaxonomySupported()) {
            $taxonomies = $this->sg->GetCustomTaxonomies();
            $enabledTaxonomies = $this->sg->GetOption('in_tax');
            if (count($taxonomies) > 0) {
                ?>
<b><?php 
                _e('Custom taxonomies', 'sitemap');
                ?>
:</b><ul><?php 
                foreach ($taxonomies as $taxName) {
                    $taxonomy = get_taxonomy($taxName);
                    $selected = in_array($taxonomy->name, $enabledTaxonomies);
                    ?>
									<li>
										<label for="sm_in_tax[<?php 
                    echo $taxonomy->name;
                    ?>
]">
											<input type="checkbox" id="sm_in_tax[<?php 
                    echo $taxonomy->name;
                    ?>
]" name="sm_in_tax[<?php 
                    echo $taxonomy->name;
                    ?>
]" <?php 
                    echo $selected ? "checked=\"checked\"" : "";
                    ?>
 />
											<?php 
                    echo str_replace('%s', $taxonomy->label, __('Include taxonomy pages for %s', 'sitemap'));
                    ?>
										</label>
									</li>
									<?php 
                }
                ?>
</ul><?php 
            }
        }
        if ($this->sg->IsCustomPostTypesSupported()) {
            $custom_post_types = $this->sg->GetCustomPostTypes();
            $enabledPostTypes = $this->sg->GetOption('in_customtypes');
            if (count($taxonomies) > 0) {
                ?>
<b><?php 
                _e('Custom post types', 'sitemap');
                ?>
:</b><ul><?php 
                foreach ($custom_post_types as $post_type) {
                    $post_type_object = get_post_type_object($post_type);
                    if (is_array($enabledPostTypes)) {
                        $selected = in_array($post_type_object->name, $enabledPostTypes);
                    }
                    ?>
									<li>
										<label for="sm_in_customtypes[<?php 
                    echo $post_type_object->name;
                    ?>
]">
											<input type="checkbox" id="sm_in_customtypes[<?php 
                    echo $post_type_object->name;
                    ?>
]" name="sm_in_customtypes[<?php 
                    echo $post_type_object->name;
                    ?>
]" <?php 
                    echo $selected ? "checked=\"checked\"" : "";
                    ?>
 />
											<?php 
                    echo str_replace('%s', $post_type_object->label, __('Include custom post type %s', 'sitemap'));
                    ?>
										</label>
									</li>
									<?php 
                }
                ?>
</ul><?php 
            }
        }
        ?>
						
						<b><?php 
        _e('Further options', 'sitemap');
        ?>
:</b>
						<ul>
							<li>
								<label for="sm_in_lastmod">
									<input type="checkbox" id="sm_in_lastmod" name="sm_in_lastmod"  <?php 
        echo $this->sg->GetOption("in_lastmod") == true ? "checked=\"checked\"" : "";
        ?>
 />
									<?php 
        _e('Include the last modification time.', 'sitemap');
        ?>
								</label><br />
								<small><?php 
        _e('This is highly recommended and helps the search engines to know when your content has changed. This option affects <i>all</i> sitemap entries.', 'sitemap');
        ?>
</small>
							</li>
						</ul>
						
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					<!-- Excluded Items -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_excludes', __('Excluded items', 'sitemap'));
        ?>
					
						<b><?php 
        _e('Excluded categories', 'sitemap');
        ?>
:</b>
						<?php 
        if (version_compare($nxt_version, "2.5.1", ">=")) {
            ?>
							<cite style="display:block; margin-left:40px;"><?php 
            _e("Note", "sitemap");
            ?>
: <?php 
            _e("Using this feature will increase build time and memory usage!", "sitemap");
            ?>
</cite>
							<div style="border-color:#CEE1EF; border-style:solid; border-width:2px; height:10em; margin:5px 0px 5px 40px; overflow:auto; padding:0.5em 0.5em;">
							<ul>
								<?php 
            nxt_category_checklist(0, 0, $this->sg->GetOption("b_exclude_cats"), false);
            ?>
							</ul>
							</div>
						<?php 
        } else {
            ?>
							<ul><li><?php 
            echo sprintf(__("This feature requires at least NXTClass 2.5.1, you are using %s", "sitemap"), $nxt_version);
            ?>
</li></ul>
						<?php 
        }
        ?>
						
						<b><?php 
        _e("Exclude posts", "sitemap");
        ?>
:</b>
						<div style="margin:5px 0 13px 40px;">
							<label for="sm_b_exclude"><?php 
        _e('Exclude the following posts or pages:', 'sitemap');
        ?>
 <small><?php 
        _e('List of IDs, separated by comma', 'sitemap');
        ?>
</small><br />
							<input name="sm_b_exclude" id="sm_b_exclude" type="text" style="width:400px;" value="<?php 
        echo implode(",", $this->sg->GetOption("b_exclude"));
        ?>
" /></label><br />
							<cite><?php 
        _e("Note", "sitemap");
        ?>
: <?php 
        _e("Child posts won't be excluded automatically!", "sitemap");
        ?>
</cite>
						</div>
						
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					<!-- Change frequencies -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_change_frequencies', __('Change frequencies', 'sitemap'));
        ?>

						<p>
							<b><?php 
        _e('Note', 'sitemap');
        ?>
:</b>
							<?php 
        _e('Please note that the value of this tag is considered a hint and not a command. Even though search engine crawlers consider this information when making decisions, they may crawl pages marked "hourly" less frequently than that, and they may crawl pages marked "yearly" more frequently than that. It is also likely that crawlers will periodically crawl pages marked "never" so that they can handle unexpected changes to those pages.', 'sitemap');
        ?>
						</p>
						<ul>
							<li>
								<label for="sm_cf_home">
									<select id="sm_cf_home" name="sm_cf_home"><?php 
        $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_home"));
        ?>
</select>
									<?php 
        _e('Homepage', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_cf_posts">
									<select id="sm_cf_posts" name="sm_cf_posts"><?php 
        $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_posts"));
        ?>
</select>
									<?php 
        _e('Posts', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_cf_pages">
									<select id="sm_cf_pages" name="sm_cf_pages"><?php 
        $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_pages"));
        ?>
</select>
									<?php 
        _e('Static pages', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_cf_cats">
									<select id="sm_cf_cats" name="sm_cf_cats"><?php 
        $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_cats"));
        ?>
</select>
									<?php 
        _e('Categories', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_cf_arch_curr">
									<select id="sm_cf_arch_curr" name="sm_cf_arch_curr"><?php 
        $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_arch_curr"));
        ?>
</select>
									<?php 
        _e('The current archive of this month (Should be the same like your homepage)', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_cf_arch_old">
									<select id="sm_cf_arch_old" name="sm_cf_arch_old"><?php 
        $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_arch_old"));
        ?>
</select>
									<?php 
        _e('Older archives (Changes only if you edit an old post)', 'sitemap');
        ?>
								</label>
							</li>
							<?php 
        if ($this->sg->IsTaxonomySupported()) {
            ?>
							<li>
								<label for="sm_cf_tags">
									<select id="sm_cf_tags" name="sm_cf_tags"><?php 
            $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_tags"));
            ?>
</select>
									<?php 
            _e('Tag pages', 'sitemap');
            ?>
								</label>
							</li>
							<?php 
        }
        ?>
							<li>
								<label for="sm_cf_auth">
									<select id="sm_cf_auth" name="sm_cf_auth"><?php 
        $this->sg->HtmlGetFreqNames($this->sg->GetOption("cf_auth"));
        ?>
</select>
									<?php 
        _e('Author pages', 'sitemap');
        ?>
								</label>
							</li>
						</ul>
						
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					<!-- Priorities -->
					<?php 
        $this->HtmlPrintBoxHeader('sm_priorities', __('Priorities', 'sitemap'));
        ?>
						<ul>
							<li>
								<label for="sm_pr_home">
									<select id="sm_pr_home" name="sm_pr_home"><?php 
        $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_home"));
        ?>
</select>
									<?php 
        _e('Homepage', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_pr_posts">
									<select id="sm_pr_posts" name="sm_pr_posts"><?php 
        $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_posts"));
        ?>
</select>
									<?php 
        _e('Posts (If auto calculation is disabled)', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_pr_posts_min">
									<select id="sm_pr_posts_min" name="sm_pr_posts_min"><?php 
        $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_posts_min"));
        ?>
</select>
									<?php 
        _e('Minimum post priority (Even if auto calculation is enabled)', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_pr_pages">
									<select id="sm_pr_pages" name="sm_pr_pages"><?php 
        $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_pages"));
        ?>
</select>
									<?php 
        _e('Static pages', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_pr_cats">
									<select id="sm_pr_cats" name="sm_pr_cats"><?php 
        $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_cats"));
        ?>
</select>
									<?php 
        _e('Categories', 'sitemap');
        ?>
								</label>
							</li>
							<li>
								<label for="sm_pr_arch">
									<select id="sm_pr_arch" name="sm_pr_arch"><?php 
        $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_arch"));
        ?>
</select>
									<?php 
        _e('Archives', 'sitemap');
        ?>
								</label>
							</li>
							<?php 
        if ($this->sg->IsTaxonomySupported()) {
            ?>
							<li>
								<label for="sm_pr_tags">
									<select id="sm_pr_tags" name="sm_pr_tags"><?php 
            $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_tags"));
            ?>
</select>
									<?php 
            _e('Tag pages', 'sitemap');
            ?>
								</label>
							</li>
							<?php 
        }
        ?>
							<li>
								<label for="sm_pr_auth">
									<select id="sm_pr_auth" name="sm_pr_auth"><?php 
        $this->sg->HtmlGetPriorityValues($this->sg->GetOption("pr_auth"));
        ?>
</select>
									<?php 
        _e('Author pages', 'sitemap');
        ?>
								</label>
							</li>
						</ul>
						
					<?php 
        $this->HtmlPrintBoxFooter();
        ?>
					
					</div>
					<div>
						<p class="submit">
							<?php 
        nxt_nonce_field('sitemap');
        ?>
							<input type="submit" name="sm_update" value="<?php 
        _e('Update options', 'sitemap');
        ?>
" />
							<input type="submit" onclick='return confirm("Do you really want to reset your configuration?");' class="sm_warning" name="sm_reset_config" value="<?php 
        _e('Reset options', 'sitemap');
        ?>
" />
						</p>
					</div>
				
				<?php 
        if ($this->mode == 27) {
            ?>
				</div>
				</div>
				<?php 
        }
        ?>
				</div>
				<script type="text/javascript">if(typeof(sm_loadPages)=='function') addLoadEvent(sm_loadPages); </script>
			</form>
			<form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="sm_donate_form">
				<?php 
        $lc = array("en" => array("cc" => "USD", "lc" => "US"), "en-GB" => array("cc" => "GBP", "lc" => "GB"), "de" => array("cc" => "EUR", "lc" => "DE"));
        $myLc = $lc["en"];
        $nxtl = get_bloginfo('language');
        if (!empty($nxtl)) {
            if (array_key_exists($nxtl, $lc)) {
                $myLc = $lc[$nxtl];
            } else {
                $nxtl = substr($nxtl, 0, 2);
                if (array_key_exists($nxtl, $lc)) {
                    $myLc = $lc[$nxtl];
                }
            }
        }
        ?>
				<input type="hidden" name="cmd" value="_xclick" />
				<input type="hidden" name="business" value="<?php 
        echo "donate" . "@" . "arnebra" . "chhold.de";
        ?>
" />
				<input type="hidden" name="item_name" value="Sitemap Generator for NXTClass. Please tell me if if you don't want to be listed on the donator list." />
				<input type="hidden" name="no_shipping" value="1" />
				<input type="hidden" name="return" value="<?php 
        echo $this->sg->GetBackLink();
        ?>
&amp;sm_donated=true" />
				<input type="hidden" name="item_number" value="0001" />
				<input type="hidden" name="currency_code" value="<?php 
        echo $myLc["cc"];
        ?>
" />
				<input type="hidden" name="bn" value="PP-BuyNowBF" />
				<input type="hidden" name="lc" value="<?php 
        echo $myLc["lc"];
        ?>
" />
				<input type="hidden" name="rm" value="2" />
				<input type="hidden" name="on0" value="Your Website" />
				<input type="hidden" name="os0" value="<?php 
        echo get_bloginfo("url");
        ?>
"/>
			</form>
		</div>
		<?php 
    }
コード例 #15
0
 /**
  * Returns popup button html
  *
  * @param string $text
  * @param string $action
  * @param string $params
  * @param integer $width
  * @param integer $height
  * @return string
  */
 function button_popup($text, $action, $params = '', $width = 800, $height = 600)
 {
     $url = nxt_nonce_url(sprintf('admin.php?page=w3tc_general&w3tc_%s%s', $action, $params != '' ? '&' . $params : ''), 'w3tc');
     $url = str_replace('&amp;', '&', $url);
     $onclick = sprintf('window.open(\'%s\', \'%s\', \'width=%d,height=%d,status=no,toolbar=no,menubar=no,scrollbars=yes\');', $url, $action, $width, $height);
     return $this->button($text, $onclick);
 }
コード例 #16
0
ファイル: plugins.php プロジェクト: nxtclass/NXTClass
     check_admin_referer('bulk-plugins');
     if (isset($_GET['plugins'])) {
         $plugins = explode(',', $_GET['plugins']);
     } elseif (isset($_POST['checked'])) {
         $plugins = (array) $_POST['checked'];
     } else {
         $plugins = array();
     }
     $title = __('Update Plugins');
     $parent_file = 'plugins.php';
     require_once ABSPATH . 'nxt-admin/admin-header.php';
     echo '<div class="wrap">';
     screen_icon();
     echo '<h2>' . esc_html($title) . '</h2>';
     $url = self_admin_url('update.php?action=update-selected&amp;plugins=' . urlencode(join(',', $plugins)));
     $url = nxt_nonce_url($url, 'bulk-update-plugins');
     echo "<iframe src='{$url}' style='width: 100%; height:100%; min-height:850px;'></iframe>";
     echo '</div>';
     require_once ABSPATH . 'nxt-admin/admin-footer.php';
     exit;
     break;
 case 'error_scrape':
     if (!current_user_can('activate_plugins')) {
         nxt_die(__('You do not have sufficient permissions to activate plugins for this site.'));
     }
     check_admin_referer('plugin-activation-error_' . $plugin);
     $valid = validate_plugin($plugin);
     if (is_nxt_error($valid)) {
         nxt_die($valid);
     }
     if (!nxt_DEBUG) {
コード例 #17
0
ファイル: import.php プロジェクト: nxtclass/NXTClass
<table class="widefat importers" cellspacing="0">

<?php 
    $style = '';
    foreach ($importers as $id => $data) {
        $style = 'class="alternate"' == $style || 'class="alternate active"' == $style ? '' : 'alternate';
        $action = '';
        if ('install' == $data[2]) {
            $plugin_slug = $id . '-importer';
            if (file_exists(nxt_PLUGIN_DIR . '/' . $plugin_slug)) {
                // Looks like Importer is installed, But not active
                $plugins = get_plugins('/' . $plugin_slug);
                if (!empty($plugins)) {
                    $keys = array_keys($plugins);
                    $plugin_file = $plugin_slug . '/' . $keys[0];
                    $action = '<a href="' . esc_url(nxt_nonce_url(admin_url('plugins.php?action=activate&plugin=' . $plugin_file . '&from=import'), 'activate-plugin_' . $plugin_file)) . '"title="' . esc_attr__('Activate importer') . '"">' . $data[0] . '</a>';
                }
            }
            if (empty($action)) {
                if (is_main_site()) {
                    $action = '<a href="' . esc_url(network_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug . '&from=import&TB_iframe=true&width=600&height=550')) . '" class="thickbox" title="' . esc_attr__('Install importer') . '">' . $data[0] . '</a>';
                } else {
                    $action = $data[0];
                    $data[1] = sprintf(__('This importer is not installed. Please install importers from <a href="%s">the main site</a>.'), get_admin_url($current_site->blog_id, 'import.php'));
                }
            }
        } else {
            $action = "<a href='" . esc_url("admin.php?import={$id}") . "' title='" . esc_attr(nxttexturize(strip_tags($data[1]))) . "'>{$data[0]}</a>";
        }
        if ($style != '') {
            $style = 'class="' . $style . '"';
コード例 #18
0
ファイル: themes.php プロジェクト: nxtclass/NXTClass
     check_admin_referer('bulk-themes');
     if (isset($_GET['themes'])) {
         $themes = explode(',', $_GET['themes']);
     } elseif (isset($_POST['checked'])) {
         $themes = (array) $_POST['checked'];
     } else {
         $themes = array();
     }
     $title = __('Update Themes');
     $parent_file = 'themes.php';
     require_once ABSPATH . 'nxt-admin/admin-header.php';
     echo '<div class="wrap">';
     screen_icon();
     echo '<h2>' . esc_html($title) . '</h2>';
     $url = self_admin_url('update.php?action=update-selected-themes&amp;themes=' . urlencode(join(',', $themes)));
     $url = nxt_nonce_url($url, 'bulk-update-themes');
     echo "<iframe src='{$url}' style='width: 100%; height:100%; min-height:850px;'></iframe>";
     echo '</div>';
     require_once ABSPATH . 'nxt-admin/admin-footer.php';
     exit;
     break;
 case 'delete-selected':
     if (!current_user_can('delete_themes')) {
         nxt_die(__('You do not have sufficient permissions to delete themes for this site.'));
     }
     check_admin_referer('bulk-themes');
     $themes = isset($_REQUEST['checked']) ? (array) $_REQUEST['checked'] : array();
     if (isset($themes[get_option('template')])) {
         unset($themes[get_option('template')]);
     }
     if (isset($themes[get_option('stylesheet')])) {
コード例 #19
0
/**
 * Returns the public message link for displayed user
 *
 * @since 1.2.0
 *
 * @global object $bp BuddyPress global settings
 * @uses bp_is_my_profile()
 * @uses is_user_logged_in()
 * @uses nxt_nonce_url()
 * @uses bp_loggedin_user_domain()
 * @uses bp_get_activity_slug()
 * @uses bp_core_get_username()
 * @uses apply_filters() To call the 'bp_get_send_public_message_link' hook
 *
 * @return string The public message link for displayed user
 */
function bp_get_send_public_message_link()
{
    global $bp;
    if (bp_is_my_profile() || !is_user_logged_in()) {
        return false;
    }
    return apply_filters('bp_get_send_public_message_link', nxt_nonce_url(bp_loggedin_user_domain() . bp_get_activity_slug() . '/?r=' . bp_core_get_username($bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login)));
}
コード例 #20
0
function bp_groups_adminbar_admin_menu()
{
    global $bp, $groups_template;
    if (empty($bp->groups->current_group)) {
        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') || !is_super_admin() || !$bp->is_item_admin && !$bp->is_item_mod) {
        return false;
    }
    ?>

	<li id="bp-adminbar-adminoptions-menu">
		<a href="<?php 
    bp_groups_action_link('admin');
    ?>
"><?php 
    _e('Admin Options', 'buddypress');
    ?>
</a>

		<ul>
			<li><a href="<?php 
    bp_groups_action_link('admin/edit-details');
    ?>
"><?php 
    _e('Edit Details', 'buddypress');
    ?>
</a></li>

			<li><a href="<?php 
    bp_groups_action_link('admin/group-settings');
    ?>
"><?php 
    _e('Group Settings', 'buddypress');
    ?>
</a></li>

			<?php 
    if (!(int) bp_get_option('bp-disable-avatar-uploads')) {
        ?>

				<li><a href="<?php 
        bp_groups_action_link('admin/group-avatar');
        ?>
"><?php 
        _e('Group Avatar', 'buddypress');
        ?>
</a></li>

			<?php 
    }
    ?>

			<?php 
    if (bp_is_active('friends')) {
        ?>

				<li><a href="<?php 
        bp_groups_action_link('send-invites');
        ?>
"><?php 
        _e('Manage Invitations', 'buddypress');
        ?>
</a></li>

			<?php 
    }
    ?>

			<li><a href="<?php 
    bp_groups_action_link('admin/manage-members');
    ?>
"><?php 
    _e('Manage Members', 'buddypress');
    ?>
</a></li>

			<?php 
    if ($bp->groups->current_group->status == 'private') {
        ?>

				<li><a href="<?php 
        bp_groups_action_link('admin/membership-requests');
        ?>
"><?php 
        _e('Membership Requests', 'buddypress');
        ?>
</a></li>

			<?php 
    }
    ?>

			<li><a class="confirm" href="<?php 
    echo nxt_nonce_url(bp_get_group_permalink($bp->groups->current_group) . 'admin/delete-group/', 'groups_delete_group');
    ?>
&amp;delete-group-button=1&amp;delete-group-understand=1"><?php 
    _e("Delete Group", 'buddypress');
    ?>
</a></li>

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

		</ul>
	</li>

	<?php 
}
コード例 #21
0
ファイル: update-core.php プロジェクト: nxtclass/NXTClass
function do_undismiss_core_update()
{
    $version = isset($_POST['version']) ? $_POST['version'] : false;
    $locale = isset($_POST['locale']) ? $_POST['locale'] : 'en_US';
    $update = find_core_update($version, $locale);
    if (!$update) {
        return;
    }
    undismiss_core_update($version, $locale);
    nxt_redirect(nxt_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core'));
    exit;
}
コード例 #22
0
" title="<?php 
        printf(esc_attr__('Edit the %s role', 'members'), $name);
        ?>
"><?php 
        _e('Edit', 'members');
        ?>
</a> 
								<?php 
    }
    ?>

								<?php 
    if (is_multisite() && is_super_admin() && $role !== get_option('default_role') || current_user_can('delete_roles') && $role !== get_option('default_role') && !current_user_can($role)) {
        ?>
									| <a href="<?php 
        echo admin_url(nxt_nonce_url("users.php?page=roles&amp;action=delete&amp;role={$role}", members_get_nonce('edit-roles')));
        ?>
" title="<?php 
        printf(esc_attr__('Delete the %s role', 'members'), $name);
        ?>
"><?php 
        _e('Delete', 'members');
        ?>
</a>
								<?php 
    }
    ?>

								<?php 
    if (current_user_can('manage_options') && $role == get_option('default_role')) {
        ?>
コード例 #23
0
function bp_get_members_component_link($component, $action = '', $query_args = '', $nonce = false)
{
    global $bp;
    // Must be displayed user
    if (empty($bp->displayed_user->id)) {
        return;
    }
    // Append $action to $url if there is no $type
    if (!empty($action)) {
        $url = $bp->displayed_user->domain . $bp->{$component}->slug . '/' . $action;
    } else {
        $url = $bp->displayed_user->domain . $bp->{$component}->slug;
    }
    // Add a slash at the end of our user url
    $url = trailingslashit($url);
    // Add possible query arg
    if (!empty($query_args) && is_array($query_args)) {
        $url = add_query_arg($query_args, $url);
    }
    // To nonce, or not to nonce...
    if (true === $nonce) {
        $url = nxt_nonce_url($url);
    } elseif (is_string($nonce)) {
        $url = nxt_nonce_url($url, $nonce);
    }
    // Return the url, if there is one
    if (!empty($url)) {
        return $url;
    }
}
コード例 #24
0
ファイル: theme-install.php プロジェクト: nxtclass/NXTClass
/**
 * Display theme information in dialog box form.
 *
 * @since 2.8.0
 */
function install_theme_information()
{
    //TODO: This function needs a LOT of UI work :)
    global $tab, $themes_allowedtags;
    $api = themes_api('theme_information', array('slug' => stripslashes($_REQUEST['theme'])));
    if (is_nxt_error($api)) {
        nxt_die($api);
    }
    // Sanitize HTML
    foreach ((array) $api->sections as $section_name => $content) {
        $api->sections[$section_name] = nxt_kses($content, $themes_allowedtags);
    }
    foreach (array('version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug') as $key) {
        if (isset($api->{$key})) {
            $api->{$key} = nxt_kses($api->{$key}, $themes_allowedtags);
        }
    }
    iframe_header(__('Theme Install'));
    if (empty($api->download_link)) {
        echo '<div id="message" class="error"><p>' . __('<strong>ERROR:</strong> This theme is currently not available. Please try again later.') . '</p></div>';
        iframe_footer();
        exit;
    }
    if (!empty($api->tested) && version_compare($GLOBALS['nxt_version'], $api->tested, '>')) {
        echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This theme has <strong>not been tested</strong> with your current version of NXTClass.') . '</p></div>';
    } else {
        if (!empty($api->requires) && version_compare($GLOBALS['nxt_version'], $api->requires, '<')) {
            echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This theme has not been marked as <strong>compatible</strong> with your version of NXTClass.') . '</p></div>';
        }
    }
    // Default to a "new" theme
    $type = 'install';
    // Check to see if this theme is known to be installed, and has an update awaiting it.
    $update_themes = get_site_transient('update_themes');
    if (is_object($update_themes) && isset($update_themes->response)) {
        foreach ((array) $update_themes->response as $theme_slug => $theme_info) {
            if ($theme_slug === $api->slug) {
                $type = 'update_available';
                $update_file = $theme_slug;
                break;
            }
        }
    }
    $themes = get_themes();
    foreach ((array) $themes as $this_theme) {
        if (is_array($this_theme) && $this_theme['Stylesheet'] == $api->slug) {
            if ($this_theme['Version'] == $api->version) {
                $type = 'latest_installed';
            } elseif ($this_theme['Version'] > $api->version) {
                $type = 'newer_installed';
                $newer_version = $this_theme['Version'];
            }
            break;
        }
    }
    ?>

<div class='available-theme'>
<img src='<?php 
    echo esc_url($api->screenshot_url);
    ?>
' width='300' class="theme-preview-img" />
<h3><?php 
    echo $api->name;
    ?>
</h3>
<p><?php 
    printf(__('by %s'), $api->author);
    ?>
</p>
<p><?php 
    printf(__('Version: %s'), $api->version);
    ?>
</p>

<?php 
    $buttons = '<a class="button" id="cancel" href="#" onclick="tb_close();return false;">' . __('Cancel') . '</a> ';
    switch ($type) {
        default:
        case 'install':
            if (current_user_can('install_themes')) {
                $buttons .= '<a class="button-primary" id="install" href="' . nxt_nonce_url(self_admin_url('update.php?action=install-theme&theme=' . $api->slug), 'install-theme_' . $api->slug) . '" target="_parent">' . __('Install Now') . '</a>';
            }
            break;
        case 'update_available':
            if (current_user_can('update_themes')) {
                $buttons .= '<a class="button-primary" id="install"	href="' . nxt_nonce_url(self_admin_url('update.php?action=upgrade-theme&theme=' . $update_file), 'upgrade-theme_' . $update_file) . '" target="_parent">' . __('Install Update Now') . '</a>';
            }
            break;
        case 'newer_installed':
            if (current_user_can('install_themes') || current_user_can('update_themes')) {
                ?>
<p><?php 
                printf(__('Newer version (%s) is installed.'), $newer_version);
                ?>
</p><?php 
            }
            break;
        case 'latest_installed':
            if (current_user_can('install_themes') || current_user_can('update_themes')) {
                ?>
<p><?php 
                _e('This version is already installed.');
                ?>
</p><?php 
            }
            break;
    }
    ?>
<br class="clear" />
</div>

<p class="action-button">
<?php 
    echo $buttons;
    ?>
<br class="clear" />
</p>

<?php 
    iframe_footer();
    exit;
}
コード例 #25
0
 /**
  * Generate HTML for a single row on the users.php admin panel.
  *
  * @since 2.1.0
  *
  * @param object $user_object
  * @param string $style Optional. Attributes added to the TR element.  Must be sanitized.
  * @param string $role Key for the $nxt_roles array.
  * @param int $numposts Optional. Post count to display for this user.  Defaults to zero, as in, a new user has made zero posts.
  * @return string
  */
 function single_row($user_object, $style = '', $role = '', $numposts = 0)
 {
     global $nxt_roles;
     if (!(is_object($user_object) && is_a($user_object, 'nxt_User'))) {
         $user_object = new nxt_User((int) $user_object);
     }
     $user_object->filter = 'display';
     $email = $user_object->user_email;
     if ($this->is_site_users) {
         $url = "site-users.php?id={$this->site_id}&amp;";
     } else {
         $url = 'users.php?';
     }
     $checkbox = '';
     // Check if the user for this row is editable
     if (current_user_can('list_users')) {
         // Set up the user editing link
         // TODO: make profile/user-edit determination a separate function
         if (get_current_user_id() == $user_object->ID) {
             $edit_link = 'profile.php';
         } else {
             $edit_link = esc_url(add_query_arg('nxt_http_referer', urlencode(stripslashes($_SERVER['REQUEST_URI'])), "user-edit.php?user_id={$user_object->ID}"));
         }
         // Set up the hover actions for this user
         $actions = array();
         if (current_user_can('edit_user', $user_object->ID)) {
             $edit = "<strong><a href=\"{$edit_link}\">{$user_object->user_login}</a></strong><br />";
             $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
         } else {
             $edit = "<strong>{$user_object->user_login}</strong><br />";
         }
         if (!is_multisite() && get_current_user_id() != $user_object->ID && current_user_can('delete_user', $user_object->ID)) {
             $actions['delete'] = "<a class='submitdelete' href='" . nxt_nonce_url("users.php?action=delete&amp;user={$user_object->ID}", 'bulk-users') . "'>" . __('Delete') . "</a>";
         }
         if (is_multisite() && get_current_user_id() != $user_object->ID && current_user_can('remove_user', $user_object->ID)) {
             $actions['remove'] = "<a class='submitdelete' href='" . nxt_nonce_url($url . "action=remove&amp;user={$user_object->ID}", 'bulk-users') . "'>" . __('Remove') . "</a>";
         }
         $actions = apply_filters('user_row_actions', $actions, $user_object);
         $edit .= $this->row_actions($actions);
         // Set up the checkbox ( because the user is editable, otherwise its empty )
         $checkbox = "<input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='{$role}' value='{$user_object->ID}' />";
     } else {
         $edit = '<strong>' . $user_object->user_login . '</strong>';
     }
     $role_name = isset($nxt_roles->role_names[$role]) ? translate_user_role($nxt_roles->role_names[$role]) : __('None');
     $avatar = get_avatar($user_object->ID, 32);
     $r = "<tr id='user-{$user_object->ID}'{$style}>";
     list($columns, $hidden) = $this->get_column_info();
     foreach ($columns as $column_name => $column_display_name) {
         $class = "class=\"{$column_name} column-{$column_name}\"";
         $style = '';
         if (in_array($column_name, $hidden)) {
             $style = ' style="display:none;"';
         }
         $attributes = "{$class}{$style}";
         switch ($column_name) {
             case 'cb':
                 $r .= "<th scope='row' class='check-column'>{$checkbox}</th>";
                 break;
             case 'username':
                 $r .= "<td {$attributes}>{$avatar} {$edit}</td>";
                 break;
             case 'name':
                 $r .= "<td {$attributes}>{$user_object->first_name} {$user_object->last_name}</td>";
                 break;
             case 'email':
                 $r .= "<td {$attributes}><a href='mailto:{$email}' title='" . esc_attr(sprintf(__('E-mail: %s'), $email)) . "'>{$email}</a></td>";
                 break;
             case 'role':
                 $r .= "<td {$attributes}>{$role_name}</td>";
                 break;
             case 'posts':
                 $attributes = 'class="posts column-posts num"' . $style;
                 $r .= "<td {$attributes}>";
                 if ($numposts > 0) {
                     $r .= "<a href='edit.php?author={$user_object->ID}' title='" . esc_attr__('View posts by this author') . "' class='edit'>";
                     $r .= $numposts;
                     $r .= '</a>';
                 } else {
                     $r .= 0;
                 }
                 $r .= "</td>";
                 break;
             default:
                 $r .= "<td {$attributes}>";
                 $r .= apply_filters('manage_users_custom_column', '', $column_name, $user_object->ID);
                 $r .= "</td>";
         }
     }
     $r .= '</tr>';
     return $r;
 }
コード例 #26
0
ファイル: theme.php プロジェクト: nxtclass/NXTClass
/**
 * Check if there is an update for a theme available.
 *
 * Will display link, if there is an update available.
 *
 * @since 2.7.0
 *
 * @param object $theme Theme data object.
 * @return bool False if no valid info was passed.
 */
function theme_update_available($theme)
{
    static $themes_update;
    if (!current_user_can('update_themes')) {
        return;
    }
    if (!isset($themes_update)) {
        $themes_update = get_site_transient('update_themes');
    }
    if (is_object($theme) && isset($theme->stylesheet)) {
        $stylesheet = $theme->stylesheet;
    } elseif (is_array($theme) && isset($theme['Stylesheet'])) {
        $stylesheet = $theme['Stylesheet'];
    } else {
        return false;
    }
    //No valid info passed.
    if (isset($themes_update->response[$stylesheet])) {
        $update = $themes_update->response[$stylesheet];
        $theme_name = is_object($theme) ? $theme->name : (is_array($theme) ? $theme['Name'] : '');
        $details_url = add_query_arg(array('TB_iframe' => 'true', 'width' => 1024, 'height' => 800), $update['url']);
        //Theme browser inside nxt? replace this, Also, theme preview JS will override this on the available list.
        $update_url = nxt_nonce_url('update.php?action=upgrade-theme&amp;theme=' . urlencode($stylesheet), 'upgrade-theme_' . $stylesheet);
        $update_onclick = 'onclick="if ( confirm(\'' . esc_js(__("Updating this theme will lose any customizations you have made.  'Cancel' to stop, 'OK' to update.")) . '\') ) {return true;}return false;"';
        if (!is_multisite()) {
            if (!current_user_can('update_themes')) {
                printf('<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a>.') . '</strong></p>', $theme_name, $details_url, $update['new_version']);
            } else {
                if (empty($update['package'])) {
                    printf('<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a>. <em>Automatic update is unavailable for this theme.</em>') . '</strong></p>', $theme_name, $details_url, $update['new_version']);
                } else {
                    printf('<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a> or <a href="%4$s" %5$s>update automatically</a>.') . '</strong></p>', $theme_name, $details_url, $update['new_version'], $update_url, $update_onclick);
                }
            }
        }
    }
}
コード例 #27
0
 function single_row($key, $theme)
 {
     global $status, $page, $s;
     $context = $status;
     if ($this->is_site_themes) {
         $url = "site-themes.php?id={$this->site_id}&amp;";
     } else {
         $url = 'themes.php?';
     }
     // preorder
     $actions = array('enable' => '', 'disable' => '', 'edit' => '', 'delete' => '');
     $theme_key = $theme['Stylesheet'];
     if (empty($theme['enabled'])) {
         $actions['enable'] = '<a href="' . esc_url(nxt_nonce_url($url . 'action=enable&amp;theme=' . $theme_key . '&amp;paged=' . $page . '&amp;s=' . $s, 'enable-theme_' . $theme_key)) . '" title="' . esc_attr__('Enable this theme') . '" class="edit">' . ($this->is_site_themes ? __('Enable') : __('Network Enable')) . '</a>';
     } else {
         $actions['disable'] = '<a href="' . esc_url(nxt_nonce_url($url . 'action=disable&amp;theme=' . $theme_key . '&amp;paged=' . $page . '&amp;s=' . $s, 'disable-theme_' . $theme_key)) . '" title="' . esc_attr__('Disable this theme') . '">' . ($this->is_site_themes ? __('Disable') : __('Network Disable')) . '</a>';
     }
     if (current_user_can('edit_themes')) {
         $actions['edit'] = '<a href="' . esc_url('theme-editor.php?theme=' . urlencode($theme['Name'])) . '" title="' . esc_attr__('Open this theme in the Theme Editor') . '" class="edit">' . __('Edit') . '</a>';
     }
     if (empty($theme['enabled']) && current_user_can('delete_themes') && !$this->is_site_themes && $theme_key != get_option('stylesheet') && $theme_key != get_option('template')) {
         $actions['delete'] = '<a href="' . esc_url(nxt_nonce_url('themes.php?action=delete-selected&amp;checked[]=' . $theme_key . '&amp;theme_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-themes')) . '" title="' . esc_attr__('Delete this theme') . '" class="delete">' . __('Delete') . '</a>';
     }
     $actions = apply_filters('theme_action_links', array_filter($actions), $theme_key, $theme, $context);
     $actions = apply_filters("theme_action_links_{$theme_key}", $actions, $theme_key, $theme, $context);
     $class = empty($theme['enabled']) ? 'inactive' : 'active';
     $checkbox_id = "checkbox_" . md5($theme['Name']);
     $checkbox = "<input type='checkbox' name='checked[]' value='" . esc_attr($theme_key) . "' id='" . $checkbox_id . "' /><label class='screen-reader-text' for='" . $checkbox_id . "' >" . __('Select') . " " . $theme['Name'] . "</label>";
     $description = '<p>' . $theme['Description'] . '</p>';
     $theme_name = $theme['Name'];
     $id = sanitize_title($theme_name);
     echo "<tr id='{$id}' class='{$class}'>";
     list($columns, $hidden) = $this->get_column_info();
     foreach ($columns as $column_name => $column_display_name) {
         $style = '';
         if (in_array($column_name, $hidden)) {
             $style = ' style="display:none;"';
         }
         switch ($column_name) {
             case 'cb':
                 echo "<th scope='row' class='check-column'>{$checkbox}</th>";
                 break;
             case 'name':
                 echo "<td class='theme-title'{$style}><strong>{$theme_name}</strong>";
                 echo $this->row_actions($actions, true);
                 echo "</td>";
                 break;
             case 'description':
                 echo "<td class='column-description desc'{$style}>\n\t\t\t\t\t\t<div class='theme-description'>{$description}</div>\n\t\t\t\t\t\t<div class='{$class} second theme-version-author-uri'>";
                 $theme_meta = array();
                 if (!empty($theme['Version'])) {
                     $theme_meta[] = sprintf(__('Version %s'), $theme['Version']);
                 }
                 if (!empty($theme['Author'])) {
                     $theme_meta[] = sprintf(__('By %s'), $theme['Author']);
                 }
                 if (!empty($theme['Theme URI'])) {
                     $theme_meta[] = '<a href="' . $theme['Theme URI'] . '" title="' . esc_attr__('Visit theme homepage') . '">' . __('Visit Theme Site') . '</a>';
                 }
                 $theme_meta = apply_filters('theme_row_meta', $theme_meta, $theme_key, $theme, $status);
                 echo implode(' | ', $theme_meta);
                 echo "</div></td>";
                 break;
             default:
                 echo "<td class='{$column_name} column-{$column_name}'{$style}>";
                 do_action('manage_themes_custom_column', $column_name, $theme_key, $theme);
                 echo "</td>";
         }
     }
     echo "</tr>";
     if ($this->is_site_themes) {
         remove_action("after_theme_row_{$theme_key}", 'nxt_theme_update_row');
     }
     do_action('after_theme_row', $theme_key, $theme, $status);
     do_action("after_theme_row_{$theme_key}", $theme_key, $theme, $status);
 }
コード例 #28
0
 function _get_row_actions($post, $att_title)
 {
     $actions = array();
     if ($this->detached) {
         if (current_user_can('edit_post', $post->ID)) {
             $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
         }
         if (current_user_can('delete_post', $post->ID)) {
             if (EMPTY_TRASH_DAYS && MEDIA_TRASH) {
                 $actions['trash'] = "<a class='submitdelete' href='" . nxt_nonce_url("post.php?action=trash&amp;post={$post->ID}", 'trash-attachment_' . $post->ID) . "'>" . __('Trash') . "</a>";
             } else {
                 $delete_ays = !MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
                 $actions['delete'] = "<a class='submitdelete'{$delete_ays} href='" . nxt_nonce_url("post.php?action=delete&amp;post={$post->ID}", 'delete-attachment_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
             }
         }
         $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $att_title)) . '" rel="permalink">' . __('View') . '</a>';
         if (current_user_can('edit_post', $post->ID)) {
             $actions['attach'] = '<a href="#the-list" onclick="findPosts.open( \'media[]\',\'' . $post->ID . '\' );return false;" class="hide-if-no-js">' . __('Attach') . '</a>';
         }
     } else {
         if (current_user_can('edit_post', $post->ID) && !$this->is_trash) {
             $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
         }
         if (current_user_can('delete_post', $post->ID)) {
             if ($this->is_trash) {
                 $actions['untrash'] = "<a class='submitdelete' href='" . nxt_nonce_url("post.php?action=untrash&amp;post={$post->ID}", 'untrash-attachment_' . $post->ID) . "'>" . __('Restore') . "</a>";
             } elseif (EMPTY_TRASH_DAYS && MEDIA_TRASH) {
                 $actions['trash'] = "<a class='submitdelete' href='" . nxt_nonce_url("post.php?action=trash&amp;post={$post->ID}", 'trash-attachment_' . $post->ID) . "'>" . __('Trash') . "</a>";
             }
             if ($this->is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH) {
                 $delete_ays = !$this->is_trash && !MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
                 $actions['delete'] = "<a class='submitdelete'{$delete_ays} href='" . nxt_nonce_url("post.php?action=delete&amp;post={$post->ID}", 'delete-attachment_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
             }
         }
         if (!$this->is_trash) {
             $title = _draft_or_post_title($post->post_parent);
             $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
         }
     }
     $actions = apply_filters('media_row_actions', $actions, $post, $this->detached);
     return $actions;
 }
コード例 #29
0
ファイル: ajax.php プロジェクト: nxtclass/NXTClass-Plugin
function bp_dtheme_ajax_joinleave_group()
{
    global $bp;
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    if (groups_is_user_banned($bp->loggedin_user->id, $_POST['gid'])) {
        return false;
    }
    if (!($group = new BP_Groups_Group($_POST['gid'], false, false))) {
        return false;
    }
    if (!groups_is_user_member($bp->loggedin_user->id, $group->id)) {
        if ('public' == $group->status) {
            check_ajax_referer('groups_join_group');
            if (!groups_join_group($group->id)) {
                _e('Error joining group', 'buddypress');
            } else {
                echo '<a id="group-' . esc_attr($group->id) . '" class="leave-group" rel="leave" title="' . __('Leave Group', 'buddypress') . '" href="' . nxt_nonce_url(bp_get_group_permalink($group) . 'leave-group', 'groups_leave_group') . '">' . __('Leave Group', 'buddypress') . '</a>';
            }
        } else {
            if ('private' == $group->status) {
                check_ajax_referer('groups_request_membership');
                if (!groups_send_membership_request($bp->loggedin_user->id, $group->id)) {
                    _e('Error requesting membership', 'buddypress');
                } else {
                    echo '<a id="group-' . esc_attr($group->id) . '" class="membership-requested" rel="membership-requested" title="' . __('Membership Requested', 'buddypress') . '" href="' . bp_get_group_permalink($group) . '">' . __('Membership Requested', 'buddypress') . '</a>';
                }
            }
        }
    } else {
        check_ajax_referer('groups_leave_group');
        if (!groups_leave_group($group->id)) {
            _e('Error leaving group', 'buddypress');
        } else {
            if ('public' == $group->status) {
                echo '<a id="group-' . esc_attr($group->id) . '" class="join-group" rel="join" title="' . __('Join Group', 'buddypress') . '" href="' . nxt_nonce_url(bp_get_group_permalink($group) . 'join', 'groups_join_group') . '">' . __('Join Group', 'buddypress') . '</a>';
            } else {
                if ('private' == $group->status) {
                    echo '<a id="group-' . esc_attr($group->id) . '" class="request-membership" rel="join" title="' . __('Request Membership', 'buddypress') . '" href="' . nxt_nonce_url(bp_get_group_permalink($group) . 'request-membership', 'groups_send_membership_request') . '">' . __('Request Membership', 'buddypress') . '</a>';
                }
            }
        }
    }
}
コード例 #30
0
 function after()
 {
     $update_actions = array();
     if (!empty($this->upgrader->result['destination_name']) && ($theme_info = $this->upgrader->theme_info()) && !empty($theme_info)) {
         $name = $theme_info['Name'];
         $stylesheet = $this->upgrader->result['destination_name'];
         $template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet;
         $preview_link = htmlspecialchars(add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true'), trailingslashit(esc_url(get_option('home')))));
         $activate_link = nxt_nonce_url("themes.php?action=activate&amp;template=" . urlencode($template) . "&amp;stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);
         $update_actions['preview'] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name)) . '">' . __('Preview') . '</a>';
         $update_actions['activate'] = '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr(sprintf(__('Activate &#8220;%s&#8221;'), $name)) . '">' . __('Activate') . '</a>';
         if (!$this->result || is_nxt_error($this->result) || $stylesheet == get_stylesheet()) {
             unset($update_actions['preview'], $update_actions['activate']);
         }
     }
     $update_actions['themes_page'] = '<a href="' . self_admin_url('themes.php') . '" title="' . esc_attr__('Return to Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>';
     $update_actions = apply_filters('update_theme_complete_actions', $update_actions, $this->theme);
     if (!empty($update_actions)) {
         $this->feedback(implode(' | ', (array) $update_actions));
     }
 }