[ Index ]
 

Code source de Cr@wltr@ck 2.2.1

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/include/ -> display-keyword.php (source)

   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-keyword.php

  14  //----------------------------------------------------------------------

  15  if (!defined('IN_CRAWLT'))
  16  {
  17      echo"<h1>Hacking attempt !!!!</h1>";
  18      exit();
  19  }
  20  //initialize array

  21  $visitkeywordgoogle=array();
  22  $visitkeywordYahoo=array();
  23  $visitkeywordMSN=array();
  24  $visitkeywordask=array();
  25  $visitkeyword=array();
  26  $visitkeyworddisplay=array();
  27  
  28  $cachename=$navig.$period.$site.$displayall.$firstdayweek.$localday.$graphpos.$crawltlang;
  29  
  30  //start the caching if fopen exist

  31  if(function_exists('fopen'))
  32      {
  33      $ch = new cache($cachename);
  34      }
  35  
  36  //database connection

  37  $connexion = mysql_connect($crawlthost,$crawltuser,$crawltpassword) or die("MySQL connection to database problem");
  38  $selection = mysql_select_db($crawltdb) or die("MySQL database selection problem");
  39  
  40  //include menu 

  41  include "include/menumain.php";
  42  include "include/menusite.php";
  43  include "include/timecache.php";
  44  //cleaning of the crawlt_visits_human table

  45  include "include/cleaning-double-entry.php";
  46  //limite to 

  47  if($displayall=='no')
  48      {
  49      $limitquery='LIMIT '.$rowdisplay;
  50      }
  51  else
  52      {
  53      $limitquery='';
  54      }
  55  //date for the mysql query

  56  if($period>=10)
  57      {
  58      $datetolookfor=" date >'".sql_quote($daterequest)."' 
  59      AND  date <'".sql_quote($daterequest2)."'";    
  60      }
  61  else
  62      {
  63      $datetolookfor=" date >'".sql_quote($daterequest)."'";
  64      }
  65      
  66  //query to have the number of entry per keyword

  67  $sql = "SELECT  keyword, COUNT(DISTINCT id_visit) AS nbrvisits FROM crawlt_visits_human , crawlt_keyword
  68  WHERE crawlt_visits_human.crawlt_keyword_id_keyword=crawlt_keyword.id_keyword
  69  AND  $datetolookfor
  70  AND crawlt_site_id_site='".sql_quote($site)."'  
  71  GROUP BY keyword
  72  ORDER BY nbrvisits DESC 
  73  $limitquery";
  74  
  75  $requete = mysql_query($sql, $connexion) or die("MySQL query error");
  76  $nbrresult=mysql_num_rows($requete);
  77  
  78  
  79  if($nbrresult>=1)
  80      {
  81      while ($ligne = mysql_fetch_row($requete))                                                                              
  82          {
  83          $visitkeyword[$ligne[0]] = $ligne[1];
  84          } 
  85      }    
  86      
  87      
  88      
  89              
  90  //request to have the keyword for Googlebot

  91  $sqlgoogle = "SELECT  keyword, COUNT(DISTINCT id_visit) FROM crawlt_visits_human , crawlt_keyword
  92  WHERE crawlt_visits_human.crawlt_keyword_id_keyword=crawlt_keyword.id_keyword
  93  AND  $datetolookfor
  94  AND crawlt_site_id_site='".sql_quote($site)."' 
  95  AND crawlt_id_crawler= '1' 
  96  GROUP BY keyword";
  97  
  98  $requetegoogle = mysql_query($sqlgoogle, $connexion) or die("MySQL query error");
  99  $nbrresultgoogle=mysql_num_rows($requetegoogle);
 100  
 101  
 102  if($nbrresultgoogle>=1)
 103      {
 104      while ($ligne = mysql_fetch_row($requetegoogle))                                                                              
 105          {
 106          $visitkeywordgoogle[$ligne[0]] = $ligne[1];
 107          } 
 108      }
 109  
 110  
 111  //request to have the keyword for Yahoo

 112  $sqlYahoo = "SELECT  keyword, COUNT(DISTINCT id_visit) FROM crawlt_visits_human , crawlt_keyword
 113  WHERE crawlt_visits_human.crawlt_keyword_id_keyword=crawlt_keyword.id_keyword
 114  AND  $datetolookfor
 115  AND crawlt_site_id_site='".sql_quote($site)."' 
 116  AND crawlt_id_crawler= '2' 
 117  GROUP BY keyword";
 118  
 119  
 120  $requeteYahoo = mysql_query($sqlYahoo, $connexion) or die("MySQL query error");
 121  $nbrresultYahoo=mysql_num_rows($requeteYahoo);
 122  
 123  if($nbrresultYahoo>=1)
 124      {
 125      while ($ligne = mysql_fetch_row($requeteYahoo))                                                                              
 126          {
 127          $visitkeywordYahoo[$ligne[0]] = $ligne[1];
 128          } 
 129      }
 130  
 131  
 132  //request to have the keyword for MSN

 133  $sqlMSN = "SELECT  keyword, COUNT(DISTINCT id_visit) FROM crawlt_visits_human , crawlt_keyword
 134  WHERE crawlt_visits_human.crawlt_keyword_id_keyword=crawlt_keyword.id_keyword
 135  AND  $datetolookfor
 136  AND crawlt_site_id_site='".sql_quote($site)."' 
 137  AND crawlt_id_crawler= '3' 
 138  GROUP BY keyword";
 139  
 140  
 141  $requeteMSN = mysql_query($sqlMSN, $connexion) or die("MySQL query error");
 142  $nbrresultMSN=mysql_num_rows($requeteMSN);
 143  
 144  if($nbrresultMSN>=1)
 145      {
 146      while ($ligne = mysql_fetch_row($requeteMSN))                                                                              
 147          {
 148          $visitkeywordMSN[$ligne[0]] = $ligne[1];
 149          } 
 150      }
 151  
 152  //request to have the keyword for Ask

 153  $sqlask = "SELECT  keyword, COUNT(DISTINCT id_visit) FROM crawlt_visits_human , crawlt_keyword
 154  WHERE crawlt_visits_human.crawlt_keyword_id_keyword=crawlt_keyword.id_keyword
 155  AND  $datetolookfor
 156  AND crawlt_site_id_site='".sql_quote($site)."' 
 157  AND crawlt_id_crawler= '4' 
 158  GROUP BY keyword";
 159  
 160  
 161  $requeteask = mysql_query($sqlask, $connexion) or die("MySQL query error");
 162  $nbrresultask=mysql_num_rows($requeteask);
 163  
 164  if($nbrresultask>=1)
 165      {
 166      while ($ligne = mysql_fetch_row($requeteask))                                                                              
 167          {
 168          $visitkeywordask[$ligne[0]] = $ligne[1];
 169          } 
 170      }
 171  //mysql connexion close

 172  mysql_close($connexion);
 173  
 174  //display----------------------------------------------------------------------------------------------------------

 175  echo"<div class=\"content\">\n";
 176  echo crawltbackforward('keyword',$period,$daytodaylocal,$monthtodaylocal,$yeartodaylocal,$daybeginlocal,$monthbeginlocal,$yearbeginlocal,$dayendweek,$monthendweek,$yearendweek,$crawler,$navig,$site,$graphpos);
 177  echo"</div>\n";
 178  
 179  //to close the menu rollover

 180  echo"<div width='100%' height:'5px' onmouseover=\"javascript:montre();\">&nbsp;</div>\n";
 181  echo"<div class='tableaularge' align='center'>\n";
 182  if(count($visitkeyword)>=1)
 183      {
 184      echo"<table   cellpadding='0px' cellspacing='0' width='100%'>\n";
 185      echo"<tr><th class='tableau1' colspan=\"2\" rowspan=\"2\">\n";
 186      echo"".$language['keyword']."\n";
 187      echo"</th>\n";        
 188      echo"<th class='tableau2'colspan=\"4\">\n";
 189      echo"".$language['nbr_tot_visit_seo']."\n";
 190      echo"</th></tr>\n";  
 191      echo"<tr>\n";
 192      echo"<th class='tableau20'>\n";
 193      echo"".$language['ask']."\n";
 194      echo"</th>\n";
 195      echo"<th class='tableau20'>\n";
 196      echo"".$language['google']."\n";
 197      echo"</th>\n";
 198      echo"<th class='tableau20'>\n";
 199      echo"".$language['msn']."\n";
 200      echo"</th>\n";
 201      echo"<th class='tableau200'>\n";
 202      echo"".$language['yahoo']."\n";
 203      echo"</th>\n";
 204      echo"</tr>\n";
 205      //counter for alternate color lane

 206      $comptligne=2;
 207      //counter to limite number of datas displayed

 208      $comptdata=0;
 209  
 210      
 211      foreach ($visitkeyword as $keyword => $value)
 212          {
 213          $crawlencode=urlencode($keyword);
 214          $keyworddisplay = stripslashes(crawltcutkeyword($keyword,60));
 215          if(isset($visitkeywordask[$keyword]))
 216              {
 217              $visitask=$visitkeywordask[$keyword];
 218              }
 219          else
 220              {
 221              $visitask='-';
 222              }        
 223          if(isset($visitkeywordgoogle[$keyword]))
 224              {
 225              $visitgoogle=$visitkeywordgoogle[$keyword];
 226              }
 227          else
 228              {
 229              $visitgoogle='-';
 230              }
 231          if(isset($visitkeywordMSN[$keyword]))
 232              {
 233              $visitmsn=$visitkeywordMSN[$keyword];
 234              }
 235          else
 236              {
 237              $visitmsn='-';
 238              }                     
 239          if(isset($visitkeywordYahoo[$keyword]))
 240              {
 241              $visityahoo=$visitkeywordYahoo[$keyword];
 242              }
 243          else
 244              {
 245              $visityahoo='-';
 246              }        
 247          //to limit the display to 100 datas

 248          if($comptdata<100)
 249              {        
 250              if ($comptligne%2 ==0)
 251                  {
 252                  echo"<tr><td class='tableau3'";
 253                  if($keywordcut==1)
 254                      {
 255                      echo"onmouseover=\"javascript:montre('smenu".($comptligne+9)."');\"   onmouseout=\"javascript:montre();\"";
 256                      }
 257                  echo"><a href='index.php?navig=16&amp;period=".$period."&amp;site=".$site."&amp;crawler=".$crawlencode."&amp;graphpos=".$graphpos."' >".$keyworddisplay."</a></td>\n";
 258                  echo"<td class='tableau6' width=\"8%\"". crawltkeywordwindow($keyword).">\n";               
 259                  echo"<a href=\"#\">\n";    
 260                  echo" <img src=\"./images/information.png\" width=\"16\" height=\"16\" border=\"0\" ></a>\n";                
 261                  echo"</td> \n"; 
 262                  echo"<td class='tableau3' width=\"11%\">".numbdisp($visitask)."</td>\n";
 263                  echo"<td class='tableau3' width=\"11%\">".numbdisp($visitgoogle)."</td>\n";
 264                  echo"<td class='tableau3' width=\"11%\">".numbdisp($visitmsn)."</td>\n";
 265                  echo"<td class='tableau5' width=\"11%\">".numbdisp($visityahoo)."</td></tr>\n";
 266                  }
 267               else
 268                  {
 269                  echo"<tr><td class='tableau30'";
 270                  if($keywordcut==1)
 271                      {
 272                      echo"onmouseover=\"javascript:montre('smenu".($comptligne+9)."');\"   onmouseout=\"javascript:montre();\"";
 273                      }
 274                  echo"><a href='index.php?navig=16&amp;period=".$period."&amp;site=".$site."&amp;crawler=".$crawlencode."&amp;graphpos=".$graphpos."'  >".$keyworddisplay."</a></td>\n";
 275                  echo"<td class='tableau60' width=\"8%\"". crawltkeywordwindow($keyword).">\n";               
 276                  echo"<a href=\"#\">\n";   
 277                  echo" <img src=\"./images/information.png\" width=\"16\" height=\"16\" border=\"0\" ></a>\n";                
 278                  echo"</td> \n"; 
 279                  echo"<td class='tableau30' width=\"11%\">".numbdisp($visitask)."</td>\n";
 280                  echo"<td class='tableau30' width=\"11%\">".numbdisp($visitgoogle)."</td>\n";
 281                  echo"<td class='tableau30' width=\"11%\">".numbdisp($visitmsn)."</td>\n";
 282                  echo"<td class='tableau50' width=\"11%\">".numbdisp($visityahoo)."</td></tr>\n";               
 283                  }  
 284                  if($keywordcut==1)
 285                      {             
 286                      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";      
 287                      echo"&nbsp;".stripslashes(htmlentities(utf8_decode(urldecode($keyword))))."&nbsp;\n";
 288                      echo"</div>\n";
 289                      }        
 290      
 291                        
 292               $comptligne++;
 293                  if($displayall=='no')
 294                      {
 295                      $comptdata++;
 296                      }
 297               }
 298          }
 299      echo"</table>\n"; 
 300        
 301                    
 302      if(count($visitkeyword)>=$rowdisplay && $displayall=='no')
 303          {
 304          echo"<h2><span class=\"smalltext\">\n";
 305          printf($language['100_lines'],$rowdisplay);
 306          echo"<br>\n";
 307           $crawlencode = urlencode($crawler);
 308          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>";
 309          }  
 310      echo"<br>\n";                   
 311      }
 312  else
 313      {
 314      echo"<h1>".$language['no_visit']."</h1>\n";
 315      echo"<br>\n"; 
 316      }        
 317  ?>


Généré le : Thu Sep 6 14:14:11 2007 par Balluche grâce à PHPXref 0.7