(#1)
c0rrupt Offline
Administrator
 
Posts: 192
Join Date: Mar 2010
Location: Canada
Top Searches - Module - 11-07-2010, 06:21 PM

by jomasaco on Sun Sep 06, 2009


An near clone of recent search, it show the results by most searched



Create an new file on modules folder name wcddl_TopSearch.php
inside past

Code:
   <?php
if(!defined("WCDDL_GUTS"))
   exit;
/*BEGIN_INFO
Top 100 Searches.
END_INFO*/
$recentsLimit = 500;  //Many results you want show
$recentsResults = array();
$recentsQuery = mysql_query("SELECT query, searches FROM wcddl_recents ORDER BY searches DESC LIMIT ".mysql_real_escape_string($recentsLimit)."");
   while($recentsRow = mysql_fetch_assoc($recentsQuery)) {
      $recentsRow['queryURL'] = $core->processURL($recentsRow['query']);
      $recentsRow['query'] = strip_tags($recentsRow['query']);
                $recentsRow['searches'] = $recentsRow['searches'] +1;
      $recentsResults[] = '<a href="index.php?q='.$recentsRow['queryURL'].'" title="Searched '.$recentsRow['searches'].' Times">'.$recentsRow['query'].'</a>';
   }
$recentsResult = implode(", ",$recentsResults);
$core->setTemplateVar("TopSearches",$recentsResult);
?>
In page where you want see the table place

Code:
             <h2>Top Searches</h2>
          <?=$core->templateVar("TopSearches")?>
            </p>


Before doing any edits to your DDL Site always make a BACKUP first.
(#2)
twisted Offline
 
Posts: 5
Join Date: Nov 2010
Re: Top Searches - Module - 11-07-2010, 10:05 PM

thank bro this works on fully loaded on thank

Bookmarks

Tags
module, searches, top

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Powered by vBulletin


Content Relevant URLs by vBSEO