====== Adding a Page Search ====== If you are using a plugin like Evil_Blog or Additional_Pages you have the problem, that pages created with theses plugins are not included in the standard Piwigo search.\\ In other words: If you have created a kind of blog, your blog articles are not found within the Piwigo search.\\ \\ One solution might be to include a external search engine, but probably those external solutions have some limitations (adding ads, limited indexing etc.).\\ Here is another way how you can add a 'page search' to your Piwigo gallery:\\ \\ Before we start:\\ * To make things easier you should install and enable the FCK editor plugin. * The steps below are based on my Piwigo installation with Additional_Pages and Evil_Blog installed. * Although the solution works on my installation, I can not give any guarantee that it will work with your Piwigo gallery * There will also be no guarantee if this solution will cause security issues within your Piwigo gallery * Because we are adding some pages to the Piwigo installation you will do this at your own risk - be sure to have a backup of your Piwigo installation \\ \\ Now let's go:\\ **Step 1 - Creating the search form:**\\ \\ The style adjustments you see below are created to fit into the 'Stripped' template. If you use a different template you will have to modifiy it. Also you might have to change the german descriptions I have used.\\ In an editor like notepad++ create a html page with the content shown below:\\ Search

   

 

 

 

\\ Save the html page as:\\ search.html\\ Create a new folder within your Piwigo installation named:\\ search\\ and upload the search.html you have created to this folder.\\ \\ **Step 2 - Including it into Piwigo**\\ \\ Create a new page with the Additional_Pages plugin and name this page something like 'page search'.\\ Have a look in the editor menu bar for the IFrame icon and add the search.html as the iframe source.\\ Change the properties of the iframe to fit your needs. My source code for the iframe looks like:\\

\\ You will need to modify 'yourdomain' to your domain name :-)\\ \\ **Step 3 - the results page**\\ \\ Note: You will change the parameters for $Verbindung to your data.\\ You might also want to change the german description, page title etc.\\ We will search the database table 'evil_blog' here. You might need to change it too.\\ Pixel Wonders | Search Results  

Nothing entered."); // sql statement erstellen $srequest = sprintf("SELECT * FROM `evil_blog` WHERE `%s` = '%s'", $feld, $searchitem); $srequest = sprintf("SELECT * FROM `evil_blog` WHERE `header` LIKE '%s'", '%'.$searchitem.'%'); $srequest = sprintf("SELECT * FROM `evil_blog` WHERE `text` LIKE '%s'", '%'.$searchitem.'%'); $sresult = mysql_query($srequest); echo ''; echo ""; if(mysql_num_rows($sresult) > 0) { while($row = mysql_fetch_object($sresult)) { echo ''; echo ""; echo ''; } } else { echo "For your search: '".$_POST["searchitem"]."' nothing was found."; } echo '
Search Results for: ".$_POST["searchitem"].":
id\" target=\"_parent\">$row->header
'; mysql_close($sconnection); ?>
\\ Save the file as results.php and upload it to the search folder created before.\\ \\ ** Important:**\\ Take the results.php as a starting point for creating your own page search.Depending on rewrite rules or settincs in the local file editor (php extension, question mark in urls etc) you will have to make adjustmens to get it working!\\ Especially the display of the search results is depending on the adjustments you have made before. The results table:\\ echo "id\" target=\"_parent\">$row->header"; echo ''; is an example for this. Hint:\\ Simply look at the url displayed for your evil_blog and adjust the settings.\\ \\ \\ ** Finally:**\\ Again: Following the steps decribed here will be at your own risk!\\ The files created here will not be updated automatically when a new Piwigo release comes out.\\ I am pretty sure that a search described here is not the non-plus-ultra-solution, so take it as it is:\\ Only one possibility how you can extend the Piwigo search.\\ \\ By modifying the search.tpl of the stripped template you can embedd the search form into the search template as I did it on my site:\\ http://www.pixel-wonders.de/search.php \\ Just have a look in the search.tpl file in the stripped folder.\\ \\ You can also add a 'New search' button to the results.php which reloads the search form by adding:\\ Neue Suche Just after the style definition (around line 20) in the results.php\\ **Important:**You should really consider to store the database connection data in a separate file and include it with the include_once command!! \\ \\ Cheers\\ Ralf\\ \\ If you have any questions or enhancements please feel free to use the contact form on:\\ http://www.pixel-wonders.de