[MODDB] eXtreme Styles mod - v1.01

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
User avatar
Arty
Former Team Member
Posts: 16654
Joined: Wed Mar 06, 2002 2:36 pm
Name: Vjacheslav Trushkin
Contact:

[MODDB] eXtreme Styles mod - v1.01

Post by Arty » Wed Apr 23, 2003 8:22 am

Mod is finally stable and was submitted to moddb

This mod is fast and powerful replacement for phpBB templates system.

It allowes to use php in templates, include other tpl files inside templates. Also it includes fast cache system (much faster than one in contrib)
that doesn't use database and will speed up forums several times.
Also it includes additional styles administration functions that allow you to
easily switch templates for users.

Important notes:

If your host runs in safe mode after installing mod you might need to go to admin control panel and change filename separator from "/" to "." for cache.

When upgrading from beta versions delete all cache.

If you can't use cache for some reason then you might still consider using this mod because it compiles and executes templates faster even without cache feature.


Update:

This mod updated to 1.01
Update time: 26.05.2003 11:00 GMT
Compatible with phpBB 2.0.x up to 2.0.6

Features:

- Fast templates compilation algorythm
- Fast templates execution (even if not cached)
- Checks for errors in template while compiling it
- Cache system that doesn't use database
- Cache directory can be changed at any time
- Additional styles administration features
- Mod can be turned off from administrator control panel (to disable it completely overwrite template.php with old one)
- Include other tpl files in templates with <!-- INCLUDE file.tpl -->
- PHP code in templates (php code starts with <?php or <!-- PHP --> and ends with ?> or <!-- ENDPHP -->)
- Unlimited <!-- BEGIN blah --><!-- END blah --> tags in one line.
- Auto-update feature that can check for newer versions of phpbb, styles, mods.
- Variable {LANG} that corresponds to current language. Can be
used to create truly multi-lingual templates (you can use this
in urls: "images/lang_{LANG}/icon_blah.gif").
- Variable {PHP} that corresponds to file extension with session
data. Can be used to avoid modding when you need to add some
url (like "somescript.{PHP}" or "script.{PHP}test=1"). Inlcudes & or ?
at the end of variable so you could easily add parameters.
- Variable {TEMPLATE} that corresponds to current template
directory (like "templates/subSilver/"). Can be used to avoid
filenames case confusion and to fix phpBB path error when
confirm_body.tpl and message_body.tpl are used in acp.
- Variable {TEMPLATE_NAME} that curresponds to current template name (like "subSilver")
- Feature to use subSilver tpl file (default template is changable) if there is no such file for current template. Should help is someone forgot to upload some tpl file to all templates when modding it.


Why is it faster:

- Doesn't use eval() where it can be avoided (uses eval only once to execute template if template isn't cached)
- Uses preg_match only where it is really needed.
- Faster variable assignment (uses variable pointers instead of eval when assigning block vars)
- Cache system doesn't use any database.
- Compiled code uses php only when it is needed (no useless php code like echo "<br />" . "\n";) so php executes compiled code much faster.
- Compiled code uses pointers instead of copying arrays. This speeds up execution of compiled code a lot.


For designers:

- use php inside templates. php code starts with <?php and ends with ?>
so you will be able to edit code without problems using all editors that
support php syntax hightlight. also you can use phpBB 2.2 tags <!-- PHP -->
and <!-- ENDPHP --> instead of <?php and ?>
- unlimited <!-- BEGIN key --><!-- END key --> in one line
- include other .tpl files in template with <!-- INCLUDE template.tpl -->
- check root switches (like switch_user_logged_in) inside other switches using
simple php code.
- to access root variables (set with $template->assign_vars) use $this->vars['VAR'] (alias for $this->_tpldata['.'][0]['VAR'])
- to access current item inside loop use "loopname_item" (like inside loop starting
with <!-- BEGIN postrow --> you can use $postrow_item['VAR'] inside php code)
- to access current item number inside loop use "loopname_i" (like inside loop
starting with <!-- BEGIN postrow --> you can use $postrow_i)
- if you want to access whole array instead of using $postrow_item['VAR'] you can use
this: $this->_tpldata['postrow.'][$postrow_i]['VAR']
- you can use variables {LANG}, {PHP}, {TEMPLATE} inside template, but you cannot
use it inside php code. see code example 3 on how to use it properly

Changes from 1.0

- Fixed bug that caused error on page if cache is disabled and more than one <!-- INCLUDE --> is used in file.


Installation:

- Unpack zip file
- Overwrite includes/template.php with on included in package
- Upload 11 other files (for admin control panel)
- Create directory "cache" and chmod it to 777.


MOD Released.

Download and support is now located at:


http://www.phpbb.com/phpBB/viewtopic.php?t=125251
Last edited by Arty on Wed Aug 06, 2003 9:13 am, edited 17 times in total.
Vjacheslav Trushkin / Arty.
Free phpBB 3.1 styles | New project: Iconify - modern SVG framework

Antony
Registered User
Posts: 529
Joined: Wed Feb 12, 2003 9:06 am

Post by Antony » Wed Apr 23, 2003 3:56 pm

Wow! Don't think I've ever ran this fast.

Thanks.

2.0.4 and runs perfect on a digitaltwilight theme.

Only one slight problem, in the ACP the settings for this are below the submit and reset buttons.
I've Been Banned!

User avatar
Arty
Former Team Member
Posts: 16654
Joined: Wed Mar 06, 2002 2:36 pm
Name: Vjacheslav Trushkin
Contact:

Post by Arty » Wed Apr 23, 2003 4:17 pm

> Only one slight problem, in the ACP the settings for this are below the submit and reset buttons.

you modded incorrectly. install.txt said "add before", not "add after".


Please tell me if you'll notice any bugs. I've been testing it on 2 forums for about a week now and didn't find any bugs, but i still might be missing something.
Vjacheslav Trushkin / Arty.
Free phpBB 3.1 styles | New project: Iconify - modern SVG framework

Antony
Registered User
Posts: 529
Joined: Wed Feb 12, 2003 9:06 am

Post by Antony » Wed Apr 23, 2003 4:44 pm

I shall fix that bug in a moment.

Proberly my mouse, it's really messed up.
I've Been Banned!

Partsking
Registered User
Posts: 132
Joined: Tue Aug 20, 2002 6:48 pm

Post by Partsking » Wed Apr 23, 2003 4:53 pm

^Yep, runs fast!

No problems on 2.0.4 and several themes.
"Believing oneself to be perfect is often the sign of a delusional mind"-Data

Antony
Registered User
Posts: 529
Joined: Wed Feb 12, 2003 9:06 am

Post by Antony » Wed Apr 23, 2003 5:44 pm

Tried on a few other baords, and workls perfect.
I've Been Banned!

Mighty_Y
Registered User
Posts: 36
Joined: Thu Dec 05, 2002 5:38 pm

Post by Mighty_Y » Wed Apr 23, 2003 5:50 pm

I want to run this too, but then I need to know what you changed in the template.php file because I use a to nuke ported version of phpBB and i'm running a site dedictated to porting mods from the original phpBB to the ported one. If you did alot of changes I'll port the templates.php file you delivered with the package, but that'll take some time.

Thanks,
Mighty_Y

User avatar
Arty
Former Team Member
Posts: 16654
Joined: Wed Mar 06, 2002 2:36 pm
Name: Vjacheslav Trushkin
Contact:

Post by Arty » Wed Apr 23, 2003 7:32 pm

Thanks everyone. If by the end of this week noone would find any bugs i think it would be a "release" instead of "beta" :)

> I need to know what you changed in the template.php file

It would be easier to say what i didn't change - i didn't change names of functions and its arguments, except for function compile(). But contents of all functions are different.

function compile() has completely new meaning now and doesn't compile to variable - always compiles to echo() output and if variable assignment needed uses ob_get_contents(). But that function shouldn't be called from outside anyway.

As for internal variables - better not use it directly.
$_tpldata is replaced by 2 arrays - $vars for root variables and $data for block variables.
$files is now 3 arrays instead of 1.
$root has corresponding value for cache root dir - $cachedir.
$compiled_code is used only when mod is disabled.
$uncompiled_code is also used only when mod is disabled, but it is still checked because attachment_mod uses it directly.
Vjacheslav Trushkin / Arty.
Free phpBB 3.1 styles | New project: Iconify - modern SVG framework

Mighty_Y
Registered User
Posts: 36
Joined: Thu Dec 05, 2002 5:38 pm

Post by Mighty_Y » Wed Apr 23, 2003 7:38 pm

It would be easier to say what i didn't change - i didn't change names of functions and its arguments, except for function compile(). But contents of all functions are different.

function compile() has completely new meaning now and doesn't compile to variable - always compiles to echo() output and if variable assignment needed uses ob_get_contents(). But that function shouldn't be called from outside anyway.

As for internal variables - better not use it directly.
$_tpldata is replaced by 2 arrays - $vars for root variables and $data for block variables.
$files is now 3 arrays instead of 1.
$root has corresponding value for cache root dir - $cachedir.
$compiled_code is used only when mod is disabled.
$uncompiled_code is also used only when mod is disabled, but it is still checked because attachment_mod uses it directly.

Thanks, I'll see if I can get it ported over

Antony
Registered User
Posts: 529
Joined: Wed Feb 12, 2003 9:06 am

Post by Antony » Wed Apr 23, 2003 7:52 pm

JUst passed on to a fiend who had template troubles with it being so heavy, and his forum runs super fast now.

This is by far the greatest template mod ever. You are a genious.
I've Been Banned!

heyyoBB
Registered User
Posts: 75
Joined: Tue Mar 11, 2003 8:49 pm
Location: France

sub-template

Post by heyyoBB » Wed Apr 23, 2003 8:11 pm

Is it working with sub-template mod ?

Antony
Registered User
Posts: 529
Joined: Wed Feb 12, 2003 9:06 am

Post by Antony » Wed Apr 23, 2003 8:19 pm

Now that is a question...needs a tester.
I've Been Banned!

Dr DLP
Registered User
Posts: 527
Joined: Sat Mar 29, 2003 5:34 pm
Location: France
Contact:

Post by Dr DLP » Wed Apr 23, 2003 8:23 pm

Woayuh !!!
Never seen my forums run so fast !!!!
CyberAlien , can I translate your mod and put him on phpbb french official site ?

chadsmith
Registered User
Posts: 261
Joined: Sat Jul 13, 2002 4:54 pm
Location: 67212
Contact:

Post by chadsmith » Wed Apr 23, 2003 8:43 pm

Very nice mod. I'm running it on my site - hella fast now. :D However I did find a minor problem. :| I have the statistics mod running on my site which loads fine normally, but it doesn't load at all with this mod.

To fix this I backed up my old template.php and renamed it nonxs_template.php then I made the following code changes so statistics.php would know to run the old template instead of the new one.

Code: Select all

# 
#-----[ OPEN ]------------------------------------------ 
#
common.php
# 
#-----[ FIND ]------------------------------------------ 
#
include($phpbb_root_path . 'includes/template.'.$phpEx);
# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
if ($non_xs)
 include($phpbb_root_path . 'includes/nonxs_template.'.$phpEx);
else
 include($phpbb_root_path . 'includes/template.'.$phpEx);
# 
#-----[ OPEN ]------------------------------------------ 
#
statistics.php
# 
#-----[ FIND ]------------------------------------------ 
#
$phpbb_root_path = './';
# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
$non_xs = 1;
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
This fix is only for people who would like to use the Statistics Mod by Billy Sauls and Acyd Burn along with this mod.

- Chad

User avatar
Arty
Former Team Member
Posts: 16654
Joined: Wed Mar 06, 2002 2:36 pm
Name: Vjacheslav Trushkin
Contact:

Post by Arty » Wed Apr 23, 2003 8:44 pm

Thanks for info on stats mod - i'll didn't find anything in it that changes template.php so i'll look at it and will change xs mod so it would work with stats mod.
heyyoBB wrote: Is it working with sub-template mod ?

I don't think so. I just looked at that mod and it modifies includes/template .php so i doubt that mod is compatible.
Dr DLP wrote: can I translate your mod and put him on phpbb french official site ?

Sure, but better wait for release. This is only a beta version.
Last edited by Arty on Wed Apr 23, 2003 8:54 pm, edited 1 time in total.
Vjacheslav Trushkin / Arty.
Free phpBB 3.1 styles | New project: Iconify - modern SVG framework

Locked

Return to “[2.0.x] MODs in Development”