// Copyright 2001,2002,2003,2004,2005,2006, Chris Heart - ALL RIGHTS RESERVED WORLDWIDE
// viewads.html
include("../tpnsecurity.inc");
include("../tpndblib.inc");
include("../tpnuserlib.inc");
checkSessionActive();
if ( $message )
unset($message);
if ( $tpn[message1] )
unset( $tpn[message1] );
if ( isset($actionflag) && ( ($actionflag == "showads1" ) || ($actionflag == "showads2" ) || ($actionflag == "showads3" ) ) )
$tpn[viewads] = $form;
elseif ( $tpn[viewads] )
$form = $tpn[viewads];
else
{
$tpn[viewads][COUNTRY] = "ANY";
if ( ( $tpn[logged_in] ) && $tpn[id]==1 )
$tpn[viewads][CATEGORIES] = "ANY";
}
// error checking
if ( ($actionflag == "showads1" ) && ( $form[CATEGORIES]=="ANY" || $form[COUNTRY]=="" || $form[COUNTRY]=="ANY" ) )
$tpn[message1] .= "'Search A' requires a CATEGORY and a COUNTRY as a minimum to search for !";
if ( ($actionflag == "showads2" ) && $form[NICKNAME] == "" )
$tpn[message1] .= "'Search B' requires a Nickname to search for !";
if ( ($actionflag == "showads3" ) && $form[AD_ID] == "" )
$tpn[message1] .= "'Search C' requires an Ad ID to search for !";
function displayAds( )
{
global $tpn;
$countem=0;
if ( $tpn[message1] == "" )
$ads = retrieveAds( $tpn[viewads][EMAIL], $tpn[viewads][USERNAME], $tpn[viewads][USER_ID],
$tpn[viewads][FIRSTNAME], $tpn[viewads][LASTNAME], $tpn[viewads][NICKNAME],
$tpn[viewads][TOWN], $tpn[viewads][STATE], $tpn[viewads][COUNTRY], $tpn[viewads][CATEGORIES],
$tpn[viewads][AD_ID], $tpn[viewads][SITECODE], $tpn[viewads][FROMAGE], $tpn[viewads][TOAGE] );
if ( ( $tpn[message1] == "" ) && ( ! $ads ) )
{
print "
Sorry - The search returned NO results.
Why not place your own Ad ?
";
return; // stop right there !
}
?>
Search Results
The results have the most recently updated Ads to the top.
A maximum of 25 Ads can be retrieved in one search.