WordPress.org

Plugin Directory

Changeset 827653


Ignore:
Timestamp:
12/23/13 20:31:57 (4 years ago)
Author:
UnderWordPressure
Message:

Code maintenance for WP 3.8

Location:
cosimo/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cosimo/trunk/Cosimo.class.php

    r794762 r827653  
    11<?php 
    2 /** 
    3  * Cosimo - Main Class for wordpress plugin "Cosimo" 
    4  * Author: grobator 
    5  * Version: latest 
     2/* 
     3 Cosimo - Main Class for wordpress plugin "Cosimo" 
     4 Author: andurban.de 
     5 Version: latest 
     6 ---------------------------------------------------------------------------------------- 
     7 Copyright 2009-2013 andurban.de  (email: http://www.andurban.de/kontakt) 
     8 
     9 This program is free software; you can redistribute it and/or modify 
     10 it under the terms of the GNU General Public License as published by 
     11 the Free Software Foundation; either version 2 of the License, or 
     12 (at your option) any later version. 
     13 
     14 This program is distributed in the hope that it will be useful, 
     15 but WITHOUT ANY WARRANTY; without even the implied warranty of 
     16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     17 GNU General Public License for more details. 
     18 
     19 You should have received a copy of the GNU General Public License 
     20 along with this program; if not, write to the Free Software 
     21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
    622 */ 
    723class Cosimo { 
     
    1127    var $firstImage = null; 
    1228 
    13  
    1429    /** 
    1530     * PHP5 Construktor 
     
    2237     * @param $imgurl - Die URL des Background Images 
    2338     */ 
    24     function out($imgurl) { 
    25         echo '<!--Cosimo $Rev$--> 
     39    function out($imgurl,$csstag="body") { 
     40        echo <<<_EOT 
     41<!--Cosimo \$Rev$--> 
    2642<style type="text/css" media="screen"> 
    27 body {background-image:url('.$imgurl.') !important;} 
     43${csstag} {background-image:url(${imgurl}) !important;} 
    2844</style> 
    29 '; 
     45_EOT; 
    3046 
    3147    } 
     
    196212        if (!$doCosimo) { 
    197213//echo "DEBUG: ".var_export($opts,true)."<br /> now + $interval $unit".time()."</pre>"; 
    198             $this->out($imgurl); 
     214            $this->out($imgurl,$csstag); 
    199215            return true; 
    200216        } 
     
    227243        } 
    228244 
    229         $this->out($imgurl); 
     245        $this->out($imgurl,$csstag); 
    230246        return true; 
    231247    } 
  • cosimo/trunk/CosimoAdmin.class.php

    r794762 r827653  
    11<?php 
    2 /** 
    3  * CosimoAdmin - Class for wordpress plugin "Cosimo" backend 
    4  * Author: grobator 
    5  * Version: latest 
     2/* 
     3 CosimoAdmin - Class for wordpress plugin "Cosimo" backend 
     4 Author: andurban.de 
     5 Version: latest 
     6 ---------------------------------------------------------------------------------------- 
     7 Copyright 2009-2013 andurban.de  (email: http://www.andurban.de/kontakt) 
     8 
     9 This program is free software; you can redistribute it and/or modify 
     10 it under the terms of the GNU General Public License as published by 
     11 the Free Software Foundation; either version 2 of the License, or 
     12 (at your option) any later version. 
     13 
     14 This program is distributed in the hope that it will be useful, 
     15 but WITHOUT ANY WARRANTY; without even the implied warranty of 
     16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     17 GNU General Public License for more details. 
     18 
     19 You should have received a copy of the GNU General Public License 
     20 along with this program; if not, write to the Free Software 
     21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
    622 */ 
     23 
    724class CosimoAdmin { 
    825 
    9  
    1026    /** 
    11      * PHP5 Construktor 
     27     * Construktor 
    1228     */ 
    1329    function __construct() {} 
     
    7086        $interval = 1; 
    7187        $unit = 'weeks'; 
     88        $csstag = 'body'; 
    7289        $pattern = 'Summer:2010*'; 
    7390 
     
    8097 
    8198        $message = null; 
    82  
    8399        $nonce = isset($_POST['_wpnonce']) ? $_POST['_wpnonce'] : null; 
    84100 
     
    97113                $interval = 1; 
    98114 
    99             if ($opts['unit'] != 'views') 
     115            if (isset($opts['unit']) && ($opts['unit'] != 'views')) 
    100116                $_POST['timestamp'] = strtotime("now + $interval $unit"); 
    101117 
     
    112128 
    113129            update_option('cosimo',$opts); 
    114  
    115130            $message = 'Settings updated'; 
    116131        } 
     
    152167 
    153168 
    154         echo '<div class="wrap"> 
    155       <div id="icon-options-general" class="icon32"><br /></div> 
    156        <h2>'.__('Cosimo', 'cosimo').' Settings</h2>'.$message.' 
    157        <div style="float: right;margin:10px;padding-right:50px;"> 
    158         <a href="http://donate.grobator.de/"><img src="https://www.paypal.com/en_GB/i/btn/btn_donate_SM.gif" border="0" alt="donate" title="Sollte Ihnen das Plugin gefallen, w&auml;re ich &uuml;ber eine kleine Spende sehr erfreut" /></a 
     169        $nextgenSelectBox = $this->getNextGENGalleries($orflag,$nggallery); 
     170        $title = ($title) ? ' checked="checked"' : ''; 
     171        $caption = ($caption) ? ' checked="checked"' : ''; 
     172        $desc = ($desc) ? ' checked="checked"' : ''; 
     173         
     174echo <<<_EOT 
     175<div class="wrap"> 
     176 <div id="icon-options-general" class="icon32"><br /></div> 
     177    <h2>Cosimo Settings</h2>${message} 
     178       <div style="margin:10px;padding-right:50px;"> 
     179        <a href="http://donate.andurban.de/"><img src="https://www.paypal.com/en_GB/i/btn/btn_donate_SM.gif" border="0" alt="donate" title="Sollte Ihnen das Plugin gefallen, w&auml;re ich &uuml;ber eine kleine Spende sehr erfreut" /></a 
    159180       </div> 
    160181       <form id="cosimo" name="cosimo" method="post"> 
    161182        <table class="form-table" summary=""> 
    162         '.$this->getNextGENGalleries($orflag,$nggallery).' 
    163         <tr> 
    164           <td width="110">Media Library Filter:</td> 
    165           <td><input type="text" name="pattern" size="30" value="'.$pattern.'" /> 
     183        ${nextgenSelectBox} 
     184        <tr> 
     185          <td width="110"><label for="pattern">Media Library Filter:</label></td> 
     186          <td><input type="text" id="pattern" name="pattern" size="30" value="${pattern}" /> 
    166187         </tr> 
    167188         <tr> 
    168189         <td></td> 
    169190         <td> 
    170            <input type="checkbox" id="title" name="title" value="true"'.($title ? ' checked="checked"' : null).' /><label for="title"> in title</label> | 
    171            <input type="checkbox" id="caption" name="caption" value="true"'.($caption ? ' checked="checked"' : null).' /><label for="caption"> in caption</label> | 
    172            <input type="checkbox" id="desc" name="desc" value="true"'.($desc ? ' checked="checked"' : null).' /><label for="description"> in description</label> 
     191           <input type="checkbox" id="title" name="title" value="true"${title} /><label for="title"> in title</label> | 
     192           <input type="checkbox" id="caption" name="caption" value="true"${caption} /><label for="caption"> in caption</label> | 
     193           <input type="checkbox" id="desc" name="desc" value="true"${desc} /><label for="description"> in description</label> 
    173194         </td> 
    174195        </tr> 
     
    177198        </tr> 
    178199        <tr> 
    179           <td>Interval:</td> 
    180           <td><input type="text" id="interval" name="interval" size="4" value="'.$interval.'" /> 
     200          <td><label for="interval">Interval:</label></td> 
     201          <td><input type="text" id="interval" name="interval" size="4" value="${interval}" /> 
    181202          <select id="unit" name="unit"> 
    182            <option value="views"'.$views.'>Views</option> 
    183            <option value="minutes"'.$minutes.'>Minutes</option> 
    184            <option value="hours"'.$hours.'>Hours</option> 
    185            <option value="days"'.$days.'>Days</option> 
    186            <option value="weeks"'.$weeks.'>Weeks</option> 
    187            <option value="month"'.$month.'>Month</option> 
    188            <option value="years"'.$years.'>Years</option> 
     203           <option value="views"${views}>Views</option> 
     204           <option value="minutes"${minutes}>Minutes</option> 
     205           <option value="hours"${hours}>Hours</option> 
     206           <option value="days"${days}>Days</option> 
     207           <option value="weeks"${weeks}>Weeks</option> 
     208           <option value="month"${month}>Month</option> 
     209           <option value="years"${years}>Years</option> 
    189210          </select> 
    190211        </tr> 
    191212        <tr> 
     213         <td><label for="tag">CSS-Selector:</label></td> 
     214          <td><input type="text" id="csstag" name="csstag" size="20" value="${csstag}" /></td> 
     215        </tr>     
     216        <tr> 
    192217          <td class="submit"><input type="submit" name="_submit" value="Submit" /> 
    193           <input type="hidden" name="_wpnonce" value="'.$nonce.'" /></td> 
     218          <input type="hidden" name="_wpnonce" value="${nonce}" /></td> 
    194219        </tr> 
    195220       </table> 
    196221      </form> 
    197222     </div> 
    198 '; 
     223_EOT; 
    199224 
    200225    } 
  • cosimo/trunk/cosimo.php

    r327770 r827653  
    22/* 
    33Plugin Name: Cosimo 
    4 Plugin URI: http://www.grobator.de/wordpress-stuff/plugins/cosimo 
     4Plugin URI: http://www.andurban.de/wordpress-stuff/plugins/cosimo 
    55Description: Change Of Scene Image Many Often 
    6 Author: grobator 
    7 Version:  0.3 
    8 Author URI:  http://www.grobator.de/ 
     6Author: andurban.de 
     7Version:  0.4 
     8Author URI:  http://www.andurban.de/ 
    99---------------------------------------------------------------------------------------- 
    1010This program is free software; you can redistribute it and/or modify 
  • cosimo/trunk/readme.txt

    r327770 r827653  
    11=== Cosimo - Change Of Scene Image Many Often === 
    2 Contributors: grobator 
     2Contributors: andurban.de 
    33Tags: background, backgrounds, images, CSS 
    4 Donate link: http://donate.grobator.de/ 
     4Donate link: http://donate.andurban.de/ 
    55Requires at least: 2.7 
    6 Tested up to: 3.0.3 
    7 Stable tag: 0.3 
     6Tested up to: 3.8 
     7Stable tag: 0.4 
    88 
    99Change the background image of the BODY-Tag. A pool of images from Media Library and / or a NextGEN gallery can be used. 
     
    3333* OTH = Other 
    3434 
     35= 0.4 = 
     36* CLN: Code maintenance for WP 3.8 
     37* FEA: Free CSS-Selector instead of just BODY-Tag. Example: #page, .menu, etc. 
     38 
    3539= 0.3 = 
    3640* OPT: Code maintenance for WP 3.x 
Note: See TracChangeset for help on using the changeset viewer.