Changeset 710833
- Timestamp:
- 05/10/2013 10:36:32 AM (13 years ago)
- Location:
- meta-ographr
- Files:
-
- 16 added
- 3 edited
-
tags/0.8.9 (added)
-
tags/0.8.9/inc (added)
-
tags/0.8.9/inc/jqplot.dateAxisRenderer.min.js (added)
-
tags/0.8.9/inc/jqplot.highlighter.min.js (added)
-
tags/0.8.9/inc/jquery.jqplot.min.css (added)
-
tags/0.8.9/inc/jquery.jqplot.min.js (added)
-
tags/0.8.9/inc/scripts.min.js (added)
-
tags/0.8.9/inc/style.min.css (added)
-
tags/0.8.9/meta-ographr_admin.php (added)
-
tags/0.8.9/meta-ographr_index.php (added)
-
tags/0.8.9/readme.txt (added)
-
tags/0.8.9/screenshot-1.png (added)
-
tags/0.8.9/screenshot-2.png (added)
-
tags/0.8.9/screenshot-3.png (added)
-
tags/0.8.9/screenshot-4.png (added)
-
tags/0.8.9/screenshot-5.png (added)
-
trunk/meta-ographr_admin.php (modified) (1 diff)
-
trunk/meta-ographr_index.php (modified) (19 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
meta-ographr/trunk/meta-ographr_admin.php
r706963 r710833 1534 1534 1535 1535 }; // end of class 1536 -
meta-ographr/trunk/meta-ographr_index.php
r706963 r710833 4 4 Plugin URI: http://ographr.whyeye.org 5 5 Description: This plugin scans posts for embedded video and music players and adds their thumbnails URL as an OpenGraph meta-tag. While at it, the plugin also adds OpenGraph tags for the title, description (excerpt) and permalink. Facebook and other social networks can use these to style shared or "liked" articles. 6 Version: 0.8. 86 Version: 0.8.9 7 7 Author: Jan T. Sott 8 8 Author URI: http://whyeye.org … … 29 29 30 30 // OGRAPHR OPTIONS 31 define("OGRAPHR_VERSION", "0.8. 8");31 define("OGRAPHR_VERSION", "0.8.9"); 32 32 // enables developer settings on Wordpress interface, can be overwritten from plug-in settings once activated 33 33 define("OGRAPHR_DEVMODE", FALSE); … … 373 373 374 374 if (($web_thumb) && (!$options['not_always'])) 375 $thumbnails[] = $web_thumb;375 $thumbnails[]['img'] = $web_thumb; 376 376 377 377 // Get date et al … … 520 520 } 521 521 } 522 523 522 } 524 523 … … 538 537 if (isset($thumbnail['img'])) { 539 538 if (filter_var($thumbnail['img'], FILTER_VALIDATE_URL)) { 540 print "\t Post meta: " . $thumbnail['img']; 539 if ($thumbnail['img'] != $web_thumb) 540 print "\t Post meta: " . $thumbnail['img']; 541 541 if( (isset($thumbnail['w'])) && (isset($thumbnail['h'])) ) 542 542 print " (" . $thumbnail['w'] . "×" . $thumbnail['h'] . ")"; … … 547 547 } 548 548 } 549 print "\n";549 //print "\n"; 550 550 } 551 551 } else if ( (isset($meta_values)) && (is_array($meta_values)) && (!isset($thumbnails)) && ($expiry >= $interval) ) { … … 569 569 } else { 570 570 if( ( ($options['debug_level'] > 0) && (current_user_can('edit_plugins')) ) && ($options['exec_mode'] == 1) && ($expiry >= $interval) ){ 571 print "\ t Empty post-meta, retrieving images\n\n";571 print "\n\t Empty post-meta, retrieving images\n\n"; 572 572 } else if( ( ($options['debug_level'] > 0) && (current_user_can('edit_plugins')) ) && ($options['exec_mode'] == 1) && ($expiry < $interval) ) { 573 print "\ t Data expired, indexing\n\n";573 print "\n\t Data expired, indexing\n\n"; 574 574 } 575 575 … … 839 839 // Add permalink 840 840 if (($options['add_permalink']) && (is_front_page()) && ($link = get_option('home'))) { 841 print "<meta property=\"og:url\" content=\"$link\" />\n";841 $opengraph_meta['og:url'] = $link; 842 842 if (isset($options['add_twitter_meta'])) 843 843 $twitter_meta['twitter:url'] = $link; … … 911 911 } 912 912 913 if ( ( isset($total_img)) && ($total_img == 0) && ($web_thumb)) {913 if ( ((!isset($total_img)) || ($total_img == 0)) && (!empty($web_thumb))) { 914 914 //print "<meta property=\"og:image\" content=\"$web_thumb\" />\n"; 915 915 $opengraph_meta['og:image'][] = $web_thumb; … … 1035 1035 // Add Link elements 1036 1036 if (isset($options['add_link_rel'])) { 1037 if (($total_img == 0) && ( $web_thumb)) {1037 if (($total_img == 0) && (isset($web_thumb))) { 1038 1038 $ext = pathinfo($web_thumb, PATHINFO_EXTENSION); 1039 1039 if (($ext == "jpg") || ($ext == "jpe")) … … 1102 1102 if(is_array($twitter_meta['og:image'])) 1103 1103 $twitter_meta['og:image'] = array_unique($twitter_meta['og:image']); // unlikely, but hey! 1104 foreach($twitter_meta as $key => $value) { 1105 if ($key == "twitter:image") { 1106 foreach($twitter_meta['twitter:image'] as $val_image) 1107 print "<meta property=\"$key\" content=\"$val_image\" />\n"; 1108 } else { 1109 print "<meta property=\"$key\" content=\"$value\" />\n"; 1104 if(is_array($twitter_meta['twitter:image'])) { 1105 foreach($twitter_meta as $key => $value) { 1106 if ($key == "twitter:image") { 1107 foreach($twitter_meta['twitter:image'] as $val_image) 1108 print "<meta property=\"$key\" content=\"$val_image\" />\n"; 1109 } else { 1110 print "<meta property=\"$key\" content=\"$value\" />\n"; 1111 } 1110 1112 } 1111 1113 } … … 1148 1150 preg_match('/\/wp-includes\/images\/smilies\/icon_.+/i', $match, $filter); 1149 1151 if ((!isset($options['filter_smilies'])) || (!$filter[0])) { 1150 //$thumbnails[] = $match;1151 1152 $no_smilies = TRUE; 1152 1153 } … … 1155 1156 preg_match('/\/wp-content\/themes\//i', $match, $filter); 1156 1157 if ((!isset($options['filter_themes'])) || (!$filter[0])) { 1157 //$thumbnails[] = $match;1158 1158 $no_themes = TRUE; 1159 1159 } … … 1163 1163 preg_match($pattern, $match, $filter); 1164 1164 if ((!isset($options['filter_gravatar'])) || (!$filter[0])) { 1165 //$thumbnails[] = $match;1166 1165 $no_gravatar = TRUE; 1167 1166 } … … 1169 1168 // filter custom URLs 1170 1169 foreach(preg_split("/((\r?\n)|(\n?\r))/", preg_quote($options['filter_custom_urls'], '/')) as $line) { 1171 //print "<!-- \$line=$line -->\n";1172 1170 preg_match("/$line/", $match, $filter); 1173 1171 foreach($filter as $key => $value) { … … 1236 1234 1237 1235 // Get attachment images 1238 if (isset($options['add_attached_image'])) {1236 if (isset($options['add_attached_image'])) { 1239 1237 $attached_thumbnails = $this->get_attached_img(); 1240 1238 … … 1758 1756 if (!$options['soundcloud_api']) { $options['soundcloud_api'] = SOUNDCLOUD_API_KEY; $soundcloud_api = $options['soundcloud_api']; } 1759 1757 if (!$options['ustream_api']) { $options['ustream_api'] = USTREAM_API_KEY; $ustream_api = $options['ustream_api']; } 1758 1759 //upgrades 1760 if(isset($options['last_update'])) { 1761 if (version_compare($options['last_update'], "0.8", '<')) { 1762 if (isset($options['enable_eight_tracks'])) { 1763 $options['enable_etracks'] = $options['enable_eight_tracks']; 1764 unset($options['enable_eight_tracks']); 1765 } 1766 } 1760 1767 1761 if (version_compare($options['last_update'], "0.8", '<')) { 1762 if (isset($options['enable_eight_tracks'])) { 1763 $options['enable_etracks'] = $options['enable_eight_tracks']; 1764 unset($options['enable_eight_tracks']); 1765 } 1766 } 1767 1768 if (version_compare($options['last_update'], "0.8.6", '<')) { 1769 $published = wp_count_posts(); 1770 $published = $published->publish; 1771 $args = array( 'numberposts' => $published, 'meta_key' => 'ographr_twitter_image' ); 1772 $ographr_urls = get_posts( $args ); 1773 foreach($ographr_urls as $ographr_url) { 1774 $ographr_id = $ographr_url->ID; 1775 $tmp = get_post_meta($ographr_id, 'ographr_twitter_image', true); 1776 update_post_meta($ographr_id, 'ographr_primary_image', $tmp); 1777 delete_post_meta($ographr_id, 'ographr_twitter_image'); 1778 } 1779 } 1768 if (version_compare($options['last_update'], "0.8.6", '<')) { 1769 $published = wp_count_posts(); 1770 $published = $published->publish; 1771 $args = array( 'numberposts' => $published, 'meta_key' => 'ographr_twitter_image' ); 1772 $ographr_urls = get_posts( $args ); 1773 foreach($ographr_urls as $ographr_url) { 1774 $ographr_id = $ographr_url->ID; 1775 $tmp = get_post_meta($ographr_id, 'ographr_twitter_image', true); 1776 update_post_meta($ographr_id, 'ographr_primary_image', $tmp); 1777 delete_post_meta($ographr_id, 'ographr_twitter_image'); 1778 } 1779 } 1780 1781 if (version_compare($options['last_update'], "0.8.9", '<')) { 1782 //delete old, incompatible index data 1783 $published = wp_count_posts(); 1784 $published = $published->publish; 1785 $args = array( 'numberposts' => $published, 'meta_key' => 'ographr_urls' ); 1786 $ographr_urls = get_posts( $args ); 1787 foreach($ographr_urls as $ographr_url) { 1788 $ographr_id = $ographr_url->ID; 1789 delete_post_meta($ographr_id, 'ographr_urls'); 1790 delete_post_meta($ographr_id, 'ographr_indexed'); 1791 } 1792 } 1793 } 1794 1795 1780 1796 1781 1797 //save current version to db … … 1842 1858 public function ographr_save_postmeta($post_id) { 1843 1859 global $core; 1844 //global $options; 1860 1845 1861 $options = get_option('ographr_options'); 1846 1862 … … 1963 1979 1964 1980 }; // end of class 1965 1966 ?>=meta-ographr/meta-ographr_admin.php')1967 ),1968 array(1969 'id' => 'ographr-home',1970 'parent' => 'ographr',1971 'title' => 'Website',1972 'href' => 'http://wordpress.org/extend/plugins/meta-ographr/'1973 )1974 );1975 1976 foreach ($menu_items as $menu_item) {1977 $wp_admin_bar->add_menu($menu_item);1978 }1979 }1980 }1981 1982 }; // end of class1983 1984 1981 ?> -
meta-ographr/trunk/readme.txt
r706963 r710833 5 5 Requires at least: 3.0 6 6 Tested up to: 3.5.1 7 Stable tag: 0.8. 87 Stable tag: 0.8.9 8 8 License: GPLv2 9 9 … … 104 104 == Changelog == 105 105 106 = 0.8.9 = 107 * fixed bug with default thumbnails 108 * fixed bug in update routine 109 * fixed minor bug when adding og:url tag 110 * removed some old commented code 111 * improved some conditionals 112 106 113 = 0.8.8 = 107 114 * removed some old update functions
Note: See TracChangeset
for help on using the changeset viewer.