Extension:KeepSearches

From MediaWiki.org

Jump to: navigation, search

         

Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
KeepSearches

Release status: stable

Implementation  Database, Search
Description Keeps in database and counts all the searches made by users in your mediawiki
Author(s)  MP2P Technologies S.A. (Daniel Remeseiro)
Last Version  1.0 (6th August 2009)
MediaWiki  1.13.2
License GNU General Public License 3.0 or later
Download http://soundshare.googlecode.com/svn/trunk/www/extensions/KeepSearches/

check usage (experimental)

Contents

[edit] What can this extension do?

KeepSearches Extension keeps into the mediawiki database, counts the times, and get the last date-time, all the query searches made by users in your mediawiki. This extension comes with a "most searched terms tag cloud" render function, see instructions below to print the tag cloud on your mediawiki skin.

Important: This extension does not work when ajax search is enabled.

[edit] Installation

  1. Download the files from SVN and place them in $IP/extensions/KeepSearches/
  2. Add the following to LocalSettings.php:
require_once("$IP/extensions/KeepSearches/KeepSearches.php");

[edit] Database table creation

Open a console, go to the KeepSearches extension directory and run this command:

php install.php

If everything goes fine, you will see this message:

The table 'keep_searches' has been set up correctly.

You must run this script to create the keep_searches table, and this is mandatory to use this extension properly.

[edit] How to print the "most searched terms tag cloud"

This extension comes with a "most searched terms tag cloud" render function

Just use it into your skin (/skins/YourSkinName.php file) like this (it`s an example, you can change the numbers):

(you have to edit your main php theme : example if your theme is monobook : /skins/MonoBook.php)


<?php generateTagCloudSearches ( 40, 0 ); ?>

or without php start and end tags if you want to include the cloud into php itself

generateTagCloudSearches ( 40, 0 );

Where the first param is $SIZE_LIST , the number of the items in the list (top 10, or top 20, etc...) and ths second param is $SIZE_OFFSET , the number where start to count on the list.

[edit] css sample for cloud tag

Add this classes to your css file to format your tag cloud:

.tagcloud {
  list-style-type:none;
  margin:0;
  width: 200px;
  text-align:left;  
}

.tagcloud li {
  display:inline; 
}

.tagcloud ul, ol {
  list-style-image:none;
  list-style-position:outside;
  list-style-type:none;
  margin:0;
  padding:0;
}

.tagcloud a {
  color: #999;
  font-weight: bold;
  padding-right:2px;
}



Please don't hesitate to contact me : daniel [at] mp2p.net