Changeset 618438
- Timestamp:
- 10/29/2012 12:06:25 AM (13 years ago)
- Location:
- wp-pocket
- Files:
-
- 4 edited
- 1 copied
-
tags/1.1 (copied) (copied from wp-pocket/trunk)
-
tags/1.1/readme.txt (modified) (2 diffs)
-
tags/1.1/wp-pocket.php (modified) (11 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-pocket.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-pocket/tags/1.1/readme.txt
r608978 r618438 5 5 Requires at least: 3.4 6 6 Tested up to: 3.4 7 Stable tag: 1. 0.37 Stable tag: 1.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 52 52 == Changelog == 53 53 54 = 1.1 = 55 Remedy the wrong output of the links during the generation of a post 56 Umlauts in Metatags are displayed correctly, independent of the encoding 57 Associated links work again 58 Add link to options in installed plugins overview 59 54 60 = 1.0.3 = 55 61 Fix API-Key bug on install -
wp-pocket/tags/1.1/wp-pocket.php
r608978 r618438 6 6 Author: Jan Karres 7 7 Author URI: http://www.jankarres.de/ 8 Version: 1. 0.38 Version: 1.1 9 9 */ 10 10 … … 24 24 25 25 // Set plugin version 26 $this->version = '1. 0.3';26 $this->version = '1.1'; 27 27 28 28 // Check WP version … … 145 145 } 146 146 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 147 158 // Gennerator for random keys for encrytion 148 159 private function keygen($length) { … … 202 213 // Return 203 214 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); 204 230 } 205 231 … … 339 365 // Start the view of the options page 340 366 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); 341 370 } 342 371 … … 810 839 $getLinks = $tmp; 811 840 } 812 echo '<pre>'; 813 print_r($getLinks); 814 echo '</pre>'; 841 815 842 if (count((array)$getLinks->list) == 0) { // No elements 816 843 ?> … … 844 871 if ($value->title == '') { 845 872 $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 } 847 878 } 848 879 … … 853 884 854 885 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 } 856 890 } 857 891 858 892 if (get_option('wppocket_meta_keyword_as_tags') == 1) { 859 893 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 } 861 898 } 862 899 } … … 1001 1038 ## SET ASSOCIATE LINKS ## 1002 1039 ######################### 1003 1004 1040 $i = 0; 1005 1041 while ($i < (count($_POST['element']) / 7)) { … … 1011 1047 while(true) { 1012 1048 // 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']) { 1014 1050 $_POST['element'][($i * 7) + 3][] = $_POST['element'][(($i * 7) + 3 + ($i2 * 7))]['url']; 1015 1051 $_POST['element'][($i * 7) + 4][] = $_POST['element'][(($i * 7) + 4 + ($i2 * 7))]['url_uncleaned']; … … 1059 1095 1060 1096 // Check if this it not a associate link 1061 if (!$_POST['element'][($i * 7) + 5]['associate']) {1097 if (!$_POST['element'][($i * 7) + 6]['associate']) { 1062 1098 // Gennerate url array in url string 1063 1099 $url = ''; -
wp-pocket/trunk/readme.txt
r608978 r618438 5 5 Requires at least: 3.4 6 6 Tested up to: 3.4 7 Stable tag: 1. 0.37 Stable tag: 1.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 52 52 == Changelog == 53 53 54 = 1.1 = 55 Remedy the wrong output of the links during the generation of a post 56 Umlauts in Metatags are displayed correctly, independent of the encoding 57 Associated links work again 58 Add link to options in installed plugins overview 59 54 60 = 1.0.3 = 55 61 Fix API-Key bug on install -
wp-pocket/trunk/wp-pocket.php
r608978 r618438 6 6 Author: Jan Karres 7 7 Author URI: http://www.jankarres.de/ 8 Version: 1. 0.38 Version: 1.1 9 9 */ 10 10 … … 24 24 25 25 // Set plugin version 26 $this->version = '1. 0.3';26 $this->version = '1.1'; 27 27 28 28 // Check WP version … … 145 145 } 146 146 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 147 158 // Gennerator for random keys for encrytion 148 159 private function keygen($length) { … … 202 213 // Return 203 214 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); 204 230 } 205 231 … … 339 365 // Start the view of the options page 340 366 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); 341 370 } 342 371 … … 810 839 $getLinks = $tmp; 811 840 } 812 echo '<pre>'; 813 print_r($getLinks); 814 echo '</pre>'; 841 815 842 if (count((array)$getLinks->list) == 0) { // No elements 816 843 ?> … … 844 871 if ($value->title == '') { 845 872 $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 } 847 878 } 848 879 … … 853 884 854 885 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 } 856 890 } 857 891 858 892 if (get_option('wppocket_meta_keyword_as_tags') == 1) { 859 893 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 } 861 898 } 862 899 } … … 1001 1038 ## SET ASSOCIATE LINKS ## 1002 1039 ######################### 1003 1004 1040 $i = 0; 1005 1041 while ($i < (count($_POST['element']) / 7)) { … … 1011 1047 while(true) { 1012 1048 // 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']) { 1014 1050 $_POST['element'][($i * 7) + 3][] = $_POST['element'][(($i * 7) + 3 + ($i2 * 7))]['url']; 1015 1051 $_POST['element'][($i * 7) + 4][] = $_POST['element'][(($i * 7) + 4 + ($i2 * 7))]['url_uncleaned']; … … 1059 1095 1060 1096 // Check if this it not a associate link 1061 if (!$_POST['element'][($i * 7) + 5]['associate']) {1097 if (!$_POST['element'][($i * 7) + 6]['associate']) { 1062 1098 // Gennerate url array in url string 1063 1099 $url = '';
Note: See TracChangeset
for help on using the changeset viewer.