Execute($sql); if ($recordSet === false) log_error($sql); $num_images = $recordSet->RecordCount(); if ($num_images > 0) { echo ""; echo "$lang[images]

"; // while (!$recordSet->EOF) // { // $caption = make_db_unsafe ($recordSet->fields[caption]); // $thumb_file_name = make_db_unsafe ($recordSet->fields[thumb_file_name]); // $file_name = make_db_unsafe ($recordSet->fields[file_name]); // $imageID = make_db_unsafe ($recordSet->fields[ID]); // // gotta grab the image size // $imagedata = GetImageSize("$config[listings_upload_path]/$thumb_file_name"); // $imagewidth = $imagedata[0]; // $imageheight = $imagedata[1]; // $shrinkage = $config[thumbnail_width]/$imagewidth; // $displaywidth = $imagewidth * $shrinkage; // $displayheight = $imageheight * $shrinkage; // // echo " "; // // echo "
"; // echo " $caption

"; // $recordSet->MoveNext(); // } // end while echo ""; } // end if ($num_images > 0) } // end function renderListingsImages function makeYahooMap($listingID, $address_field, $city_field, $state_field) { // renders a link to yahoo maps on the page global $conn, $config; $sql_listingID = make_db_extra_safe($listingID); $sql_address_field = make_db_safe($address_field); $sql_city_field = make_db_safe($city_field); $sql_state_field = make_db_safe($state_field); // get address $sql = "SELECT listingsDBElements.field_value, listingsFormElements.field_type, listingsFormElements.field_caption FROM listingsDBElements, listingsFormElements WHERE ((listingsDBElements.listing_id = $sql_listingID) AND (listingsFormElements.field_name = listingsDBElements.field_name) AND (listingsDBElements.field_name = $sql_address_field))"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); while (!$recordSet->EOF) { $yahoo_address = make_db_unsafe ($recordSet->fields[field_value]); $recordSet->MoveNext(); } // end while // get city $sql = "SELECT listingsDBElements.field_value, listingsFormElements.field_type, listingsFormElements.field_caption FROM listingsDBElements, listingsFormElements WHERE ((listingsDBElements.listing_id = $sql_listingID) AND (listingsFormElements.field_name = listingsDBElements.field_name) AND (listingsDBElements.field_name = $sql_city_field))"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); while (!$recordSet->EOF) { $yahoo_city = make_db_unsafe ($recordSet->fields[field_value]); $recordSet->MoveNext(); } // end while // get state $sql = "SELECT listingsDBElements.field_value, listingsFormElements.field_type, listingsFormElements.field_caption FROM listingsDBElements, listingsFormElements WHERE ((listingsDBElements.listing_id = $sql_listingID) AND (listingsFormElements.field_name = listingsDBElements.field_name) AND (listingsDBElements.field_name = $sql_state_field))"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); while (!$recordSet->EOF) { $yahoo_state = make_db_unsafe ($recordSet->fields[field_value]); $recordSet->MoveNext(); } // end while $yahoo_string = "Pyt=Tmap&addr=$yahoo_address&csz=$yahoo_city,$yahoo_state&Get+Map=Get+Map"; echo "View a map of the area"; } // end makeYahooMap function renderSingleListingItem($listingID, $name) { // renders a single item on the listings page // includes the caption global $conn, $config; $listingID = make_db_extra_safe($listingID); $name = make_db_extra_safe($name); $sql = "SELECT listingsDBElements.field_value, listingsFormElements.field_type, listingsFormElements.field_caption FROM listingsDBElements, listingsFormElements WHERE ((listingsDBElements.listing_id = $listingID) AND (listingsFormElements.field_name = listingsDBElements.field_name) AND (listingsDBElements.field_name = $name))"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); while (!$recordSet->EOF) { $field_value = make_db_unsafe ($recordSet->fields[field_value]); $field_type = make_db_unsafe ($recordSet->fields[field_type]); $field_caption = make_db_unsafe ($recordSet->fields[field_caption]); if ($field_value != "") { if ($field_type == "select-multiple" OR $field_type == "option" OR $field_type == "checkbox") { // handle field types with multiple options echo "$field_caption
"; $feature_index_list = explode("||", $field_value); while (list($feature_list_Value, $feature_list_item) = each ($feature_index_list)) { echo "$feature_list_item
"; } // end while } // end if field type is a multiple type elseif ($field_type == "price") { $money_amount = international_num_format($field_value); echo "
$field_caption: ".money_value($money_amount); } // end elseif elseif ($field_type == "number") { echo "
$field_caption: ".international_num_format($field_value); } // end elseif elseif ($field_type == "url") { echo "
$field_caption: $field_value"; } elseif ($field_type == "email") { echo "
$field_caption: $field_value"; } elseif ($field_type == "text" OR $field_type == "textarea") { if ($config[add_linefeeds] == "yes") { $field_value = nl2br($field_value); //replace returns with
} // end if echo "
$field_caption: $field_value"; } else { echo "
$field_caption: $field_value"; } // end else } // end if ($field_value != "") $recordSet->MoveNext(); } // end while } // end renderSingleListingItem function renderSingleListingItemRaw($listingID, $name) { // renders a single item without any fancy formatting or anything. // useful if you need to plug a variable into something else... global $conn, $config; $listingID = make_db_extra_safe($listingID); $name = make_db_extra_safe($name); $sql = "SELECT listingsDBElements.field_value FROM listingsDBElements, listingsFormElements WHERE ((listingsDBElements.listing_id = $listingID) AND (listingsFormElements.field_name = listingsDBElements.field_name) AND (listingsDBElements.field_name = $name))"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); while (!$recordSet->EOF) { $field_value = make_db_unsafe ($recordSet->fields[field_value]); echo $field_value; } } // end renderSingleListingItemRaw($listingID, $name) function renderSingleListingItemNoCaption($listingID, $name) { // renders a single item on the listings page // this time, without a caption, though... global $conn, $config; $listingID = make_db_extra_safe($listingID); $name = make_db_extra_safe($name); $sql = "SELECT listingsDBElements.field_value, listingsFormElements.field_type FROM listingsDBElements, listingsFormElements WHERE ((listingsDBElements.listing_id = $listingID) AND (listingsFormElements.field_name = listingsDBElements.field_name) AND (listingsDBElements.field_name = $name))"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); while (!$recordSet->EOF) { $field_value = make_db_unsafe ($recordSet->fields[field_value]); $field_type = make_db_unsafe ($recordSet->fields[field_type]); if ($field_value != "") { if ($field_type == "select-multiple" OR $field_type == "option" OR $field_type == "checkbox") { // handle field types with multiple options $feature_index_list = explode("||", $field_value); while (list($feature_list_Value, $feature_list_item) = each ($feature_index_list)) { echo "$feature_list_item
"; } // end while } // end if field type is a multiple type elseif ($field_type == "price") { $money_amount = international_num_format($field_value); echo "
$field_caption: ".money_format($money_amount); } // end elseif elseif ($field_type == "number") { echo "
$field_caption: ".international_num_format($field_value); } // end elseif elseif ($field_type == "url") { echo "$field_value"; } elseif ($field_type == "email") { echo "$field_value"; } elseif ($field_type == "text" OR $field_type == "textarea") { if ($config[add_linefeeds] == "yes") { $field_value = nl2br($field_value); //replace returns with
} // end if echo $field_value; } else { echo "$field_value"; } // end else } // end if ($field_value != "") $recordSet->MoveNext(); } // end while } // end renderSingleListingItemNoCaption function renderTemplateArea($templateArea, $listingID) { // renders all the elements in a given template area on the listing pages global $conn, $config; $listingID = make_db_extra_safe($listingID); $templateArea = make_db_extra_safe($templateArea); $sql = "SELECT listingsDBElements.field_value, listingsFormElements.field_type, listingsFormElements.field_caption FROM listingsDBElements, listingsFormElements WHERE ((listingsDBElements.listing_id = $listingID) AND (listingsFormElements.field_name = listingsDBElements.field_name) AND (listingsFormElements.location = $templateArea)) ORDER BY listingsFormElements.rank ASC"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); while (!$recordSet->EOF) { $field_value = make_db_unsafe ($recordSet->fields[field_value]); $field_type = make_db_unsafe ($recordSet->fields[field_type]); $field_caption = make_db_unsafe ($recordSet->fields[field_caption]); if ($field_value != "") { if ($field_type == "select-multiple" OR $field_type == "option" OR $field_type == "checkbox") { // handle field types with multiple options echo "$field_caption
"; $feature_index_list = explode("||", $field_value); while (list($feature_list_Value, $feature_list_item) = each ($feature_index_list)) { echo "$feature_list_item
"; } // end while } // end if field type is a multiple type elseif ($field_type == "price") { $money_amount = international_num_format($field_value); echo "
$field_caption: ".money_value($money_amount); } // end elseif elseif ($field_type == "number") { echo "
$field_caption: ".international_num_format($field_value); } // end elseif elseif ($field_type == "url") { echo "
$field_caption: $field_value"; } elseif ($field_type == "email") { echo "
$field_caption: $field_value"; } elseif ($field_type == "text" OR $field_type == "textarea") { if ($config[add_linefeeds] == "yes") { $field_value = nl2br($field_value); //replace returns with
} // end if echo "
$field_caption: $field_value"; } else { echo "
$field_caption: $field_value"; } // end else } // end if ($field_value != "") $recordSet->MoveNext(); } // end while } // end renderTemplateArea function renderTemplateAreaNoCaption($templateArea, $listingID) { // renders all the elements in a given template area on the listing pages // this time without the corresponding captions global $conn, $config; $listingID = make_db_extra_safe($listingID); $templateArea = make_db_extra_safe($templateArea); $sql = "SELECT listingsDBElements.field_value, listingsFormElements.field_type, listingsFormElements.field_caption FROM listingsDBElements, listingsFormElements WHERE ((listingsDBElements.listing_id = $listingID) AND (listingsFormElements.field_name = listingsDBElements.field_name) AND (listingsFormElements.location = $templateArea)) ORDER BY listingsFormElements.rank ASC"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); while (!$recordSet->EOF) { $field_value = make_db_unsafe ($recordSet->fields[field_value]); $field_type = make_db_unsafe ($recordSet->fields[field_type]); $field_caption = make_db_unsafe ($recordSet->fields[field_caption]); if ($field_value != "") { if ($field_type == "select-multiple" OR $field_type == "option" OR $field_type == "checkbox") { // handle field types with multiple options $feature_index_list = explode("||", $field_value); while (list($feature_list_Value, $feature_list_item) = each ($feature_index_list)) { echo "$feature_list_item
"; } // end while } // end if field type is a multiple type elseif ($field_type == "price") { $money_amount = international_num_format($field_value); echo "
$field_caption: ".money_format($money_amount); } // end elseif elseif ($field_type == "number") { echo "
$field_caption: ".international_num_format($field_value); } // end elseif elseif ($field_type == "url") { echo "
$field_value"; } elseif ($field_type == "email") { echo "
$field_value"; } elseif ($field_type == "text" OR $field_type == "textarea") { if ($config[add_linefeeds] == "yes") { $field_value = nl2br($field_value); //replace returns with
} // end if echo "
$field_value"; } else { echo "
$field_value"; } // end else } // end if ($field_value != "") $recordSet->MoveNext(); } // end while } // end renderTemplateAreaNoCaption function getMainListingData($listingID) { // get the main data for a given listing global $conn, $lang; $listingID = make_db_extra_safe($listingID); $sql = "SELECT listingsDB.user_ID, listingsDB.Title, listingsDB.expiration, UserDB.user_name FROM listingsDB, UserDB WHERE ((listingsDB.ID = $listingID) AND (UserDB.ID = listingsDB.user_ID))"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); // get main listings data while (!$recordSet->EOF) { $listing_user_ID = make_db_unsafe ($recordSet->fields[user_ID]); $listing_Title = make_db_unsafe ($recordSet->fields[Title]); $listing_expiration = make_db_unsafe ($recordSet->fields[Title]); $listing_user_name = make_db_unsafe ($recordSet->fields[user_name]); $recordSet->MoveNext(); } // end while echo "
$listing_Title
"; echo "$lang[listed_by] $listing_user_name"; } // function getMainListingData function getListingEmail($listingID) { // get the email address for the person who posted a listing global $conn, $lang; $listingID = make_db_extra_safe($listingID); $sql = "SELECT UserDB.emailAddress FROM listingsDB, UserDB WHERE ((listingsDB.ID = $listingID) AND (UserDB.ID = listingsDB.user_ID))"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); // return the email address while (!$recordSet->EOF) { $listing_emailAddress = make_db_unsafe ($recordSet->fields[emailAddress]); $recordSet->MoveNext(); } // end while echo "$lang[user_email]: $listing_emailAddress
"; } // function getMainListingData function hitcount($listingID) { // counts hits to a given listing global $conn, $lang; $listingID = make_db_extra_safe($listingID); $sql = "UPDATE listingsDB SET hitcount=hitcount+1 WHERE ID=$listingID"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); $sql = "SELECT hitcount FROM listingsDB WHERE ID=$listingID"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); while (!$recordSet->EOF) { $hitcount = $recordSet->fields[hitcount]; echo "$lang[this_listing_has_been_viewed] $hitcount $lang[times]."; $recordSet->MoveNext(); } // end while } // end function hitcount function renderUserInfoOnListingsPage($listingID) { if ($listingID != "") { // grabs the information for a given user // and displays it on a listings page global $conn, $config, $lang; $listingID = make_db_extra_safe($listingID); $sql = "SELECT UserDB.ID, UserDB.user_name FROM listingsDB, UserDB WHERE ((listingsDB.ID = $listingID) AND (UserDB.ID = listingsDB.user_ID))"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); // get main listings data while (!$recordSet->EOF) { $listing_user_ID = make_db_unsafe ($recordSet->fields[ID]); $listing_user_name = make_db_unsafe ($recordSet->fields[user_name]); $recordSet->MoveNext(); } // end while echo "$lang[listed_by] $listing_user_name"; if ($listing_user_ID != "") { $sql = "SELECT UserDBElements.field_value, userFormElements.field_type, userFormElements.field_caption FROM UserDBElements, userFormElements WHERE ((UserDBElements.user_id = $listing_user_ID) AND (UserDBElements.field_name = userFormElements.field_name)) ORDER BY userFormElements.rank ASC"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); while (!$recordSet->EOF) { $field_value = make_db_unsafe ($recordSet->fields[field_value]); $field_type = make_db_unsafe ($recordSet->fields[field_type]); $field_caption = make_db_unsafe ($recordSet->fields[field_caption]); if ($field_value != "") { if ($field_type == "select-multiple" OR $field_type == "option" OR $field_type == "checkbox") { // handle field types with multiple options echo "$field_caption
"; $feature_index_list = explode("||", $field_value); while (list($feature_list_Value, $feature_list_item) = each ($feature_index_list)) { echo "$feature_list_item
"; } // end while } // end if field type is a multiple type elseif ($field_type == "price") { $money_amount = international_num_format($field_value); echo "
$field_caption: ".money_format($money_amount); } // end elseif elseif ($field_type == "number") { echo "
$field_caption: ".international_num_format($field_value); } // end elseif elseif ($field_type == "url") { echo "
$field_caption: $field_value"; } elseif ($field_type == "email") { echo "
$field_caption: $field_value"; } else { if ($config[add_linefeeds] == "yes") { $field_value = nl2br($field_value); //replace returns with
} // end if echo "
$field_caption: $field_value"; } // end else } // end if ($field_value != "") $recordSet->MoveNext(); } // end while } // end if ($listing_user_ID != "") } // end ($listingID != "") } // end renderUserInfo function renderFeaturedListingsVertical($num_of_listings) { echo ""; // shows the images connected to a given image global $conn, $lang, $config, $style; // grab the images $listingID = make_db_extra_safe($listingID); $sql = "SELECT ID, Title FROM listingsDB WHERE (featured = 'yes')"; $recordSet = $conn->SelectLimit($sql, $num_of_listings, 0 ); if ($recordSet === false) log_error($sql); $returned_num_listings = $recordSet->RecordCount(); if ($returned_num_listings > 0) { echo ""; } // end if ($num_images > 0) echo "
"; echo "$lang[featured_listings]"; while (!$recordSet->EOF) { $Title = make_db_unsafe ($recordSet->fields[Title]); $ID = make_db_unsafe ($recordSet->fields[ID]); $sql2 = "SELECT thumb_file_name FROM listingsImages WHERE (listing_id = $ID) ORDER BY rank"; $recordSet2 = $conn->SelectLimit($sql2, 1, 0 ); if ($recordSet2 === false) log_error($sql); while (!$recordSet2->EOF) { $thumb_file_name = make_db_unsafe ($recordSet2->fields[thumb_file_name]); // gotta grab the image size $imagedata = GetImageSize("$config[listings_upload_path]/$thumb_file_name"); $imagewidth = $imagedata[0]; $imageheight = $imagedata[1]; $shrinkage = $config[thumbnail_width]/$imagewidth; $displaywidth = $imagewidth * $shrinkage; $displayheight = $imageheight * $shrinkage; echo " "; echo "\"$lang[click_to_learn_more]\"
"; echo "$Title


"; $recordSet2->MoveNext(); } // end while $recordSet->MoveNext(); } // end while echo "
"; } // end function renderFeaturedListingsVertical // RENDER THE USER PAGE ELEMENTS function renderUserImages($user) { // grabs the listings for a given user global $conn, $lang, $config, $style; $user = make_db_extra_safe($user); // grab the images $sql = "SELECT ID, caption, file_name, thumb_file_name FROM userImages WHERE (user_id = $user) ORDER BY rank"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); $num_images = $recordSet->RecordCount(); if ($num_images > 0) { echo ""; echo "$lang[images]

"; while (!$recordSet->EOF) { $caption = make_db_unsafe ($recordSet->fields[caption]); $thumb_file_name = make_db_unsafe ($recordSet->fields[thumb_file_name]); $file_name = make_db_unsafe ($recordSet->fields[file_name]); $imageID = make_db_unsafe ($recordSet->fields[ID]); // gotta grab the image size $imagedata = GetImageSize("$config[user_upload_path]/$thumb_file_name"); $imagewidth = $imagedata[0]; $imageheight = $imagedata[1]; $shrinkage = $config[thumbnail_width]/$imagewidth; $displaywidth = $imagewidth * $shrinkage; $displayheight = $imageheight * $shrinkage; echo " "; echo "
"; echo "$caption

"; $recordSet->MoveNext(); } // end while echo ""; } // end ($num_images > 0) } // end function renderUserImages function renderUserInfo($user) { // grabs the information for a given user global $conn, $config; $user = make_db_extra_safe($user); $sql = "SELECT UserDBElements.field_value, userFormElements.field_type, userFormElements.field_caption FROM UserDBElements, userFormElements WHERE ((UserDBElements.user_id = $user) AND (UserDBElements.field_name = userFormElements.field_name)) ORDER BY userFormElements.rank ASC"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); while (!$recordSet->EOF) { $field_value = make_db_unsafe ($recordSet->fields[field_value]); $field_type = make_db_unsafe ($recordSet->fields[field_type]); $field_caption = make_db_unsafe ($recordSet->fields[field_caption]); if ($field_value != "") { if ($field_type == "select-multiple" OR $field_type == "option" OR $field_type == "checkbox") { // handle field types with multiple options echo "$field_caption
"; $feature_index_list = explode("||", $field_value); while (list($feature_list_Value, $feature_list_item) = each ($feature_index_list)) { echo "$feature_list_item
"; } // end while } // end if field type is a multiple type elseif ($field_type == "price") { $money_amount = international_num_format($field_value); echo "
$field_caption: ".money_format($money_amount); } // end elseif elseif ($field_type == "number") { echo "
$field_caption: ".international_num_format($field_value); } // end elseif elseif ($field_type == "url") { echo "
$field_caption: $field_value"; } elseif ($field_type == "email") { echo "
$field_caption: $field_value"; } else { if ($config[add_linefeeds] == "yes") { $field_value = nl2br($field_value); //replace returns with
} // end if echo "
$field_caption: $field_value"; } // end else } // end if ($field_value != "") $recordSet->MoveNext(); } // end while } // end renderUserInfo function getMainUserData($user) { // grabs the main info for a given user global $conn, $lang; $user = make_db_extra_safe($user); $sql = "SELECT user_name, emailAddress FROM UserDB WHERE (ID = $user)"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); // get main listings data while (!$recordSet->EOF) { $name = make_db_unsafe ($recordSet->fields[user_name]); $emailAddress = make_db_unsafe ($recordSet->fields[emailAddress]); $recordSet->MoveNext(); } // end while echo "

$name

"; } // function getMainListingData function getUserEmail($user) { // grabs the main info for a given user global $conn, $lang; $user = make_db_extra_safe($user); $sql = "SELECT emailAddress FROM UserDB WHERE (ID = $user)"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); // get main listings data while (!$recordSet->EOF) { $emailAddress = make_db_unsafe ($recordSet->fields[emailAddress]); $recordSet->MoveNext(); } // end while echo "$lang[user_email]: $emailAddress"; } // function getMainListingData function userHitcount($user) { // hit counter for user listings global $conn, $lang; $user = make_db_extra_safe($user); $sql = "UPDATE UserDB SET hitcount=hitcount+1 WHERE ID=$user"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); $sql = "SELECT hitcount FROM UserDB WHERE ID=$user"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); while (!$recordSet->EOF) { $hitcount = $recordSet->fields[hitcount]; echo "$lang[this_user_has_been_viewed] $hitcount $lang[times]."; $recordSet->MoveNext(); } // end while } // end function userHitcount function userListings($user) { // produces the rest of the listings for users global $conn, $lang; $user = make_db_extra_safe($user); echo "Current listings:"; $sql = "SELECT ID, Title FROM listingsDB WHERE user_ID = $user"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); while (!$recordSet->EOF) { $ID = $recordSet->fields[ID]; $Title = make_db_unsafe ($recordSet->fields[Title]); echo "
  • $Title
  • "; $recordSet->MoveNext(); } echo "

    "; } // end function userListings // BROWSING PAGE ELEMENTS function browse_all_listings() { global $conn, $config; $sql = "SELECT listingsDB.Title FROM listingsDB WHERE active = 'yes'"; if ($config[use_expiration] == "yes") { $sql .= " AND expiration > ".$conn->DBDate(time()); } $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); $num_listings = $recordSet->RecordCount(); echo "Browse All Listings ($num_listings)"; } // end function browse_all_listings function searchbox_select ($browse_caption, $browse_field_name) { // builds a multiple choice select box for any given item you want // to let users search by global $conn, $config; echo "$browse_caption"; echo ""; } // end function searchbox_select function searchbox_select_vert ($browse_caption, $browse_field_name) { // builds a multiple choice select box for any given item you want // to let users search by global $conn, $config; echo ""; echo "
    $browse_caption
    "; } // end function searchbox_select_vert function searchbox_pulldown ($browse_caption, $browse_field_name) { // builds a pulldown menu for any given item you want // to let users search by global $conn, $config; echo "$browse_caption"; echo ""; } // end function searchbox_pulldown function searchbox_pulldown_vert ($browse_caption, $browse_field_name) { // builds a pulldown menu for any given item you want // to let users search by global $conn, $config; echo ""; echo ""; } // end function searchbox_pulldown_vert function searchbox_checkbox ($browse_caption, $browse_field_name) { // builds a series of checkboxes for any given item you want // to let users search by global $conn, $config; echo ""; echo ""; } // end function searchbox_checkbox function searchbox_checkbox_vert ($browse_caption, $browse_field_name) { // builds a series of checkboxes for any given item you want // to let users search by global $conn, $config; echo "
    $browse_caption
    $browse_caption"; $sql = "SELECT listingsDBElements.field_value, listingsDB.ID, count(field_value) AS num_type FROM listingsDBElements, listingsDB WHERE listingsDBElements.field_name = '$browse_field_name' AND listingsDB.active = 'yes' AND listingsDBElements.listing_id = listingsDB.ID "; if ($config[use_expiration] == "yes") { $sql .= " AND expiration > ".$conn->DBDate(time()); } $sql .= "GROUP BY listingsDBElements.field_value ORDER BY listingsDBElements.field_value"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); while (!$recordSet->EOF) { $field_output = make_db_unsafe ($recordSet->fields[field_value]); $num_type = $recordSet->fields[num_type]; echo "$field_output ($num_type)
    "; $recordSet->MoveNext(); } // end while echo "
    "; echo "
    $browse_caption
    "; $sql = "SELECT listingsDBElements.field_value, listingsDB.ID, count(field_value) AS num_type FROM listingsDBElements, listingsDB WHERE listingsDBElements.field_name = '$browse_field_name' AND listingsDB.active = 'yes' AND listingsDBElements.listing_id = listingsDB.ID "; if ($config[use_expiration] == "yes") { $sql .= " AND expiration > ".$conn->DBDate(time()); } $sql .= "GROUP BY listingsDBElements.field_value ORDER BY listingsDBElements.field_value"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); while (!$recordSet->EOF) { $field_output = make_db_unsafe ($recordSet->fields[field_value]); $num_type = $recordSet->fields[num_type]; echo "$field_output ($num_type)
    "; $recordSet->MoveNext(); } // end while echo "
    "; } // end function searchbox_checkbox_vert function searchbox_option ($browse_caption, $browse_field_name) { // builds a pulldown menu for any given item you want // to let users search by global $conn, $config; echo "$browse_caption"; echo ""; $sql = "SELECT listingsDBElements.field_value, listingsDB.ID, count(field_value) AS num_type FROM listingsDBElements, listingsDB WHERE listingsDBElements.field_name = '$browse_field_name' AND listingsDB.active = 'yes' AND listingsDBElements.listing_id = listingsDB.ID "; if ($config[use_expiration] == "yes") { $sql .= " AND expiration > ".$conn->DBDate(time()); } $sql .= "GROUP BY listingsDBElements.field_value ORDER BY listingsDBElements.field_value"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); while (!$recordSet->EOF) { $field_output = make_db_unsafe ($recordSet->fields[field_value]); $num_type = $recordSet->fields[num_type]; echo "$field_output ($num_type)
    "; $recordSet->MoveNext(); } // end while echo ""; } // end function searchbox_option function searchbox_option_vert ($browse_caption, $browse_field_name) { // builds a pulldown menu for any given item you want // to let users search by global $conn, $config; echo ""; echo "
    $browse_caption
    "; $sql = "SELECT listingsDBElements.field_value, listingsDB.ID, count(field_value) AS num_type FROM listingsDBElements, listingsDB WHERE listingsDBElements.field_name = '$browse_field_name' AND listingsDB.active = 'yes' AND listingsDBElements.listing_id = listingsDB.ID "; if ($config[use_expiration] == "yes") { $sql .= " AND expiration > ".$conn->DBDate(time()); } $sql .= "GROUP BY listingsDBElements.field_value ORDER BY listingsDBElements.field_value"; $recordSet = $conn->Execute($sql); if ($recordSet === false) log_error($sql); while (!$recordSet->EOF) { $field_output = make_db_unsafe ($recordSet->fields[field_value]); $num_type = $recordSet->fields[num_type]; echo "$field_output ($num_type)
    "; $recordSet->MoveNext(); } // end while echo "
    "; } // end function searchbox_option_vert function latestListings($num_of_listings) { // builds a list of X number of latest listings global $conn; echo "

    "; } // end function latestListings function getMainListingTitle($listingID) { // get the main data for a given listing global $conn, $config, $lang; $listingID = make_db_extra_safe($listingID); $sql = "SELECT " . $config[table_prefix] . "listingsDB.user_ID, " . $config[table_prefix] . "listingsDB.Title, " . $config[table_prefix] . "listingsDB.expiration, " . $config[table_prefix] . "UserDB.user_name FROM " . $config[table_prefix] . "listingsDB, " . $config[table_prefix] . "UserDB WHERE ((" . $config[table_prefix] . "listingsDB.ID = $listingID) AND (" . $config[table_prefix] . "UserDB.ID = " . $config[table_prefix] . "listingsDB.user_ID))"; $recordSet = $conn->Execute($sql); if ($recordSet === false) { log_error($sql); } // get main listings data while (!$recordSet->EOF) { $listing_user_ID = make_db_unsafe ($recordSet->fields[user_ID]); $listing_Title = make_db_unsafe ($recordSet->fields[Title]); $listing_expiration = make_db_unsafe ($recordSet->fields[Title]); $listing_user_name = make_db_unsafe ($recordSet->fields[user_name]); $recordSet->MoveNext(); } // end while echo "$listing_Title"; } // function getMainListingTitle ?>