phpBB Standalone Template Engine

Discussion forum for MOD Writers regarding MOD Development.
Locked
ChaosBringer
Registered User
Posts: 412
Joined: Mon Apr 19, 2004 11:30 pm
Contact:

Re: phpBB Standalone Template Engine

Post by ChaosBringer » Sun Feb 07, 2010 4:58 am

...[removed]...
Last edited by ChaosBringer on Tue Nov 24, 2015 10:34 pm, edited 1 time in total.

01000001 01101100 01101100 00100000 01111001 01101111 01110101 01110010 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01100001 01110010 01100101 00100000 01100010 01100101 01101100 01101111 01101110 01100111 00100000 01110100 01101111 00100000 01110101 01110011 00100001

User avatar
tbackoff
Former Team Member
Posts: 7022
Joined: Thu Jun 04, 2009 1:41 am
Location: cheerleading practice
Name: Tabitha Backoff

Re: phpBB Standalone Template Engine

Post by tbackoff » Sun Feb 07, 2010 6:09 am

*EDIT* nevermind
Flying is the second best thrill to cheerleaders; being caught is the first.

User avatar
imkingdavid
Former Team Member
Posts: 2667
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: phpBB Standalone Template Engine

Post by imkingdavid » Sun Feb 07, 2010 2:22 pm

Actually, if you're including common.php, it already has the phpBB template engine class in it, so you don't need the standalone one from here. Unless I'm reading your code wrong... :P
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

Kjtocool
Registered User
Posts: 186
Joined: Mon Jul 19, 2004 1:09 am

Re: phpBB Standalone Template Engine

Post by Kjtocool » Sun Feb 07, 2010 4:22 pm

No mod will do all of what I want, so I need to heavily modify something. I like doing it all from scratch simply because it lets ... or forces ... me to learn what everything is doing. Thus when changes are needed or additional functionality critical, I'm not held hostage by a mod that i don't fully understand.

As for not needing the standalone ... that may be true if I was going to use phpbb as my root, but I'm not. The site will look like:

/
/forum
/class
/layout

So essentially ... the forum will have it's own template engine, and the main site will have a simplified and streamlined version. They will be partially integrated, but disparate systems. There are many benefits to this, the main being a complete reduction in code bloat. I don't need a lot of what's included in common.php, I don't even need a lot of what's included in the template classes. So I'll remove it, have a much simpler and smaller code base to include, and it will make development that much easier. This way I can basically keep the two systems running separately, with the only true integration point being session management and leveraging the forum's database to house registered users, which was the goal. The other key gain is I can now use their template engine apart and independent of the forum's engine.

User avatar
imkingdavid
Former Team Member
Posts: 2667
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: phpBB Standalone Template Engine

Post by imkingdavid » Sun Feb 07, 2010 4:48 pm

Well that makes sense. :) Good luck with that.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

ChaosBringer
Registered User
Posts: 412
Joined: Mon Apr 19, 2004 11:30 pm
Contact:

Re: phpBB Standalone Template Engine

Post by ChaosBringer » Sun Feb 07, 2010 7:51 pm

Kjtocool wrote:No mod will do all of what I want, so I need to heavily modify something. I like doing it all from scratch simply because it lets ... or forces ... me to learn what everything is doing. Thus when changes are needed or additional functionality critical, I'm not held hostage by a mod that i don't fully understand.

As for not needing the standalone ... that may be true if I was going to use phpbb as my root, but I'm not. The site will look like:

/
/forum
/class
/layout

So essentially ... the forum will have it's own template engine, and the main site will have a simplified and streamlined version. They will be partially integrated, but disparate systems. There are many benefits to this, the main being a complete reduction in code bloat. I don't need a lot of what's included in common.php, I don't even need a lot of what's included in the template classes. So I'll remove it, have a much simpler and smaller code base to include, and it will make development that much easier. This way I can basically keep the two systems running separately, with the only true integration point being session management and leveraging the forum's database to house registered users, which was the goal. The other key gain is I can now use their template engine apart and independent of the forum's engine.
session management is a huge thing, that is deeply integrated into a bunch of different files ( functions.php, auth.php, the different dbals and template files....)
You could just set your phpbb_root_path variable to point to the right directory if you used the custom site mod ( i would do that if i needed those things you listed ).
Last edited by ChaosBringer on Tue Nov 24, 2015 10:35 pm, edited 1 time in total.

01000001 01101100 01101100 00100000 01111001 01101111 01110101 01110010 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01100001 01110010 01100101 00100000 01100010 01100101 01101100 01101111 01101110 01100111 00100000 01110100 01101111 00100000 01110101 01110011 00100001

Kjtocool
Registered User
Posts: 186
Joined: Mon Jul 19, 2004 1:09 am

Re: phpBB Standalone Template Engine

Post by Kjtocool » Sun Feb 07, 2010 8:03 pm

Well, worst case, I continue to include common.php and deal with the bloated code. Everything works as of now, the only functionality I don't have active is allowing a user to check the "Remember Me" box from the main site, and I'm confident I can get that working. I'm also fairly confident I can isolate at least a few unneeded classes and functions for removal ... either way, we'll see how it goes.

Part of the fun of this is learning more about the system. Who knows how far I'll get, but my goal is to get the layout engine and session management to be as isolated as possible.

nanothree
Registered User
Posts: 262
Joined: Wed Dec 10, 2003 8:33 am
Location: Doncaster, UK
Contact:

Re: phpBB Standalone Template Engine

Post by nanothree » Tue Feb 09, 2010 9:26 pm

ChaosBringer

I'd like to see the sessions class you got from phpBB. If you could make this available to look at id be very grateful.

I currently use the dbal as well. The dbal + templating system makes quite a good simple framework i've found.

The only addition i have made to the dbal is so that by default it returns objects from the database instead of an array.

Well done phpBB!

gamecharmer
Registered User
Posts: 62
Joined: Sat Dec 30, 2006 7:46 am

Re: phpBB Standalone Template Engine

Post by gamecharmer » Sun Feb 21, 2010 10:02 pm

I have successfully integrated the templating system into a small game I have co-authored. I changed the class names from template to aod_template so that it does not conflict with the main phpBB3 template system.

Basically, this game was written for phpBB3 and relies heavily on it. I am slowly breaking all ties to actual phpBB3 install and, instead, am writing it to be modular and work off of bridge scripts. So, when you setup the game, you pick your CMS, which then activates the proper authentication module, and connects the game to your users.

I still have to convert the language system, user system, and database systems over to run independently from phpBB3 core, as it's much easier working with modified phpBB3 files than creating them all from scratch. :)

If you would like a work-in-progress example, check out [removed]. The website does require registration to get to the game. Just look for "Age of Dragons" in the nav bar once you log in. :)
Last edited by camm15h on Sun Feb 21, 2010 10:42 pm, edited 1 time in total.
Reason: URL not needed (rule6a), already specified in profile if needed.

User avatar
Nelsaidi
Registered User
Posts: 525
Joined: Mon Feb 11, 2008 1:59 pm
Location: London, UK
Contact:

Re: phpBB Standalone Template Engine

Post by Nelsaidi » Sun Feb 21, 2010 10:36 pm

eviL<3 wrote:You may be interested it PDO, the database abstraction layer that comes with PHP5.
Seconded, what I've done was extended the base class into my own DBAL - Its parameter binding is awesome, which I utilise in my own private phpBB mods sometimes :P
Image
Click here to find out what eRepublik is.

ChaosBringer
Registered User
Posts: 412
Joined: Mon Apr 19, 2004 11:30 pm
Contact:

Re: phpBB Standalone Template Engine

Post by ChaosBringer » Thu Feb 25, 2010 8:48 am

...[removed]...
Last edited by ChaosBringer on Tue Nov 24, 2015 10:35 pm, edited 1 time in total.

01000001 01101100 01101100 00100000 01111001 01101111 01110101 01110010 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01100001 01110010 01100101 00100000 01100010 01100101 01101100 01101111 01101110 01100111 00100000 01110100 01101111 00100000 01110101 01110011 00100001

ChaosBringer
Registered User
Posts: 412
Joined: Mon Apr 19, 2004 11:30 pm
Contact:

Re: phpBB Standalone Template Engine

Post by ChaosBringer » Thu Feb 25, 2010 8:51 am

nanothree wrote:ChaosBringer

I'd like to see the sessions class you got from phpBB. If you could make this available to look at id be very grateful.

I currently use the dbal as well. The dbal + templating system makes quite a good simple framework i've found.

The only addition i have made to the dbal is so that by default it returns objects from the database instead of an array.

Well done phpBB!

http://forums.devshed.com/php-developme ... 75453.html

Its not made exactly from phpBB. I tried doing that but it didnt work as planned so i made my own, but with a lot of influence from phpBB's session class.

BTW: Released under GPLv3 as i am building software that i will be selling that is going to use this session class.
Last edited by ChaosBringer on Thu Feb 25, 2010 9:06 am, edited 1 time in total.

01000001 01101100 01101100 00100000 01111001 01101111 01110101 01110010 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01100001 01110010 01100101 00100000 01100010 01100101 01101100 01101111 01101110 01100111 00100000 01110100 01101111 00100000 01110101 01110011 00100001

nanothree
Registered User
Posts: 262
Joined: Wed Dec 10, 2003 8:33 am
Location: Doncaster, UK
Contact:

Re: phpBB Standalone Template Engine

Post by nanothree » Thu Feb 25, 2010 9:02 am

just out of interest what benefits does your session class bring?

Regarding using a template from a database, i reckon it could be possible. Not one hundred percent though and cant look at the code at the moment. I doubt it would be an easy change however.

It would probably be quite easy to get a single template from a database but i wonder how you would go about using nested templates from a database.

I think you would probably need to extend the current class to add this functionality.

I'll have a look at the code when i get home tonight and see if i can see an easy way of doing it

ChaosBringer
Registered User
Posts: 412
Joined: Mon Apr 19, 2004 11:30 pm
Contact:

Re: phpBB Standalone Template Engine

Post by ChaosBringer » Thu Feb 25, 2010 9:11 am

nanothree wrote:just out of interest what benefits does your session class bring?....
I created the sessions class for my personal use. The thing was that the phpBB sessions class had a lot of stuff I did not need, so i created my own instead. I am in the process of doing a bit of a start up and releasing different pieces of software that will use user management, so I'll just plug this in, and done.

To plug it in to different applications it would require very small changes, such as changing URLs and some contant values, but other than that its pretty straight forward...From my use of it so far, its very fast.

01000001 01101100 01101100 00100000 01111001 01101111 01110101 01110010 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01100001 01110010 01100101 00100000 01100010 01100101 01101100 01101111 01101110 01100111 00100000 01110100 01101111 00100000 01110101 01110011 00100001

nanothree
Registered User
Posts: 262
Joined: Wed Dec 10, 2003 8:33 am
Location: Doncaster, UK
Contact:

Re: phpBB Standalone Template Engine

Post by nanothree » Thu Feb 25, 2010 10:48 am

does it include user management such as logging in etc?

I'm in the process of developing m,y own little framework for projects and really need something like this.

Locked

Return to “[3.0.x] MOD Writers Discussion”