imhodad / dokuwiki-plugin-searchstats Goto Github PK
View Code? Open in Web Editor NEWDokuwiki Plugin that stores search keywords and displays stats in admin backend.
Dokuwiki Plugin that stores search keywords and displays stats in admin backend.
Plugin dose not work with Hogfather Release
Currently there's no start / end time displayed for the statistics.
It would be of great help to know, which period of time the statistics cover.
TypeError: closedir(): Argument #1 ($dir_handle) must be of type resource or null, bool given
An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the searchstats plugin.
More info has been written to the DokuWiki error log.
2022-02-05 22:39:07TypeError: closedir(): Argument #1 ($dir_handle) must be of type resource or null, bool given /usr/local/www/wiki/lib/plugins/searchstats/helper.php(63)
#0 /usr/local/www/wiki/lib/plugins/searchstats/helper.php(63): closedir()
#1 /usr/local/www/wiki/lib/plugins/searchstats/action.php(34): helper_plugin_searchstats->getSearchWordArray()
#2 /usr/local/www/wiki/lib/plugins/searchstats/admin.php(32): action_plugin_searchstats->getSearchWordArray()
#3 /usr/local/www/wiki/inc/Action/Admin.php(33): admin_plugin_searchstats->handle()
#4 /usr/local/www/wiki/inc/ActionRouter.php(83): dokuwiki\Action\Admin->preProcess()
#5 /usr/local/www/wiki/inc/ActionRouter.php(48): dokuwiki\ActionRouter->setupAction()
#6 /usr/local/www/wiki/inc/ActionRouter.php(60): dokuwiki\ActionRouter->__construct()
#7 /usr/local/www/wiki/inc/actions.php(16): dokuwiki\ActionRouter::getInstance()
#8 /usr/local/www/wiki/doku.php(122): act_dispatch()
#9 {main}
Currently there seems to be no easy way of resetting the statistics via the admin area.
It would be helpful, if the search statistics could be reset via a button on the search statistics page.
I'm using the Plugin in a Farm setup and had to change the save folder location.
I don't know if $conf['indexdir'] is a sensible place for it, but maybe one could even remove the Plugins config option?
Anyway, here's the patch:
diff -urN -x'*~' searchstats/conf/default.php /usr/local/www/dokuwiki/lib/plugins/searchstats/conf/default.php
--- searchstats/conf/default.php 2010-09-15 21:08:40.000000000 +0200
+++ /usr/local/www/dokuwiki/lib/plugins/searchstats/conf/default.php 2010-12-22 12:49:52.000000000 +0100
@@ -3,6 +3,6 @@
* Options for the searchstats plugin
*/
-$conf['searchstats_savefolder'] = 'data/index/searchstats'; // sets folder where search words are stored
+$conf['searchstats_savefolder'] = 'searchstats'; // sets folder where search words are stored
-?>
\ No newline at end of file
+?>
diff -urN -x'*~' searchstats/helper.php /usr/local/www/dokuwiki/lib/plugins/searchstats/helper.php
--- searchstats/helper.php 2010-09-15 21:08:40.000000000 +0200
+++ /usr/local/www/dokuwiki/lib/plugins/searchstats/helper.php 2010-12-22 12:50:51.000000000 +0100
@@ -69,9 +69,10 @@
}
function _getSaveFolder() {
- return $this->getConf('searchstats_savefolder');
+ global $conf;
+ return $conf['indexdir'].'/'.$this->getConf('searchstats_savefolder');
}
}
-?>
\ No newline at end of file
+?>
I added a dirty little fix for the "2nd parameter" issue by adding the missing "$Indexer" according to how the function is used in http://xref.dokuwiki.org/reference/dokuwiki/inc/fulltext.php.source.html#l38
--- action.php~ 2010-12-22 12:44:03.000000000 +0100
+++ action.php 2011-06-29 17:33:10.000000000 +0200
@@ -43,7 +43,7 @@
* @author Michael Schuh <[email protected]>
*/
function _getSearchWords(&$event, $param) {
- $q = ft_queryParser($event->data['query']);
+ $q = ft_queryParser(idx_get_indexer(),$event->data['query']);
if(is_array($q['highlight'])) {
$this->_checkSaveFolder();
foreach($q['words'] as $saveWord) {
there is no test if "bcmath" is available - other plugins check for their PHP dependencies and "msg" when something is missing.
I just got PHP errors in Admin page until I installed bcmath.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.