Changeset 671064
- Timestamp:
- 02/21/2013 08:04:41 AM (13 years ago)
- Location:
- google-break-dance
- Files:
-
- 4 added
- 2 edited
-
tags/0.5 (added)
-
tags/0.5/google-break-dance.php (added)
-
tags/0.5/index.php (added)
-
tags/0.5/readme.txt (added)
-
trunk/google-break-dance.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
google-break-dance/trunk/google-break-dance.php
r670785 r671064 4 4 Plugin URI: http://wordpress.org/extend/plugins/google-break-dance/ 5 5 Description: Image tidak lagi terindek Google? <a href="http://wordpress.org/extend/plugins/google-break-dance/" target="_blank">EDIT .htaccess menjadi seperti ini</a>. Redirect Visitor dari Google image ke langsung halaman Post, jangan lupa edit file <b>.htaccess</b> sebelum menggunakan Plugin ini. Oh iya klo berguna, kapan2 jgn lupa cendolnya buat <strong><a href="http://www.cekpr.com">cekPR.com</a></strong> heheh... 6 Version: 0. 46 Version: 0.5 7 7 Author: ewwink 8 8 Author URI: http://www.cekpr.com/ … … 17 17 $attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM " . $prefix . "posts" . " WHERE guid='" . $image_url . "';")); 18 18 } 19 if(!isset($attachment[0])){ 20 $tryImage = preg_replace('/(-[0-9]{1,3})x[0-9]{1,3}\.(jpe?g|gif|png|ico)/i',".$2",$image_url); 21 $attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM " . $prefix . "posts WHERE guid=%s;", $tryImage)); 22 if(!$attachment){ 23 $attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM " . $prefix . "posts" . " WHERE guid='" . $tryImage . "';")); 24 } 25 } 19 26 return $attachment[0]; 20 27 } 28 21 29 function Google_Image_Dance(){ 22 30 if(preg_match('/get_image?.*\.(jpe?g|gif|png|ico)$/i',$_SERVER['REQUEST_URI'])){ 23 $getImg = str_ireplace('get_image?','',$_SERVER['REQUEST_URI']); 31 $getImg = str_ireplace('get_image?','',$_SERVER['REQUEST_URI']); 32 echo get_site_url().$getImg; 24 33 if(cekpr_image_id(get_site_url().$getImg)){ 25 34 $GattachId = get_permalink(cekpr_image_id(get_site_url().$getImg)); 26 $GoriUrl = get_site_url().$getImg;27 35 $GpId = cekpr_image_id(get_site_url().$getImg); 28 36 $GaUrl = get_post($GpId); 29 37 $GPostId = get_permalink($GaUrl->post_parent); 30 if( $GPostId){38 if(isset($GPostId)){ 31 39 header("HTTP/1.1 301 Moved Permanently"); 32 40 header("Location: $GPostId"); … … 34 42 } 35 43 else{ 36 if($GattachId){ 37 header("HTTP/1.1 301 Moved Permanently"); 38 header("Location: $GattachId"); 39 exit; 40 } 41 else{ 42 header("HTTP/1.1 301 Moved Permanently"); 43 header("Location: $GoriUrl"); 44 exit; 45 } 44 header("HTTP/1.1 301 Moved Permanently"); 45 header("Location: $GattachId"); 46 exit; 46 47 } 47 48 } 49 } 48 50 } 49 }50 51 add_action('init','Google_Image_Dance',1); 51 52 -
google-break-dance/trunk/readme.txt
r670832 r671064 16 16 Saat visitor klik link "Lihat Gambar Asli" di halaman Google search image maka URLnya akan dialihkan / Redirect langsung halaman Post dimana image tersebut berada. 17 17 sebelum menginstall plugin ini jangan lupa masukan baris text berikut ke paling atas file <b>.htaccess</b> : <br /><br /> 18 = v 0.5 = 19 - fix no referer, no redirect 20 - tidak redirect thumbnail dihalaman google search 21 - fix redirect untuk gambar yg non full size seperti, http://blog/uploads/image-100x100.png 18 22 19 = *** Penting: untuk v 0. 4 edit lagi .htaccess menjadi seperti dibawah supaya BOT tidak diredirect ke post dan menghilangkan error ketika tidak ada referer=23 = *** Penting: untuk v 0.5 edit lagi .htaccess menjadi seperti dibawah = 20 24 21 25 <code> … … 24 28 RewriteCond %{REQUEST_URI} wp-content/uploads/.*\.(gif|jpg|jpeg|png)$ [NC] 25 29 RewriteCond %{HTTP_USER_AGENT} !.*bot.* [NC] 30 RewriteCond %{HTTP_REFERER} !^$ [NC] 31 RewriteCond %{HTTP_REFERER} !^http://www.google.[a-z]{2,4}(.[a-z]{2,4})?/blank.html$ [NC] 26 32 RewriteCond %{HTTP_REFERER} !^http://(www.)?cekpr.com/.*$ [NC] 27 33 RewriteRule ^(.*)$ /get_image?$1 [R=302,L] … … 52 58 RewriteCond %{REQUEST_URI} wp-content/uploads/.*\.(gif|jpg|jpeg|png)$ [NC] 53 59 RewriteCond %{HTTP_USER_AGENT} !.*bot.* [NC] 60 RewriteCond %{HTTP_REFERER} !^$ [NC] 61 RewriteCond %{HTTP_REFERER} !^http://www.google.[a-z]{2,4}(.[a-z]{2,4})?/blank.html$ [NC] 54 62 RewriteCond %{HTTP_REFERER} !^http://(www.)?cekpr.com/.*$ [NC] 55 63 RewriteRule ^(.*)$ /get_image?$1 [R=302,L] … … 69 77 *<i>ganti cekpr.com dengan nama domain ente</i> 70 78 71 = Perubahan versi Plugin =72 73 = 0.4 =74 perubahan pada .htaccess supaya jangan redirect Bot ke post, tambahkan <br />75 <strong>RewriteCond %{HTTP_USER_AGENT} !.\*bot.\* [NC]</strong>76 = 0.3 =77 Fix $wpdb Compability78 = 0.2 =79 fix $wpdb80 = 0.1 =81 test release82 83 79 84 80 == Frequently Asked Questions == … … 95 91 96 92 == Changelog == 97 93 = 0.5 = 94 - fix no referer, no redirect 95 - tidak redirect thumbnail dihalaman google search 96 - fix redirect untuk gambar yg non full size seperti, http://blog/uploads/image-100x100.png 98 97 = 0.4 = 99 98 perubahan pada .htaccess supaya jangan redirect Bot Bot ke post, tambahkan <br />
Note: See TracChangeset
for help on using the changeset viewer.