WordPress.org

Plugin Directory

Changeset 648469


Ignore:
Timestamp:
01/05/13 22:50:56 (16 months ago)
Author:
MrWiblog
Message:

0.2.4 Fixed some debugging errors

Location:
bannerman
Files:
10 added
2 edited

Legend:

Unmodified
Added
Removed
  • bannerman/trunk/bannerman.php

    r245746 r648469  
    44Plugin URI: http://www.stillbreathing.co.uk/wordpress/bannerman/ 
    55Description: Shows a banner at the top or bottom of every page 
    6 Version: 0.2.2 
     6Version: 0.2.4 
    77Author: Chris Taylor 
    88Author URI: http://www.stillbreathing.co.uk 
     
    2121$register->slug = "bannerman"; 
    2222$register->name = "BannerMan"; 
    23 $register->version = "0.2.2"; 
     23$register->version = "0.2.4"; 
    2424$register->developer = "Chris Taylor"; 
    2525$register->homepage = "http://www.stillbreathing.co.uk"; 
     
    3636// add the admin button 
    3737function bannerman_add_admin() { 
    38     // in a future version I will add different options for WP MultiSite (i.e. WPMU) and standard WP 
    39     //if ( bannerman_mu() ) { 
    40     //  add_submenu_page('wpmu-admin.php', 'BannerMan', 'BannerMan', 10, 'bannerman_admin', 'bannerman_admin'); 
    41     //} else { 
    42     //  add_submenu_page('themes.php', __( "BannerMan", "bannerman" ), __( "BannerMan", "bannerman" ), 1, 'bannerman', 'bannerman_admin'); 
    43     //} 
    4438    add_submenu_page('options-general.php', __( "BannerMan", "bannerman" ), __( "BannerMan", "bannerman" ), 10, 'bannerman', 'bannerman_admin'); 
    4539} 
     
    4943 
    5044    $page = "options-general.php"; 
    51     //if ( bannerman_mu() ) { 
    52     //  $page = "wpmu-admin.php"; 
    53     //} 
    5445     
    5546    $saved = false; 
     
    197188        '; 
    198189 
    199         if ( is_array( $options["banners"] ) && count( $options["banners"] ) > 0 ) { 
     190        if ( array_key_exists( "banners", $options) && is_array( $options["banners"] ) && count( $options["banners"] ) > 0 ) { 
    200191            foreach( $options["banners"] as $banner ) { 
    201192             
     
    272263        <script type="text/javascript" src="' . get_option( "siteurl" ) . '/wp-content/plugins/bannerman/bannerman.js"></script> 
    273264        <script type="text/javascript"> 
    274         BannerMan.location = "' . $options["display"] . '"; 
    275         BannerMan.background = "' . $options["background"] . '"; 
    276         BannerMan.foreground = "' . $options["foreground"] . '"; 
    277         BannerMan.days = "' . $options["days"] . '";'; 
    278         if ( $options["cookie"] != "" ) { 
     265        BannerMan.location = "' . ( array_key_exists( "display", $options ) ? $options["display"] : 7 ) . '"; 
     266        BannerMan.background = "' . ( array_key_exists( "background", $options ) ? $options["background"] : "#333" ) . '"; 
     267        BannerMan.foreground = "' . ( array_key_exists( "foreground", $options ) ? $options["foreground"] : "#fff" ) . '"; 
     268        BannerMan.days = "' . ( array_key_exists( "days", $options ) ? $options["days"] : 7 ) . '";'; 
     269        if ( array_key_exists( "cookie", $options ) && $options["cookie"] != "" ) { 
    279270        echo ' 
    280271        BannerMan.cookie = ' . $options["cookie"] . ';'; 
    281272        } 
    282         if ( $options["animate"] != "" ) { 
     273        if ( array_key_exists( "animate", $options ) && $options["animate"] != "" ) { 
    283274        echo ' 
    284275        BannerMan.animate = ' . $options["animate"] . ';'; 
    285276        } 
    286         if ( $options["refresh"] != "0" ) { 
     277        if ( array_key_exists( "refresh", $options ) && $options["refresh"] != "0" ) { 
    287278            echo ' 
    288279        BannerMan.banners = ["' . implode( '","', $banners ) . '"]; 
     
    292283            $banner = array_rand( $banners ); 
    293284            echo ' 
    294         BannerMan.banner = "' . str_replace( "'", "\'", $banners[$banner] ) . '"; 
     285        BannerMan.banner = \'' . str_replace( "'", "\'", $banners[$banner] ) . '\'; 
    295286            '; 
    296287        } 
  • bannerman/trunk/readme.txt

    r318304 r648469  
    55Requires at least: 2.7 
    66Tested up to: 2.9.2 
    7 Stable tag: 0.2.3 
     7Stable tag: 0.2.4 
    88 
    99BannerMan allows you to easily add banners or advert to the top or bottom of pages in your Wordpress site. 
     
    5050== Changelog == 
    5151 
     520.2.4 Fixed some debugging errors 
    52530.2.3 Fixed bug in Plugin Register caused by latest version of WordPress 
    53540.2.2 Fixed bug with options form again 
Note: See TracChangeset for help on using the changeset viewer.