[pmwiki-users] "facetted search"

Patrice PELLE patrice-pelle at bbox.fr
Sun Jan 10 05:25:23 CST 2016


Good morning and best wishes for this new year

At the present time, I’m working on a new project,, inspired bus this site http://www.souslesmers.fr/ <http://www.souslesmers.fr/>   -> Recherche avancée, but with my own pictures and « discoveries ». The main idea is to try identifying what I have seen underwater (and pictured) more quickly than going through books (which I will have to do to populate the « database » prior to the dives. But it is also a way to learn marine life).

I created  some forms to create new Poissons (fishes), Vers (Worms) and nudibranchs based on fox cookbook contacts examples. They are working.

Then, I wanted to create a « facetted search » on the Poissons.Poissons page (the test form includes only 3 criteria among the 10 I used to identify a fish)


J’ai créé le formulaire suivant sur la page « Poissons.Poissons »

	(:fox formulaire  ptvupdate=0 template=CherchePoisson#display  ptvclear=1:)
	!!Caractéristiques
	||'''Lieu : '''||(:input select name=$:lieu value="*" label="*":)
	(:input select name=$:lieu value="Atlantique" label="Atlantique":)
	(:input select name=$:lieu value="Méditerranée" label="Méditerranée":)
	(:input select name=$:lieu value="Indo-Pacifique" label="Indo-Pacifique":)||
	||'''Forme :'''||(:input select name=$:forme value="*" label="*":)
	(:input select name=$:forme value="Corps fuselé" label="Corps fuselé":)
	(:input select name=$:forme value="Corps comprimé latéralement" label="Corps comprimé latéralement":)
	(:input select name=$:forme value="Corps allongé" label="Corps allongé":)
	(:input select name=$:forme value="Corps en forme de gourdin" label="Corps en forme de gourdin":)
	(:input select name=$:forme value="Corps robuste/Ovale" label="Corps robuste/ovale":)
	(:input select name=$:forme value="Corps plat" label="Corps plat":)||
	||'''Taille :'''||(:input select name=taille value="*" label="*":)
	(:input select name=$:taille value="*" label="*":)
	(:input select name=$:taille value="Inférieure 10cm" label="Inférieure 10cm":)
	(:input select name=$:taille value="10-20cm" label="10-20cm":)
	(:input select name=$:taille value="20-30cm" label="20-30cm":)
	(:input select name=$:taille value="30-40cm" label="30-40cm":)
	(:input select name=$:taille value="40-50cm" label="40-50cm":)
	(:input select name=$:taille value="50-60cm" label="50-60cm":)
	(:input select name=$:taille value="60-70cm" label="60-70cm":)
	(:input select name=$:taille value="70-80cm" label="60-80cm":)
	(:input select name=$:taille value="80-90cm" label="80-90cm":)
	(:input select name=$:taille value="90-100cm" label="90-100cm":)
	(:input select name=$:taille value="Supérieure 1m" label="Supérieure 1m":)

	(:input submit post Enter:)

	(:foxend formulaire:)

As you see, this form is calling the page « Poissons.CherchePoisson » which includes the following :

	(:nogroupheader:)

	[[#display]]
	(:pagelist taille={$$taille} lieu={$$lieu}:)

	[[#displayend]]

The first search « Lieu=* » « Forme=* » « Taille Inférieur 10cm » is giving the expected result. The second search is also giving the proper result, except that it is piled under the previous one which is not deleted. I give you the content of the « Poissons.Poissons » page after the second search :


(:fox formulaire  ptvupdate=0 template=CherchePoisson#display  ptvclear=1:)
	!!Caractéristiques
	||'''Lieu : '''||(:input select name=$:lieu value="*" label="*":)
	(:input select name=$:lieu value="Atlantique" label="Atlantique":)
	(:input select name=$:lieu value="Méditerranée" label="Méditerranée":)
	(:input select name=$:lieu value="Indo-Pacifique" label="Indo-Pacifique":)||
	||'''Forme :'''||(:input select name=$:forme value="*" label="*":)
	(:input select name=$:forme value="Corps fuselé" label="Corps fuselé":)
	(:input select name=$:forme value="Corps comprimé latéralement" label="Corps comprimé latéralement":)
	(:input select name=$:forme value="Corps allongé" label="Corps allongé":)
	(:input select name=$:forme value="Corps en forme de gourdin" label="Corps en forme de gourdin":)
	(:input select name=$:forme value="Corps robuste/Ovale" label="Corps robuste/ovale":)
	(:input select name=$:forme value="Corps plat" label="Corps plat":)||
	||'''Taille :'''||(:input select name=taille value="*" label="*":)
	(:input select name=$:taille value="*" label="*":)
	(:input select name=$:taille value="Inférieure 10cm" label="Inférieure 10cm":)
	(:input select name=$:taille value="10-20cm" label="10-20cm":)
	(:input select name=$:taille value="20-30cm" label="20-30cm":)
	(:input select name=$:taille value="30-40cm" label="30-40cm":)
	(:input select name=$:taille value="40-50cm" label="40-50cm":)
	(:input select name=$:taille value="50-60cm" label="50-60cm":)
	(:input select name=$:taille value="60-70cm" label="60-70cm":)
	(:input select name=$:taille value="70-80cm" label="60-80cm":)
	(:input select name=$:taille value="80-90cm" label="80-90cm":)
	(:input select name=$:taille value="90-100cm" label="90-100cm":)
	(:input select name=$:taille value="Supérieure 1m" label="Supérieure 1m":)

	(:input submit post Enter:)

	(:foxend formulaire:)
	(:pagelist taille=Inférieure 10cm lieu=*:)
	(:pagelist taille=Supérieure 1m lieu=*:)


I’m trying another way, using sqlite, dataquery, dataplates and ZAP cookbooks. I created a new test site with the latest pmwiki version (2.2.83) using MAMP 3.4 (PHP 5.6.1) on Mac OS X Yosemite. I have created a config.php file as follow :

<?php if (!defined('PmWiki')) exit();
$WikiTitle = "Essai";


# Uncomment these if needed
## Use "Clean URLs".
$EnablePathInfo = 1;
$ScriptUrl = "http://localhost:8888/pmwiki/pmwiki.php <http://localhost:8888/pmwiki/pmwiki.php>";
#$ScriptUrl = 'http://example.com/pmwiki/pmwiki.php' <http://example.com/pmwiki/pmwiki.php'>;
#$PubDirUrl = 'http://example.com/pmwiki/pub' <http://example.com/pmwiki/pub'>;

$DefaultPasswords['admin'] = pmcrypt('root');

$EnableUpload = 1;
$DefaultPasswords['upload'] = pmcrypt('root');



///////////////////////////////////////////

## Unicode (UTF-8) allows the display of all languages and all alphabets.
include_once("scripts/xlpage-utf-8.php");
//include_once("scripts/xlpage-iso-8859-2.php");



 ##---------------Francisation ------------------------------------
//XLPage('fr','PmWikiFr.XLPage'); // Les chaînes de PmWiki
//XLPage('fr','PmWikiFr.XLPageCookbook'); // Les chaînes de PmWiki

///////////////////////////////////////////

##---Création de sous-dossiers XML--##
$EnablePageStoreXML = 1;
include_once('cookbook/XMLPageStore.php');

//$WikiDir = new XMLPageStore('$FarmD/wiki.d/{$Group}/{$FullName}');

##---Sqlite---##
include_once("$FarmD/cookbook/sqlite.php");
$WikiDir = new PageStoreSQLite($WorkDir.'/pmwiki.sqlite.db', 1);
$WikiLibDirs = array(
  &$WikiDir,
  new PageStore('wiki.d/{$FullName}'),
  new XMLPageStore('$FarmD/wiki.d/{$Group}/{$FullName}'),
  new PageStore('$FarmD/wikilib.d/{$FullName}')
);


## formulaires ZAP et databases##
$Databases['$FarmD/wiki.d/pmwiki.sqlite.db'] =  array(
  'driver' => 'sqlite',
  'hostname' => 'localhost',
  'database' => '$FarmD/wiki.d/pmwiki.sqlite.db'
  'username' => 'admin',
  'password' => 'root');

$DQglobals['scriptfile'] = "$PubDirUrl/dFilter.js";
include "$FarmD/cookbook/dataquery.php";
include "$FarmD/cookbook/dataplates.php";
include "$FarmD/cookbook/zap.php";
include "$FarmD/cookbook/zaptoolbox.php »;

The site is not working (blank pages)


Note that I tried numerous combinations of the $Databases array :

	$Databases['$FarmD/wiki.d/pmwiki.sqlite.db’] or pmwiki, ou pmwikir.sqlite or pmwikir.sqlite.db
 	hostname : localhost, localhost:8888, localhost:8888/pmwiki, localhost:8888/pmwiki/pmwiki.php
	database : cf first line
	username et password : with or without

Thanks for your help and sorry for the language mistakes, as English is not my mother tongue.

Sincerely yours

Patrice PELLE
patrice-pelle at bbox.fr <mailto:patrice-pelle at bbox.fr>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20160110/5d9f8e46/attachment-0001.html>


More information about the pmwiki-users mailing list