Thread: Search Log

Page 3 of 10 FirstFirst 12345 ... LastLast
Results 21 to 30 of 95
  1. #21
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default Re: Search Log

    Sorry about that. Continusly, from my post above,

    replace that line:

    PHP Code:
    $searchterm = (isset($row['searchterm']) && !empty($row['searchterm']) ? (strip_tags($row['searchterm'])) : ""
    with this one:

    PHP Code:
    $searchterm = (isset($row['searchterm']) && !empty($row['searchterm'])) ? (strip_tags($row['searchterm'])) : ""
    My mistake.

  2. #22
    Join Date
    Oct 2005
    Location
    Chicago, IL USA
    Posts
    1,587
    Plugin Contributions
    29

    Default Re: Search Log

    Bingo! I made both edits and it's working fine. Here is the corrected file (to save others of doing the edits.)

    The contriubtion is appreciated!
    Attached Files Attached Files

  3. #23
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default Re: Search Log

    Excellent. Thanks for reporting this. Now, up to the language definitions . . .

    However, to avoid any disputes, I think it would be wise to add Woza's name on top of the attachment since, I believe, he originally posted this contribution in the first place.

  4. #24
    Join Date
    Feb 2005
    Location
    West Yorkshire, UK
    Posts
    70
    Plugin Contributions
    0

    Default Re: Search Log

    I'm glad to see this mod is getting some interest.

    I've made some adjustments tonight (including the fixes by TheOracle).

    There is no changes to the database table. The only files to change are:
    admin/searchlog.php
    admin/includes/languages/english/extra_definitions/search_log.php

    I've uploaded the latest release here:
    http://www.seamless-packages.co.uk/z..._analyser.html
    You can check that link for new releases if you are not bothered about all this development talk ;)

    Let me know how you get on...

    p.s. Big thanks to TheOracle for all his/ her continued help!
    ---------------------------------------------
    www.seamless-packages.co.uk

  5. #25
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default Re: Search Log

    -- Patches for languages (and some security fixes):

    In your admin/serverlog.php file,

    find:

    PHP Code:
    <tr>
        <
    td align="center" bgcolor="#CCCCCC"><strong>Date Range </strong><strong>Match search term </strong></td>
        <
    td align="center" bgcolor="#CCCCCC"><strong>Search Match </strong></td>
        <
    td align="center" bgcolor="#CCCCCC"><strong>Global Actions </strong></td>
        <
    td width="25%" bgcolor="#FF9900"><strong>Info</strong></td>
      </
    tr
    replace with:

    PHP Code:
    <tr>
        <td align="center" bgcolor="#CCCCCC"><?php echo DATE_RANGE' ' MATCH_SEARCH_TERM?></td>
        <td align="center" bgcolor="#CCCCCC"><?php echo MATCH_SEARCH?></td>
        <td align="center" bgcolor="#CCCCCC"><?php echo GLOBAL_ACTIONS?></td>
        <td width="25%" bgcolor="#FF9900"><?php echo INFO?></td>
      </tr>
    Then, two lines below, find:

    PHP Code:
    <strong>coming soon</strong
    replace with:

    PHP Code:
    <?php echo COMING_SOON?>
    Then, find:

    PHP Code:
    <td align="center" valign="top" bgcolor="#CCCCCC"><strong>coming soon </strong></td>
        <
    td align="center" valign="top" bgcolor="#CCCCCC"><p><strong>coming soon </strong></p>    </td>
        <
    td width="25%" valign="top" bgcolor="#FF9900"><p>Built by: <a href="http://www.seamless-packages.co.uk">Seamless-packages</a> <br>
          
    AuthorWarren Lloyd <br>
        
    Version0.1beta</p>
        <
    p><a href="#"></a> </p></td>
      </
    tr>
    </
    table
    replace with:

    PHP Code:
    <td align="center" valign="top" bgcolor="#CCCCCC"><p><?php echo COMING_SOON?></p></td>
        <td align="center" valign="top" bgcolor="#CCCCCC"><p><?php echo COMING_SOON?></p></td>
        <td width="25%" valign="top" bgcolor="#FF9900"><p><?php echo COPYRIGHT_AUTHOR_URL?></p>
        <p><?php zen_href_link('#''''NONSSL'); ?></a></p></td>
      </tr>
    </table>
    Then, find:

    PHP Code:
    switch( $_GET['action'] ){
        case 
    "delete":
      
    $sqldelete "delete from zen_search_log where id = $id";
      
    $result mysql_query$sqldelete )
            or die(
    "invalid query: " mysql_error());
        echo 
    "<h1>Item $id deleted</h1>";
            break;
        case 
    "deleteall":
      
    $sqldelete "delete from zen_search_log where id = $id";
      
    $result mysql_query$sqldelete )
            or die(
    "invalid query: " mysql_error());
        echo 
    "<h1>Item $id deleted</h1>";
            break;
        } 
    Replace with:

    PHP Code:
    switch( $_GET['action'] ){
        case 
    "delete":

      if (isset(
    $_GET['id']) || isset($_POST['id'])) {
      
    $id = (isset($_POST['id']) && $_POST['id'] != 0) ? intval(trim($_POST['id'])) : 0;
      } else {
      
    $id 0;
      } 
    ###### End of if statement.

      
    if ($id <= 0) {
      
    $messageStack->add_session(ENTRY_SEARCHLOG_ID_NOT_FOUND'error');
     } 
    ###### End of if statement.

      
    if ($id >= 1) {

      
    $sqldelete "delete from " TABLE_SEARCHLOG " where id = ".(int)$id;
      
    $result mysql_query($sqldelete);

      if (!
    $result) {
      
    $messageStack->add_session(ENTRY_SEARCHLOG_DELETE_FAILED'error');
      } else {
      
    $messageStack->add_session(ENTRY_SEARCHLOG_DELETE_SUCCESSFUL'success');
      break;
      } 
    ###### End of if statement.
      
      
    case "deleteall":
      
    $sqldelete "delete from " TABLE_SEARCHLOG " where id = ".(int)$id;
      
    $result mysql_query$sqldelete )
      if (!
    $result) {
      
    $messageStack->add_session(ENTRY_SEARCHLOG_DELETE_FAILED'error');
      } else {
      
    $messageStack->add_session(ENTRY_SEARCHLOG_DELETE_SUCCESSFUL'success');
      } 
    ###### End of if statement.
      
    break;
      } 
    ###### End of switch case statement.
      
    ###### End of if statement. 
    Then, find:

    PHP Code:
        echo "<table width=\"100%\" border=\"0\" cellpadding=\"4\" cellspacing=\"0\">
        <tr>
            <td width=\"110\"><b>Search Term</b></td>
            <td><b>Number of times searched for</b></td>
            <td><b>Date</b></td>
            <td><b>Action</b></td>
        </tr>"
    ;
    $color1 "#BFD8BC";
    $color2 "#E0E0E0";
    $row_count 0;
     if(!isset(
    $_GET['page'])){
        
    $page 1;
    } else {
        
    $page $_GET['page'];
    }

    // Define the number of results per page
    if (isset($resultcount)) {
       
    $max_results $resultcount;
    } else {
    $max_results 15;
    }

    // Figure out the limit for the query based
    // on the current page number.
    $from = (($page $max_results) - $max_results);

    // Perform MySQL query on only the current page number's results
    if (isset($theDate) && isset($theDate2)) { 
    replace with:

    PHP Code:
    <?php

      $color1 
    "#BFD8BC";
      
    $color2 "#E0E0E0";
      
    $row_count 0;

      if (!isset(
    $_GET['page']) || empty($_GET['page'])) {
      
    $page 1;
      } else {
      
    $page intval(trim($_GET['page']));
      } 
    ###### End of if statement.

      // Define the number of results per page
      
    if (isset($resultcount) && $resultcount != 0) {
      
    $max_results intval(trim($resultcount));
      } else {
      
    $max_results 15;
      } 
    ###### End of if statement.

      // Figure out the limit for the query based
      // on the current page number.
      
    $set_page intval(trim($page));
      
    $set_max_results intval(trim($max_results));
      
    $from = (isset($set_page) && isset($set_max_results) && $set_page != && $set_max_results != 0) ? ($set_page $set_max_results) - $set_max_results) : 0;
      
    $set_from = (isset($from)) ? trim($from) : "";

      
    // Perform MySQL query on only the current page number's results
      
    if ($_SESSION['admin_id'] && isset($theDate) && isset($theDate2) && $theDate != "0000-00-00" && $theDate2 != "0000-00-00") {
    Then, find:

    PHP Code:

     $sql 
    "SELECT id, date, searchterm, count(*) AS Number
                      FROM zen_search_log
                           WHERE searchterm is not null and searchterm not like  ''
                        and date BETWEEN '
    $theDate' and   '$theDate2'
                            GROUP BY searchterm
                                  ORDER BY Number desc LIMIT 
    $from$max_results";

    } else {


         
    $sql "SELECT id, date, searchterm, count(*) AS Number
                      FROM zen_search_log
                           WHERE searchterm is not null and searchterm not like  ''

                            GROUP BY searchterm
                                  ORDER BY Number desc LIMIT 
    $from$max_results";}
      
    $result mysql_query($sql)
          or die (
    "invalid query: " mysql_error()); 
    replace with:

    PHP Code:
    $searchlog "SELECT id, date, searchterm, count(*) AS Number
                       FROM " 
    TABLE_SEARCHLOG "
                        WHERE searchterm is not null and searchterm not like  '' and date BETWEEN '
    $theDate' and   '$theDate2'
                     GROUP BY searchterm
                       ORDER BY Number desc
                     LIMIT 
    $from$max_results";

      } else {

       
    $searchlog "SELECT id, date, searchterm, count(*) AS Number
                       FROM " 
    TABLE_SEARCHLOG "
                        WHERE searchterm is not null and searchterm not like  ''
                     GROUP BY searchterm
                       ORDER BY Number desc
                     LIMIT 
    $from$max_results";
      } 
    ###### End of if statement.

       
    $result mysql_query($searchlog);

       if (!
    $result || $db->Recordcount() <= 0) {
       
    $messageStack->add_session(SEARCHLOG_FAILED_TO_SELECT_FIELDS'error');
       } 
    ###### End of if statement. 
    Then, find:

    PHP Code:
    echo "</table>"
    replace with:

    PHP Code:
    ?>
    </table>
    <?php
    Then, find:

    PHP Code:

    if (isset($dateone) && isset($datetwo)) {
    $total_results mysql_result(mysql_query("SELECT count( DISTINCT searchterm )
    FROM zen_search_log
    WHERE searchterm IS NOT NULL
    and date BETWEEN '
    $theDate' and   '$theDate2'
    AND searchterm NOT LIKE ''"
    ),0);
    } else {
    $total_results mysql_result(mysql_query("SELECT count( DISTINCT searchterm )
    FROM zen_search_log
    WHERE searchterm IS NOT NULL

    AND searchterm NOT LIKE ''"
    ),0);


    replace with:

    PHP Code:
    if (isset($dateone) && isset($datetwo) && $dateone != "0000-00-00" && $datetwo != "0000-00-00") {
    $total_results mysql_result(mysql_query("SELECT count( DISTINCT searchterm )
    FROM " 
    TABLE_SEARCHLOG "
    WHERE searchterm IS NOT NULL
    and date BETWEEN '
    $theDate' and   '$theDate2'
    AND searchterm NOT LIKE ''"
    ),0);
    } else {
    $total_results mysql_result(mysql_query("SELECT count( DISTINCT searchterm )
    FROM " 
    TABLE_SEARCHLOG "
    WHERE searchterm IS NOT NULL

    AND searchterm NOT LIKE ''"
    ),0);


    Then, find:

    PHP Code:
    echo "<center>Select a Page<br />"
    replace with:

    PHP Code:
    echo SEARCHLOG_SELECT_PAGE "<br />"
    Then, find:

    PHP Code:
    // Build Previous Link
    if($page 1){
        
    $prev = ($page 1);
        echo 
    "<a href=\"".zen_href_link(FILENAME_SEARCH_LOG"page=".intval(trim($prev))", "NONSSL")."\"><<Previous</a>&nbsp;";
    }

    for(
    $i 1$i <= $total_pages$i++){
        if((
    $page) == $i){
            echo 
    "$i&nbsp;";
            } else {
                echo 
    "<a href=\"".$_SERVER['PHP_SELF']."?page=$i\">$i</a>&nbsp;";
        }
    }

    // Build Next Link
    if($page $total_pages){
        
    $next = ($page 1);
        echo 
    "<a href=\"".$_SERVER['PHP_SELF']."?page=$next\">Next>></a>";


    Replace with:
    PHP Code:
    // Build Previous Link
    if($page 1) {
        
    $prev = ($page 1);
        echo 
    "<a href=\"".zen_href_link(FILENAME_SEARCH_LOG"page=".intval(trim($prev)), "NONSSL")."\">" SEARCHLOG_PREVIOUS_PAGE "</a>&nbsp;";
    }

    for(
    $i 1$i <= $total_pages$i++){
        if((
    $page) == $i) {
            echo 
    "$i&nbsp;";
            } else {
                echo 
    "<a href=\"".zen_href_link(FILENAME_SEARCH_LOG"page=".$prev"NONSSL")."\">" $i "</a>&nbsp;";
        }
    }

    // Build Next Link
    if($page $total_pages){
        
    $next = ($page 1);
        echo 
    "<a href=\"".zen_href_link(FILENAME_SEARCH_LOG"page=".intval(trim($next)), "NONSSL")."\">" SEARCHLOG_NEXT_PAGE "</a>";


    Then, from your admin/includes/extra_datafiles/searchlog.php file, make sure you have these readings:

    PHP Code:
    define('TABLE_SEARCHLOG''search_log');
    define('FILENAME_SEARCH_LOG''searchlog'); 
    Then, from your admin/includes/languages/extra_definitions/searchlog.php file, make sure you have these readings:

    PHP Code:
    define('BOX_REPORTS_SEARCH_LOG','Search Log');
    define('HEADING_TITLE','Search Log');
    define('DATE_RANGE''<strong>Date Range </strong>');
    define('MATCH_SEARCH_TERM''<strong>Match search term </strong>');
    define('MATCH_SEARCH''<strong>Search Match </strong>');
    define('NUMBER_TIMES_SEARCHED_FOR''<b>Number of times searched for</b>');
    define('GLOBAL_ACTIONS''<strong>Global Actions </strong>');
    define('INFO''<strong>Info</strong>');
    define('COMING_SOON''<strong>coming soon</strong>');
    define('ENTRY_DELETE_LINK''[ DELETE ] <b>cannot undo</b>');
    define('ENTRY_SEARCHLOG_DELETE_SUCCESSFUL''Success ! Selected item deleted:');
    define('ENTRY_SEARCHLOG_DELETE_FAILED''Error: Failed to delete the selected item named:');
    define('ENTRY_SEARCHLOG_ID_NOT_FOUND''Error: Search ID could not be found.');
    define('SEARCHLOG_FAILED_TO_SELECT_FIELDS''Error: Failed to select one or more fields from the ' TABLE_SEARCHLOG '. It might, also, be possible that your table is empty.');
    define('SEARCHLOG_DATE''<b>Date</b>');
    define('SEARCHLOG_ACTION''<b>Action</b>');
    define('SEARCHLOG_TOP_5''Search Log Top 5');
    define('SEARCHLOG_SELECT_PAGE''<center>Select a Page</center>');
    define('SEARCHLOG_PREVIOUS_PAGE''<< Previous');
    define('SEARCHLOG_NEXT_PAGE''Next >>');
    define('COPYRIGHT_AUTHOR_URL''Built by: <a href=\"http://www.seamless-packages.co.uk\">Seamless-packages</a><br />Author: Warren Lloyd <br />Version: 0.1 beta'); 
    Then, from your admin/includes/languages/extra_configures/searchlog.php file, make sure you have these readings:

    PHP Code:
    define('FILENAME_SEARCH_LOG''searchlog'); 
    Recall: This is NOT a new posted MOD but corrections from the first beta release.

  6. #26
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default Re: Search Log

    It would seem that I made a mistake on the 9th and 10th PHP code.

    Correction for these blocks:

    Find:

    PHP Code:
    echo "<table width=\"100%\" border=\"0\" cellpadding=\"4\" cellspacing=\"0\"> 
        <tr> 
            <td width=\"110\"><b>Search Term</b></td> 
            <td><b>Number of times searched for</b></td> 
            <td><b>Date</b></td> 
            <td><b>Action</b></td> 
        </tr>"

    $color1 "#BFD8BC"
    $color2 "#E0E0E0"
    $row_count 0
     if(!isset(
    $_GET['page'])){ 
        
    $page 1
    } else { 
        
    $page $_GET['page']; 


    // Define the number of results per page 
    if (isset($resultcount)) { 
       
    $max_results $resultcount
    } else { 
    $max_results 15


    // Figure out the limit for the query based 
    // on the current page number. 
    $from = (($page $max_results) - $max_results); 

    // Perform MySQL query on only the current page number's results 
    if (isset($theDate) && isset($theDate2)) { 
    replace with:

    PHP Code:
    <table width=\"100%\" border=\"0\" cellpadding=\"4\" cellspacing=\"0\">
        <tr>
            <td width=\"110\"><?php echo SEARCHLOG_TERM?></td>
            <td><?php echo NUMBER_TIMES_SEARCHED_FOR?></td>
            <td><?php echo SEARCHLOG_DATE?></td>
            <td><?php echo SEARCHLOG_ACTION?></td>
        </tr>
      <?php

      $color1 
    "#BFD8BC";
      
    $color2 "#E0E0E0";
      
    $row_count 0;

      if (!isset(
    $_GET['page']) || empty($_GET['page'])) {
      
    $page 1;
      } else {
      
    $page intval(trim($_GET['page']));
      } 
    ###### End of if statement.

      // Define the number of results per page
      
    if (isset($resultcount) && $resultcount != 0) {
      
    $max_results intval(trim($resultcount));
      } else {
      
    $max_results 15;
      } 
    ###### End of if statement.

      // Figure out the limit for the query based
      // on the current page number.
      
    $set_page intval(trim($page));
      
    $set_max_results intval(trim($max_results));
      
    $from = (isset($set_page) && isset($set_max_results) && $set_page != && $set_max_results != 0) ? ($set_page $set_max_results) - $set_max_results) : 0;
      
    $set_from = (isset($from)) ? trim($from) : "";

      
    // Perform MySQL query on only the current page number's results
      
    if ($_SESSION['admin_id'] && isset($theDate) && isset($theDate2) && $theDate != "0000-00-00" && $theDate2 != "0000-00-00") {
    My apologize for this forgotten step.

  7. #27
    Join Date
    Jun 2006
    Posts
    7
    Plugin Contributions
    0

    Default Re: Search Log

    questions:

    1. how to save utf8 search log?

    2. the update contribution is not table name flexible, can you make it to be?

    I just went through this mod and really appriciate the efforts.

  8. #28
    Join Date
    Feb 2005
    Location
    West Yorkshire, UK
    Posts
    70
    Plugin Contributions
    0

    Default Re: Search Log

    Hi nick80

    I'm going to be working on the script later today. So should have some updates for you later...
    Also can you elaberate on question 1?

    Cheers
    ---------------------------------------------
    www.seamless-packages.co.uk

  9. #29
    Join Date
    Aug 2004
    Posts
    1,590
    Plugin Contributions
    1

    Default Re: Search Log


    1. how to save utf8 search log?

    can you elaberate on question 1?
    Similar to the Email Exporter MOD - created by DrByte. Nick80 is looking to export the search logs readings into either, CSV, XML, HTML ect ...

  10. #30
    Join Date
    Jun 2006
    Posts
    7
    Plugin Contributions
    0

    Default Re: Search Log

    about UTF8 search log, I mean the search keywords is in UTF8 format instead of normal ASCII format.

    right now, the keywords in UTF8 format are not stored into the database correctly.

    so, please look into this UTF8 issues.

    thanks.

 

 
Page 3 of 10 FirstFirst 12345 ... LastLast

Similar Threads

  1. Customer Search Log
    By CJPinder in forum Addon Admin Tools
    Replies: 60
    Last Post: 27 Jan 2023, 11:06 PM
  2. log of Search history
    By Genzai in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 14 May 2009, 08:08 PM
  3. Search log mod vs. user tracking
    By ashton0603 in forum General Questions
    Replies: 4
    Last Post: 30 Jan 2008, 08:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg