Firefox PHP

Template like AutoWeek

Posted by Edwin 
Template like AutoWeek
February 19, 2007 10:20AM
I've just downloaded the bunch after I saw it on [autoweek.nl].
How can I create a template like that one with the images before the titles(subtitles)?

And how can I integrate it within' a website without creating different pages?
Re: Template like AutoWeek
February 19, 2007 11:02AM
AutoWeek uses some more specific hacks than only a different template. For example, the active topic list and the new topic list aren't part of Phorum.

For creating a template like that, you'll have to change the index_new.tpl to include the images somehow. If there need to be different images for different forums, then I would relate the forum's id to the name of the image file. That way, it's easy to add dynamic image entries to the template. Asuming that your template is called "yourtemplate", you could use something like this for example:
<img src="./templates/yourtemplate/forumicons/{FORUMS->forum_id}.gif"/>
This way, you can store images by using <forum_id>.gif as their name in the template's subdirectory "forumicons".

And how can I integrate it within' a website without creating different pages?

Normally, you can't. It's much easier to put the right code in the header.tpl and footer.tpl of Phorum, than to try and use your already existing website templates. One of the biggest problems is that the header doesn't only contain static data. It also contains things like dynamic CSS and JavaScript declarations and code that is used for alerting users of new PM's and moderators of new messages and/or users to moderate.

I have integrated Phorum in full in my own website [www.gitaar.net], but there the integration goes all the way. Phorum is a full slave of my own user and site system. There, Phorum is reduced to a system that only provides all the parts that are needed to build a page and some special glue code makes sure that all data is put at the right places in the main site template. Based on your message, I don't think that you need embedding up to this extend. If you do, then check out the embed phorum thread.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce



Edited 1 time(s). Last edit at 05/02/2008 01:48AM by mmakaay.
Re: Template like AutoWeek
May 01, 2008 10:04PM
I can't make this work.

<img src="./templates/yourtemplate/forumicons/{FORUMS->id}.gif"/>

Does it go here?:

<th class="forum-name"><img src="./templates/yourtemplate/forumicons/{FORUMS->id}.gif"/><a href="{FORUMS->url}">{FORUMS->name}</a></th>

Thanks for the help
Re: Template like AutoWeek
May 02, 2008 01:48AM
Yes, that looks like what you need, asuming that your template directory is actually called "yourtemplate", since that's the name that you used in the example. What you can also do is take a look at the generated page source and see what image path is shown in there. There you can look if the id field was put in there like expected.

BTW: I see one possible problem here.It should be {FORUMS->forum_id} instead of {FORUMS->id}. I'll change that in my original posting as well.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Template like AutoWeek
May 02, 2008 02:40PM
Thanks Maurice!

Now it works....
Sorry, only registered users may post in this forum.

Click here to login