PDA

View Full Version : trying to use templates for something else


Mutt
03-10-2002, 03:03 PM
A little while back I posted a hack for grouping custom templates. I wanted to make an easy way to add new groups and thought that would be real easy.

I used phpmyadmin to insert a a new template called templategroups with a templateset id of -2

then I set the template field to

$only['links'] = 'Links';
$only['eventcalendar'] = 'Event Calendar';
$only['activetopics'] = 'Active Topics';

then I wanted to grab that template info and stick it in template.php right after

$only['vbcode'] = 'vB Code';
$only['whosonline'] = 'Who\'s Online';
$only['showgroup'] = 'Show Groups';

that way I could edit the template to add new groups without having to edit template.php again.

i tried several variations of like these

eval (gettemplate("templategroups"));
gettemplate("templategroups");
gettemplate("templategroups",0);

but nothing worked. could I get a little help here people?

Admin
03-10-2002, 04:34 PM
Because the templatesetid is -2 gettemplate() won't grab it, you need to use your own query:
$gettemplate = $DB_site->query_first("SELECT template FROM template WHERE title='templategroups' AND templatesetid=-2");
eval($gettemplate['template']);

Mutt
03-10-2002, 05:02 PM
THAT DID IT!!

Thanks so much. I'll go write up some directions.

Admin
03-11-2002, 11:10 AM
:)