Open main menu

Extension:KeepSearches

MediaWiki extensions manual
OOjs UI icon alert-invert.svg
KeepSearches
Release status: unstable
Implementation Database, Search
Description Keeps in database and counts all the searches made by users in your mediawiki
Author(s) Daniel Remeseiro
Latest version 1.0 (2009-08-05)
MediaWiki 1.13.2
License GNU General Public License 3.0 or later
Download http://soundshare.googlecode.com/svn/trunk/www/extensions/KeepSearches/
Translate the KeepSearches extension if it is available at translatewiki.net
Check usage and version matrix.

Contents

What can this extension do?Edit

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.

Broken?Edit

Extension dont run under MW 1.16.

No Reply on Discussion Page!

InstallationEdit

  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");

Database table creationEdit

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.

How to print the "most searched terms tag cloud"Edit

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.

css sample for cloud tagEdit

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;
}