Forum Moderators: coopster
You'd likely have database columns for meta descr, title, etc. for each of these elements. If you don't, you can extract the title element from the company title and description from the first couple lines of property description, stripping out any HTML.
Not optimum, but it will work.
The orig developer had this in the file (for the title):
/*This was a try for Advert Title tag
function dspAdvertRevisions($rs, $AdvertID, $char) {
$aAdvertTitle = array();
$PageID = $AdvertID;
$varPageID = $PageID;
$rsAdvertRevisions = GetAdvertRevisions($aAdvertTitle, $connDB);
if ($varPageID!="") {
while (!$rsAdvertRevisions->EOF) {
if ($rsAdvertRevisions->Fields('AdvertID') == $varPageID) {
$aHTMLTitle['HTMLTitle'] = htmlspecialchars($rsAdvertRevisions->Fields('AdvertTitle')) ;
}
$rsAdvertRevisions->MoveNext();
}
}
return $aHTMLTitle;
}*/
This is how the <body> details (which I follow and edit even) are called:
function dspAdvert($arr_get) {
$AdvertInfo = array();
$AdvertRevisionInfo = array();
$AdvertInfo = get_approvedadvert_details($arr_get['adid']);
if ($AdvertInfo['AdvertID'] <> "") {
$s .= "<div id=\"rental\">\n";
$s .= "<h1><span class=\"goRight\"> " . $AdvertInfo['PriceFrom'] . "</span>" . htmlspecialchars($AdvertInfo['AdvertTitle']) . "</h1>";
$s .= "<table id=\"tblAdvertDetail\" cellpadding=\"1\" cellspacing=\"2\">\n";
$s .= "<tr>\n";
$s .= "<td id=\"advert-detail\">\n";
$s .= "<div id=\"rental-details\">\n";
$s .= "<p class=\"where\">" . htmlspecialchars($AdvertInfo['AreaName']) . ", " . htmlspecialchars($AdvertInfo['Country']) . "</p>\n";
$s .= "<ul>\n";
if ($AdvertInfo['ResidenceType'] != "") {
$s .= "<li>• " . htmlspecialchars($AdvertInfo['ResidenceType']) . "</li>\n";
}
if ($AdvertInfo['LocationType'] != "") {
$s .= "<li>• " . htmlspecialchars($AdvertInfo['LocationType']) . " location</li>\n";
}
$s .= "<li>• " . htmlspecialchars($AdvertInfo['NoOfBedrooms']) . " Bedroom(s)</li>\n";
if ($AdvertInfo['Sleeps'] != "") {
$s .= "<li>• Sleeps up to " . htmlspecialchars($AdvertInfo['Sleeps']) . "</li>\n";
}
if ($AdvertInfo['FloorArea'] != "") {
$s .= "<li>• Floor area " . htmlspecialchars($AdvertInfo['FloorArea']) . " m2</li>\n";
}
if ($AdvertInfo['ChildrenWelcome'] == 1) {
$s .= "<li>• Children welcome - " . dspYesNo($AdvertInfo['ChildrenWelcome'],false) . "</li>\n";
}
if ($AdvertInfo['ElderlyOK'] == 1) {
$s .= "<li>• OK for the Elderly or Infirm</li>\n";
}
if ($AdvertInfo['DisabledAccess'] == 1) {
$s .= "<li>• Disabled Access</li>\n";
}
if ($AdvertInfo['PetsDesc'] != "") {
$s .= "<li>• " . htmlspecialchars($AdvertInfo['PetsDesc']) . "</li>\n";
}
$s .= "</ul>\n";
$s .= "</div>\n";
$s .= "<div id=\"rental-desc\">\n";
$s .= "<center><iframe name=\"I1\" id=\"I1\" src=\"http://www.mywebsite.co.uk/inserts/advert" . $AdvertInfo['AdvertID'] . ".htm\" frameborder=\"0\" width=\"560\" scrolling=\"no\" height=\"575\"></iframe></center><br />\n";
$s .= $AdvertInfo['LongDesc'] . "\n";
$s .= "</div>\n";
$s .= dspAdvertFacilities($arr_get['adid'],"");
$advertiserinfo = get_user_details($AdvertInfo['UserID']);
$s .= "<div id=\"call-to-arms\">\n";
$s .= "<center><p>PLEASE CONTACT OWNER BY <a href=\"mailto:" . $advertiserinfo['userobfusc'] . "?subject=Booking enquiry for advert " . $AdvertInfo['AdvertID'] . "&cc=info@solapartments.co.uk\">EMAIL</a>
</p><p>OR PHONE: " . $AdvertInfo['AdvertTelNo'] . "</p></center>\n";
$s .= "</div>\n";
$s .= " <br />\n";
$s .= " <p>Advert Created : " . $AdvertInfo['DateCreated'] . "</p>\n";
$s .= " <p>Details Last Updated : " . $AdvertInfo['ApprovedDate'] . "</p>\n";
$s .= " <p>(apart from the Calendar)</p>\n";
$s .= "</td>\n";
$s .= "</tr>\n";
$s .= "</table>\n";
$s .= "</div>\n";
} else {
$s .= "<h2>Error</h2>\n
<p>The Advert you have requested cannot be displayed.</p>\n";
}
return $s;
}
There is a lot of other associated code, but maybe you can get the idea where I'm coming from.
Thanks, Dave