session_start();
$root="/usr/home/deb3977n3/domains/morechemistry.com/public_html";
include("${root}/includes/layout_page.php");
layout_load();
#META INFORMATION
//$filetosave="";
$category="events";
$title="Events - Search";
$keywords="search, events, chemistry";
$description="search chemistry related events";
include("${root}/members/includes/members-common.php");
include("${root}/members/includes/members-config.php");
include("${root}/members/includes/members-events.php");
# copyright 2000-2010, morechemistry.com, All Rights Reserved
##################################### SUBROUTINES ######################################
menu_load($category);
$content=$menu;
#$content.="
UNDER CONSTRUCTION
";
$content.="Your links
";
# page value
$pv=$_REQUEST['pv'];
if ($pv == "") { $pv=1; }
if ($pv<1) { $pv=1; }
##################################### SUBROUTINES ######################################
function create_list($searchword,$pv)
{
global $startPage;
global $EntryID;
$wText=$_SESSION['wText'];
$selection="WHERE LOCATE('$searchword',EventDescription)>0 ";
$allrecords=get_specific_userowned_records("events",$selection,"");
$FoundOne=mysql_num_rows($allrecords);
if ($FoundOne==0) { $foundStr="No links found!"; }
if ($FoundOne==1) { $foundStr="1 link found!"; }
if ($FoundOne>0)
{
if ($wText=="1")
{
# allow to turn off
$switchtextsetting="hide full description";
}
else
{
#allow to turn on
$switchtextsetting="show full description";
}
}
$startPage=1;
$buttonbar="";
if ($FoundOne>1)
{
$foundStr="${FoundOne} links found!";
if ($FoundOne>10)
{
$buttonbar=make_buttonbar("/agenda/events-search.php?frmSearchStr=${searchword}&pv=",$FoundOne,$pv);
}
}
# report number of links found in new LOCAL content
$content="${foundStr} ${switchtextsetting}
\n";
$content.=$buttonbar."
\n";
# show the results
if ($FoundOne>0)
{
# collect the records ordered and limited to 10
$entrycount=$startPage-1;
$allrecords=get_specific_userowned_records("events",$selection,"ORDER BY EventDateFrom DESC LIMIT $entrycount,10");
# set some initial values before starting the loop
$entrycount=$startPage-1;
while ($data=mysql_fetch_array($allrecords))
{
$content.=make_event_sample($data,$wText,0,"#ccffff");
}
}
$content.=$buttonbar."
\n";
return $content;
}
function create_form($frmSearchStr)
{
$form=<<
FORM;
return $form;
}
##################################### MAIN PROGRAM ######################################
$frmSearchStr=$_REQUEST['frmSearchStr'];
$content=create_form($frmSearchStr);
$content.=create_list($frmSearchStr,$pv);
layout_show($layoutpage,$content,$googlecode,$title,$keywords,$description);
?>