Gossamer Forum
Home : General : Perl Programming :

Template drivern

Quote Reply
Template drivern
Is a template-based forum program suit for high traffic? There are around 200 online users every min and almost 200,000 posts stored in MySQL database. I heard using template will cause some kinds of memory leak but I am not very sure about this. I notice that all of Gossamer products are using templates, the author must have the knownledge on templates-based scrpts.

Anyone can suggest which forum program can handle this? template-version of W3T, vBulletin 2 or Gossamer forum?

Thanks in Advanced and I need more info before I buy the program. The program must be template-driven because our designers don't know programming well.


Quote Reply
Re: Template drivern In reply to
Yes Gossamer Forum is a prime example of a powerful system using templates.

I would hazard a guess that vbulletin and wwwthreads don't have as powerful a template parser as Gossamer Forum (although I know wwwthreads uses some of GT's modules...maybe not the template ones though).

But I expect there will be a bit of a wait for Gossamer Forum.

Quote Reply
Re: Template drivern In reply to
Hi,

Using templates does not cause a memory leak, or neccessairly slow things down. It all comes down to how the program is designed and coded.

I would always recommend templates as it makes it much easier to customize.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Template drivern In reply to
Thanks for the reply. And another question, which is the best Perl template module, HTML::Template, FastTemplate or your own module(is it modified from HTML::Template?) ...


Quote Reply
Re: Template drivern In reply to
GT modules by far....


========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: Template drivern In reply to
Quote:
(is it modified from HTML::Template?) ...

Certainly not. GT don't need to base their modules on a pre-existing module.


Last edited by:

PaulWilson: Sep 9, 2001, 4:07 AM
Quote Reply
Re: Template drivern In reply to
On a note about our template parser, this version of Gossamer Forum is the first product to use a redesigned version of the parser (I believe Gossamer Mail 2.0.5 includes it). Basically, the parser no longer parses a page on every request.

Basically, what happens with the new one is that the parser receives the request. At this point, the parser looks into a "compiled" directory to see if the file exists. If it does not, it loads the actual template parser, which takes a template file and converts it into actual Perl code, and saves this in a file in the "compiled" directory in the template directories. If the original file changes, the template is recompiled.

So now, instead of parsing a large template file every time you request a page (the page displayed when you view the posts in a forum is by far the largest at 20KB) instead of having the parse the entire page, all it does is run a file containing perl code - which spits out what you want.

Let's see another template parser that can do THAT Tongue


Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: Template drivern In reply to
In Reply To:
But I expect there will be a bit of a wait for Gossamer Forum.
Don't expect it to be too long - we are very close to a beta release - not to mention that that user side is being extensively tested right now.


Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: Template drivern In reply to
Hmm, what's the meaning of "the original file changes"? What's the compiled file looks like? static HTML page?

Actually I am very interesting in the template parser, is it possibile to release it as a CPAN module:)

Does your fileman 2 using the new parser?


Quote Reply
Re: Template drivern In reply to
In Reply To:
Hmm, what's the meaning of "the original file changes"?
The modification time of the original file is stored, and if the file has changed since it was last converted into Perl, it will be reparsed.

The compiled file is plain perl code. I can show you what a simple template would look like:

Let's say this is the template:
Quote:
Code:
my template<%if variable%>23<%else%>24<%endif%>

The compiled file will then look something like:
Quote:
Code:
print "my template";
if (get_var('variable')) {
print '23';
}
else {
print '24';
}

Obviously it's a little more complex than that, I've simplified it a bit to give a better indication of how it works.


Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] Template drivern In reply to
Wow, cool! Looking forward to your parser...
Quote Reply
Re: [sh2sg] Template drivern In reply to
Unfortunately, there are currently no plans to release the parser (or any other of our modules) individually or via CPAN.Unsure

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] Template drivern In reply to
If it's of any use, you can try the parser I wrote, and I can send you some instructions if interested.

It was inspired by Template.pm from Links 2.0, although written diferently (ie, uses a series of while loops instead of parsing on a line-by-line basis). It supports the same style tags (with the exception of the "ifnot" tag) plus file includes, nested "ifs", setting of variables from within the template, and optionally printing out available tags in a (buggy...) debug view. Warning though... it is still being worked on.

ftp://ftp.camelsoup.com/pub/CamelSoup/Parse.pm


--Philip
Links 2.0 moderator
Quote Reply
Re: [sh2sg] Template drivern In reply to
I cannot speak with any experience of Gossamer Threads' Forum, but from what I've seen, vBulletin can handle, at times, a million posts, and a couple hundred users at a time, assuming the server is up to it. :)

Best of luck with your choice. I'm a vBulletin-head...probably always will be, but it's not for everyone.

Chris Bowyer
MovieForums.com
"Do Not Taunt Happy Fun Ball."
Quote Reply
Re: [TWTCommish] Template drivern In reply to
As can GT Forum...but as mentioned it will not be a freeware program...it will definitely be a license-based program...I think people are looking for freeware solutions, which there are only a few decent ones left...

As wil mentioned...you get what you pay for...
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [sh2sg] Template drivern In reply to
I found this... Template Tookit ... same idea as Gossamer uses for template ...

http://www.template-toolkit.org/index.html
Quote Reply
Re: [sh2sg] Template drivern In reply to
Sorry, but there is no way on earth I'd want to download 654 files to parse templates.
Quote Reply
Re: [RedRum] Template drivern In reply to
ew... just looking at the examples, the code looks a little messy and really resembles HTML coding via CGI.pm; it appears mainly to just be used for inserting HTML fragments... Template Toolkit is not anything like GT::Template.

--Philip
Links 2.0 moderator
Quote Reply
Re: [Jagerman] Template drivern In reply to
In Reply To:
Unfortunately, there are currently no plans to release the parser (or any other of our modules) individually or via CPAN.Unsure

No current plans? No long term plans? Ever ever? It seems such a shame :-\. The module base GT have developed over the years has become very powerful. Surely it would make sense to share these with the Perl community? Angelic

- wil
Quote Reply
Re: [Wil] Template drivern In reply to
It would make more business sense not to share them (for free at least) ;)
Quote Reply
Re: [Paul] Template drivern In reply to
I dunno - would it? They are only common libraries - many of which can be found freely on CPAN already that do very similar, if not exact functions?

- wil
Quote Reply
Re: [Wil] Template drivern In reply to
So why release them if they are already available ;)
Quote Reply
Re: [Paul] Template drivern In reply to
Because a lot of us are accustmed to the way they work and are familiar with the strucutre?

- wil