[ Index ] |
|
Code source de Cr@wltr@ck 2.2.1 |
1 <?php 2 //---------------------------------------------------------------------- 3 // CrawlTrack 2.2.1 4 //---------------------------------------------------------------------- 5 // Crawler Tracker for website 6 //---------------------------------------------------------------------- 7 // Author: Jean-Denis Brun 8 //---------------------------------------------------------------------- 9 // Website: www.crawltrack.fr 10 //---------------------------------------------------------------------- 11 // That script is distributed under GNU GPL license 12 //---------------------------------------------------------------------- 13 // file: display-one-entrypage.php 14 //---------------------------------------------------------------------- 15 if (!defined('IN_CRAWLT')) 16 { 17 echo"<h1>Hacking attempt !!!!</h1>"; 18 exit(); 19 } 20 21 //initialize array 22 $visitkeywordgoogle=array(); 23 $visitkeywordYahoo=array(); 24 $visitkeywordMSN=array(); 25 $visitkeywordask=array(); 26 $visitkeyword=array(); 27 $visitkeyworddisplay=array(); 28 29 $crawlencode=urlencode($crawler); 30 $cachename=$navig.$period.$site.$displayall.$firstdayweek.$crawlencode.$localday.$graphpos.$crawltlang; 31 32 //start the caching if fopen exist 33 if(function_exists('fopen')) 34 { 35 $ch = new cache($cachename); 36 } 37 38 //database connection 39 $connexion = mysql_connect($crawlthost,$crawltuser,$crawltpassword) or die("MySQL connection to database problem"); 40 $selection = mysql_select_db($crawltdb) or die("MySQL database selection problem"); 41 42 //include menu 43 include "include/menumain.php"; 44 include "include/menusite.php"; 45 include "include/timecache.php"; 46 //cleaning of the crawlt_visits_human table 47 include "include/cleaning-double-entry.php"; 48 //limite to 49 if($displayall=='no') 50 { 51 $limitquery='LIMIT '.$rowdisplay; 52 } 53 else 54 { 55 $limitquery=''; 56 } 57 //date for the mysql query 58 if($period>=10) 59 { 60 $datetolookfor=" date >'".sql_quote($daterequest)."' 61 AND date <'".sql_quote($daterequest2)."'"; 62 } 63 else 64 { 65 $datetolookfor=" date >'".sql_quote($daterequest)."'"; 66 } 67 //query to have the number of entry per keyword 68 $sql = "SELECT keyword, COUNT(DISTINCT id_visit) AS nbrvisits FROM crawlt_visits_human , crawlt_keyword ,crawlt_pages 69 WHERE crawlt_visits_human.crawlt_keyword_id_keyword=crawlt_keyword.id_keyword 70 AND crawlt_visits_human.crawlt_id_page=crawlt_pages.id_page 71 AND $datetolookfor 72 AND crawlt_site_id_site='".sql_quote($site)."' 73 AND crawlt_pages.url_page='".sql_quote($crawler)."' 74 GROUP BY keyword 75 ORDER BY nbrvisits DESC 76 $limitquery"; 77 78 $requete = mysql_query($sql, $connexion) or die("MySQL query error"); 79 $nbrresult=mysql_num_rows($requete); 80 81 82 if($nbrresult>=1) 83 { 84 while ($ligne = mysql_fetch_row($requete)) 85 { 86 $visitkeyword[$ligne[0]] = $ligne[1]; 87 } 88 } 89 90 91 //request to have the keyword for Googlebot 92 $sqlgoogle = "SELECT keyword, COUNT(DISTINCT id_visit) FROM crawlt_visits_human , crawlt_keyword ,crawlt_pages 93 WHERE crawlt_visits_human.crawlt_keyword_id_keyword=crawlt_keyword.id_keyword 94 AND crawlt_visits_human.crawlt_id_page=crawlt_pages.id_page 95 AND $datetolookfor 96 AND crawlt_site_id_site='".sql_quote($site)."' 97 AND crawlt_pages.url_page='".sql_quote($crawler)."' 98 AND crawlt_id_crawler= '1' 99 GROUP BY keyword"; 100 101 $requetegoogle = mysql_query($sqlgoogle, $connexion) or die("MySQL query error"); 102 $nbrresultgoogle=mysql_num_rows($requetegoogle); 103 104 105 if($nbrresultgoogle>=1) 106 { 107 while ($ligne = mysql_fetch_row($requetegoogle)) 108 { 109 $visitkeywordgoogle[$ligne[0]] = $ligne[1]; 110 } 111 } 112 113 114 //request to have the keyword for Yahoo 115 $sqlYahoo = "SELECT keyword, COUNT(DISTINCT id_visit) FROM crawlt_visits_human , crawlt_keyword ,crawlt_pages 116 WHERE crawlt_visits_human.crawlt_keyword_id_keyword=crawlt_keyword.id_keyword 117 AND crawlt_visits_human.crawlt_id_page=crawlt_pages.id_page 118 AND $datetolookfor 119 AND crawlt_site_id_site='".sql_quote($site)."' 120 AND crawlt_pages.url_page='".sql_quote($crawler)."' 121 AND crawlt_id_crawler= '2' 122 GROUP BY keyword"; 123 124 125 $requeteYahoo = mysql_query($sqlYahoo, $connexion) or die("MySQL query error"); 126 $nbrresultYahoo=mysql_num_rows($requeteYahoo); 127 128 if($nbrresultYahoo>=1) 129 { 130 while ($ligne = mysql_fetch_row($requeteYahoo)) 131 { 132 $visitkeywordYahoo[$ligne[0]] = $ligne[1]; 133 } 134 } 135 136 137 //request to have the keyword for MSN 138 $sqlMSN = "SELECT keyword, COUNT(DISTINCT id_visit) FROM crawlt_visits_human , crawlt_keyword ,crawlt_pages 139 WHERE crawlt_visits_human.crawlt_keyword_id_keyword=crawlt_keyword.id_keyword 140 AND crawlt_visits_human.crawlt_id_page=crawlt_pages.id_page 141 AND $datetolookfor 142 AND crawlt_site_id_site='".sql_quote($site)."' 143 AND crawlt_pages.url_page='".sql_quote($crawler)."' 144 AND crawlt_id_crawler= '3' 145 GROUP BY keyword"; 146 147 148 $requeteMSN = mysql_query($sqlMSN, $connexion) or die("MySQL query error"); 149 $nbrresultMSN=mysql_num_rows($requeteMSN); 150 151 if($nbrresultMSN>=1) 152 { 153 while ($ligne = mysql_fetch_row($requeteMSN)) 154 { 155 $visitkeywordMSN[$ligne[0]] = $ligne[1]; 156 } 157 } 158 159 //request to have the keyword for Ask 160 $sqlask = "SELECT keyword, COUNT(DISTINCT id_visit) FROM crawlt_visits_human , crawlt_keyword ,crawlt_pages 161 WHERE crawlt_visits_human.crawlt_keyword_id_keyword=crawlt_keyword.id_keyword 162 AND crawlt_visits_human.crawlt_id_page=crawlt_pages.id_page 163 AND $datetolookfor 164 AND crawlt_site_id_site='".sql_quote($site)."' 165 AND crawlt_pages.url_page='".sql_quote($crawler)."' 166 AND crawlt_id_crawler= '4' 167 GROUP BY keyword"; 168 169 170 $requeteask = mysql_query($sqlask, $connexion) or die("MySQL query error"); 171 $nbrresultask=mysql_num_rows($requeteask); 172 173 if($nbrresultask>=1) 174 { 175 while ($ligne = mysql_fetch_row($requeteask)) 176 { 177 $visitkeywordask[$ligne[0]] = $ligne[1]; 178 } 179 } 180 181 //mysql connexion close 182 mysql_close($connexion); 183 184 //display------------------------------------------------------------------------------------------------------------- 185 $crawlerdisplay = crawltcuturl($crawler,'55'); 186 echo"<div class=\"content\">\n"; 187 echo crawltbackforward($crawlerdisplay,$period,$daytodaylocal,$monthtodaylocal,$yeartodaylocal,$daybeginlocal,$monthbeginlocal,$yearbeginlocal,$dayendweek,$monthendweek,$yearendweek,$crawler,$navig,$site,$graphpos); 188 echo"</div>\n"; 189 //to close the menu rollover 190 echo"<div width='100%' height:'5px' onmouseover=\"javascript:montre();\"> </div>\n"; 191 192 echo"<div class='tableaularge' align='center'>\n"; 193 if(count($visitkeyword)>=1) 194 { 195 echo"<table cellpadding='0px' cellspacing='0' width='100%'>\n"; 196 echo"<tr><th class='tableau1' colspan=\"2\" rowspan=\"2\">\n"; 197 echo"".$language['keyword']."\n"; 198 echo"</th>\n"; 199 echo"<th class='tableau2'colspan=\"4\">\n"; 200 echo"".$language['nbr_tot_visit_seo']."\n"; 201 echo"</th></tr>\n"; 202 echo"<tr>\n"; 203 echo"<th class='tableau20'>\n"; 204 echo"".$language['ask']."\n"; 205 echo"</th>\n"; 206 echo"<th class='tableau20'>\n"; 207 echo"".$language['google']."\n"; 208 echo"</th>\n"; 209 echo"<th class='tableau20'>\n"; 210 echo"".$language['msn']."\n"; 211 echo"</th>\n"; 212 echo"<th class='tableau200'>\n"; 213 echo"".$language['yahoo']."\n"; 214 echo"</th>\n"; 215 echo"</tr>\n"; 216 //counter for alternate color lane 217 $comptligne=2; 218 219 220 foreach ($visitkeyword as $keyword => $value) 221 { 222 $crawlencode=urlencode($keyword); 223 $keyworddisplay = stripslashes(crawltcutkeyword($keyword,50)); 224 if(isset($visitkeywordask[$keyword])) 225 { 226 $visitask=$visitkeywordask[$keyword]; 227 } 228 else 229 { 230 $visitask='-'; 231 } 232 if(isset($visitkeywordgoogle[$keyword])) 233 { 234 $visitgoogle=$visitkeywordgoogle[$keyword]; 235 } 236 else 237 { 238 $visitgoogle='-'; 239 } 240 if(isset($visitkeywordMSN[$keyword])) 241 { 242 $visitmsn=$visitkeywordMSN[$keyword]; 243 } 244 else 245 { 246 $visitmsn='-'; 247 } 248 if(isset($visitkeywordYahoo[$keyword])) 249 { 250 $visityahoo=$visitkeywordYahoo[$keyword]; 251 } 252 else 253 { 254 $visityahoo='-'; 255 } 256 257 if ($comptligne%2 ==0) 258 { 259 echo"<tr><td class='tableau3'"; 260 if($keywordcut==1) 261 { 262 echo"onmouseover=\"javascript:montre('smenu".($comptligne+9)."');\" onmouseout=\"javascript:montre();\""; 263 } 264 echo"><a href='index.php?navig=16&period=".$period."&site=".$site."&crawler=".$crawlencode."&graphpos=".$graphpos."' >".$keyworddisplay."</a></td>\n"; 265 echo"<td class='tableau6' width=\"8%\"". crawltkeywordwindow($keyword).">\n"; 266 echo"<a href=\"#\">\n"; 267 echo" <img src=\"./images/information.png\" width=\"16\" height=\"16\" border=\"0\" ></a>\n"; 268 echo"</td> \n"; 269 echo"<td class='tableau3' width=\"11%\">".numbdisp($visitask)."</td>\n"; 270 echo"<td class='tableau3' width=\"11%\">".numbdisp($visitgoogle)."</td>\n"; 271 echo"<td class='tableau3' width=\"11%\">".numbdisp($visitmsn)."</td>\n"; 272 echo"<td class='tableau5' width=\"11%\">".numbdisp($visityahoo)."</td></tr>\n"; 273 } 274 else 275 { 276 echo"<tr><td class='tableau30'"; 277 if($keywordcut==1) 278 { 279 echo"onmouseover=\"javascript:montre('smenu".($comptligne+9)."');\" onmouseout=\"javascript:montre();\""; 280 } 281 echo"><a href='index.php?navig=16&period=".$period."&site=".$site."&crawler=".$crawlencode."&graphpos=".$graphpos."' >".$keyworddisplay."</a></td>\n"; 282 echo"<td class='tableau60' width=\"8%\"". crawltkeywordwindow($keyword).">\n"; 283 echo"<a href=\"#\">\n"; 284 echo" <img src=\"./images/information.png\" width=\"16\" height=\"16\" border=\"0\" ></a>\n"; 285 echo"</td> \n"; 286 echo"<td class='tableau30' width=\"11%\">".numbdisp($visitask)."</td>\n"; 287 echo"<td class='tableau30' width=\"11%\">".numbdisp($visitgoogle)."</td>\n"; 288 echo"<td class='tableau30' width=\"11%\">".numbdisp($visitmsn)."</td>\n"; 289 echo"<td class='tableau50' width=\"11%\">".numbdisp($visityahoo)."</td></tr>\n"; 290 } 291 if($keywordcut==1) 292 { 293 echo"<div id=\"smenu".($comptligne+9)."\" style=\"display:none; font-size:14px; font-weight:bold; color:#ff0000; font-family:Verdana,Geneva, Arial, Helvetica, Sans-Serif; text-align:left; border:2px solid navy; position:absolute; top:".(270+(($comptligne-3)*25))."px; left:20px; background:#fff;\">\n"; 294 echo" ".stripslashes(htmlentities(utf8_decode(urldecode($keyword))))." \n"; 295 echo"</div>\n"; 296 } 297 298 299 $comptligne++; 300 301 } 302 echo"</table>\n"; 303 304 305 if(count($visitkeyword)>=$rowdisplay && $displayall=='no') 306 { 307 echo"<h2><span class=\"smalltext\">\n"; 308 printf($language['100_lines'],$rowdisplay); 309 echo"<br>\n"; 310 $crawlencode = urlencode($crawler); 311 echo"<a href=\"index.php?navig=$navig&period=$period&site=$site&crawler=$crawlencode&order=$order&displayall=yes&graphpos=$graphpos\">".$language['show_all']."</a></span></h2>"; 312 } 313 echo"<br>\n"; 314 } 315 else 316 { 317 echo"<h1>".$language['no_visit']."</h1>\n"; 318 echo"<br>\n"; 319 } 320 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Sep 6 14:14:11 2007 | par Balluche grâce à PHPXref 0.7 |