Ignore:
Timestamp:
07/28/08 16:58:47 (4 years ago)
Author:
hverton
Message:

fixed layout issue in the footer
only count hits if we think it's a real user

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/common/wiki/php-files/modules/wiki/actions/footer.php

    r1447 r1554  
    4343<table width='100%'> 
    4444<tr> 
    45     <td width='1%' style='white-space:nowrap;'> 
    46  
    47 Search: <input name="phrase" size="75" class="searchbox" /> 
     45    <td width='100%' style='white-space:nowrap;'> 
     46        Search: <input name="phrase" style='width:90%;' class="searchbox" /> 
    4847    </td> 
    49     <td width='1%' align='right'> 
     48    <td width='25' align='right'> 
    5049<?php  
    5150echo $this->GetPageTime() ? " <a href=\"".$this->href("revisions.xml")."\" title=\"Click to view recent page revisions in XML format.\"><img src=\"images/xml.png\" width=\"36\" height=\"14\" align=\"bottom\" style=\"border : 0px;\" alt=\"XML\" /></a>\n" : "&nbsp;"; 
     
    5453</tr> 
    5554<tr> 
    56     <td colspan='2' width='99%' align='right'> 
     55    <td colspan='2' width='100%' align='right'> 
    5756        <div class="smallprint"> 
    5857        <?php echo $this->Link("http://validator.w3.org/check/referer", "", "Valid XHTML 1.0 Transitional") ?> | 
     
    7978 
    8079    // page hit counter code 
     80    $thispage=$this->GetPageTag(); 
    8181 
    82     $thispage=$this->GetPageTag(); 
    83     // Get hit count 
    84     $result2 = mysql_query( "SELECT hits FROM ".$this->config["table_prefix"]."pages WHERE tag='$thispage' AND latest='Y'" ); 
    85     $row2 = mysql_fetch_array($result2); 
    86     $hit_count1 = $row2[hits]; 
    87     // Count is incremented if not your own page 
    88     if ($this->GetUserName() != $this->GetPageOwner($tag)) 
     82    // Hot count is incremented if not your own page and we think it's a user 
     83    if (!CMS_IS_BOT && $this->GetUserName() != $this->GetPageOwner($tag)) 
    8984    { 
    90         // End Get hit Count   Start adding hits 
    91         $hit_count2 = $hit_count1 + 1; 
    92         // End adding hits   Start Update Hit 
    93         $sql = "UPDATE `".$this->config["table_prefix"]."pages` SET `hits` = '$hit_count2' WHERE tag='$thispage' AND latest='Y'"; 
     85        // Update Hit counter 
     86        $sql = "UPDATE `".$this->config["table_prefix"]."pages` SET `hits` = `hits`+1 WHERE tag='$thispage' AND latest='Y'"; 
    9487        // $sql .= " WHERE `ref` = $ref"; 
    9588        mysql_query($sql) or die("Unable to process query: " . mysql_error()); 
Note: See TracChangeset for help on using the changeset viewer.