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