Plugin Directory

Changeset 618438


Ignore:
Timestamp:
10/29/2012 12:06:25 AM (13 years ago)
Author:
jankarres
Message:

tagging version 1.1

Location:
wp-pocket
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wp-pocket/tags/1.1/readme.txt

    r608978 r618438  
    55Requires at least: 3.4
    66Tested up to: 3.4
    7 Stable tag: 1.0.3
     7Stable tag: 1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5252== Changelog ==
    5353
     54= 1.1 =
     55Remedy the wrong output of the links during the generation of a post
     56Umlauts in Metatags are displayed correctly, independent of the encoding
     57Associated links work again
     58Add link to options in installed plugins overview
     59
    5460= 1.0.3 =
    5561Fix API-Key bug on install
  • wp-pocket/tags/1.1/wp-pocket.php

    r608978 r618438  
    66    Author: Jan Karres
    77    Author URI: http://www.jankarres.de/
    8     Version: 1.0.3
     8    Version: 1.1
    99*/
    1010
     
    2424           
    2525            // Set plugin version
    26             $this->version = '1.0.3';
     26            $this->version = '1.1';
    2727       
    2828            // Check WP version
     
    145145        }
    146146       
     147        // Function to create a plugin_action_links
     148        function plugin_action_links($links, $file) {
     149            // create link
     150            array_unshift(
     151                $links,
     152                sprintf('<a href="options-general.php?page=%s">%s</a>', 'settings_pocket_poster', __('Settings'))
     153            );
     154           
     155            return $links;
     156        }
     157       
    147158        // Gennerator for random keys for encrytion
    148159        private function keygen($length) {
     
    202213            // Return
    203214            return $output;
     215        }
     216       
     217        // Function to check if string in UTF-8 after W3C
     218        function is_utf8($string) {
     219            // From http://w3.org/International/questions/qa-forms-utf-8.html
     220            return preg_match('%^(?:
     221            [\x09\x0A\x0D\x20-\x7E]            # ASCII
     222            | [\xC2-\xDF][\x80-\xBF]             # non-overlong 2-byte
     223            |  \xE0[\xA0-\xBF][\x80-\xBF]        # excluding overlongs
     224            | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}  # straight 3-byte
     225            |  \xED[\x80-\x9F][\x80-\xBF]        # excluding surrogates
     226            |  \xF0[\x90-\xBF][\x80-\xBF]{2}     # planes 1-3
     227            | [\xF1-\xF3][\x80-\xBF]{3}          # planes 4-15
     228            |  \xF4[\x80-\x8F][\x80-\xBF]{2}     # plane 16
     229            )*$%xs', $string);
    204230        }
    205231       
     
    339365            // Start the view of the options page
    340366            add_options_page('WP Pocket Settings', 'WP Pocket', 'manage_options', 'settings_pocket_poster', array($this, 'options_page_view'));
     367           
     368            // Setzte Link
     369            add_filter('plugin_action_links', array($this, 'plugin_action_links'), 10, 2);
    341370        }
    342371       
     
    810839                            $getLinks = $tmp;
    811840                        }
    812                         echo '<pre>';
    813                         print_r($getLinks);
    814                         echo '</pre>';
     841                       
    815842                        if (count((array)$getLinks->list) == 0) { // No elements
    816843                            ?>
     
    844871                                        if ($value->title == '') {
    845872                                            $nodes = $doc->getElementsByTagName('title');
    846                                             $value->title = utf8_decode(utf8_encode($nodes->item(0)->nodeValue));
     873                                            $value->title = utf8_decode($nodes->item(0)->nodeValue);
     874                                           
     875                                            if (!$this->is_utf8($value->title)) {
     876                                                $value->title = utf8_encode($value->title);
     877                                            }
    847878                                        }
    848879                                       
     
    853884                                           
    854885                                            if($meta->getAttribute('name') == 'description') {
    855                                                 $value->description = utf8_decode(utf8_encode($meta->getAttribute('content')));
     886                                                $value->description = utf8_decode($meta->getAttribute('content'));
     887                                                if (!$this->is_utf8($value->description)) {
     888                                                    $value->description = utf8_encode($value->description);
     889                                                }
    856890                                            }
    857891                                           
    858892                                            if (get_option('wppocket_meta_keyword_as_tags') == 1) {
    859893                                                if ($meta->getAttribute('name') == 'keywords') {
    860                                                     $value->tags = utf8_decode(utf8_encode($meta->getAttribute('content')));
     894                                                    $value->tags = utf8_decode($meta->getAttribute('content'));
     895                                                    if (!$this->is_utf8($value->tags)) {
     896                                                        $value->tags = utf8_encode($value->tags);
     897                                                    }
    861898                                                }
    862899                                            }
     
    10011038                ## SET ASSOCIATE LINKS ##
    10021039                #########################
    1003                
    10041040                $i = 0;
    10051041                while ($i < (count($_POST['element']) / 7)) {
     
    10111047                        while(true) {
    10121048                            // If this is an associate links, add this to the array, else break the while-loop
    1013                             if ($_POST['element'][$i + 5 + ($i2 * 7)]['associate']) {
     1049                            if ($_POST['element'][($i * 7) + 6 + ($i2 * 7)]['associate']) {
    10141050                                $_POST['element'][($i * 7) + 3][] = $_POST['element'][(($i * 7) + 3 + ($i2 * 7))]['url'];
    10151051                                $_POST['element'][($i * 7) + 4][] = $_POST['element'][(($i * 7) + 4 + ($i2 * 7))]['url_uncleaned'];
     
    10591095                   
    10601096                    // Check if this it not a associate link
    1061                     if (!$_POST['element'][($i * 7) + 5]['associate']) {                   
     1097                    if (!$_POST['element'][($i * 7) + 6]['associate']) {                   
    10621098                        // Gennerate url array in url string
    10631099                        $url = '';
  • wp-pocket/trunk/readme.txt

    r608978 r618438  
    55Requires at least: 3.4
    66Tested up to: 3.4
    7 Stable tag: 1.0.3
     7Stable tag: 1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5252== Changelog ==
    5353
     54= 1.1 =
     55Remedy the wrong output of the links during the generation of a post
     56Umlauts in Metatags are displayed correctly, independent of the encoding
     57Associated links work again
     58Add link to options in installed plugins overview
     59
    5460= 1.0.3 =
    5561Fix API-Key bug on install
  • wp-pocket/trunk/wp-pocket.php

    r608978 r618438  
    66    Author: Jan Karres
    77    Author URI: http://www.jankarres.de/
    8     Version: 1.0.3
     8    Version: 1.1
    99*/
    1010
     
    2424           
    2525            // Set plugin version
    26             $this->version = '1.0.3';
     26            $this->version = '1.1';
    2727       
    2828            // Check WP version
     
    145145        }
    146146       
     147        // Function to create a plugin_action_links
     148        function plugin_action_links($links, $file) {
     149            // create link
     150            array_unshift(
     151                $links,
     152                sprintf('<a href="options-general.php?page=%s">%s</a>', 'settings_pocket_poster', __('Settings'))
     153            );
     154           
     155            return $links;
     156        }
     157       
    147158        // Gennerator for random keys for encrytion
    148159        private function keygen($length) {
     
    202213            // Return
    203214            return $output;
     215        }
     216       
     217        // Function to check if string in UTF-8 after W3C
     218        function is_utf8($string) {
     219            // From http://w3.org/International/questions/qa-forms-utf-8.html
     220            return preg_match('%^(?:
     221            [\x09\x0A\x0D\x20-\x7E]            # ASCII
     222            | [\xC2-\xDF][\x80-\xBF]             # non-overlong 2-byte
     223            |  \xE0[\xA0-\xBF][\x80-\xBF]        # excluding overlongs
     224            | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}  # straight 3-byte
     225            |  \xED[\x80-\x9F][\x80-\xBF]        # excluding surrogates
     226            |  \xF0[\x90-\xBF][\x80-\xBF]{2}     # planes 1-3
     227            | [\xF1-\xF3][\x80-\xBF]{3}          # planes 4-15
     228            |  \xF4[\x80-\x8F][\x80-\xBF]{2}     # plane 16
     229            )*$%xs', $string);
    204230        }
    205231       
     
    339365            // Start the view of the options page
    340366            add_options_page('WP Pocket Settings', 'WP Pocket', 'manage_options', 'settings_pocket_poster', array($this, 'options_page_view'));
     367           
     368            // Setzte Link
     369            add_filter('plugin_action_links', array($this, 'plugin_action_links'), 10, 2);
    341370        }
    342371       
     
    810839                            $getLinks = $tmp;
    811840                        }
    812                         echo '<pre>';
    813                         print_r($getLinks);
    814                         echo '</pre>';
     841                       
    815842                        if (count((array)$getLinks->list) == 0) { // No elements
    816843                            ?>
     
    844871                                        if ($value->title == '') {
    845872                                            $nodes = $doc->getElementsByTagName('title');
    846                                             $value->title = utf8_decode(utf8_encode($nodes->item(0)->nodeValue));
     873                                            $value->title = utf8_decode($nodes->item(0)->nodeValue);
     874                                           
     875                                            if (!$this->is_utf8($value->title)) {
     876                                                $value->title = utf8_encode($value->title);
     877                                            }
    847878                                        }
    848879                                       
     
    853884                                           
    854885                                            if($meta->getAttribute('name') == 'description') {
    855                                                 $value->description = utf8_decode(utf8_encode($meta->getAttribute('content')));
     886                                                $value->description = utf8_decode($meta->getAttribute('content'));
     887                                                if (!$this->is_utf8($value->description)) {
     888                                                    $value->description = utf8_encode($value->description);
     889                                                }
    856890                                            }
    857891                                           
    858892                                            if (get_option('wppocket_meta_keyword_as_tags') == 1) {
    859893                                                if ($meta->getAttribute('name') == 'keywords') {
    860                                                     $value->tags = utf8_decode(utf8_encode($meta->getAttribute('content')));
     894                                                    $value->tags = utf8_decode($meta->getAttribute('content'));
     895                                                    if (!$this->is_utf8($value->tags)) {
     896                                                        $value->tags = utf8_encode($value->tags);
     897                                                    }
    861898                                                }
    862899                                            }
     
    10011038                ## SET ASSOCIATE LINKS ##
    10021039                #########################
    1003                
    10041040                $i = 0;
    10051041                while ($i < (count($_POST['element']) / 7)) {
     
    10111047                        while(true) {
    10121048                            // If this is an associate links, add this to the array, else break the while-loop
    1013                             if ($_POST['element'][$i + 5 + ($i2 * 7)]['associate']) {
     1049                            if ($_POST['element'][($i * 7) + 6 + ($i2 * 7)]['associate']) {
    10141050                                $_POST['element'][($i * 7) + 3][] = $_POST['element'][(($i * 7) + 3 + ($i2 * 7))]['url'];
    10151051                                $_POST['element'][($i * 7) + 4][] = $_POST['element'][(($i * 7) + 4 + ($i2 * 7))]['url_uncleaned'];
     
    10591095                   
    10601096                    // Check if this it not a associate link
    1061                     if (!$_POST['element'][($i * 7) + 5]['associate']) {                   
     1097                    if (!$_POST['element'][($i * 7) + 6]['associate']) {                   
    10621098                        // Gennerate url array in url string
    10631099                        $url = '';
Note: See TracChangeset for help on using the changeset viewer.