i think this is the section:
PHP Code:
function cachetemplates($templateslist) {
// $templateslist: comma delimited list
global $templatecache,$DB_site,$templatesetid,$loadmaxusers,$loadbirthdays;
// add in sql info
//$templateslist=str_replace(",","' OR title='",$templateslist);
$templateslist=str_replace(',', "','", $templateslist);
// run query
$temps=$DB_site->query("SELECT template,title
FROM template
WHERE (title IN ('$templateslist')
AND (templatesetid=-1 OR templatesetid='$templatesetid'))
".iif ($loadmaxusers,"OR (title = 'maxloggedin')","")."
".iif ($loadbirthdays,"OR (title = 'birthdays')","")."
ORDER BY templatesetid");
// cache templates
while ($temp=$DB_site->fetch_array($temps)) {
$templatecache["$temp[title]"]=$temp['template'];
}
unset($temp);
$DB_site->free_result($temps);
}
how does this OR thing work
(templatesetid=-1 OR templatesetid='$templatesetid'))
does that mean, find a specific template where templatesetid=x as well as where templatesetid=-1? so both are returned. By ordering by templatesetid, the ones with a real template setid come up first?
any ideas what would happen if i just did
(templatesetid=-1 OR templatesetid='$templatesetid' OR tempatesetid='10'))
? if i ensure that all my other template sets have a higher number than 10? (or perhaps a lower number if that is what is needed)?