function theme_update_notifier_bar_menu()
{
    if (function_exists('simplexml_load_string')) {
        // Stop if simplexml_load_string funtion isn't available
        global $wp_admin_bar, $wpdb;
        if (!is_super_admin() || !is_admin_bar_showing()) {
            // Don't display notification in admin bar if it's disabled or the current user isn't an administrator
            return;
        }
        $xml = theme_get_latest_theme_version(THEME_NOTIFIER_CACHE_INTERVAL);
        // Get the latest remote XML file on our server
        $title = explode("Private: ", $xml->item->title);
        if ($title[1] != get_option("latest-orange-theme")) {
            // Compare current theme version with the remote XML version
            $wp_admin_bar->add_menu(array('id' => 'other_themes', 'title' => '<span>Orange Themes <span id="ab-updates">1 Theme</span></span>', 'href' => get_admin_url() . '/themes.php?page=other-themes'));
        }
    }
}
Exemple #2
0
function other_themes()
{
    ?>
		<!-- BEGIN more-orange-themes -->
		<div class="more-orange-themes">

			<div class="header">
				<img src="<?php 
    echo THEME_IMAGE_MTHEMES_URL;
    ?>
title-more-themes.png" alt="" width="447" height="23" />
				<p>
					<a href="http://www.themeforest.net/user/orange-themes/portfolio?ref=orange-themes" class="btn-1" target="_blank"><span><u class="themeforest">Check our portfolio at themeforest.net</u></span></a>
					<a href="http://www.twitter.com/#!/orangethemes" class="btn-1" target="_blank"><span><u class="twitter">Follow us on twitter</u></span></a>
					<a href="http://www.orange-themes.com" class="btn-1" target="_blank"><span><u class="orangethemes">Orange-themes.com</u></span></a>
				</p>
			</div>

			<?php 
    $xml = theme_get_latest_theme_version(THEME_NOTIFIER_CACHE_INTERVAL);
    foreach ($xml->item as $entry) {
        $title = explode("Private: ", $entry->title);
        ?>
			
			<!-- BEGIN .item -->
			<div class="item">
				<div class="image">
					<a href="<?php 
        echo $entry->purchase;
        ?>
"><img src="<?php 
        echo $entry->image;
        ?>
" /></a>
				</div>
				<div class="text">
					<h2><a href="<?php 
        echo $entry->purchase;
        ?>
"><?php 
        echo $title[1];
        ?>
</a></h2>
					<p><?php 
        echo $entry->content;
        ?>
</p>
					<p class="link"><a href="<?php 
        echo $entry->demo;
        ?>
" target="_blank">Demo website</a></p>
					<p class="link"><a href="<?php 
        echo $entry->purchase;
        ?>
" target="_blank">Purchase at ThemeForest.net</a></p>
					<?php 
        if ($entry->html) {
            ?>
						<p class="link"><a href="<?php 
            echo $entry->html;
            ?>
" target="_blank">HTML version</a></p>
					<?php 
        }
        ?>
				</div>
			<!-- END .item -->
			</div>
			<?php 
    }
    ?>
 
			
		<!-- END more-orange-themes -->
		</div>
<?php 
}