require_once "maincore.php";
include LOCALE.LOCALESET."photosearch.php";
$meta_title = " : ".$locale['400'];
require_once "subheader.php";
require_once "side_left.php";
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if (isset($stype)) $stype = $stype;
if (isset($stext)) $stext = stripinput($stext);
if (!isset($stype)) $stype = isset($_POST['stype']) ? $_POST['stype'] : "a";
if (!isset($stext)) $stext = isset($_POST['stext']) ? $_POST['stext'] : "";
opentable($locale['400']);
echo "
\n";
closetable();
if ($stext != "" && strlen($stext > "3")) {
opentable($locale['409']);
if ($stype == "a") {
$result = dbquery( "SELECT ta.* FROM ".$db_prefix."photos ta
WHERE (photo_title LIKE '%$stext%')"
);
$rows = dbrows($result);
if ($rows != 0) {
echo $rows." ".($rows == 1 ? $locale['410'] : $locale['411']).$locale['422'].":
\n";
$result = dbquery(
"SELECT ta.* FROM ".$db_prefix."photos ta
WHERE (photo_title LIKE '%$stext%')
ORDER BY photo_date DESC LIMIT $rowstart,10"
);
while ($data = dbarray($result)) {
if (eregi($stext, $data['photo_title']) && eregi($stext, $data['photo_title'])) {
$subj_c = substr_count(strtolower($data['photo_title']), strtolower($stext));
$text_c = substr_count(strtolower($data['photo_title']), strtolower($stext));
echo "".$data['photo_title']."
\n";
// echo "".$locale['040']."".$data['user_name']."\n";
// echo $locale['041'].showdate("longdate", $data['photo_date'])."
\n";
// echo "".$subj_c." ".($subj_c == 1 ? "Match" : "Matches").$locale['432'].$locale['433'].", ";
// echo $text_c." ".($text_c == 1 ? "Match" : "Matches").$locale['432'].$locale['434']."
";
} elseif (eregi($stext, $data['photo_title'])) {
$text_c = substr_count(strtolower($data['photo_title']), strtolower($stext));
echo "".$data['photo_title']."
\n";
// echo "".$locale['040']."".$data['user_name']."\n";
// echo $locale['041'].showdate("longdate", $data['photo_date'])."
\n";
// echo "".$text_c." ".($text_c == 1 ? "Match" : "Matches").$locale['432'].$locale['434']."
";
} elseif (eregi($stext, $data['photo_title'])) {
$subj_c = substr_count(strtolower($data['photo_title']), strtolower($stext));
echo "".$data['photo_title']."
\n";
// echo "".$locale['040']."".$data['user_name']."\n";
// echo $locale['041'].showdate("longdate", $data['photo_date'])."
\n";
// echo "".$subj_c." ".($subj_c == 1 ? "Match" : "Matches").$locale['432'].$locale['433']."
";
}
}
} else {
echo "0 ".$locale['411'].$locale['422'].".\n";
}
closetable();