$title\n");
print("$content");
print(" Posted at $ptime on $pdate By 5StarDating.com ");
list($key1, $key2) = explode(",", $pkeywords);
$key1 = trim($key1);
$key2 = trim($key2);
$exclude = "id!=$id";
$relcnt = 0;
print("\n \n");
print("Related Dating Articles: \n\n");
$query = "SELECT id, ptitle, file FROM news WHERE active=1 and date_start < $timestamp and ($exclude) and pkeywords LIKE '%$key1%' ORDER BY id DESC LIMIT 4";
$result = mysql_query($query);
if ($result && mysql_num_rows($result) != 0) {
while ($row = mysql_fetch_row($result)) {
list($relid, $reltitle, $relfile) = $row;
$exclude = "$exclude && id!=$relid";
print("- $reltitle
\n");
$relcnt++;
}
}
$query = "SELECT id, ptitle, file FROM news WHERE active=1 and date_start < $timestamp and ($exclude) and pkeywords LIKE '%$key2%' ORDER BY id DESC LIMIT 4";
$result = mysql_query($query);
if ($result && mysql_num_rows($result) != 0) {
while ($row = mysql_fetch_row($result)) {
list($relid, $reltitle, $relfile) = $row;
$exclude = "$exclude && id!=$relid";
print("- $reltitle
\n");
$relcnt++;
}
}
if ($relcnt < 6) {
$startid = $id - 3;
if ($startid < 1)
$startid = 1;
$query = "SELECT id, ptitle, file FROM news WHERE active=1 and date_start < $timestamp and ($exclude) and id>=$startid ORDER BY id LIMIT 4";
$result = mysql_query($query);
if ($result && mysql_num_rows($result) != 0) {
while ($row = mysql_fetch_row($result)) {
list($relid, $reltitle, $relfile) = $row;
$exclude = "$exclude && id!=$relid";
print("- $reltitle
\n");
}
}
}
print(" \nDating Sites > Dating Digest > $title \n");
?>
|