Plugin Directory

Changeset 690197


Ignore:
Timestamp:
04/01/2013 05:18:03 PM (13 years ago)
Author:
InoPlugs
Message:

Minor Update

Location:
wp-backgrounds-lite
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • wp-backgrounds-lite/tags/1.1/inoplugs_background_plugin.php

    r380910 r690197  
    44 *  Plugin URI: http://inoplugs.com
    55 *  Description: Set fullsize background images for Posts | Get the Premium version here: <a href="http://inoplugs.com/projects/wp-backgrounds-plugin/">Premium Version</a>
    6  *  Author: InoPlugs | Peter Schoenmann
     6 *  Author: InoPlugs
    77 *  Version: 1.1.0.0
    88 *  Author URI: http://inoplugs.com
     
    1717    add_action('init', array (&$inoplugs_wp_backgrounds_display, 'handler_frontend_includes'));
    1818    add_action('wp_head', array (&$inoplugs_wp_backgrounds_display, 'handler_add_background_slideshow'));
    19    
    20    
     19
     20
    2121    //options
    2222    $ino_zindex = '-999';
    2323    $ino_bg_color = '';
    2424    $ino_credit = true;
    25    
    26    
    27    
     25
     26
     27
    2828    if (function_exists('register_uninstall_hook')){
    2929        register_uninstall_hook(__FILE__, 'deinstall_inoplugs_wp_backgrounds');
    3030    }
    31    
     31
    3232    function deinstall_inoplugs_wp_backgrounds() {
    3333        delete_option('inoplugs_bg_options');
    34        
     34
    3535        $allposts = get_posts('numberposts=-1&post_type=post&post_status=any');
    3636
     
    4343    //metabox
    4444    $prefix = 'ino_';
    45              
     45
    4646            $meta_box = array(
    4747                'id' => 'ino-meta-box_post',
     
    6767                )
    6868            );
    69            
     69
    7070            $meta_box = array(
    7171                'id' => 'ino-meta-box_post',
     
    9191                )
    9292            );
    93              
     93
    9494            add_action('admin_menu', 'ino_add_box');
    95              
     95
    9696            // Add meta box
    9797            function ino_add_box() {
    9898                global $meta_box;
    99              
     99
    100100                add_meta_box($meta_box['id'], $meta_box['title'], 'ino_show_box', $meta_box['page'], $meta_box['context'], $meta_box['priority']);
    101101            }
    102              
     102
    103103            // Callback function to show fields in meta box
    104104            function ino_show_box() {
    105105                global $meta_box, $post;
    106              
     106
    107107                // Use nonce for verification
    108108                echo '<input type="hidden" name="ino_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
    109              
     109
    110110                echo '<table class="form-table">';
    111              
     111
    112112                foreach ($meta_box['fields'] as $field) {
    113113                    // get current post meta data
    114114                    $meta = get_post_meta($post->ID, $field['id'], true);
    115              
     115
    116116                    echo '<tr>',
    117117                            '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>',
    118118                            '<td>';
    119119                    switch ($field['type']) {
    120              
    121              
    122              
    123              
    124             //If Text       
     120
     121
     122
     123
     124            //If Text
    125125                        case 'text':
    126126                            echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />',
    127127                                '<br />', $field['desc'];
    128128                            break;
    129              
    130              
    131             //If Text Area         
     129
     130
     131            //If Text Area
    132132                        case 'textarea':
    133133                            echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>',
    134134                                '<br />', $field['desc'];
    135135                            break;
    136              
    137              
    138             //If Button 
    139              
     136
     137
     138            //If Button
     139
    140140                            case 'button':
    141141                            echo '<input type="button" name="', $field['id'], '" id="', $field['id'], '"value="', $meta ? $meta : $field['std'], '" />';
     
    145145                        '</tr>';
    146146                }
    147              
     147
    148148                echo '</table>';
    149149            }
    150              
     150
    151151            add_action('save_post', 'ino_save_data');
    152              
     152
    153153            // Save data from meta box
    154154            function ino_save_data($post_id) {
    155155                global $meta_box;
    156              
     156
    157157                // verify nonce
    158158                if (!wp_verify_nonce($_POST['ino_meta_box_nonce'], basename(__FILE__))) {
    159159                    return $post_id;
    160160                }
    161              
     161
    162162                // check autosave
    163163                if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
    164164                    return $post_id;
    165165                }
    166              
     166
    167167                // check permissions
    168168                if ('page' == $_POST['post_type']) {
     
    173173                    return $post_id;
    174174                }
    175              
     175
    176176                foreach ($meta_box['fields'] as $field) {
    177177                    $old = get_post_meta($post_id, $field['id'], true);
    178178                    $new = $_POST[$field['id']];
    179              
     179
    180180                    if ($new && $new != $old) {
    181181                        update_post_meta($post_id, $field['id'], $new);
     
    185185                }
    186186            }
    187              
     187
    188188            function ino_admin_scripts() {
    189189            wp_enqueue_script('media-upload');
     
    198198            add_action('admin_print_styles', 'ino_admin_styles');
    199199
    200            
     200
    201201            //metabox
    202202    $prefix = 'ino_';
    203              
     203
    204204            $meta_box_page = array(
    205205                'id' => 'ino-meta-box_page',
     
    225225                )
    226226            );
    227              
     227
    228228            add_action('admin_menu', 'ino_add_box_page');
    229              
     229
    230230            // Add meta box page
    231231            function ino_add_box_page() {
    232232                global $meta_box_page;
    233              
     233
    234234                add_meta_box($meta_box_page['id'], $meta_box_page['title'], 'ino_show_box_page', $meta_box_page['page'], $meta_box_page['context'], $meta_box_page['priority']);
    235235            }
    236              
     236
    237237            // Callback function to show fields in meta box
    238238            function ino_show_box_page() {
    239239                global $meta_box_page, $post;
    240              
     240
    241241                // Use nonce for verification
    242242                echo '<input type="hidden" name="ino_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
    243              
     243
    244244                echo '<table class="form-table">';
    245              
     245
    246246                foreach ($meta_box_page['fields'] as $field) {
    247247                    // get current post meta data
    248248                    $meta = get_post_meta($post->ID, $field['id'], true);
    249              
     249
    250250                    echo '<tr>',
    251251                            '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>',
    252252                            '<td>';
    253253                    switch ($field['type']) {
    254              
    255              
    256              
    257              
    258             //If Text       
     254
     255
     256
     257
     258            //If Text
    259259                        case 'text':
    260260                            echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />',
    261261                                '<br />', $field['desc'];
    262262                            break;
    263              
    264              
    265             //If Text Area         
     263
     264
     265            //If Text Area
    266266                        case 'textarea':
    267267                            echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>',
    268268                                '<br />', $field['desc'];
    269269                            break;
    270              
    271              
    272             //If Button 
    273              
     270
     271
     272            //If Button
     273
    274274                            case 'button':
    275275                            echo '<input type="button" name="', $field['id'], '" id="', $field['id'], '"value="', $meta ? $meta : $field['std'], '" />';
     
    279279                        '</tr>';
    280280                }
    281              
     281
    282282                echo '</table>';
    283283            }
    284              
     284
    285285            add_action('save_post', 'ino_save_data_page');
    286              
     286
    287287            // Save data from meta box
    288288            function ino_save_data_page($post_id) {
    289289                global $meta_box_page;
    290              
     290
    291291                // verify nonce
    292292                if (!wp_verify_nonce($_POST['ino_meta_box_nonce'], basename(__FILE__))) {
    293293                    return $post_id;
    294294                }
    295              
     295
    296296                // check autosave
    297297                if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
    298298                    return $post_id;
    299299                }
    300              
     300
    301301                // check permissions
    302302                if ('page' == $_POST['post_type']) {
     
    307307                    return $post_id;
    308308                }
    309              
     309
    310310                foreach ($meta_box_page['fields'] as $field) {
    311311                    $old = get_post_meta($post_id, $field['id'], true);
    312312                    $new = $_POST[$field['id']];
    313              
     313
    314314                    if ($new && $new != $old) {
    315315                        update_post_meta($post_id, $field['id'], $new);
     
    319319                }
    320320            }
    321              
     321
    322322            function ino_admin_scripts_page() {
    323323            wp_enqueue_script('media-upload');
  • wp-backgrounds-lite/tags/1.2/inoplugs_background_plugin.php

    r390402 r690197  
    44 *  Plugin URI: http://inoplugs.com
    55 *  Description: Set fullsize background images for Posts | Get the Premium version here: <a href="http://inoplugs.com/projects/wp-backgrounds-plugin/">Premium Version</a>
    6  *  Author: InoPlugs | Peter Schoenmann
     6 *  Author: InoPlugs
    77 *  Version: 1.2.0.0
    88 *  Author URI: http://inoplugs.com
     
    1717    add_action('init', array (&$inoplugs_wp_backgrounds_display, 'handler_frontend_includes'));
    1818    add_action('wp_head', array (&$inoplugs_wp_backgrounds_display, 'handler_add_background_slideshow'));
    19    
    20    
     19
     20
    2121    //options
    2222    $ino_zindex = '-999';
    2323    $ino_bg_color = '';
    2424    $ino_credit = true;
    25    
    26    
    27    
     25
     26
     27
    2828    if (function_exists('register_uninstall_hook')){
    2929        register_uninstall_hook(__FILE__, 'deinstall_inoplugs_wp_backgrounds');
    3030    }
    31    
     31
    3232    function deinstall_inoplugs_wp_backgrounds() {
    3333        delete_option('inoplugs_bg_options');
    34        
     34
    3535        $allposts = get_posts('numberposts=-1&post_type=post&post_status=any');
    3636
     
    4343    //metabox
    4444    $prefix = 'ino_';
    45              
     45
    4646            $meta_box = array(
    4747                            $meta_box_post = array(
     
    6868                                        )
    6969                            ),
    70                            
     70
    7171                            $meta_box_page = array(
    7272                                            'id' => 'ino-meta-box_page',
     
    9090                                                    'std' => 'Select Background Image'
    9191                                                    )
    92                                                 )   
     92                                                )
    9393                                        )
    9494                            );
    95            
    96              
     95
     96
    9797            add_action('admin_menu', 'ino_add_box');
    98              
     98
    9999            // Add meta box
    100100            function ino_add_box() {
    101101                            global $meta_box;
    102102                            foreach($meta_box as $box){
    103                 add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']);                 
     103                add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']);
    104104                            }
    105105                        }
    106              
    107          
     106
     107
    108108            // Callback function to show fields in meta box
    109109            function ino_show_box() {
    110110                global $meta_box, $post;
    111              
     111
    112112                // Use nonce for verification
    113113                echo '<input type="hidden" name="ino_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
    114              
     114
    115115                echo '<table class="form-table">';
    116              
     116
    117117                foreach ($meta_box[0]['fields'] as $field) {
    118118                    // get current post meta data
    119119                    $meta = get_post_meta($post->ID, $field['id'], true);
    120              
     120
    121121                    echo '<tr>',
    122122                            '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>',
    123123                            '<td>';
    124124                    switch ($field['type']) {
    125              
    126              
    127              
    128              
    129             //If Text       
     125
     126
     127
     128
     129            //If Text
    130130                        case 'text':
    131131                            echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />',
    132132                                '<br />', $field['desc'];
    133133                            break;
    134              
    135              
    136             //If Text Area         
     134
     135
     136            //If Text Area
    137137                        case 'textarea':
    138138                            echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>',
    139139                                '<br />', $field['desc'];
    140140                            break;
    141              
    142              
    143             //If Button 
    144              
     141
     142
     143            //If Button
     144
    145145                            case 'button':
    146146                            echo '<input type="button" name="', $field['id'], '" id="', $field['id'], '"value="', $meta ? $meta : $field['std'], '" />';
     
    150150                        '</tr>';
    151151                }
    152              
     152
    153153                echo '</table>';
    154154            }
    155              
     155
    156156            add_action('save_post', 'ino_save_data');
    157              
    158              
     157
     158
    159159            // Save data from meta box
    160160            function ino_save_data($post_id) {
    161161                global $meta_box;
    162              
     162
    163163                // verify nonce
    164164                if (!wp_verify_nonce($_POST['ino_meta_box_nonce'], basename(__FILE__))) {
    165165                    return $post_id;
    166166                }
    167              
     167
    168168                // check autosave
    169169                if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
    170170                    return $post_id;
    171171                }
    172              
     172
    173173                // check permissions
    174174                if ('page' == $_POST['post_type']) {
     
    179179                    return $post_id;
    180180                }
    181              
     181
    182182                foreach ($meta_box[0]['fields'] as $field) {
    183183                    $old = get_post_meta($post_id, $field['id'], true);
    184184                    $new = $_POST[$field['id']];
    185              
     185
    186186                    if ($new && $new != $old) {
    187187                        update_post_meta($post_id, $field['id'], $new);
     
    191191                }
    192192            }
    193              
     193
    194194            function ino_admin_scripts() {
    195195            wp_enqueue_script('media-upload');
     
    203203            add_action('admin_print_scripts', 'ino_admin_scripts');
    204204            add_action('admin_print_styles', 'ino_admin_styles');
    205                        
     205
    206206?>
  • wp-backgrounds-lite/tags/1.3/inoplugs_background_plugin.php

    r394918 r690197  
    44 *  Plugin URI: http://inoplugs.com
    55 *  Description: Set fullsize background images for Posts | Get the Premium version here: <a href="http://inoplugs.com/projects/wp-backgrounds-plugin/">Premium Version</a>
    6  *  Author: InoPlugs | Peter Schoenmann
     6 *  Author: InoPlugs
    77 *  Version: 1.3.0.0
    88 *  Author URI: http://inoplugs.com
     
    1717    add_action('init', array (&$inoplugs_wp_backgrounds_display, 'handler_frontend_includes'));
    1818    add_action('wp_head', array (&$inoplugs_wp_backgrounds_display, 'handler_add_background_slideshow'));
    19    
    20    
     19
     20
    2121    //options
    2222    $ino_zindex = '-999';
    2323    $ino_bg_color = '';
    2424    $ino_credit = true;
    25    
    26    
    27    
     25
     26
     27
    2828    if (function_exists('register_uninstall_hook')){
    2929        register_uninstall_hook(__FILE__, 'deinstall_inoplugs_wp_backgrounds');
    3030    }
    31    
     31
    3232    function deinstall_inoplugs_wp_backgrounds() {
    3333        delete_option('inoplugs_bg_options');
    34        
     34
    3535        $allposts = get_posts('numberposts=-1&post_type=post&post_status=any');
    3636
     
    4343    //metabox
    4444    $prefix = 'ino_';
    45              
     45
    4646            $meta_box = array(
    4747                            $meta_box_post = array(
     
    6868                                        )
    6969                            ),
    70                            
     70
    7171                            $meta_box_page = array(
    7272                                            'id' => 'ino-meta-box_page',
     
    9090                                                    'std' => 'Select Background Image'
    9191                                                    ),
    92                                                    
     92
    9393                                                    array(
    9494                                                    'name' => '',
     
    9898                                                    'std' => ''
    9999                                                    )
    100                                                 )   
     100                                                )
    101101                                        )
    102102                            );
    103            
    104              
     103
     104
    105105            add_action('admin_menu', 'ino_add_box');
    106              
     106
    107107            // Add meta box
    108108            function ino_add_box() {
    109109                            global $meta_box;
    110110                            foreach($meta_box as $box){
    111                 add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']);                 
     111                add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']);
    112112                            }
    113113                        }
    114              
    115          
     114
     115
    116116            // Callback function to show fields in meta box
    117117            function ino_show_box() {
    118118                global $meta_box, $post;
    119              
     119
    120120                // Use nonce for verification
    121121                echo '<input type="hidden" name="ino_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
    122              
     122
    123123                echo '<table class="form-table">';
    124              
     124
    125125                foreach ($meta_box[0]['fields'] as $field) {
    126126                    // get current post meta data
    127127                    $meta = get_post_meta($post->ID, $field['id'], true);
    128              
     128
    129129                    echo '<tr>',
    130130                            '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>',
    131131                            '<td>';
    132132                    switch ($field['type']) {
    133              
    134              
    135              
    136              
    137             //If Text       
     133
     134
     135
     136
     137            //If Text
    138138                        case 'text':
    139139                            echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />',
    140140                                '<br />', $field['desc'];
    141141                            break;
    142              
    143              
    144             //If Text Area         
     142
     143
     144            //If Text Area
    145145                        case 'textarea':
    146146                            echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>',
    147147                                '<br />', $field['desc'];
    148148                            break;
    149              
    150              
    151             //If Button 
    152              
     149
     150
     151            //If Button
     152
    153153                            case 'button':
    154154                            echo '<input type="button" name="', $field['id'], '" id="', $field['id'], '"value="', $meta ? $meta : $field['std'], '" />';
     
    158158                        '</tr>';
    159159                }
    160              
     160
    161161                echo '</table>';
    162162            }
    163              
     163
    164164            add_action('save_post', 'ino_save_data');
    165              
    166              
     165
     166
    167167            // Save data from meta box
    168168            function ino_save_data($post_id) {
    169169                global $meta_box;
    170              
     170
    171171                // verify nonce
    172172                if (!wp_verify_nonce($_POST['ino_meta_box_nonce'], basename(__FILE__))) {
    173173                    return $post_id;
    174174                }
    175              
     175
    176176                // check autosave
    177177                if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
    178178                    return $post_id;
    179179                }
    180              
     180
    181181                // check permissions
    182182                if ('page' == $_POST['post_type']) {
     
    187187                    return $post_id;
    188188                }
    189              
     189
    190190                foreach ($meta_box[0]['fields'] as $field) {
    191191                    $old = get_post_meta($post_id, $field['id'], true);
    192192                    $new = $_POST[$field['id']];
    193              
     193
    194194                    if ($new && $new != $old) {
    195195                        update_post_meta($post_id, $field['id'], $new);
     
    199199                }
    200200            }
    201              
     201
    202202            function ino_admin_scripts() {
    203203            wp_enqueue_script('media-upload');
     
    211211            add_action('admin_print_scripts', 'ino_admin_scripts');
    212212            add_action('admin_print_styles', 'ino_admin_styles');
    213                        
     213
    214214?>
  • wp-backgrounds-lite/tags/1.4/inoplugs_background_plugin.php

    r401589 r690197  
    44 *  Plugin URI: http://inoplugs.com
    55 *  Description: Set fullsize background images for Posts | Get the Premium version here: <a href="http://inoplugs.com/projects/wp-backgrounds-plugin/">Premium Version</a>
    6  *  Author: InoPlugs | Peter Schoenmann
     6 *  Author: InoPlugs
    77 *  Version: 1.4.0.0
    88 *  Author URI: http://inoplugs.com
     
    1717    add_action('init', array (&$inoplugs_wp_backgrounds_display, 'handler_frontend_includes'));
    1818    add_action('wp_head', array (&$inoplugs_wp_backgrounds_display, 'handler_add_background_slideshow'));
    19    
    20    
     19
     20
    2121    //options
    2222    $ino_zindex = '-999';
    2323    $ino_bg_color = '';
    2424    $ino_credit = true;
    25    
    26    
    27    
     25
     26
     27
    2828    if (function_exists('register_uninstall_hook')){
    2929        register_uninstall_hook(__FILE__, 'deinstall_inoplugs_wp_backgrounds');
    3030    }
    31    
     31
    3232    function deinstall_inoplugs_wp_backgrounds() {
    3333        delete_option('inoplugs_bg_options');
    34        
     34
    3535        $allposts = get_posts('numberposts=-1&post_type=post&post_status=any');
    3636
     
    4343    //metabox
    4444    $prefix = 'ino_';
    45              
     45
    4646            $meta_box = array(
    4747                            $meta_box_post = array(
     
    6868                                        )
    6969                            ),
    70                            
     70
    7171                            $meta_box_page = array(
    7272                                            'id' => 'ino-meta-box_page',
     
    9090                                                    'std' => 'Select Background Image'
    9191                                                    ),
    92                                                    
     92
    9393                                                    array(
    9494                                                    'name' => '',
     
    9898                                                    'std' => ''
    9999                                                    )
    100                                                 )   
     100                                                )
    101101                                        )
    102102                            );
    103            
    104              
     103
     104
    105105            add_action('admin_menu', 'ino_add_box');
    106              
     106
    107107            // Add meta box
    108108            function ino_add_box() {
    109109                            global $meta_box;
    110110                            foreach($meta_box as $box){
    111                 add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']);                 
     111                add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']);
    112112                            }
    113113                        }
    114              
    115          
     114
     115
    116116            // Callback function to show fields in meta box
    117117            function ino_show_box() {
    118118                global $meta_box, $post;
    119              
     119
    120120                // Use nonce for verification
    121121                echo '<input type="hidden" name="ino_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
    122              
     122
    123123                echo '<table class="form-table">';
    124              
     124
    125125                foreach ($meta_box[0]['fields'] as $field) {
    126126                    // get current post meta data
    127127                    $meta = get_post_meta($post->ID, $field['id'], true);
    128              
     128
    129129                    echo '<tr>',
    130130                            '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>',
    131131                            '<td>';
    132132                    switch ($field['type']) {
    133              
    134              
    135              
    136              
    137             //If Text       
     133
     134
     135
     136
     137            //If Text
    138138                        case 'text':
    139139                            echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />',
    140140                                '<br />', $field['desc'];
    141141                            break;
    142              
    143              
    144             //If Text Area         
     142
     143
     144            //If Text Area
    145145                        case 'textarea':
    146146                            echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>',
    147147                                '<br />', $field['desc'];
    148148                            break;
    149              
    150              
    151             //If Button 
    152              
     149
     150
     151            //If Button
     152
    153153                            case 'button':
    154154                            echo '<input type="button" name="', $field['id'], '" id="', $field['id'], '"value="', $meta ? $meta : $field['std'], '" />';
     
    158158                        '</tr>';
    159159                }
    160              
     160
    161161                echo '</table>';
    162162            }
    163              
     163
    164164            add_action('save_post', 'ino_save_data');
    165              
    166              
     165
     166
    167167            // Save data from meta box
    168168            function ino_save_data($post_id) {
    169169                global $meta_box;
    170              
     170
    171171                // verify nonce
    172172                if (!wp_verify_nonce($_POST['ino_meta_box_nonce'], basename(__FILE__))) {
    173173                    return $post_id;
    174174                }
    175              
     175
    176176                // check autosave
    177177                if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
    178178                    return $post_id;
    179179                }
    180              
     180
    181181                // check permissions
    182182                if ('page' == $_POST['post_type']) {
     
    187187                    return $post_id;
    188188                }
    189              
     189
    190190                foreach ($meta_box[0]['fields'] as $field) {
    191191                    $old = get_post_meta($post_id, $field['id'], true);
    192192                    $new = $_POST[$field['id']];
    193              
     193
    194194                    if ($new && $new != $old) {
    195195                        update_post_meta($post_id, $field['id'], $new);
     
    199199                }
    200200            }
    201              
     201
    202202            function ino_admin_scripts() {
    203203            wp_enqueue_script('media-upload');
     
    211211            add_action('admin_print_scripts', 'ino_admin_scripts');
    212212            add_action('admin_print_styles', 'ino_admin_styles');
    213                        
     213
    214214?>
  • wp-backgrounds-lite/tags/1.5/inoplugs_background_plugin.php

    r573497 r690197  
    44 *  Plugin URI: http://inoplugs.com
    55 *  Description: Set fullsize background images for Posts | Get the Premium version here: <a href="http://inoplugs.com/projects/wp-backgrounds-plugin/">Premium Version</a>
    6  *  Author: InoPlugs | Peter Schoenmann
     6 *  Author: InoPlugs
    77 *  Version: 1.5.0.0
    88 *  Author URI: http://inoplugs.com
     
    1717    add_action('init', array (&$inoplugs_wp_backgrounds_display, 'handler_frontend_includes'));
    1818    add_action('wp_head', array (&$inoplugs_wp_backgrounds_display, 'handler_add_background_slideshow'));
    19    
    20    
     19
     20
    2121    //options
    2222    $ino_zindex = '-999';
    2323    $ino_bg_color = '';
    2424    $ino_credit = true;
    25    
    26    
    27    
     25
     26
     27
    2828    if (function_exists('register_uninstall_hook')){
    2929        register_uninstall_hook(__FILE__, 'deinstall_inoplugs_wp_backgrounds');
    3030    }
    31    
     31
    3232    function deinstall_inoplugs_wp_backgrounds() {
    3333        delete_option('inoplugs_bg_options');
    34        
     34
    3535        $allposts = get_posts('numberposts=-1&post_type=post&post_status=any');
    3636
     
    4343    //metabox
    4444    $prefix = 'ino_';
    45              
     45
    4646            $meta_box = array(
    4747                            $meta_box_post = array(
     
    6868                                        )
    6969                            ),
    70                            
     70
    7171                            $meta_box_page = array(
    7272                                            'id' => 'ino-meta-box_page',
     
    9090                                                    'std' => 'Select Background Image'
    9191                                                    ),
    92                                                    
     92
    9393                                                    array(
    9494                                                    'name' => '',
     
    9898                                                    'std' => ''
    9999                                                    )
    100                                                 )   
     100                                                )
    101101                                        )
    102102                            );
    103            
    104              
     103
     104
    105105            add_action('admin_menu', 'ino_add_box');
    106              
     106
    107107            // Add meta box
    108108            function ino_add_box() {
    109109                            global $meta_box;
    110110                            foreach($meta_box as $box){
    111                 add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']);                 
     111                add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']);
    112112                            }
    113113                        }
    114              
    115          
     114
     115
    116116            // Callback function to show fields in meta box
    117117            function ino_show_box() {
    118118                global $meta_box, $post;
    119              
     119
    120120                // Use nonce for verification
    121121                echo '<input type="hidden" name="ino_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
    122              
     122
    123123                echo '<table class="form-table">';
    124              
     124
    125125                foreach ($meta_box[0]['fields'] as $field) {
    126126                    // get current post meta data
    127127                    $meta = get_post_meta($post->ID, $field['id'], true);
    128              
     128
    129129                    echo '<tr>',
    130130                            '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>',
    131131                            '<td>';
    132132                    switch ($field['type']) {
    133              
    134              
    135              
    136              
    137             //If Text       
     133
     134
     135
     136
     137            //If Text
    138138                        case 'text':
    139139                            echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />',
    140140                                '<br />', $field['desc'];
    141141                            break;
    142              
    143              
    144             //If Text Area         
     142
     143
     144            //If Text Area
    145145                        case 'textarea':
    146146                            echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>',
    147147                                '<br />', $field['desc'];
    148148                            break;
    149              
    150              
    151             //If Button 
    152              
     149
     150
     151            //If Button
     152
    153153                            case 'button':
    154154                            echo '<input type="button" name="', $field['id'], '" id="', $field['id'], '"value="', $meta ? $meta : $field['std'], '" />';
     
    158158                        '</tr>';
    159159                }
    160              
     160
    161161                echo '</table>';
    162162            }
    163              
     163
    164164            add_action('save_post', 'ino_save_data');
    165              
    166              
     165
     166
    167167            // Save data from meta box
    168168            function ino_save_data($post_id) {
    169169                global $meta_box;
    170              
     170
    171171                // verify nonce
    172172                if (!wp_verify_nonce($_POST['ino_meta_box_nonce'], basename(__FILE__))) {
    173173                    return $post_id;
    174174                }
    175              
     175
    176176                // check autosave
    177177                if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
    178178                    return $post_id;
    179179                }
    180              
     180
    181181                // check permissions
    182182                if ('page' == $_POST['post_type']) {
     
    187187                    return $post_id;
    188188                }
    189              
     189
    190190                foreach ($meta_box[0]['fields'] as $field) {
    191191                    $old = get_post_meta($post_id, $field['id'], true);
    192192                    $new = $_POST[$field['id']];
    193              
     193
    194194                    if ($new && $new != $old) {
    195195                        update_post_meta($post_id, $field['id'], $new);
     
    199199                }
    200200            }
    201              
     201
    202202            function ino_admin_scripts() {
    203203            wp_enqueue_script('media-upload');
     
    211211            add_action('admin_print_scripts', 'ino_admin_scripts');
    212212            add_action('admin_print_styles', 'ino_admin_styles');
    213                        
     213
    214214?>
  • wp-backgrounds-lite/tags/1.6/inoplugs_background_plugin.php

    r619395 r690197  
    44 *  Plugin URI: http://inoplugs.com
    55 *  Description: Set clickable fullsize background images for Posts/Pages | Get the Premium version here: <a href="http://inoplugs.com/wpbackgroundsII">WP-Backgrounds II</a>
    6  *  Author: InoPlugs | Peter Schoenmann
     6 *  Author: InoPlugs
    77 *  Version: 2.1.0.0
    88 *  Author URI: http://inoplugs.com
    99 */
    10  
     10
    1111    define( 'INO_WPBLITE_URLPATH', WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__ ),'',plugin_basename(__FILE__)) );
    1212    define( 'INO_WPBLITE_TEXTDOMAIN', 'inowpblite' );
    1313    define( 'INO_WPBLITE_OPTIONNAME', 'inoplugs_bglite_options' );
    14    
     14
    1515    load_plugin_textdomain( INO_WPBLITE_TEXTDOMAIN, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
    16    
     16
    1717    require_once('inoplugs_classes/inoplugs_background_display.php');
    18    
    19    
    20    
     18
     19
     20
    2121    global $ino_bglite_options;
    2222    $ino_bglite_options = array();
    2323    $ino_bglite_options = get_option(INO_WPBLITE_OPTIONNAME);
    24                
    25     //set falback settings     
     24
     25    //set falback settings
    2626    $ino_bglite_options['zindex'] = empty($ino_bglite_options['zindex']) ? "-1" : $ino_bglite_options['zindex'];
    2727    $ino_bglite_options['bg_color'] = empty($ino_bglite_options['bg_color']) ? "" : $ino_bglite_options['bg_color'];
     
    3333    $inoplugs_wp_backgrounds_display = new inoplugs_background_display();
    3434
    35     # Add the options/actions to WordPress 
     35    # Add the options/actions to WordPress
    3636    add_action('init', array (&$inoplugs_wp_backgrounds_display, 'handler_frontend_includes'));
    37     add_action('wp_head', array (&$inoplugs_wp_backgrounds_display, 'handler_add_background_slideshow'));   
    38    
     37    add_action('wp_head', array (&$inoplugs_wp_backgrounds_display, 'handler_add_background_slideshow'));
     38
    3939    if (function_exists('register_uninstall_hook')){
    4040        register_uninstall_hook(__FILE__, 'deinstall_inoplugs_wp_backgrounds');
    4141    }
    42    
     42
    4343    function deinstall_inoplugs_wp_backgrounds() {
    4444        delete_option('inoplugs_bg_options');
    45        
     45
    4646        $allposts = get_posts('numberposts=-1&post_type=post&post_status=any');
    4747
     
    6868                                                    'std' => ''
    6969                                                ),
    70                                                
     70
    7171                                                array(
    7272                                                    'name' => '',
     
    7676                                                    'std' => __('Select Background Image',INO_WPBLITE_TEXTDOMAIN)
    7777                                                ),
    78                                                
     78
    7979                                                array(
    8080                                                    'name' => '',
     
    8686                                        )
    8787                            ),
    88                            
     88
    8989                         $meta_box_page = array(
    9090                                            'id' => 'ino-meta-box_page',
     
    108108                                                    'std' => __('Select Background Image',INO_WPBLITE_TEXTDOMAIN)
    109109                                                    ),
    110                                                    
     110
    111111                                                    array(
    112112                                                    'name' => '',
     
    116116                                                    'std' => ''
    117117                                                    )
    118                                                 )   
     118                                                )
    119119                                        )
    120120                            );
    121            
    122              
     121
     122
    123123            add_action('admin_menu', 'ino_add_box');
    124              
     124
    125125            // Add meta box
    126126            function ino_add_box() {
    127127                            global $meta_box;
    128128                            foreach($meta_box as $box){
    129                 add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']);                 
     129                add_meta_box($box['id'], $box['title'], 'ino_show_box', $box['page'], $box['context'], $box['priority']);
    130130                            }
    131131                        }
    132              
    133          
     132
     133
    134134            // Callback function to show fields in meta box
    135135            function ino_show_box() {
    136136                global $meta_box, $post;
    137              
     137
    138138                // Use nonce for verification
    139139                echo '<input type="hidden" name="ino_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
    140              
     140
    141141                echo '<table class="form-table">';
    142              
     142
    143143                foreach ($meta_box[0]['fields'] as $field) {
    144144                    // get current post meta data
    145145                    $meta = get_post_meta($post->ID, $field['id'], true);
    146              
     146
    147147                    echo '<tr>',
    148148                            '<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>',
    149149                            '<td>';
    150150                    switch ($field['type']) {
    151              
    152              
    153              
    154              
    155             //If Text       
     151
     152
     153
     154
     155            //If Text
    156156                        case 'text':
    157157                            echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />',
    158158                                '<br />', $field['desc'];
    159159                            break;
    160              
    161              
    162             //If Button 
    163              
     160
     161
     162            //If Button
     163
    164164                            case 'button':
    165165                            echo '<input type="button" name="', $field['id'], '" id="', $field['id'], '"value="', $meta ? $meta : $field['std'], '" />';
     
    169169                        '</tr>';
    170170                }
    171              
     171
    172172                echo '</table>';
    173173            }
    174              
     174
    175175            add_action('save_post', 'ino_save_data');
    176              
    177              
     176
     177
    178178            // Save data from meta box
    179179            function ino_save_data($post_id) {
    180180                global $meta_box;
    181              
     181
    182182                // verify nonce
    183183                if (!wp_verify_nonce($_POST['ino_meta_box_nonce'], basename(__FILE__))) {
    184184                    return $post_id;
    185185                }
    186              
     186
    187187                // check autosave
    188188                if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
    189189                    return $post_id;
    190190                }
    191              
     191
    192192                // check permissions
    193193                if ('page' == $_POST['post_type']) {
     
    198198                    return $post_id;
    199199                }
    200              
     200
    201201                foreach ($meta_box[0]['fields'] as $field) {
    202202                    $old = get_post_meta($post_id, $field['id'], true);
    203203                    $new = $_POST[$field['id']];
    204              
     204
    205205                    if ($new && $new != $old) {
    206206                        update_post_meta($post_id, $field['id'], $new);
     
    210210                }
    211211            }
    212              
     212
    213213            function ino_admin_scripts() {
    214214                wp_enqueue_script('media-upload');
     
    217217                wp_enqueue_script('my-upload');
    218218            }
    219            
     219
    220220            function ino_admin_styles() {
    221221                wp_enqueue_style('thickbox');
    222222            }
    223            
     223
    224224            add_action('admin_print_scripts', 'ino_admin_scripts');
    225225            add_action('admin_print_styles', 'ino_admin_styles');
    226        
    227        
     226
     227
    228228    # Register an administration page
    229229
    230230    add_action('admin_menu', 'inowpblite_addAdminPage');
    231      
     231
    232232    function inowpblite_addAdminPage() {
    233233        add_options_page(__('WP-Backgrounds Lite',INO_WPBLITE_TEXTDOMAIN), 'WP-Backgrounds Lite', 8, 'WP-Backgrounds', 'inowpblite_adminmenu');
     
    235235
    236236    # Generates the administration menu
    237    
     237
    238238
    239239    add_action('wp_ajax_inoptions_inowpblite_ajax_save','inoplugs_inowpblite_save_ajax');
    240    
     240
    241241    function inoplugs_inowpblite_save_ajax() {
    242242
     
    246246        unset($data['security'], $data['action']);
    247247
    248         if(update_option(INO_WPBLITE_OPTIONNAME, $data)) 
     248        if(update_option(INO_WPBLITE_OPTIONNAME, $data))
    249249        {
    250250            die('1');
     
    258258    <div class="wrap">
    259259        <div id="message"></div>
    260        
     260
    261261        <script type="text/javascript">
    262262        jQuery(document).ready(function($) {
     
    291291        }
    292292        </script>
    293        
     293
    294294        <div class="logo"><a href="http://inoplugs.com"><img style="float:left;" src="<?php $ino_urlpath = WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),'',plugin_basename(__FILE__)); echo $ino_urlpath; ?>images/logo.png" height="100" alt="logo" /></a>
    295295            <h2 style="float:left; margin-top: 64px;"><?php _e('Backgrounds Lite Option Page',INO_WPBLITE_TEXTDOMAIN); ?></h2>
     
    297297        </div>
    298298        <div style="clear: both;"></div>
    299        
     299
    300300        <form method="post" action="options.php" name="ino_inowpblite_option_form" id="ino_inowpblite_option_form">
    301301        <?php global $ino_bglite_options; wp_nonce_field('update-options'); ?>
    302        
     302
    303303            <div id="ino-options-cont">
    304304
     
    314314                    </div>
    315315                </div>
    316                
    317                                
     316
     317
    318318                <div id="ino-containerid" class="tab-option">
    319319                    <h3 class="option-title"><strong><?php _e('ID or class of the content container/wrapper',INO_WPBLITE_TEXTDOMAIN); ?></strong></h3>
    320320                    <div class="option-content">
    321                    
     321
    322322                    <label for="containerid">
    323323                        <input type="text" name="<?php echo INO_WPBLITE_OPTIONNAME; ?>[containerid]" value="<?php if( !empty($ino_bglite_options['containerid']) ) { echo $ino_bglite_options['containerid']; }else{ echo ""; } ?>" /><br/>
     
    328328                    </div>
    329329                </div>
    330                
    331                
     330
     331
    332332                <div id="ino-zindexcontainer" class="tab-option">
    333333                    <h3 class="option-title"><strong><?php _e('Z-index value of content layer',INO_WPBLITE_TEXTDOMAIN); ?></strong></h3>
    334334                    <div class="option-content">
    335                    
     335
    336336                    <label for="zindexcontainer">
    337                         <input type="text" name="<?php echo INO_WPBLITE_OPTIONNAME; ?>[zindexcontainer]" value="<?php if( !empty($ino_bglite_options['zindexcontainer']) ) { echo $ino_bglite_options['zindexcontainer']; }else{ echo "5"; } ?>" /> 
     337                        <input type="text" name="<?php echo INO_WPBLITE_OPTIONNAME; ?>[zindexcontainer]" value="<?php if( !empty($ino_bglite_options['zindexcontainer']) ) { echo $ino_bglite_options['zindexcontainer']; }else{ echo "5"; } ?>" />
    338338                        <br /><?php _e('Enter the z-index value of the background layer (5 by default).',INO_WPBLITE_TEXTDOMAIN); ?>
    339339                    </label>
     
    342342                    </div>
    343343                </div>
    344                
     344
    345345                <div id="ino-positioncontainer" class="tab-option">
    346346                    <h3 class="option-title"><strong><?php _e('Position of the content container/wrapper',INO_WPBLITE_TEXTDOMAIN); ?></strong></h3>
    347347                    <div class="option-content">
    348                    
     348
    349349                    <label for="positioncontainer">
    350                         <input type="text" name="<?php echo INO_WPBLITE_OPTIONNAME; ?>[positioncontainer]" value="<?php if( !empty($ino_bglite_options['positioncontainer']) ) { echo $ino_bglite_options['positioncontainer']; }else{ echo "relative"; } ?>" /> 
     350                        <input type="text" name="<?php echo INO_WPBLITE_OPTIONNAME; ?>[positioncontainer]" value="<?php if( !empty($ino_bglite_options['positioncontainer']) ) { echo $ino_bglite_options['positioncontainer']; }else{ echo "relative"; } ?>" />
    351351                        <br /><?php _e('Enter the position of the content container/wrapper. Default value is \'relative\'. Only change it if you know what you\'re doing.',INO_WPBLITE_TEXTDOMAIN); ?>
    352352                    </label>
     
    355355                    </div>
    356356                </div>
    357                
     357
    358358                <div id="ino-bg_color" class="tab-option">
    359359                    <h3 class="option-title"><strong><?php _e('Body background color',INO_WPBLITE_TEXTDOMAIN); ?></strong></h3>
    360360                    <div class="option-content">
    361                    
     361
    362362                    <label for="bg_color">
    363                         <input type="text" name="<?php echo INO_WPBLITE_OPTIONNAME; ?>[bg_color]" value="<?php if( !empty($ino_bglite_options['bg_color']) ) { echo $ino_bglite_options['bg_color']; }else{ echo ""; } ?>" /> 
     363                        <input type="text" name="<?php echo INO_WPBLITE_OPTIONNAME; ?>[bg_color]" value="<?php if( !empty($ino_bglite_options['bg_color']) ) { echo $ino_bglite_options['bg_color']; }else{ echo ""; } ?>" />
    364364                        <br /><?php _e('This option helps you to adjust the default body background color. Leave the field empty to deactivate this option.',INO_WPBLITE_TEXTDOMAIN); ?>
    365365                    </label>
     
    376376                <input type="submit" class="button-primary" value="<?php _e('Save Changes',INO_WPBLITE_TEXTDOMAIN) ?>" />
    377377            </p>
    378         </form> 
     378        </form>
    379379    </div>
    380    
     380
    381381    <?php
    382382}
  • wp-backgrounds-lite/trunk/inoplugs_background_plugin.php

    r681209 r690197  
    44 *  Plugin URI: http://inoplugs.com
    55 *  Description: Set clickable fullsize background images for Posts/Pages | Get the Premium version here: <a href="http://inoplugs.com/wpbackgroundsII">WP-Backgrounds II</a>
    6  *  Author: InoPlugs | Peter Schoenmann
     6 *  Author: InoPlugs
    77 *  Version: 2.2.5
    88 *  Author URI: http://inoplugs.com
Note: See TracChangeset for help on using the changeset viewer.