Posted on: 02/28/11 04:15pm
By: Roccivic
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
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[*2]
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
Re: Search Word Ranking Plugin
Posted on: 03/01/11 02:59am
By: ::Ben
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
Re: Search Word Ranking Plugin
Posted on: 03/01/11 08:54am
By: Roccivic
Quote by: cordisteAutomatic 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
Quote by: cordisteI 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
Re: Search Word Ranking Plugin
Posted on: 03/01/11 01:09pm
By: ::Ben
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
Re: Search Word Ranking Plugin
Posted on: 03/01/11 05:53pm
By: ::Ben
How to only display the Most Searched block to root user?
::Ben
Re: Search Word Ranking Plugin
Posted on: 03/01/11 07:29pm
By: Roccivic
Quote by: cordisteHow 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
Rouslan
Re: Search Word Ranking Plugin
Posted on: 03/01/11 07:30pm
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.
Tom
Re: Search Word Ranking Plugin
Posted on: 03/02/11 01:31am
By: Anonymous (Ales)
Congratulations, this is surely one of the most useful plugins, and longest expected
Re: Search Word Ranking Plugin
Posted on: 03/02/11 02:37am
By: ::Ben
Quote by: Roccivic
I can make it a configuration option for next version
Thanks, It will be a nice feature.
::Ben
Re: Search Word Ranking Plugin
Posted on: 03/02/11 03:05am
By: ::Ben

Side and order sorting for this block would be also very usefull.
Thanks,
::Ben
Re: Search Word Ranking Plugin
Posted on: 03/02/11 01:25pm
By: Roccivic
Quote by: LaughA 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
http://project.geeklog.net/tracking/view.php?id=1279[*3]
Quote by: cordiste
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.
And I agree, the block order should also be a configuration setting, so I will add it in.
Rouslan
Re: Search Word Ranking Plugin
Posted on: 03/03/11 11:20am
By: ivy
Re: Search Word Ranking Plugin
Posted on: 03/03/11 05:26pm
By: Roccivic
Quote by: ivyI 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
Rouslan
Re: Search Word Ranking Plugin
Posted on: 05/23/11 08:45am
By: Roccivic
Re: Search Word Ranking Plugin
Posted on: 07/01/11 02:11pm
By: Roccivic
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[*2]
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