Changeset 157

Show
Ignore:
Timestamp:
04/14/08 22:29:26 (4 months ago)
Author:
zamoose
Message:

Version checking, oh my! Oh yes!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/functions.php

    r152 r157  
    22$themename = "Elbee Elgee"; 
    33$shortname = "lblg"; 
     4$theme_current_version = "0.9"; 
     5$theme_url = "http://literalbarrage.org/blog/code/elbee-elgee"; 
    46 
    57$layout_path = TEMPLATEPATH . '/layouts/';  
     
    292294<?php*/ } 
    293295 
     296function mytheme_admin_head(){  
     297        global $theme_current_version; 
     298        global $themename; 
     299        global $theme_url; 
     300        ?> 
     301        <script type="text/javascript">   
     302         jQuery(document).ready(function() {   
     303             jQuery.get('http://literalbarrage.org/lblgversion.txt', function(newversion){   
     304                 if (<?php echo $theme_current_version; ?> < newversion) { 
     305                     jQuery('#wpbody > .wrap > h2').after('<div id="message" class="updated fade"><p><strong><?php echo $themename; ?> Update available. Click <a href="<?php echo $theme_url;?>">here</a> for details.</strong></p></div>'); 
     306           
     307                 }   
     308             });   
     309         });   
     310         </script> 
     311<?php } 
     312 
    294313if ( function_exists('register_sidebar') ) { 
    295314        register_sidebar(array('name'=>'Navigation')); 
     
    376395 
    377396add_action('wp_head', 'mytheme_wp_head'); 
     397add_action('admin_head','mytheme_admin_head'); 
    378398add_action('admin_menu', 'mytheme_add_admin');  
    379399?>