Plugin Directory

Changeset 1536878


Ignore:
Timestamp:
11/19/2016 07:12:55 PM (9 years ago)
Author:
mraliende
Message:

1.6 Bugfix: Article title link to external URL, New feature: Admin settings: hide preview image

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

Legend:

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

    r1533330 r1536878  
    11<?php
    22class Gurlpb_config {
    3     public static $_VERSION = '1.5'; // CHANGE ALSO IN gute-url-preview-box.php, README AND IN SVN!
     3    public static $_VERSION = '1.6'; // CHANGE ALSO IN gute-url-preview-box.php, README AND IN SVN!
    44    public static $_DEBUG = false;
    55    public static $_LOCAL = false;
  • good-url-preview-box/trunk/gurlpb-settings-admin.php

    r1533330 r1536878  
    6363                update_option('gurlpb-showexcerpt', '0' );
    6464            }
     65            if ( isset( $_POST['gurlpb-zoom'] ) ) {
     66                $n_zoom = 0 + $_POST['gurlpb-zoom'];
     67                if ( $n_zoom > 0.4 && $n_zoom < 2 ) {
     68                    update_option('gurlpb-zoom', sanitize_text_field( $n_zoom ) );
     69                }
     70            }
     71            if ( isset( $_POST['gurlpb-hideimages'] ) ) {
     72                update_option('gurlpb-hideimages', '1' );
     73            } else {
     74                delete_option('gurlpb-hideimages');
     75            }
    6576        }
    6677
     
    8394            $typegif = 2;
    8495        }
    85 
     96        $strZoom = get_option( 'gurlpb-zoom' );
    8697        ?>
    8798        <div class="wrap">
     
    277288                            <tr>
    278289                                <td>
     290                                        <?php _e( 'Hide images', 'gurlpb' ); ?>
     291                                </td>
     292                                <td>
     293                                    <input type="checkbox" name="gurlpb-hideimages" <?=get_option( 'gurlpb-hideimages' ) ? 'checked="checked"' : ''?> value="1" />
     294                                    <?php _e( 'Yes', 'gurlpb' ); ?>
     295
     296                                </td>
     297                            </tr>
     298                            <tr>
     299                                <td>
     300                                    <?php _e( 'Url preview box size', 'gurlpb' ); ?>
     301                                </td>
     302                                <td>
     303
     304                                    <select name="gurlpb-zoom">
     305                                        <option <?=$strZoom == '0.5' ? 'selected="selected"': ''?> value="0.5"><?php _e( 'tiny', 'gurlpb' ); ?></option>
     306                                        <option <?=$strZoom == '0.8' ? 'selected="selected"': ''?> value="0.8"><?php _e( 'small', 'gurlpb' ); ?></option>
     307                                        <option <?= ( ! $strZoom || $strZoom == '1' ) ? 'selected="selected"': ''?> value="1"><?php _e( 'standard', 'gurlpb' ); ?></option>
     308                                        <option <?=$strZoom == '1.2' ? 'selected="selected"': ''?> value="1.2"><?php _e( 'tall', 'gurlpb' ); ?></option>
     309                                    </select>
     310                                    <?php _e( 'Yes', 'gurlpb' ); ?>
     311
     312                                </td>
     313                            </tr>
     314                            <tr>
     315                                <td>
    279316                                    &nbsp;
    280317                                </td>
  • good-url-preview-box/trunk/gurlpb-start.php

    r1533330 r1536878  
    189189            GUTE-URLS
    190190        </span>
    191         <h1 style="color: #464646; font-family: Oxygen, Arial, Helvetica, sans-serif; font-weight: normal; font-style: normal; font-size: 20px; line-height: 25px; text-decoration: none; vertical-align: baseline; margin:2px;">
    192             Loading API-data about ' . $strDom . '
     191        <h1 style="color: #464646; font-family: Oxygen, Arial, Helvetica, sans-serif; font-weight: normal; font-style: normal; font-size: 17px; line-height: 20px; text-decoration: none; vertical-align: baseline; margin:2px;">
     192            <a href="https://wordpress.org/plugins/good-url-preview-box/" style="text-decoration: none; border-bottom: none;">Wordpress</a> is loading infos about ' . $strDom . '
    193193        </h1>
    194194        <span style="display: block; font-family: Oxygen, Arial, Helvetica, sans-serif; font-weight: normal; font-style: normal; font-size: 13px; line-height: 20px; text-decoration: none; vertical-align: baseline;">
    195             ' . __('Please-wait...', 'gurlpb' ) . '<br />
    196             from API server <a href="https://guteurls.de/" target="guteurls" style="text-decoration: none; ">guteurls.de</a>
    197             about this webpage <a href="' . $strUrl .'" style="text-decoration: none;">' . $arrUrl['host'] . $strPath  . '</a>
     195            ' . __('Please-wait...', 'gurlpb' ) . ' for API server <a href="https://guteurls.de/" target="guteurls" style="text-decoration: none; border-bottom: none;">guteurls.de</a>
     196            to collect data about<br />
     197            <a href="' . $strUrl .'">' . $arrUrl['host'] . $strPath  . '</a>
    198198        </span>
    199199    </span><br clear="all" />';
     
    240240        Gurlpb_utils::log( __FUNCTION__ . '[' . __LINE__ . "]:"  . $strArticleLink );
    241241        $callbackA
    242             = "(function( jqueryElement, url, jQuery ) {"
     242            = "function( jqueryElement, url, jQuery ) {"
    243243            .   "jqueryElement.closest('.post[guteurls!=done]').each(function(element) {"
    244             .       "jQuery(this).attr('guteurls', 'done').find('$strFind').attr('href', strUrl)"
     244            .       "jQuery(this).attr('guteurls', 'done').find('$strFind').attr('href', url)"
    245245            .   "})"
    246             . "})";
     246            . "}";
     247        //echo '<script type="text/javascript"> document.guc=' . $callbackA . '</script>';
    247248    }
    248249
     
    250251        . ' src="'
    251252        . ( Gurlpb_config::$_LOCAL ? Gurlpb_config::$_GUTEURL_JS_LOCAL : Gurlpb_config::$_GUTEURL_JS ) . '"'
    252         . ( $email ? ' email="' . $email . '"' : '')
    253253        // . ( $name ? ' name="' . $name . '"' : '')
    254254        . ( $strBgcolor ? ' bgcolor="' . $strBgcolor . '"': '')
     
    257257        . ( Gurlpb_config::$_DEBUG ? ' debug="1"' : '')
    258258        . ( Gurlpb_config::$_LOCAL ? ' local="1"' : '')
    259         . ( $callbackA ? ' callback-a="' . $callbackA . '"' : '')
     259        . ( 0 && $callbackA ? ' callback-a="(function( jqueryElement, url, jQuery ) { document.guc(jqueryElement, url, jQuery ) })"' : '')
     260        . ( $callbackA ? ' callback-a="(' . $callbackA . ')"' : '')
    260261        . ' selector="' . $selector .'"'
     262        . ( get_option('gurlpb-hideimages') ? ' hideimages="1"': '' )
     263        . ( get_option('gurlpb-zoom') ? ' zoom="' . get_option( 'gurlpb-zoom' ) . '"' : '' )
     264        . ( $email ? ' email="' . base64_encode( $email ) . '"' : '' )
     265        . ' pluginversion="' . Gurlpb_config::$_VERSION . '"'
     266
    261267        . ' wp="' . $nWP. '"></script>';
    262268
     
    291297    $strUrl = str_replace( array( '"', "'", '»','″' ), '', $arrAttr['url'] );
    292298
    293     if ( filter_var( $strUrl, FILTER_VALIDATE_URL) === false ) {
     299    if ( Gurlpb_utils::is_url( $strUrl, FILTER_VALIDATE_URL) === false ) {
    294300        Gurlpb_utils::log( __FUNCTION__ . '[' . __LINE__ . '] NO URL ' . $strUrl );
    295301        return '';
  • good-url-preview-box/trunk/gurlpb-utils.php

    r1514968 r1536878  
    4040    }
    4141
    42 
     42    static function is_url( $strUrl ) {
     43        if ( ! $strUrl ) return false;
     44        if ( preg_match('/[ \"\'\<\>\n\r\t]/' , $strUrl ) ) return false;
     45        if ( preg_match('/^https?:\/\/.*[a-z0-9]\.[a-z0-9]/i',  $strUrl ) ) return true;
     46        return false;
     47    }
    4348
    4449}
  • good-url-preview-box/trunk/gute-url-preview-box.php

    r1533330 r1536878  
    66Author: Martin Schaedler
    77Author URI: https://hypnose54321.de/frankfurt/_contact.html
    8 Version: 1.5
     8Version: 1.6
    99Text Domain: gurlpb
    1010*/
  • good-url-preview-box/trunk/languages/gurlpb-cn.pot

    r1533330 r1536878  
    135135
    136136msgid "Yes"
    137 msgstr "Yes"
     137msgstr "是"
     138
     139msgid "Hide images"
     140msgstr "隐藏图像"
     141
     142msgid "Url preview box size"
     143msgstr "网址预览框大小"
     144
     145msgid "tiny"
     146msgstr "更小"
     147
     148msgid "small"
     149msgstr "小"
     150
     151msgid "standard"
     152msgstr "标准"
     153
     154msgid "tall"
     155msgstr "高"
  • good-url-preview-box/trunk/languages/gurlpb-de.pot

    r1533330 r1536878  
    136136
    137137msgid "Yes"
    138 msgstr "Yes"
     138msgstr "Ja"
     139
     140msgid "Hide images"
     141msgstr "Bilder verbergen"
     142
     143msgid "Url preview box size"
     144msgstr "Größe der URL Vorschau"
     145
     146msgid "tiny"
     147msgstr "mini"
     148
     149msgid "small"
     150msgstr "klein"
     151
     152msgid "standard"
     153msgstr "standard"
     154
     155msgid "tall"
     156msgstr "groß"
  • good-url-preview-box/trunk/languages/gurlpb-en.pot

    r1533330 r1536878  
    136136msgid "Yes"
    137137msgstr "Yes"
     138
     139msgid "Hide images"
     140msgstr "Hide images"
     141
     142msgid "Url preview box size"
     143msgstr "Url preview box size"
     144
     145msgid "tiny"
     146msgstr "tiny"
     147
     148msgid "small"
     149msgstr "small"
     150
     151msgid "standard"
     152msgstr "standard"
     153
     154msgid "tall"
     155msgstr "tall"
  • good-url-preview-box/trunk/languages/gurlpb-es.pot

    r1533330 r1536878  
    135135
    136136msgid "Yes"
    137 msgstr "Yes"
     137msgstr "Sí"
     138
     139msgid "Hide images"
     140msgstr "Ocultar imágenes"
     141
     142msgid "Url preview box size"
     143msgstr "Tamaño del cuadro de vista preliminar de URL"
     144
     145msgid "tiny"
     146msgstr "menor"
     147
     148msgid "small"
     149msgstr "pequeña"
     150
     151msgid "standard"
     152msgstr "estándar"
     153
     154msgid "tall"
     155msgstr "alto"
    138156
    139157
  • good-url-preview-box/trunk/languages/gurlpb-ru.pot

    r1533330 r1536878  
    136136
    137137msgid "Yes"
    138 msgstr "Yes"
     138msgstr "да"
     139
     140msgid "Hide images"
     141msgstr "Скрыть изображения"
     142
     143msgid "Url preview box size"
     144msgstr "Размер окне предварительного просмотра Url"
     145
     146msgid "tiny"
     147msgstr "tiny"
     148
     149msgid "small"
     150msgstr "small"
     151
     152msgid "standard"
     153msgstr "standard"
     154
     155msgid "tall"
     156msgstr "tall"
    139157
    140158
  • good-url-preview-box/trunk/readme.txt

    r1533330 r1536878  
    113113== Upgrade Notice ==
    114114
     115= 1.6 =
     116* Bugfix: Article title link to external URL
     117* New feature: Admin settings: hide preview image
     118
    115119= 1.5 =
    116120* Excerpt: visible box in excerpt
     
    135139== Changelog ==
    136140
     141= 1.6 =
     142* Bugfix: Article title link to external URL
     143* New feature: Admin settings: hide preview image
     144
    137145= 1.5 =
    138146* Excerpt: visible box in excerpt
Note: See TracChangeset for help on using the changeset viewer.