I have amended the Zenphoto website files tremendously. I have installed netbeans and want to mimic a search for 'kenya' using the Zenpage theme. Adding the below to the top of the index.php (root)doesnt help. Somehow Search words is empty/null.
$_POST = array("words" => 'kenya',"inalbums" => NULL ,"SEARCH_country" => 'country',"SEARCH_desc" => 'desc',"SEARCH_location" => 'location',"SEARCH_state" => 'state', "SEARCH_tags" => 'tags',"SEARCH_title" => 'title');
$_GET = array("p" => 'search');
Please help.
Regards
You are not really talking about the root index.php file. You hopefully mean the theme's index.php. You should NEVER hack the index.php file or any other core files. If you need extra functionality built them into your theme or use plugins.
Add that on the root index.php surely will not work as that is outside the theme context. Try the theme's index.php.
And also see the documentation of the SearchEngine class:
http://www.zenphoto.org/documentation/classes/SearchEngine.html
I don't really understand what you wish to accomplish. But if all you want to do is prime the search engine with a set search [which is all your above code would do if it would work], use the object model to set the appropriate search conditions. This can be done anywhere, so you can put it in your theme and leave the rest of Zenphoto alone.
But then what do you do with this, priming the search engine dose nothing by itself. If you really want the "home" page of your site to be the result of this search then you will have to also cause your them to load its search script or modify the them index.php to mimic the search script.
But the bottom line is this: There is no call for inserting this or other code into the Zenphoto core scripts. Read up on the plugin system and on filtering as these are the mechanisms Zenphoto provides for altering its behavior. Modifying the core just makes your site unsupportable and limits your ability to upgrade Zenphoto (something necessary if you expect to benifit from any fixes or enhancements we make.)