This was re-posteed in this form by request.
The following is related to a Xoops website. I have posted on that forum with out any replies on over a week. I am not a programmer but I am fully capable of modifying code.
RE: Xoops 2.0.16 running xcGallery 2.03 module
I would like to add pre-selected search terms in a drop down list that user can use to search via selection OR manually enter other keyword criteria in an exiting field that already exists in the code that works.
Because this is an art gallery site. Some of the pre-selectable search terms needed in the drop down list should be things like: Abstract, Landscapes, Photography etc.
I have successfully added the drop down list (see code below) but I do not know how to do the coding to get it to query the DB and display the results just as the normal manual entry keyword search works when clicking the submit search button.
I would like to have the user select something from the list and then click the search button OR once they let go of the selection from the list the search begins automatically. Either one would be fine.
============================================================
<div align="center">
<table border="1" width="400" bordercolor="#1D829C" id="table2" cellpadding="10">
<tr>
<td>
<p align="center">Please enter a search criteria to fulfill your project needs.<br />
You may search by color, style, genre, artist, media, etc.</p>
<form bordercolor="#1D829C" style="margin 0; padding: 0;" method="get" action="thumbnails.php" >
<div bordercolor="#1D829C" align="center">
<table width="400" cellspacing="1" cellpadding="0" style="width: 100%;">
<tr>
<td align="center" class="foot">
BEGIN NON-WORKING CODE
<select size="1" name="search" class="textinput">
<option value="Abstract">Abstract</option>
<option value="Landscape">Landscape</option>
<option value="Photography">Photography</option>
</select>
END NON-WORKING CODE
<input type="input" style="width: 216; height: 22" name="search" maxlength="255" value="" class="textinput" />
<input type="submit" value="Submit Search" class="button" />
</td>
</tr>
</table>
</div>
<input type="hidden" name="type" value="full" />
<input type="hidden" name="album" value="search" />
</form>
</td>
</tr>
</table>
</div>
============================================================
The Search.php file code is as follows:
===========================================================
<?php
include "../../mainfile.php";
define('IN_XCGALLERY', true);
require('include/init.inc.php');
$xoopsOption['template_main'] = 'xcgal_search.html';
include XOOPS_ROOT_PATH."/header.php";
$xoopsTpl->assign('xoops_module_header', $xcgal_module_header);
$xoopsTpl->assign('search_title', _MD_SEARCH_TITLE);
user_save_profile();
$xoopsTpl->assign('gallery', $xoopsModule->getVar('name'));
include_once "include/theme_func.php";
main_menu();
do_footer();
include_once "../../footer.php";
?>
===========================================================
The main.php language file has the following line that refers to the form fields
define("_MD_SEARCH_TITLE","Search the image collection");
I tried adding the following and it breaks the gallery module so I took it out.
define{"_MD_SEARCH_ABSTRACT","Search Collection for Abstract"};
I also tried to add the line:
$xoopsTpl->assign('search_title', _MD_SEARCH_TITLE);
in the above Search.php but that did not work either. I also tried making the Option "value" in the form ="<{$search_abstract}>"
===========================================================
I hope I am being as clear as needed to help
This seems like it should be pretty simple but it is making me pull my hair out as I am on deadline with this project.
Thanks so much! Any assistance will be GREATLY appreciated.
The following is related to a Xoops website. I have posted on that forum with out any replies on over a week. I am not a programmer but I am fully capable of modifying code.
RE: Xoops 2.0.16 running xcGallery 2.03 module
I would like to add pre-selected search terms in a drop down list that user can use to search via selection OR manually enter other keyword criteria in an exiting field that already exists in the code that works.
Because this is an art gallery site. Some of the pre-selectable search terms needed in the drop down list should be things like: Abstract, Landscapes, Photography etc.
I have successfully added the drop down list (see code below) but I do not know how to do the coding to get it to query the DB and display the results just as the normal manual entry keyword search works when clicking the submit search button.
I would like to have the user select something from the list and then click the search button OR once they let go of the selection from the list the search begins automatically. Either one would be fine.
============================================================
<div align="center">
<table border="1" width="400" bordercolor="#1D829C" id="table2" cellpadding="10">
<tr>
<td>
<p align="center">Please enter a search criteria to fulfill your project needs.<br />
You may search by color, style, genre, artist, media, etc.</p>
<form bordercolor="#1D829C" style="margin 0; padding: 0;" method="get" action="thumbnails.php" >
<div bordercolor="#1D829C" align="center">
<table width="400" cellspacing="1" cellpadding="0" style="width: 100%;">
<tr>
<td align="center" class="foot">
BEGIN NON-WORKING CODE
<select size="1" name="search" class="textinput">
<option value="Abstract">Abstract</option>
<option value="Landscape">Landscape</option>
<option value="Photography">Photography</option>
</select>
END NON-WORKING CODE
<input type="input" style="width: 216; height: 22" name="search" maxlength="255" value="" class="textinput" />
<input type="submit" value="Submit Search" class="button" />
</td>
</tr>
</table>
</div>
<input type="hidden" name="type" value="full" />
<input type="hidden" name="album" value="search" />
</form>
</td>
</tr>
</table>
</div>
============================================================
The Search.php file code is as follows:
===========================================================
<?php
include "../../mainfile.php";
define('IN_XCGALLERY', true);
require('include/init.inc.php');
$xoopsOption['template_main'] = 'xcgal_search.html';
include XOOPS_ROOT_PATH."/header.php";
$xoopsTpl->assign('xoops_module_header', $xcgal_module_header);
$xoopsTpl->assign('search_title', _MD_SEARCH_TITLE);
user_save_profile();
$xoopsTpl->assign('gallery', $xoopsModule->getVar('name'));
include_once "include/theme_func.php";
main_menu();
do_footer();
include_once "../../footer.php";
?>
===========================================================
The main.php language file has the following line that refers to the form fields
define("_MD_SEARCH_TITLE","Search the image collection");
I tried adding the following and it breaks the gallery module so I took it out.
define{"_MD_SEARCH_ABSTRACT","Search Collection for Abstract"};
I also tried to add the line:
$xoopsTpl->assign('search_title', _MD_SEARCH_TITLE);
in the above Search.php but that did not work either. I also tried making the Option "value" in the form ="<{$search_abstract}>"
===========================================================
I hope I am being as clear as needed to help
This seems like it should be pretty simple but it is making me pull my hair out as I am on deadline with this project.
Thanks so much! Any assistance will be GREATLY appreciated.