コード例 #1
0
 function tagline()
 {
     if (sb_get_option('tagline')) {
         $tag_container = apply_filters('sb_description_container', 'div');
         echo '<' . $tag_container . ' id="blog-description">' . get_bloginfo('description') . '</' . $tag_container . '>';
     }
 }
コード例 #2
0
function sb_admin_load()
{
    global $sb_admin;
    // Load the scripts for handling metaboxes
    wp_enqueue_script('common');
    wp_enqueue_script('wp-lists');
    wp_enqueue_script('postbox');
    // Load StartBox-specific scripts and styles
    wp_enqueue_script('colorbox');
    wp_enqueue_script('jquery-ajaxuploader', SCRIPTS_URL . '/jquery.ajaxupload.js');
    wp_enqueue_script('jquery-colorpicker', SCRIPTS_URL . '/colorpicker/js/colorpicker.js');
    wp_enqueue_script('sb-admin', SCRIPTS_URL . '/admin.js', array('jquery-colorpicker'));
    wp_enqueue_style('colorpicker', SCRIPTS_URL . '/colorpicker/css/colorpicker.css');
    wp_enqueue_style('sb-admin', STYLES_URL . '/admin.css');
    wp_enqueue_style('colorbox');
    // Load scripts for TinyMCE (Credit: Lee Doel)
    if (user_can_richedit()) {
        wp_enqueue_script('editor');
        wp_enqueue_script('media-upload');
        wp_enqueue_style('thickbox');
        add_action('admin_head', 'wp_tiny_mce');
    }
    if (sb_get_option('reset')) {
        sb_set_default_options();
        wp_redirect(admin_url('admin.php?page=sb_admin&reset=true'));
    }
}
コード例 #3
0
 function sb_check_url()
 {
     switch (basename($_SERVER['PHP_SELF'])) {
         case 'wp-rss.php':
         case 'wp-rss2.php':
         case 'wp-atom.php':
         case 'wp-rdf.php':
             if (trim(sb_get_option('feedburner_feed_url')) != '') {
                 if (function_exists('status_header')) {
                     status_header(302);
                 }
                 header("Location:" . trim(sb_get_option('feedburner_feed_url')));
                 header("HTTP/1.1 302 Temporary Redirect");
                 exit;
             }
             break;
         case 'wp-commentsrss2.php':
             if (trim(sb_get_option('feedburner_comments_url')) != '') {
                 if (function_exists('status_header')) {
                     status_header(302);
                 }
                 header("Location:" . trim(sb_get_option('feedburner_comments_url')));
                 header("HTTP/1.1 302 Temporary Redirect");
                 exit;
             }
             break;
     }
 }
コード例 #4
0
 public function sb_pushup_output()
 {
     if (sb_get_option('enable_pushup')) {
         wp_enqueue_script('pushup');
         wp_enqueue_style('pushup');
     }
 }
コード例 #5
0
 function output()
 {
     if (sb_get_option('analytics')) {
         echo "\n\n" . '<!-- BEGIN Analytics-->' . "\n";
         echo sb_get_option('analytics') . "\n";
         echo '<!-- END Analytics-->' . "\n";
     }
 }
コード例 #6
0
 function hooks()
 {
     $primary_nav = sb_get_option('primary_nav-position');
     $secondary_nav = sb_get_option('secondary_nav-position');
     $footer_nav = sb_get_option('footer_nav-position');
     add_action($primary_nav, array($this, 'primary_nav'));
     add_action($secondary_nav, array($this, 'secondary_nav'));
     add_action($footer_nav, array($this, 'footer_nav'), 11);
 }
コード例 #7
0
 public function output()
 {
     $style = sb_get_option('styleselect');
     if ($style == 'red') {
         wp_enqueue_style('child-red', THEME_URI . '/styles/red.css');
     } elseif ($style == 'green') {
         wp_enqueue_style('child-green', THEME_URI . '/styles/green.css');
     } elseif ($style == 'blue') {
         wp_enqueue_style('child-blue', THEME_URI . '/styles/blue.css');
     }
 }
コード例 #8
0
 function update_notification()
 {
     // Don't bother checking if updates are disabled
     if (!sb_get_option('enable_updates') || sb_get_option('disable_update_notifications')) {
         return;
     }
     $sb_update = $this->update_check();
     if (!is_super_admin() || !$sb_update) {
         return false;
     }
     $update_url = wp_nonce_url('update.php?action=upgrade-theme&amp;theme=startbox', 'upgrade-theme_startbox');
     $update_onclick = __('Upgrading will overwrite the currently installed version of StartBox. Are you sure you want to upgrade?', 'startbox');
     $output = '<div class="update-nag">';
     $output .= sprintf(__('An update to StartBox is available. <a href="%s" class="thickbox thickbox-preview">Check out what\'s new in %s</a> or <a href="%s" onclick="return sb_confirm(\'%s\');">upgrade now</a>.', 'startbox'), esc_url($sb_update['url']), esc_html($sb_update['new_version']), $update_url, esc_js($update_onclick));
     $output .= '</div>';
     echo $output;
 }
コード例 #9
0
the_title();
?>
</a></h2>
		<div class="entry-meta">By <?php 
the_author();
?>
 | <i class="fa fa-graduation-cap"></i> 10 Students</div><!-- .entry-meta -->
	</div><!-- .entry-header -->

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

	<div class="entry-content">
		<?php 
if ((is_home() || is_front_page()) && sb_get_option('home_post_content') == 'full' or (!is_home() || !is_front_page()) && sb_get_option('archive_post_content') == 'full') {
    // Or, If were on an archive page and should display full content
    the_content(apply_filters("sb_read_more", sprintf(__("Continue Reading: %s &rarr;", "startbox"), get_the_title())));
    // Display the full content using a filterable read-more tag when necessary
} else {
    // Otherwise, display the excerpt with a fliterable read-more tag
    the_excerpt();
    echo '<a href="' . get_permalink() . '" title="' . sprintf(__("Continue Reading: %s", "startbox"), esc_html(get_the_title(), 1)) . '" class="more-link">' . do_shortcode(apply_filters("sb_read_more", sprintf(__("Continue Reading: %s &rarr;", "startbox"), get_the_title()))) . '</a>';
}
?>

		<?php 
wp_link_pages(array('before' => '<div class="entry-pages">' . __('Pages:', 'startbox'), 'after' => '</div>'));
?>

	</div><!-- .entry-content -->
コード例 #10
0
 public function border($id, $label, $desc)
 {
     $output = sb_input::intro($id, $label, $desc);
     $output .= sb_input::color($id . '-color', 'Border Color', sb_get_option($id . '-color'), null);
     $output .= '<p class="' . $id . '">' . sb_input::text($id . '-top', null, 'Border Top Width', sb_get_option($id . '-top'), null, 'small', null, '<span class="right">') . " px</p>\n";
     $output .= '<p class="' . $id . '">' . sb_input::text($id . '-bottom', null, 'Border Bottom Width', sb_get_option($id . '-bottom'), null, 'small', null, '<span class="right">') . " px</span></p>\n";
     $output .= '<p class="' . $id . '">' . sb_input::text($id . '-left', null, 'Border Left Width', sb_get_option($id . '-left'), null, 'small', null, '<span class="right">') . " px</span></p>\n";
     $output .= '<p class="' . $id . '">' . sb_input::text($id . '-right', null, 'Border Right Width', sb_get_option($id . '-right'), null, 'small', null, '<span class="right">') . " px</span></p>\n";
     $output .= '<p class="' . $id . '">' . sb_input::text($id . '-radius', null, 'Border Radius', sb_get_option($id . '-radius'), null, 'small', null, '<span class="right">') . " px</span></p>\n";
     $output .= "\t" . "\t" . '<p><span class="desc">Note: the Border Radius property does not apply to Internet Explorer users.</p>' . "\n";
     return $output;
 }
コード例 #11
0
 function admin()
 {
     if (sb_get_option('enable_admin')) {
         // Grab global user data
         global $user_ID, $user_identity;
         // Our default links, can be overriden using the sb_footer_admin_links filter
         $loggedin_defaults = array('Admin Dashboard' => admin_url(), 'Widgets' => admin_url('widgets.php'), 'Theme Options' => admin_url('themes.php?page=sb_admin'), 'Logout' => wp_logout_url(get_permalink()));
         $loggedout_defaults = array('Admin Dashboard' => admin_url());
         // Filter the links arrays so they can be overridden
         $loggedin_links = apply_filters('sb_footer_admin_loggedin_links', $loggedin_defaults);
         $loggedout_links = apply_filters('sb_footer_admin_loggedout_links', $loggedout_defaults);
         $separator = apply_filters('sb_footer_admin_links_separator', '<li class="meta-sep">|</li>');
         $links = array();
         $output = '';
         // If the user is logged in, use the logged in links, else use the logged out links
         if ($user_ID) {
             $links_array = $loggedin_links;
         } else {
             $links_array = $loggedout_links;
         }
         // Loop through all the links and store them in an array with proper HTML
         foreach ($links_array as $title => $url) {
             $links[] = '<li><a href="' . esc_url($url) . '">' . esc_html($title) . '</a></li>';
         }
         // Begin output
         $output .= '<div id="admin_links" class="fine">';
         if ($user_ID) {
             $output .= '<span id="login_identity">Logged in as <strong>' . $user_identity . '</strong>.</span>';
         }
         $output .= '<ul>';
         $output .= implode($separator, $links);
         $output .= '</ul>';
         $output .= '</div> <!-- #admin_links -->';
         // Filter the whole thing, incase someone wants to replace it entirely
         echo apply_filters('sb_footer_admin', $output);
     }
 }
コード例 #12
0
    function admin()
    {
        $home = home_url();
        if (sb_get_option('enable_admin')) {
            ?>
				<div id="admin_links" class="fine">
					<?php 
            global $user_ID, $user_identity, $user_level;
            ?>
					<?php 
            if ($user_ID) {
                ?>
						<span id="login_identity">Logged in as <strong><?php 
                echo $user_identity;
                ?>
</strong>.</span>
						<ul>
							<li><a href="<?php 
                echo $home;
                ?>
/wp-admin/">Admin Dashboard</a></li>
							<li class="meta-sep">|</li>
							<li><a href="<?php 
                echo $home;
                ?>
/wp-admin/widgets.php">Widgets</a></li>
							<li class="meta-sep">|</li>
							<li><a href="<?php 
                echo $home;
                ?>
/wp-admin/themes.php?page=sb_admin">Theme Options</a></li>
							<li class="meta-sep">|</li>
							<li><a href="<?php 
                echo $home;
                ?>
/wp-login.php?action=logout&amp;redirect_to=<?php 
                echo $home;
                ?>
">Logout</a></li>
						</ul>
					<?php 
            } else {
                ?>
						<a href="<?php 
                echo $home;
                ?>
/wp-admin/">Admin Login</a>
					<?php 
            }
            ?>
				</div> <!-- #admin_links -->
			<?php 
        }
    }
コード例 #13
0
 function hooks()
 {
     add_filter('sb_get_post_layout_default', array($this, 'sb_layout'));
     add_filter('sb_read_more', array($this, 'more_text'));
     add_action('sb_post_header', array($this, 'sb_header_meta'));
     add_action('sb_post_footer', array($this, 'sb_footer_meta'));
     if (sb_get_option('author_bio') == 'before') {
         add_action('sb_before_post_content', array($this, 'sb_author_bio'));
     }
     if (sb_get_option('author_bio') == 'after') {
         add_action('sb_after_post_content', array($this, 'sb_author_bio'));
     }
     add_action('sb_before_content', array($this, 'sb_post_nav'));
     add_action('sb_after_content', array($this, 'sb_post_nav'));
     if (sb_get_option('post_thumbnail_rss')) {
         add_filter('the_excerpt_rss', array($this, 'post_image_feeds'));
         add_filter('the_content_feed', array($this, 'post_image_feeds'));
     }
     add_filter('sb_post_image_settings', array($this, 'image_settings'));
     add_filter('sb_post_image_none', array($this, 'image_default'));
 }
コード例 #14
0
ファイル: seo.php プロジェクト: marqui678/finalchance.Panopta
 function sb_seo_description($content)
 {
     if ($description = sb_get_option('seo_description')) {
         echo '<meta name="description" content="' . apply_filters('sb_description', esc_attr($description)) . '" />';
     }
 }
コード例 #15
0
 public function install()
 {
     // Setup the main theme options and store them to a variable
     add_option(THEME_OPTIONS);
     // Set the current StartBox version
     add_option('startbox_version', 'SB_VERSION');
     // Update License Key if SB_LICENSE is defined
     if (defined('SB_LICENSE') && SB_LICENSE != sb_get_option('sb_license')) {
         sb_update_option('sb_license', SB_LICENSE);
     }
     // Included hook for other things to do during install
     do_action('sb_install');
 }