Changeset 1608738
- Timestamp:
- 03/06/2017 02:19:33 PM (9 years ago)
- Location:
- plista/trunk
- Files:
-
- 2 edited
-
plista_integration.php (modified) (5 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plista/trunk/plista_integration.php
r1600786 r1608738 4 4 Plugin URI: http://www.plista.com 5 5 Description: Plugin for displaying plista RecommendationAds 6 Version: 1.5. 76 Version: 1.5.8 7 7 Author: wordpress@plista.com 8 8 Author URI: http://www.plista.com … … 11 11 class plista { 12 12 13 const VERSION = '1.5. 7';13 const VERSION = '1.5.8'; 14 14 15 15 /** … … 89 89 public static function plista_admin_actions() { 90 90 if( current_user_can('level_10')) { 91 wp_enqueue_script( 'plista-admin', plugins_url('/js/plista-admin.js', __FILE__), array(), '1.5. 7' );92 wp_enqueue_style( 'plista-admin', plugins_url('/css/plista-admin.css', __FILE__), array(), '1.5. 7' );91 wp_enqueue_script( 'plista-admin', plugins_url('/js/plista-admin.js', __FILE__), array(), '1.5.8' ); 92 wp_enqueue_style( 'plista-admin', plugins_url('/css/plista-admin.css', __FILE__), array(), '1.5.8' ); 93 93 add_options_page('plista', 'plista', 1, 'plista', array(__CLASS__, 'plista_admin')); 94 94 } … … 112 112 return $youtube_img; 113 113 } 114 115 /**116 * extract first img from current post117 *118 * @return string119 */120 public static function get_first_plista_image() {121 global $post, $posts;122 $first_img = '';123 ob_start();124 ob_end_clean();125 $pattern = "/src=[\"']?([^\"']?.*(png|jpg|gif|jpeg))[\"']?/i";126 $output = preg_match_all($pattern, $post->post_content, $matches);127 $first_img = '';128 if (!empty($matches[1][0])) {129 $first_img = $matches[1][0];130 }131 // always remove title and alt attributes containing something like title="bild.jpg"132 $first_img = preg_replace(array('/[\"]+/', '/ (alt|title)=?.*(png|jpg|gif|jpeg)/'), array('', ''), $first_img);133 134 // add an extra check for img size cause sometimes they use ad pixels in the article135 // ad pixels are normaly only 1px x 1px but too be sure set it to 20px x 20px136 if ($first_img) {137 list($width, $height, $type, $attr) = @getimagesize($first_img);138 139 if (!is_null($height) && $height >= '20' && $height >= '20') {140 return $first_img;141 } else {142 return $first_img;143 }144 }145 return '';146 }147 148 149 114 150 115 /** … … 463 428 $imgsrc = $thumbnail[0]; 464 429 } 465 if (!$imgsrc || is_null($imgsrc)) { 466 $imgsrc = self::get_first_plista_image(); 467 if (!$imgsrc && !empty($isyoutube)) { 468 $imgsrc = self::get_youtube_img(); 469 } 430 if (!$imgsrc && !empty($isyoutube)) { 431 $imgsrc = self::get_youtube_img(); 470 432 } 471 433 } -
plista/trunk/readme.txt
r1600786 r1608738 6 6 Requires at least: 3.0.0 7 7 Tested up to: 4.7.1 8 Stable tag: 1.5. 78 Stable tag: 1.5.8 9 9 10 10 The plista Widget adds plista RecommendationAds to your Wordpress blog posts. … … 65 65 == Upgrade Notice == 66 66 67 Please upgrade to Version 1.5. 767 Please upgrade to Version 1.5.8 68 68 69 69 == Screenshots == … … 153 153 154 154 1.5.7 @ 21-02-2017 155 * Add input for plista origin in the plugin settings 155 * Add input for plista origin in the plugin settings 156 157 1.5.8 @ 06-03-2017 158 * Add input for plista origin in the plugin settings
Note: See TracChangeset
for help on using the changeset viewer.