Changeset 380906
- Timestamp:
- 05/04/2011 06:07:22 PM (15 years ago)
- Location:
- wp-seo-tags
- Files:
-
- 15 added
- 2 edited
-
tags/2.2.4 (added)
-
tags/2.2.4/readme.txt (added)
-
tags/2.2.4/screenshot-1.png (added)
-
tags/2.2.4/screenshot-2.png (added)
-
tags/2.2.4/screenshot-3.png (added)
-
tags/2.2.4/wp-seo-tags-be_BY.mo (added)
-
tags/2.2.4/wp-seo-tags-be_BY.po (added)
-
tags/2.2.4/wp-seo-tags-de_DE.mo (added)
-
tags/2.2.4/wp-seo-tags-de_DE.po (added)
-
tags/2.2.4/wp-seo-tags-fr_FR.mo (added)
-
tags/2.2.4/wp-seo-tags-fr_FR.po (added)
-
tags/2.2.4/wp-seo-tags-ru_RU.mo (added)
-
tags/2.2.4/wp-seo-tags-ru_RU.po (added)
-
tags/2.2.4/wp-seo-tags-template.php (added)
-
tags/2.2.4/wp-seo-tags.php (added)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/wp-seo-tags.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-seo-tags/trunk/readme.txt
r352147 r380906 18 18 19 19 == Changelog == 20 21 22 <ul> 23 <span>2.2.4</span> 24 <li>Fixed: Undefined index: HTTP_REFERER.</li> 25 </ul> 20 26 21 27 <ul> -
wp-seo-tags/trunk/wp-seo-tags.php
r352147 r380906 4 4 Plugin URI: http://www.saquery.com/wordpress/wp-seo-tags 5 5 Description: WP SEO Tags 6 Version: 2.2. 36 Version: 2.2.4 7 7 Author: Stephan Ahlf 8 8 Author URI: http://saquery.com … … 94 94 global $wpdb; 95 95 96 $engines['google.'] = 'q='; 97 $engines['altavista.com'] = 'q='; 98 $engines['search.msn.'] = 'q='; 99 $engines['yahoo.'] = 'p='; 100 $engines['bing.'] = 'q='; 101 $engines['yandex.'] = 'text='; 102 103 $referer = $_SERVER['HTTP_REFERER']; 104 $blogtarget = $_SERVER["REQUEST_URI"]; 105 $ref_arr = parse_url("$referer"); 106 $ref_host = $ref_arr['host']; 107 108 foreach($engines as $host => $skey){ 109 if (strpos($ref_host, $host) !== false){ 110 111 $res_query = urldecode($ref_arr['query']); 112 if (preg_match("/{$engines[$host]}(.*?)&/si",$res_query."&",$matches)){ 113 $query = trim($matches[1]); 114 $target = str_replace("'","''",str_replace(";","",sanitize_title_with_dashes($query))); 115 $sql= "insert into ".$wpdb->wpseotags_dbTable. 116 "(q, blogtarget, target,engine) VALUES ('$query', '$blogtarget','$target', '$ref_host') ON duplicate KEY UPDATE hits=hits+1, DT=CURRENT_TIMESTAMP"; 117 $msg="SearchEngineRedirect successful logged."; 118 try { 119 $result = $wpdb->query($sql); 120 $sql = "select count(*) from ".$wpdb->wpseotags_dbTable." where moderated = 1 and target = '$target'"; 121 $cnt=$wpdb->get_var($sql); 122 if ($cnt>0){ 123 $sql = "update ".$wpdb->wpseotags_dbTable." set moderated = 1 where moderated = 0 and target = '$target'"; 96 if (isset ($_SERVER['HTTP_REFERER'])) { 97 $engines['google.'] = 'q='; 98 $engines['altavista.com'] = 'q='; 99 $engines['search.msn.'] = 'q='; 100 $engines['yahoo.'] = 'p='; 101 $engines['bing.'] = 'q='; 102 $engines['yandex.'] = 'text='; 103 104 $referer = $_SERVER['HTTP_REFERER']; 105 $blogtarget = $_SERVER["REQUEST_URI"]; 106 $ref_arr = parse_url("$referer"); 107 $ref_host = $ref_arr['host']; 108 109 foreach($engines as $host => $skey){ 110 if (strpos($ref_host, $host) !== false){ 111 112 $res_query = urldecode($ref_arr['query']); 113 if (preg_match("/{$engines[$host]}(.*?)&/si",$res_query."&",$matches)){ 114 $query = trim($matches[1]); 115 $target = str_replace("'","''",str_replace(";","",sanitize_title_with_dashes($query))); 116 $sql= "insert into ".$wpdb->wpseotags_dbTable. 117 "(q, blogtarget, target,engine) VALUES ('$query', '$blogtarget','$target', '$ref_host') ON duplicate KEY UPDATE hits=hits+1, DT=CURRENT_TIMESTAMP"; 118 $msg="SearchEngineRedirect successful logged."; 119 try { 124 120 $result = $wpdb->query($sql); 121 $sql = "select count(*) from ".$wpdb->wpseotags_dbTable." where moderated = 1 and target = '$target'"; 122 $cnt=$wpdb->get_var($sql); 123 if ($cnt>0){ 124 $sql = "update ".$wpdb->wpseotags_dbTable." set moderated = 1 where moderated = 0 and target = '$target'"; 125 $result = $wpdb->query($sql); 126 } 127 $sql = "select count(*) from ".$wpdb->wpseotags_dbTable." where deleted = 1 and target = '$target'"; 128 $cnt=$wpdb->get_var($sql); 129 if ($cnt>0){ 130 $sql = "update ".$wpdb->wpseotags_dbTable." set deleted = 1 where deleted = 0 and target = '$target'"; 131 $result = $wpdb->query($sql); 132 } 133 } catch (Exception $e) { 134 $msg=$e->getMessage(); 125 135 } 126 $sql = "select count(*) from ".$wpdb->wpseotags_dbTable." where deleted = 1 and target = '$target'"; 127 $cnt=$wpdb->get_var($sql); 128 if ($cnt>0){ 129 $sql = "update ".$wpdb->wpseotags_dbTable." set deleted = 1 where deleted = 0 and target = '$target'"; 130 $result = $wpdb->query($sql); 131 } 132 } catch (Exception $e) { 133 $msg=$e->getMessage(); 136 echo "\n<!-- WP SEO Tags : $parm ; http://saquery.com/wp-seo-tags/ -->\n" ; 134 137 } 135 echo "\n<!-- WP SEO Tags : $parm ; http://saquery.com/wp-seo-tags/ -->\n";138 break; 136 139 } 137 break; 138 } 139 } 140 } 141 } 140 142 } 141 143
Note: See TracChangeset
for help on using the changeset viewer.