A Digital Age Deserves A Digital Leader

A neat way to sent different forums to different templates

A neat way to sent different forums to different templates

Postby kanaloa » Sat Aug 11, 2007 2:44 am

If you ever wanted to customize your phpbb "viewtopic.tpl" templates for your individual forums, below is a good way to do so. You'll just need the forum ID's you want to direct to which templates.

I must have toyed with this for half an hour before I figured out I had to use "else if" instead of "if" again. Those old computer science classes came back to me, LOL.

Code: Select all
         if ($forum_id == ## || $forum_id == ##)  {
            $template->set_filenames(array('body' => 'your_template_1.tpl'));      
                      }   
         
         else if ($forum_id == ## || $forum_id == ##)  {
            $template->set_filenames(array('body' => 'your_template_2.tpl'));      
         }
         
         else if ($forum_id == ## || $forum_id == ##)  {
            $template->set_filenames(array('body' => 'your_template_3.tpll'));      
         }
         
         else {
         $template->set_filenames(array('body' => 'your_default_template.tpl'));
         }
"Greatness is not a function of circumstance. Greatness, it turns out, is largely a matter of conscious choice, and discipline." - Jim Collins
President
User avatar
Posts: 11795
Joined: Sun Mar 10, 2002 1:18 am
Location: HI & SC
Real Name: John Derrick

Return to HTML, CSS, and Scripts

Who is online

Users browsing this forum: No registered users and 4 guests

cron
cron