How To Use eXtreme Styles on non phpBB Pages

Tutorials for <a href="http://www.phpbbstyles.com/viewtopic.php?t=356">eXtreme Styles mod</a> for phpBB 2.0.

Moderator: Moderators

Postby webnoobie on Mon Dec 12, 2005 5:08 pm

Greetings,

Ok. Im trying to create a new website using this templating system and I love it. But Im running into some errors and do not know why. I get the PHP and templating system to work, but when I break my template down into overall_header.tpl, index_body.tpl, and overall_footer.tpl, I keep getting some errors with in the template. Some of the pixels, nav buttons and etc are not working right. Would this be caused by the templating system. When I use it just as a normal HTML file, the template works fine. Let me know what you think! :D
webnoobie
Registered User
Registered User
 
Posts: 366
Joined: Wed Jun 08, 2005 10:38 pm
Location: My Computer

Postby webnoobie on Fri Jun 02, 2006 9:28 am

I am just curious, am I am to use the message_die(GENERAL ERROR, blah); code within the adaption of this file and use a normal error.tpl file like phpBB does with the same types of variables?
Best Regards:
webnoobie
webnoobie
Registered User
Registered User
 
Posts: 366
Joined: Wed Jun 08, 2005 10:38 pm
Location: My Computer

Postby Splinter on Sat Jun 03, 2006 12:29 pm

Hi,

Just started using this but i get this error:

Parse error: syntax error, unexpected ';' in C:\xampp\xampp\htdocs\site\includes\template.php on line 2129

Any idels?
User avatar
Splinter
Coder
Coder
 
Posts: 483
Joined: Sun Feb 20, 2005 10:12 pm
Location: Nottingham, UK

Postby webnoobie on Sat Jun 03, 2006 11:16 pm

Greetings,

Can you post lines 2120 to 2140. :D
Best Regards:
webnoobie
webnoobie
Registered User
Registered User
 
Posts: 366
Joined: Wed Jun 08, 2005 10:38 pm
Location: My Computer

Postby Splinter on Sun Jun 04, 2006 5:11 am

Before:

Code: Select all
         $this->vars['PHP'] = isset($this->vars['PHP']) ? $this->vars['PHP'] : $php;
         // adding language variable (eg: "english" or "german")
         // can be used to make truly multi-lingual templates
         $this->vars['LANG'] = isset($this->vars['LANG']) ? $this->vars['LANG'] : $board_config['default_lang'];
                                           // adding current template
         $tpl = $this->root . '/'; // $phpbb_root_path . 'templates/' . $this->tpl . '/';
         if(substr($tpl, 0, 2) === './')
         {
            $tpl = substr($tpl, 2, strlen($tpl));
         }
         $this->vars['TEMPLATE'] = isset($this->vars['TEMPLATE']) ? $this->vars['TEMPLATE'] : $tpl;
         $this->vars['TEMPLATE_NAME'] = isset($this->vars['TEMPLATE_NAME']) ? $this->vars['TEMPLATE_NAME'] : $this->tpl;
         $this->_tpldata['switch_xs_enabled.'] = array(array('version' => $this->xs_versiontxt));
      }
   }


After:

Code: Select all
         $this->vars['PHP'] = isset($this->vars['PHP']) ? $this->vars['PHP'] : $php;
         // adding language variable (eg: "english" or "german")
         // can be used to make truly multi-lingual templates
         $this->vars['LANG'] = isset($this->vars['LANG']) ? $this->vars['LANG'] = 'english';
                                           // adding current template
         $tpl = $this->root . '/'; // $phpbb_root_path . 'templates/' . $this->tpl . '/';
         if(substr($tpl, 0, 2) === './')
         {
            $tpl = substr($tpl, 2, strlen($tpl));
         }
         $this->vars['TEMPLATE'] = isset($this->vars['TEMPLATE']) ? $this->vars['TEMPLATE'] : $tpl;
         $this->vars['TEMPLATE_NAME'] = isset($this->vars['TEMPLATE_NAME']) ? $this->vars['TEMPLATE_NAME'] : $this->tpl;
         $this->_tpldata['switch_xs_enabled.'] = array(array('version' => $this->xs_versiontxt));
      }
   }

User avatar
Splinter
Coder
Coder
 
Posts: 483
Joined: Sun Feb 20, 2005 10:12 pm
Location: Nottingham, UK

Postby baz-x on Sun Jun 04, 2006 6:21 pm

use this:
Code: Select all
         $this->vars['PHP'] = isset($this->vars['PHP']) ? $this->vars['PHP'] : $php;
         // adding language variable (eg: "english" or "german")
         // can be used to make truly multi-lingual templates
         $this->vars['LANG'] = isset($this->vars['LANG']) ? $this->vars['LANG'] : 'english';
         // adding current template
         $tpl = $this->root . '/'; // $phpbb_root_path . 'templates/' . $this->tpl . '/';
         if(substr($tpl, 0, 2) === './')
         {
            $tpl = substr($tpl, 2, strlen($tpl));
         }
         $this->vars['TEMPLATE'] = isset($this->vars['TEMPLATE']) ? $this->vars['TEMPLATE'] : $tpl;
         $this->vars['TEMPLATE_NAME'] = isset($this->vars['TEMPLATE_NAME']) ? $this->vars['TEMPLATE_NAME'] : $this->tpl;
         $this->_tpldata['switch_xs_enabled.'] = array(array('version' => $this->xs_versiontxt));
      }
   }

Regards
baz-x [blog] [website]
current projects:
» [span style="color: darkgreen"]Mex[/span] [span style="color: darkred"][ 75% ][/span]
» Nickpage Mod 2.0.0 ME [span style="color: red"][ paused ][/span]
» Style Demo Mod 1.2.2 ME [span style="color: red"][ paused ][/span]
User avatar
baz-x
Moderator
Moderator
 
Posts: 706
Joined: Sun Aug 15, 2004 9:12 pm
Location: Cache Management of Mex

Postby Splinter on Mon Jun 05, 2006 8:37 am

Excellent!

Thanks baz-x. Works fine now.
User avatar
Splinter
Coder
Coder
 
Posts: 483
Joined: Sun Feb 20, 2005 10:12 pm
Location: Nottingham, UK

Re: How To Use eXtreme Styles on non phpBB Pages

Postby peterb on Fri Aug 04, 2006 1:43 am

[quote user="pentapenguin" post="29806"]Hello.
This post will explain how to get the eXtreme Styles template system working on non phpBB pages.
Important note: the XS system wasn't designed to be used outside of phpBB, so this is experimental and all features may not work.[/quote]

Hi,
Quick question: Does the XS entire system (folders like the file xs_mod) need to be uploaded to the root directory? Or, is it just what you have posted here dealing with template.php, cache folder etc?

Thank you much,
Peter
peterb
Registered User
Registered User
 
Posts: 6
Joined: Sun Jul 24, 2005 6:42 am

Postby UseLess on Fri Aug 04, 2006 1:48 am

Greetings,

All you need to use the XS template engine is 'includes/template.php', if you also want the cache feature then you'll also need a 'cache' dir. Along with the changes mentioned in this topic.
Movie Quote:
It's not the years honey, it's the mileage...

I do not provide any install services for phpBB, Mods or Styles.
Please do not pm me for support/scripting help - you won't get any reply. If you have a question then make a post in the appropriate forum.
User avatar
UseLess
Registered User
Registered User
 
Posts: 6220
Joined: Mon Sep 27, 2004 2:14 am
Location: North East, UK

Postby rm249 on Sat Nov 04, 2006 10:09 pm

Sorry to bring this topic back up again - But I have a question regarding using this outside of phpBB.
Currently I have this all setup to be totally outside of phpBB, with my own templates, images, includes, etc.

What I would like to know is if there is a way to have whole TPL files as a variable - for example:

Code: Select all
<?php
include('init.php');
$template = new Template;

$template->set_filenames(array(
   'home' => SITE_TEMPLATE .'/home.tpl',
));

include("includes/header.php");

$template->assign_vars(array(
   'site_name' => SITE_NAME,
   'page_title' => gettitle( CURRENT_PAGE ),
));

$template->pparse('home');
   
include("includes/footer.php");
?>


Now if I try to do the following, the content of the pparse in the assign_vars array gets outputted before everything else.
Code: Select all
<?php
include('init.php');
$template = new Template;

$template->set_filenames(array(
   'home' => SITE_TEMPLATE .'/home.tpl',
   'nav' => SITE_TEMPLATE .'/nav.tpl',
));

include("includes/header.php");

$template->assign_vars(array(
   'site_name' => SITE_NAME,
   'page_title' => gettitle( CURRENT_PAGE ),
   'nav' => $template->pparse('nav'),
));

$template->pparse('home');
   
include("includes/footer.php");
?>



I attempted to use ob_start with no success.

Any help is greatly appreciated.

Thanks,
Ryan Maffit
rm249
Registered User
Registered User
 
Posts: 10
Joined: Mon Jun 27, 2005 8:04 pm

Postby Splinter on Sat Nov 04, 2006 10:30 pm

Hi,

As soon as you use the pparse the page is generated. I'm no expert on this but could you not create nav.php and include it after header.php?
User avatar
Splinter
Coder
Coder
 
Posts: 483
Joined: Sun Feb 20, 2005 10:12 pm
Location: Nottingham, UK

Postby rm249 on Sat Nov 04, 2006 10:39 pm

Hmmm that is a possiblity, but my intent is to keep all template files together in the same location in the same format, the system I am working on right now will incorporate me and my friend's own-made Admin Panel along with extreme styles mod for the frontend. The backend will read all the tpl files from a certain folder and provide an editor for them.

I also know I could just include the file directly in the tpl file.. But I am trying to keep as much PHP out of the TPL files as possible.

Thanks
rm249
Registered User
Registered User
 
Posts: 10
Joined: Mon Jun 27, 2005 8:04 pm

Postby DooBDee on Sat Nov 04, 2006 10:40 pm

[quote user="rm249" post="83866"]What I would like to know is if there is a way to have whole TPL files as a variable - for example:[/quote]
Use file_get_contents() and assign result to variable, then yuo can do anything you want with that variable.
DooBDee
Website Ninja
DooBDee.net
User avatar
DooBDee
Moderator
Moderator
 
Posts: 3530
Joined: Tue Mar 01, 2005 6:28 pm
Location: DooBDee.net

Postby rm249 on Sat Nov 04, 2006 10:42 pm

Alright thank you DoobDee and Splinter I Will try this out. :)
rm249
Registered User
Registered User
 
Posts: 10
Joined: Mon Jun 27, 2005 8:04 pm

Postby Splinter on Sat Nov 04, 2006 10:48 pm

[quote user="rm249" post="83869"]Hmmm that is a possiblity, but my intent is to keep all template files together in the same location in the same format, the system I am working on right now will incorporate me and my friend's own-made Admin Panel along with extreme styles mod for the frontend. The backend will read all the tpl files from a certain folder and provide an editor for them.

I also know I could just include the file directly in the tpl file.. But I am trying to keep as much PHP out of the TPL files as possible.

Thanks[/quote]

You can just create nav.tpl and pparse it in nav.php. No need to have any php in the tpl's.
User avatar
Splinter
Coder
Coder
 
Posts: 483
Joined: Sun Feb 20, 2005 10:12 pm
Location: Nottingham, UK

PreviousNext

Return to eXtreme Styles mod tutorials

Who is online

Users browsing this forum: No registered users and 1 guest