Plugin Directory

Changeset 1545335


Ignore:
Timestamp:
12/04/2016 01:22:06 PM (9 years ago)
Author:
mraliende
Message:

Easier admin area. Removed automatic URL detection as a setting.

Location:
good-url-preview-box/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • good-url-preview-box/trunk/gurlpb-activated.php

    r1533330 r1545335  
    1212}
    1313
    14 if ( ! get_option( 'gurlpb-id-admin-id' ) ) {
     14if ( ! get_option( 'gurlpb-admin-id' ) ) {
    1515    update_option( 'gurlpb-admin-id', get_current_user_id() );
    1616    update_option( 'gurlpb-setting-a', 'manual' );
     17    update_option( 'gurlpb-hide-setting-a', 'true' );
    1718    update_option( 'gurlpb-showexcerpt', '1' );
     19
    1820} elseif ( get_option( 'gurlpb-showexcerpt' ) !== '1' && get_option( 'gurlpb-showexcerpt' ) !== '0' ) {
    1921    update_option( 'gurlpb-showexcerpt', '1' );
  • good-url-preview-box/trunk/gurlpb-settings-admin.php

    r1536878 r1545335  
    129129
    130130
    131                 <div class="postbox-container"  style="margin: 5px; padding: 3px; font-size: 30px; font-weight: bold;">
    132                     <?php _e( 'How-many-URL-Previews?', 'gurlpb' ); ?>
    133                 </div>
    134                 <br class="clear"/>
    135                 <div class="postbox-container" style="margin: 5px; padding: 3px; border: 1px solid #999">
    136                     <input id="inputSingle" type="radio" name="gurlpb-setting-a"
    137                            <?php if ( get_option('gurlpb-setting-a') == 'single' ) echo 'checked="checked"'; ?>
    138                            onclick="this.form.submit();"
    139                            value="single" />
    140                     <?php _e( 'Add-maximal-one', 'gurlpb' ); ?><br />
    141                     <?php _e( 'and-add-it.', 'gurlpb' ); ?><br /><br />
    142                     <a href="javascript:document.getElementById( 'inputSingle' ).checked = 'checked'; document.getElementById( 'formGurlpbOneMany' ).submit()">
    143                         <img src="<?php echo plugins_url( 'gurlpb-single.jpg', __FILE__ );?>"/></a><br />
    144                 </div>
    145                 <div class="postbox-container" style="margin: 5px; padding: 3px; border: 1px solid #999">
    146                     <input id="inputMutiple" type="radio" name="gurlpb-setting-a"
    147                             <?php if ( get_option('gurlpb-setting-a') == 'multiple' ) echo 'checked="checked"'; ?>
    148                            onclick="this.form.submit();"
    149                            value="multiple" />
    150                     <?php _e( 'Add-one-URL,', 'gurlpb' ); ?><br />
    151                     <?php _e( 'one-per-P-Tag.', 'gurlpb' ); ?><br /><br />
    152                     <a href="javascript:document.getElementById( 'inputMutiple' ).checked = 'checked'; document.getElementById( 'formGurlpbOneMany' ).submit()">
    153                         <img src="<?php echo plugins_url( 'gurlpb-multiple.jpg', __FILE__ );?>" /></a><br />
    154                 </div>
    155                 <div class="postbox-container" style="margin: 5px; padding: 3px; border: 1px solid #999">
    156                     <input id="inputMutiple" type="radio" name="gurlpb-setting-a"
    157                         <?php if ( get_option('gurlpb-setting-a') == 'manual' ) echo 'checked="checked"'; ?>
    158                            onclick="this.form.submit();"
    159                            value="manual" />
    160                     <?php _e( 'setting-manual-URL', 'gurlpb' ); ?><br />
    161                     <?php _e( 'setting-manual-URL2', 'gurlpb' ); ?><br />
    162 
    163                     <img src="<?php echo plugins_url( 'gurlpb_editor-help.jpg', __FILE__ );?>" style="display:block; margin-right:auto;margin-left:auto;"/>
    164                     <div style="margin-left:auto;margin-right:auto;text-align: center">
    165                         <?php _e( 'setting-manual-URL3', 'gurlpb' ); ?><br />
     131                <?php if ( get_option( 'gurlpb-hide-setting-a' ) ) { ?>
     132                    <div  style="text-align: left; border: 1px solid #999; padding: 10px">
     133                        <div class="postbox-container"  style="font-size: 30px; font-weight: bold;">
     134                            <?php _e( 'How to', 'gurlpb' ); ?>
    166135                        </div>
    167 
    168                     <br /><br />
    169                 </div>
     136                        <br class="clear"/><br />
     137                        <?php _e( 'setting-manual-URL', 'gurlpb' ); ?><br />
     138                        <?php _e( 'setting-manual-URL2', 'gurlpb' ); ?><br />
     139                        <br >
     140                        ----<br /><br />
     141                        <img src="<?php echo plugins_url( 'gurlpb_editor-help.jpg', __FILE__ );?>" xstyle="display:block; margin-right:auto;margin-left:auto;"/>
     142                        <div xstyle="margin-left:auto;margin-right:auto;text-align: center">
     143                            <?php _e( 'setting-manual-URL3', 'gurlpb' ); ?><br />
     144                        </div>
     145                        <br class="clear"/>
     146                        <iframe width="560" height="315" src="https://www.youtube.com/embed/CpecfL_FIzM" frameborder="0" allowfullscreen ></iframe>
     147                        <br class="clear"/>
     148                    </div>
     149                <?php } else { ?>
     150
     151                    <div class="postbox-container"  style="margin: 5px; padding: 3px; font-size: 30px; font-weight: bold;">
     152                        <?php _e( 'How-many-URL-Previews?', 'gurlpb' ); ?>
     153                    </div>
     154                    <br class="clear"/>
     155                    <div class="postbox-container" style="margin: 5px; padding: 3px; border: 1px solid #999">
     156                        <input id="inputSingle" type="radio" name="gurlpb-setting-a"
     157                               <?php if ( get_option('gurlpb-setting-a') == 'single' ) echo 'checked="checked"'; ?>
     158                               onclick="this.form.submit();"
     159                               value="single" />
     160                        <?php _e( 'Add-maximal-one', 'gurlpb' ); ?><br />
     161                        <?php _e( 'and-add-it.', 'gurlpb' ); ?><br /><br />
     162                        <a href="javascript:document.getElementById( 'inputSingle' ).checked = 'checked'; document.getElementById( 'formGurlpbOneMany' ).submit()">
     163                            <img src="<?php echo plugins_url( 'gurlpb-single.jpg', __FILE__ );?>"/></a><br />
     164                    </div>
     165                    <div class="postbox-container" style="margin: 5px; padding: 3px; border: 1px solid #999">
     166                        <input id="inputMutiple" type="radio" name="gurlpb-setting-a"
     167                                <?php if ( get_option('gurlpb-setting-a') == 'multiple' ) echo 'checked="checked"'; ?>
     168                               onclick="this.form.submit();"
     169                               value="multiple" />
     170                        <?php _e( 'Add-one-URL,', 'gurlpb' ); ?><br />
     171                        <?php _e( 'one-per-P-Tag.', 'gurlpb' ); ?><br /><br />
     172                        <a href="javascript:document.getElementById( 'inputMutiple' ).checked = 'checked'; document.getElementById( 'formGurlpbOneMany' ).submit()">
     173                            <img src="<?php echo plugins_url( 'gurlpb-multiple.jpg', __FILE__ );?>" /></a><br />
     174                    </div>
     175                    <div class="postbox-container" style="margin: 5px; padding: 3px; border: 1px solid #999">
     176                        <input id="inputMutiple" type="radio" name="gurlpb-setting-a"
     177                            <?php if ( get_option('gurlpb-setting-a') == 'manual' ) echo 'checked="checked"'; ?>
     178                               onclick="this.form.submit();"
     179                               value="manual" />
     180                        <?php _e( 'setting-manual-URL', 'gurlpb' ); ?><br />
     181                        <?php _e( 'setting-manual-URL2', 'gurlpb' ); ?><br />
     182
     183                        <img src="<?php echo plugins_url( 'gurlpb_editor-help.jpg', __FILE__ );?>" style="display:block; margin-right:auto;margin-left:auto;"/>
     184                        <div style="margin-left:auto;margin-right:auto;text-align: center">
     185                            <?php _e( 'setting-manual-URL3', 'gurlpb' ); ?><br />
     186                        </div>
     187
     188                        <br /><br />
     189                    </div>
     190                <?php } ?>
     191
     192
    170193                <br class="clear"/>
    171194                <hr />
  • good-url-preview-box/trunk/gurlpb-start.php

    r1544317 r1545335  
    147147    }
    148148
     149    if ( isset( $_REQUEST['gurlpb-setting-selector'] ) ) {
     150        $str = $_REQUEST['gurlpb-setting-selector'];
     151
     152        if ($str == 'delete') {
     153            delete_option('gurlpb-setting-selector');
     154            Gurlpb_utils::log( __FUNCTION__ . '[' . __LINE__ . "] delete gurlpb-setting-selector");
     155            $strResp .=  ( $strResp ? ',' : '' ) . "delete-selector";
     156        } elseif ( preg_match( '/^[a-z0-9\.\,\:\;\=\-\ \*+_#\_\[\]]*$/i', $str ) ) {
     157            update_option('gurlpb-setting-selector', sanitize_text_field( $str ) );
     158            $strResp .=  ( $strResp ? ',' : '' ) . "update-selector";
     159            Gurlpb_utils::log( __FUNCTION__ . '[' . __LINE__ . "] gurlpb-setting-selector set to $str");
     160        } else {
     161            $strResp .=  ( $strResp ? ',' : '' ) . "invalid-selector";
     162            Gurlpb_utils::log( __FUNCTION__ . '[' . __LINE__ . "] INVALID PARAMETER gurlpb-setting-selector");
     163        }
     164    }
     165
    149166    if ( isset( $_REQUEST['gurlpb-setting-postids'] ) ) {
    150167        $str = $_REQUEST['gurlpb-setting-postids'];
     
    176193        . get_option( 'gurlpb-setting-postids' ) . ' ## '
    177194        . 'THISPOSTID ## '
     195        . get_option( 'gurlpb-setting-selector' ) . ' ## '
    178196        . ' ##GURLPB';
    179197}
     
    257275    $email = $author ? $author->user_email: '';
    258276    //$name = $author ? $author->display_name: '';
     277    $nZoom = get_option('gurlpb-zoom');
     278    if ( ! $nZoom ) $nZoom = 1;
     279
    259280    if ( get_option( 'gurlpb-regcd' ) ) {
    260281        $email = get_option( 'gurlpb-regcd' );
     
    266287
    267288    $strSettingA = get_option('gurlpb-setting-a');
     289    if ( get_option( 'gurlpb-setting-a-extern' ) ) {
     290        $strSettingA = get_option( 'gurlpb-setting-a-extern' );
     291    }
     292
    268293    if ( $strSettingA == 'manual' ) {
    269294        $selector = 'span[guteurls]';
     
    277302    }
    278303
    279     if ( get_option( 'gurlpb-setting-a-extern' ) ) {
    280         $selector = get_option( 'gurlpb-setting-a-extern' );
     304    if ( get_option( 'gurlpb-setting-selector' ) ) {
     305        $selector = get_option( 'gurlpb-setting-selector' );
    281306    }
    282307
     
    311336        . ' selector="' . $selector .'"'
    312337        . ( get_option('gurlpb-hideimages') ? ' hideimages="1"': '' )
    313         . ( get_option('gurlpb-zoom') ? ' zoom="' . get_option( 'gurlpb-zoom' ) . '"' : '' )
     338        . ( $nZoom != 1 ? ' zoom="' . get_option( 'gurlpb-zoom' ) . '"' : '' )
    314339        . ( $email ? ' email="' . base64_encode( $email ) . '"' : '' )
    315340        . ' pluginversion="' . Gurlpb_config::$_VERSION . '"'
Note: See TracChangeset for help on using the changeset viewer.