Plugin Directory

Changeset 842838


Ignore:
Timestamp:
01/22/2014 05:08:07 AM (12 years ago)
Author:
riyaznet
Message:

Version 2.0.1

Location:
getsocial/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • getsocial/trunk/getsocial.php

    r841815 r842838  
    55  Description: GetSocial adds an intelligent, lightweight, quick to setup floating social media sharing box on your blog posts.
    66  Author: Riyaz
    7   Version: 2.0
     7  Version: 2.0.1
    88  Author URI: http://www.riyaz.net
    99  License: GPL2
     
    6363
    6464        function GetSocial() {
    65             return $this->__construct();
    66         }
    67 
    68         function __construct() {
     65            return $this->gs_construct();
     66        }
     67
     68        function gs_construct() {
    6969            $this->define_constants();
    7070            $this->add_actions();
     
    107107            add_action( 'save_post', array( $this, 'save_inpost_meta' ) );
    108108
    109             add_action( 'admin_notices', array( $this, 'show_admin_notice' ) );
     109//          add_action( 'admin_notices', array( $this, 'show_admin_notice' ) );
    110110        }
    111111
     
    179179
    180180        function add_admin_css_styles() {
    181             if ( (is_admin() && $_GET[ 'page' ] == 'getsocial/getsocial.php' ) ) {
     181            if ( (is_admin() && isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] == 'getsocial/getsocial.php' ) ) {
    182182                wp_deregister_style( 'farbtastic' );
    183183                wp_register_style( 'farbtastic', GETSOCIAL_LIB_URL . 'farbtastic.css' );
     
    190190
    191191        function add_admin_scripts() {
    192             if ( (is_admin() && $_GET[ 'page' ] == 'getsocial/getsocial.php' ) ) {
     192            if ( (is_admin() && isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] == 'getsocial/getsocial.php' ) ) {
    193193
    194194                wp_deregister_script( 'jquery' );
     
    537537        function gs_get_page_url() {
    538538            $pageURL = 'http';
    539             if ( $_SERVER[ "HTTPS" ] == "on" ) {
     539            if ( isset( $_SERVER[ "HTTPS" ] ) && "on" == $_SERVER[ "HTTPS" ] ) {
    540540                $pageURL .= "s";
    541541            }
     
    578578                    }
    579579                    if ( $context == 'options' ) {
    580                         ?>
    581                         <li class="ui-state-default" id="rtw">
     580                        ?><li class="ui-state-default" id="rtw">
    582581                            <div class="sortth">Twitter Tweet Button</div>
    583582                            <div class="sorttd"><div id="radio-tc">
     
    600599                                    ?> /><label for="gsthide">Hide</label>
    601600                                </div></div>
    602                         </li>
    603                         <?php
     601                        </li><?php
    604602                    }
    605603                    break;
     
    613611                    }
    614612                    if ( $context == 'options' ) {
    615                         ?>
    616                         <li class="ui-state-default" id="rbf">
     613                        ?><li class="ui-state-default" id="rbf">
    617614                            <div class="sortth">Buffer Button</div>
    618615                            <div class="sorttd"><div id="radio-bc">
     
    634631                                    ?> /><label for="gsbhide">Hide</label>
    635632                                </div></div>
    636                         </li>
    637                         <?php
     633                        </li><?php
    638634                    }
    639635                    break;
     
    680676                    }
    681677                    if ( $context == 'options' ) {
    682                         ?>
    683                         <li class="ui-state-default" id="rfb">
     678                        ?><li class="ui-state-default" id="rfb">
    684679                            <div class="sortth">Facebook Like Button</div>
    685680                            <div class="sorttd"><div id="radio-fc">
     
    701696                                    ?> /><label for="gsfhide">Hide</label>
    702697                                </div></div>
    703                         </li>
    704                         <?php
     698                        </li><?php
    705699                    }
    706700                    break;
     
    715709                    }
    716710                    if ( $context == 'options' ) {
    717                         ?>
    718                         <li class="ui-state-default" id="rgp">
     711                        ?><li class="ui-state-default" id="rgp">
    719712                            <div class="sortth">Google +1 Button</div>
    720713                            <div class="sorttd"><div id="radio-gc">
     
    736729                                    ?> /><label for="gsghide">Hide</label>
    737730                                </div></div>
    738                         </li>
    739                         <?php
     731                        </li><?php
    740732                    }
    741733                    break;
     
    757749                    }
    758750                    if ( $context == 'options' ) {
    759                         ?>
    760                         <li class="ui-state-default" id="rsu">
     751                        ?><li class="ui-state-default" id="rsu">
    761752                            <div class="sortth">StumbleUpon Button</div>
    762753                            <div class="sorttd"><div id="radio-sc">
     
    778769                                    ?> /><label for="gsshide">Hide</label>
    779770                                </div></div>
    780                         </li>
    781                         <?php
     771                        </li><?php
    782772                    }
    783773                    break;
     
    792782                    }
    793783                    if ( $context == 'options' ) {
    794                         ?>
    795                         <li class="ui-state-default" id="rcu">
     784                        ?><li class="ui-state-default" id="rcu">
    796785                            <div class="sortth">CentUp Button</div>
    797786                            <div class="sorttd"><div id="radio-dc">
     
    808797                                    ?> /><label for="gschide">Hide</label>
    809798                                </div></div>
    810                         </li>
    811                         <?php
     799                        </li><?php
    812800                    }
    813801                    break;
     
    824812                    }
    825813                    if ( $context == 'options' ) {
    826                         ?>
    827                         <li class="ui-state-default" id="rli">
     814                        ?><li class="ui-state-default" id="rli">
    828815                            <div class="sortth">LinkedIn Button</div>
    829816                            <div class="sorttd"><div id="radio-lc">
     
    845832                                    ?> /><label for="gslhide">Hide</label>
    846833                                </div></div>
    847                         </li>
    848                         <?php
     834                        </li><?php
    849835                    }
    850836                    break;
     
    863849                    }
    864850                    if ( $context == 'options' ) {
    865                         ?>
    866                         <li class="ui-state-default" id="rpi">
     851                        ?><li class="ui-state-default" id="rpi">
    867852                            <div class="sortth">Pinterest Pin it Button</div>
    868853                            <div class="sorttd"><div id="radio-pc">
     
    884869                                    ?> /><label for="gsphide">Hide</label>
    885870                                </div></div>
    886                         </li>
    887                         <?php
     871                        </li><?php
    888872                    }
    889873                    break;
     
    896880                    }
    897881                    if ( $context == 'options' ) {
    898                         ?>
    899                         <li class="ui-state-default" id="rab">
     882                        ?><li class="ui-state-default" id="rab">
    900883                            <div class="sortth">Additional buttons</div>
    901884                            <div class="sorttd">
    902885                                <textarea name="getsocial[main][additional]" id="getsocial_additional" cols="45" rows="5"><?php echo esc_textarea( $main[ 'additional' ] ); ?></textarea>
    903886                            </div>
    904                         </li>
    905                         <?php
     887                        </li><?php
    906888                    }
    907889                    break;
     
    913895
    914896        function show_admin_notice() {
     897            if ( !isset( $_GET[ 'gsmsg' ] ) ) {
     898                return;
     899            }
     900
    915901            if ( 'dismiss' == $_GET[ 'gsmsg' ] ) {
    916902                update_option( 'getsocial_show_remote_massage', 'dismiss' );
     
    964950                    break;
    965951                default:
    966                     trigger_error( "invalid hex length ($len). must be (3) or (6)", e_user_error );
     952                    $color = 'FFFFFF';
    967953            }
    968954
    969955            if ( !preg_match( '/[a-f0-9]{6}/i', $color ) ) {
    970                 $color = htmlentities( $color );
    971                 trigger_error( "invalid hex string #$color", e_user_error );
     956                $color = htmlentities( 'FFFFFF' );
    972957            }
    973958
     
    1003988if ( class_exists( "GetSocial" ) ) {
    1004989    $gs = new GetSocial();
    1005     register_activation_hook( __FILE__, array( 'GetSocial', 'activate' ) );
    1006     register_deactivation_hook( __FILE__, array( 'GetSocial', 'deactivate' ) );
    1007     add_action( 'plugins_loaded', array( &$gs, 'update_db_table_structure_if_needed' ) );
     990//  add_action( 'plugins_loaded', array( &$gs, 'update_db_table_structure_if_needed' ) );
    1008991}
  • getsocial/trunk/readme.txt

    r841815 r842838  
    101101
    102102== Changelog ==
     103= 2.0.1 =
     104* Minor bug fixes
     105
    103106= 2.0 =
    104107* Plugin rewritten in object-oriented style
    105108* Added support for CentUp button
     109* Hides itself on tablet and mobile screens
    106110* Minor bug fixes
    107111* Tested compatibility with WordPress 3.8
  • getsocial/trunk/settings.php

    r841815 r842838  
    1212            $("#sortable").disableSelection();
    1313        });
    14     </script>
    15     <?php
     14    </script><?php
    1615    global $wp_query;
    1716    $messages = get_transient( $this->_getsocial_settings_transient );
     
    2827                }
    2928                ?>
    30     <form method="post" action="<?php echo add_query_arg( array( ) ); ?>" name="gsopt">
    31         <?php
     29    <form method="post" action="<?php echo add_query_arg( array( ) ); ?>" name="gsopt"><?php
    3230        settings_fields( 'getsocial-settings-group' );
    3331        wp_nonce_field( 'save-getsocial-settings', 'save-getsocial-settings-nonce' );
     
    5149                <input type="hidden" name="order" id="order" value=""/>
    5250                <div class="dragtitle">Simply drag and drop the boxes below to re-order the buttons on GetSocial bar.</div>
    53                 <ul id="sortable" class="gstleft">
    54                     <?php
     51                <ul id="sortable" class="gstleft"><?php
    5552                    $order = esc_attr( $main[ 'order' ] );
    5653                    $order = trim( $order, ',' );
Note: See TracChangeset for help on using the changeset viewer.