Top Recipe Searches Today
{'Instance/RecentSearches'} as $result):
# we want to filter this list if the search is too long...
$max_size = 45;
$rq = strtolower(trim($result->q));
if(strpos($rq,' ') === false) {
# this string contains no spaces
if (strlen($rq) > 25) {
# no spaces and too long
# skip
continue;
}
}
# ok we should have some spaces
if (strlen($rq) > $max_size) {
# too long
continue;
}
if ($last <> $result->q && $c <5) {
#
# we use our new short form for display
#
# we want to tag on the word 'recipes'
# if its not already in use
$ca = explode(' ',$rq);
$lw = trim(end($ca));
if ($lw == 'recipes') {
# already there
$plusr = '';
} else {
#add it
$plusr = ' Recipes';
}
echo '- '.ucwords($rq).$plusr.'
';
$c++;
}
$last = $result->q;
endforeach;
?>
Popular Recipe Searches
##
# display all ACTIVE status=1 prs (cat=2) entries from the footer table
#
$qprc = " SELECT * FROM footer where cat='2' and status='1' order by pos asc";
$mprc = $DatabaseObj->fetchAll($qprc);
foreach($mprc as $m) {
echo '- '.$m->display_text.'
';
}
?>
Popular Recipe Categories
##
# display all ACTIVE status=1 prc (cat=1) entries from the footer table
#
$qprc = " SELECT * FROM footer where cat='1' and status='1' order by pos asc";
$mprc = $DatabaseObj->fetchAll($qprc);
foreach($mprc as $m) {
echo '- '.$m->display_text.'
';
}
?>
Recent Blog Posts
##
# display all ACTIVE status=1 rbp (cat=3) entries from the footer table
#
$qprc = " SELECT * FROM footer where cat='3' and status='1' order by pos asc";
$mprc = $DatabaseObj->fetchAll($qprc);
foreach($mprc as $m) {
echo '- '.$m->display_text.'
';
}
?>