Plugin Directory

Changeset 568404


Ignore:
Timestamp:
07/06/2012 06:50:28 PM (14 years ago)
Author:
amolnw2778
Message:

fixed php array warning

Location:
navayan-subscribe/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • navayan-subscribe/trunk/ny-subscribe.php

    r568140 r568404  
    33Plugin Name: Navayan Subscribe
    44Description: <strong>Navayan Subscribe</strong> allows your website/blog visitor to easily and quickly register to your website/blog using email, name and additional field. Send subscribe notification to admin and new post notification to subscribers.
    5 Version: 1.1.7
     5Version: 1.1.7.1
    66Usage: Paste this single line code within PHP tag in your template: if ( function_exists('navayan_subscribe') ){ echo navayan_subscribe(); } or put shortcode [navayan_subscribe] in post/page
    77Donate Link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=amolnw2778@gmail.com&item_name=NavayanSubscribe
     
    112112
    113113//if (has_filter('publish_post') ){
    114   $action_based_post = array(
     114  $ar_publish = array(
    115115    array(
    116116      'slug'    => 'ny_subscribe_field_notify_published_post',
     
    123123//}
    124124//if (has_filter('new_to_publish') ){
    125   $action_based_post .= array(
     125  $ar_new = array(
    126126    array(
    127127      'slug'    => 'ny_subscribe_field_notify_new_post',
     
    134134//}
    135135//if (has_filter('draft_to_publish') ){
    136   $action_based_post .= array(
     136  $ar_draft = array(
    137137    array(
    138138      'slug'    => 'ny_subscribe_field_notify_draft_post',
     
    145145//}
    146146//if (has_filter('pending_to_publish') ){
    147   $action_based_post .= array(
     147  $ar_pending = array(
    148148    array(
    149149      'slug'    => 'ny_subscribe_field_notify_pending_post',
     
    156156//}
    157157//if (has_filter('publish_future_post') ){
    158   $action_based_post .= array(
     158  $ar_future = array(
    159159    array(
    160160      'slug'    => 'ny_subscribe_field_notify_future_post',
     
    167167//}
    168168//if (has_filter('private_to_publish') ){
    169   $action_based_post .= array(
     169  $ar_private = array(
    170170    array(
    171171      'slug'    => 'ny_subscribe_field_notify_private_post',
     
    178178//}
    179179//if (has_filter('xmlrpc_publish_post') ){
    180   $action_based_post .= array(
     180  $ar_xmlrpc = array(
    181181    array(
    182182      'slug'    => 'ny_subscribe_field_notify_xmlrpc_post',
     
    189189//}
    190190 
    191 $admin_fields = array_merge ( $admin_fields, $action_based_post);
     191$admin_fields = array_merge ( $admin_fields, $ar_publish, $ar_new, $ar_draft, $ar_pending, $ar_future, $ar_private, $ar_xmlrpc );
    192192
    193193
     
    202202/************************ GLOBAL VARS **************************/
    203203$init_global = array();
    204 $init_global['form_heading']    = get_option( 'ny_subscribe_field_form_heading' )       ? get_option( 'ny_subscribe_field_form_heading' ) : __('Subscribe');
    205 $init_global['submit_label']    = get_option( 'ny_subscribe_field_label' )                  ? get_option( 'ny_subscribe_field_label' ) : __('Subscribe');
     204$init_global['form_heading']    = get_option( 'ny_subscribe_field_form_heading' )       ? stripslashes( get_option( 'ny_subscribe_field_form_heading' ) ) : __('Subscribe');
     205$init_global['submit_label']    = get_option( 'ny_subscribe_field_label' )                  ? stripslashes( get_option( 'ny_subscribe_field_label' ) ) : __('Subscribe');
    206206$init_global['show_name']           = get_option( 'ny_subscribe_field_show_name' );
    207207$init_global['show_custom']     = get_option( 'ny_subscribe_field_custom' );
    208 $init_global['email_error']     = get_option( 'ny_subscribe_field_email_invalid' )  ? get_option( 'ny_subscribe_field_email_invalid' ) : __('Invalid Email');
    209 $init_global['email_exist']     = get_option( 'ny_subscribe_field_email_exist' )        ? get_option( 'ny_subscribe_field_email_exist' ) : __('This Email already registered');
    210 $init_global['msg_success']     = get_option( 'ny_subscribe_field_success' )                ? get_option( 'ny_subscribe_field_success' ) : __('Thank you for subscribing!');
     208$init_global['email_error']     = get_option( 'ny_subscribe_field_email_invalid' )  ? stripslashes( get_option( 'ny_subscribe_field_email_invalid' ) ) : __('Invalid Email');
     209$init_global['email_exist']     = get_option( 'ny_subscribe_field_email_exist' )        ? stripslashes( get_option( 'ny_subscribe_field_email_exist' ) ) : __('This Email already registered');
     210$init_global['msg_success']     = get_option( 'ny_subscribe_field_success' )                ? stripslashes( get_option( 'ny_subscribe_field_success' ) ) : __('Thank you for subscribing!');
    211211$init_global['send_email']      = get_option( 'ny_subscribe_field_send_email' );
    212212$init_global['notify_published_post'] = get_option( 'ny_subscribe_field_notify_published_post' );
     
    217217$init_global['notify_private_post']   = get_option( 'ny_subscribe_field_notify_private_post' );
    218218$init_global['notify_xmlrpc_post']    = get_option( 'ny_subscribe_field_notify_xmlrpc_post' );
    219 $init_global['ny_unsubscribe_message']  = get_option( 'ny_unsubscribe_message' ) ? get_option( 'ny_unsubscribe_message' ) : __('You are successfully unsubscribed!');
    220 $init_global['ny_subscribe_logged_in_msg']  = get_option( 'ny_subscribe_logged_in_msg' ) ? get_option( 'ny_subscribe_logged_in_msg' ) : __('You are already joined us!');
     219$init_global['ny_unsubscribe_message']  = get_option( 'ny_unsubscribe_message' ) ? stripslashes( get_option( 'ny_unsubscribe_message' ) ) : __('You are successfully unsubscribed!');
     220$init_global['ny_subscribe_logged_in_msg']  = get_option( 'ny_subscribe_logged_in_msg' ) ? stripslashes( get_option( 'ny_subscribe_logged_in_msg' ) ) : __('You are already joined us!');
    221221
    222222$val_name=''; $val_email=''; $val_custom='';
     
    230230        echo "<p>
    231231            <label for='ny_name'>".__('Name')."</label>
    232             <input type='text' name='ny_name' id='ny_name' value='". $val_name ."' />
     232            <input type='text' name='ny_name' id='ny_name' value='". stripslashes( $val_name ) ."' />
    233233        </p>";
    234234    }
     
    236236    echo "<p>
    237237        <label for='ny_email'>".__('Email')."</label>
    238         <input type='text' name='ny_email' id='ny_email' value='". $val_email ."' />
     238        <input type='text' name='ny_email' id='ny_email' value='". stripslashes( $val_email ) ."' />
    239239    </p>";
    240240   
     
    242242        echo "<p>
    243243            <label for='ny_custom'>". __( $init_global['show_custom'] ) ."</label>
    244             <input type='text' name='ny_custom' id='ny_custom' value='". $val_custom ."' />
     244            <input type='text' name='ny_custom' id='ny_custom' value='". stripslashes( $val_custom ) ."' />
    245245        </p>";
    246246    }
     
    323323                                            <table cellpadding='0' cellspacing='0' border='0'>
    324324                                                <tr>
    325                                                     <td>".__('Hi ') . $uname."!</td>
     325                                                    <td>".__('Hi ') . stripslashes( $uname ) ."!</td>
    326326                                                </tr>
    327327                                                <tr>
     
    431431
    432432            $return['err'] = false;
    433             $return['msg'] = $add == true ? __('Subscriber added!') : $init_global['msg_success'];
     433            $return['msg'] = $add == true ? __('Subscriber added!') : stripslashes( $init_global['msg_success'] );
    434434          }
    435435      }
     
    516516                    echo '<p>';
    517517                    echo '<label for="'. $admin_fields[$i]['slug'] .'" style="vertical-align:top">'. __( $admin_fields[$i]['label'] ) .'</label>';
    518                     echo '<textarea name="'. $admin_fields[$i]['slug'] .'" id="'. $admin_fields[$i]['slug'] .'">'. get_option( $admin_fields[$i]['slug'] ) .'</textarea>';
     518                    echo '<textarea name="'. $admin_fields[$i]['slug'] .'" id="'. $admin_fields[$i]['slug'] .'">'. stripslashes( get_option( $admin_fields[$i]['slug'] ) ) .'</textarea>';
    519519                    echo '</p>';
    520520                  }else{
    521521                    echo '<p>';
    522522                    echo '<label for="'. $admin_fields[$i]['slug'] .'">'. __( $admin_fields[$i]['label'] ) .'</label>';
    523                     echo '<input '. $checked .' type="'. $admin_fields[$i]['type'] .'" name="'. $admin_fields[$i]['slug'] .'" id="'. $admin_fields[$i]['slug'] .'" value="'. get_option( $admin_fields[$i]['slug'] ) .'" />';
     523                    echo '<input '. $checked .' type="'. $admin_fields[$i]['type'] .'" name="'. $admin_fields[$i]['slug'] .'" id="'. $admin_fields[$i]['slug'] .'" value="'. stripslashes( get_option( $admin_fields[$i]['slug'] ) ) .'" />';
    524524                    echo '</p>';
    525525                  }
     
    585585
    586586      echo "<form name='ny_subscribe_form' id='ny_subscribe_form' method='post' action='#". $wrapper_id ."'>";
    587       echo "<h3>". $init_global['form_heading'] ."</h3>";
     587      echo "<h3>". stripslashes( $init_global['form_heading'] ) ."</h3>";
    588588
    589589            ny_subscribe_form_fields();
     
    591591      echo "<p>
    592592            <label>&nbsp;</label>
    593             <input type='submit' value='". $init_global['submit_label'] ."' name='ny_subscribe_submit' id='ny_subscribe_submit' />
     593            <input type='submit' value='". stripslashes( $init_global['submit_label'] ) ."' name='ny_subscribe_submit' id='ny_subscribe_submit' />
    594594          </p>
    595595        </form>
     
    597597    }else{
    598598            echo "<div id='userloggedin' class='widget'>";
    599             _e( "<h2 class='title'>". $init_global['form_heading'] ."</h2>" );
    600             _e( "<h4>". $init_global['ny_subscribe_logged_in_msg'] ."</h4>" );
     599            _e( "<h2 class='title'>". stripslashes( $init_global['form_heading'] ) ."</h2>" );
     600            _e( "<h4>". stripslashes( $init_global['ny_subscribe_logged_in_msg'] ) ."</h4>" );
    601601            echo '</div>';
    602602        }
     
    641641            '',
    642642            array(
    643         'name' => __($init_global['form_heading']), # FORM HEADING = WIDGET HEADING
     643        'name' => __( stripslashes( $init_global['form_heading'] ) ), # FORM HEADING = WIDGET HEADING
    644644        'description' => __('Displays Navayan Subscribe form as a widget in your sidebar', 'nysubscribe')
    645645      )
  • navayan-subscribe/trunk/readme.txt

    r568144 r568404  
    44Requires at least: 3+
    55Tested up to: 3.4.1
    6 Stable tag: 1.1.7
     6Stable tag: 1.1.7.1
    77Donate Link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=amolnw2778@gmail.com&item_name=NavayanSubscribe
    88
     
    9898== Changelog ==
    9999
     100= 1.1.7.1 (20120707) =
     101* FIX: PHP warning
     102
    100103= 1.1.7 (20120706) =
    101104* FIX: Avoided various filters
Note: See TracChangeset for help on using the changeset viewer.