Plugin Directory

Changeset 642671


Ignore:
Timestamp:
12/21/2012 12:12:24 AM (13 years ago)
Author:
Bit51
Message:

Added option to put buttons above or below content.

Location:
share-center-pro/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • share-center-pro/trunk/inc/admin.php

    r633773 r642671  
    9595                            <input type="checkbox" name="bit51_scp[search]" id="search" value="1" <?php if ( $scpoptions['search'] == 1 ) echo "checked"; ?> /> <label for="search"> <?php _e( 'Show on Search Results', $this->hook ); ?></label><br />
    9696                            <input type="checkbox" name="bit51_scp[single]" id="single" value="1" <?php if ( $scpoptions['single'] == 1 ) echo "checked"; ?> /> <label for="single"> <?php _e( 'Show on Single Posts', $this->hook ); ?></label><br />
     97                            <select name="bit51_scp[locationsingle]" id="locationsingle">
     98                                <option value="0" <?php if ( $scpoptions['locationsingle'] == 0 ) echo "selected"; ?> ><?php _e( 'Bottom', $this->hook ); ?></option>
     99                                <option value="1" <?php if ( $scpoptions['locationsingle'] == 1 ) echo "selected"; ?> ><?php _e( 'Top', $this->hook ); ?></option>
     100                                <option value="2" <?php if ( $scpoptions['locationsingle'] == 2 ) echo "selected"; ?> ><?php _e( 'Both', $this->hook ); ?></option>
     101                            </select><label for="locationsingle"> <?php _e( 'Show above content, below content, or both in single posts and pages', $this->hook ); ?></label><br />
     102                            <select name="bit51_scp[locationlist]" id="locationlist">
     103                                <option value="0" <?php if ( $scpoptions['locationlist'] == 0 ) echo "selected"; ?> ><?php _e( 'Bottom', $this->hook ); ?></option>
     104                                <option value="1" <?php if ( $scpoptions['locationlist'] == 1 ) echo "selected"; ?> ><?php _e( 'Top', $this->hook ); ?></option>
     105                                <option value="2" <?php if ( $scpoptions['locationlist'] == 2 ) echo "selected"; ?> ><?php _e( 'Both', $this->hook ); ?></option>
     106                            </select><label for="locationlist"> <?php _e( 'Show above content, below content, or both on blog, category, search, or other pages where content is listed', $this->hook ); ?></label><br />
    97107                            <em><?php _e( 'Note: The widget will only show on single posts and pages regardless of what you choose above.', $this->hook ); ?></em>
    98108                        </td>
     
    139149            $input['fbog'] = isset( $input['fbog'] ) ? $input['fbog'] : '0';
    140150            $input['tcmd'] = isset( $input['tcmd'] ) ? $input['tcmd'] : '0';
     151            $input['locationsingle'] = isset( $input['locationsingle'] ) ? $input['locationsingle'] : '0';
     152            $input['locationlist'] = isset( $input['locationlist'] ) ? $input['locationlist'] : '0';
    141153
    142154            $input['header'] = sanitize_text_field( $input['header'] );
  • share-center-pro/trunk/share-center-pro.php

    r633773 r642671  
    2121    class bit51_scp extends Bit51 {
    2222   
    23         public $pluginversion   = '0010'; //current plugin version
     23        public $pluginversion   = '0012'; //current plugin version
    2424   
    2525        //important plugin information
     
    5555                    'fbappid'               => '',
    5656                    'fpog'                  => '0',
    57                     'tcmd'                  => '0'
     57                    'tcmd'                  => '0',
     58                    'locationsingle'        => '0',
     59                    'locationlist'          => '0'
    5860                )
    5961            )
     
    238240            //if the buttons should be on the current content then add them to the end of it
    239241            if ( ( is_archive() && $scpoptions['archive'] == 1 ) || ( is_page() && ! is_front_page() && ! is_home() && $scpoptions['page'] == 1 ) || ( ( is_front_page() || is_home() ) && $scpoptions['home'] == 1 ) || ( is_search() &&  $scpoptions['search'] == 1 ) || ( is_single() && $scpoptions['single'] == 1 ) ) {
     242
     243                //decide which location we should pick based on page type
     244                if ( is_page() || is_single() ) {
     245                    $location = $scpoptions['locationsingle'];
     246                } else {
     247                    $location = $scpoptions['locationlist'];
     248                }
     249               
     250                //add buttons before/after/both depending on user's choice
     251                switch ( $location ) {
     252                    case '0':
     253                        return $content . $this->scp_social_buttons();
     254                        break;
     255                    case '1':
     256                        return $this->scp_social_buttons() . $content;
     257                        break;
     258                    case '2':
     259                        return $this->scp_social_buttons() . $content . $this->scp_social_buttons();
     260                        break;
     261                    default:
     262                        return $content;
     263                        break;
     264                }
     265
    240266                return $content . $this->scp_social_buttons();
    241267            } else {
Note: See TracChangeset for help on using the changeset viewer.