Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 08:38 am EDT

Geeklog Forums

Search Word Ranking Plugin


Status: offline

Roccivic

Forum User
Moderator
Registered: 05/19/10
Posts: 136
Hi All,
I've just finished writing a plugin that implements a log for search queries and provides an optional phpblock to display the top N results. And I would be very thankful, if you would download it, give it a go and let me know what you make of it.

Features:
  • Provides a Right Block, a Left Block or Nothing (to silently log the queries).
  • Items in the block are clickable.
  • Provides a log viewer and an option to clear the log.
  • Groups hits to save disk space and be faster.
  • Deletes entries after N days.
  • Supports MySQL and PgSQL.
Requires:
  • Geeklog 1.6.0+ for MySQL.
  • Geeklog 1.7.0+ for PgSQL.
Download:Oh, and I guess that I should mention that this is the very first Geeklog plugin that I made Big Grin

Rouslan

EDIT @ 1-JUL-2011: New version also available:

Download: http://code.google.com/p/geeklog/downloads/detail?name=searchrank_1.1.0_1.6.0.tar.gz

New in 1.1.0:
  • Better database performance
  • Better log viewer
  • Option to show top ten search queries in the site statistics
  • Proper CSS layout
  • Some new configuration settings
  • Some updated icons
  • Some small bugfixes
  • Bulgarian translation
  • Italian translation
  • German translation
  • Japanese translation
  • Portuguese translation
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Hi,

I downloaded the plugin. Automatic install was not possible certainly due to the folder name searchrank_1.0.0_1.6.0
You must rename the folder searchrank before make your archive (.tar.gz or zip)

I like your code to go to the configuration area :
Text Formatted Code

<form name='searchrank_conf_link' action='{$_CONF['site_admin_url']}/configuration.php' method='POST'>"
         . "<input type='hidden' name='conf_group' value='searchrank'></form>"

         . "<div style='text-align: center; margin: 10px; width: 200px;'>"
         . "<a style='text-decoration: none;' href='#' onclick=\"document.searchrank_conf_link.submit()\">"
         . "<img alt='' src='{$imgpath}/configuration.png'" . XHTML . "><br" . XHTML . ">{$LANG_SEARCHRANK_1['conf_link']}</a>
 


I also found a bug. Apostrophe are not escape in search query.

Very nice plugin :shakehands:

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

Roccivic

Forum User
Moderator
Registered: 05/19/10
Posts: 136
Quote by: cordiste

Automatic install was not possible certainly due to the folder name searchrank_1.0.0_1.6.0


Thanks Ben, I recompressed the package the correct way. It should work now Smile

Quote by: cordiste

I also found a bug. Apostrophe are not escape in search query.


Could you please clarify where the problem is. I used "addslashes" when saving to and "stripslashes" when retrieving from the database. So I'm not sure about where this problem is manifesting itself. Thanks.

Rouslan
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Oups sorry it is a bud from the forum plugin.

If I try a search on "Roccivic's first plugin" with forum plugin 2.7.4 enable, I get a SQL error:
Text Formatted Code

An error has occurred:
This is being displayed as "Root Debugging" is enabled in your Geeklog configuration.

If this is a production website you must disable this option once you have resolved any issues you are investigating.

256 - An SQL error has occurred. Please see error.log for details. @ C:\wamp\www\geeklog-1.7.1\system\databases\mysql.class.php line 260

array(3) {
  ["sql"]=>
  string(202) "SELECT id,name,forum,date,subject,comment,views,uid FROM gl_forum_topic  WHERE 1=1 AND (comment LIKE '%Roccivic's first plugin%' OR subject LIKE '%Roccivic's first plugin%') ORDER BY date DESC LIMIT 0,5"
  ["ignore_errors"]=>
  int(0)
  ["result"]=>
  bool(false)
}
 


Very usefull plugin :shakehands:

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
How to only display the Most Searched block to root user?

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

Roccivic

Forum User
Moderator
Registered: 05/19/10
Posts: 136
Quote by: cordiste

How to only display the Most Searched block to root user?

::Ben


I think that in file functions.inc, near line 309, you should change the following:
Text Formatted Code
        SEARCHRANK_housekeeping();
    $retval = array();
    if ($_SR_CONF['showblock']) {
        if (($side=='left' && $_SR_CONF['isleftblock'] == 1) || ($side=='right' && $_SR_CONF['isleftblock'] == 0)) { // Create a block
            $results = SEARCHRANK_getResults(0, $_SR_CONF['maxresults']);

to
Text Formatted Code
        SEARCHRANK_housekeeping();
    $retval = array();
    if ($_SR_CONF['showblock'] && SEC_inGroup('Root')) {
        if (($side=='left' && $_SR_CONF['isleftblock'] == 1) || ($side=='right' && $_SR_CONF['isleftblock'] == 0)) { // Create a block
            $results = SEARCHRANK_getResults(0, $_SR_CONF['maxresults']);


I can make it a configuration option for next version Smile

Rouslan
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
A good idea for a plugin. I have always wondered what the top search queries are for my sites are to help better organize them.

Tom
One of the Geeklog Core Developers.
 Quote

Ales

Anonymous
Congratulations, this is surely one of the most useful plugins, and longest expected
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Quote by: Roccivic

I can make it a configuration option for next version Smile



Thanks, It will be a nice feature.

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Idea Side and order sorting for this block would be also very usefull.

Thanks,

::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

Roccivic

Forum User
Moderator
Registered: 05/19/10
Posts: 136
Quote by: Laugh

A good idea for a plugin. I have always wondered what the top search queries are for my sites are to help better organize them.


I think it was Ivy's and Dirk's idea Smile

http://project.geeklog.net/tracking/view.php?id=1279

Quote by: cordiste

Idea Side and order sorting for this block would be also very usefull.


You can already choose if you want to show a right block or a left block in the settings. It's worded a bit awkward though, I guess.
You can set "Display Block on Left" to false to show the block on right. Smile

And I agree, the block order should also be a configuration setting, so I will add it in.

Rouslan
 Quote

Status: offline

ivy

Forum User
Full Member
Registered: 11/25/04
Posts: 314
Location:Tokyo Japan
Hi Roccivic,

Thank you so much!

http://www.ivywe.co.jp/downloads/index.php/Search_Word_Ranking
I uploaded Japanese language file for this plugin.
Geeklog Japan https://www.geeklog.jp
 Quote

Status: offline

Roccivic

Forum User
Moderator
Registered: 05/19/10
Posts: 136
Quote by: ivy

I uploaded Japanese language file for this plugin.


Hi Ivy,

Thank you very much for the translation, it very appreciated.
I will include it in the next version of the plugin for sure Smile

Rouslan
 Quote

Status: offline

Roccivic

Forum User
Moderator
Registered: 05/19/10
Posts: 136
This plugin now has a home here: http://code.google.com/p/geeklog/ and the development of version 1.1.0 has already started. Feel free to submit bug reports, feature requests and patches to the tracker here: http://code.google.com/p/geeklog/issues/list

Rouslan
 Quote

Status: offline

Roccivic

Forum User
Moderator
Registered: 05/19/10
Posts: 136
I've just packaged version 1.1.0 of the Search Word Ranking plugin and uploaded it to Google Code.

Download: http://code.google.com/p/geeklog/downloads/detail?name=searchrank_1.1.0_1.6.0.tar.gz

New in 1.1.0:
  • Better database performance
  • Better log viewer
  • Option to show top ten search queries in the site statistics
  • Proper CSS layout
  • Some new configuration settings
  • Some updated icons
  • Some small bugfixes
  • Bulgarian translation
  • Italian translation
  • German translation
  • Japanese translation
  • Portuguese translation
 Quote

All times are EDT. The time is now 08:38 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content