[submitted] 2.0.4 : sub-template v 1.0.0

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.
User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

[submitted] 2.0.4 : sub-template v 1.0.0

Post by Ptirhiik »

This mod is designed to have different templates per forums or categories. You can have ie a subSilver template on most forums and cats, then have a subTail for all forums of a particular category, and also a subGreen on one forum of this cat (or any cat btw ;)).

It also fits the popular ask of having different logos and pic folders suiting a forum thematic on a board (it has been a non-solved KMR I think ;)).

The template can be partial (only the modified tpl) or complete. Most of the time overall_header.tpl and images/ will be requested.

If you plan to use different colors and/or layers, you'll have to activate in the overall_header.tpl the css link to the good stylesheet.

The sub-templates must be stored in a directory under the default template, and the link of a sub-template to the forums and categories is done within the Admin Control Panel.

:arrow: the mod plus the 2 basic sub-templates I use on the demo board (zip file, near 180k because of the pictures)
:arrow: demo : check cat 2, cat 2.2, and their forums

nb.: the sub-template mod is designed to work perfectly without the categories hierarchy mod ;).

This is a very quick mod to apply (about 5 minutes or less), but the time doesn't include the choose or design of a sub-template :).



Changelog :
  • 1.0.0 :
    o add the ability to choose many css files (avoid having to duplicate overall_header.tpl when not needed)
  • 0.0.2 :
    o add the admin part,
    o free the directory name
  • 0.0.1 : initial beta
Last edited by Ptirhiik on Thu Nov 06, 2003 7:08 pm, edited 6 times in total.
User avatar
agentneo
Registered User
Posts: 178
Joined: Tue May 28, 2002 10:33 pm
Location: USA
Contact:

Post by agentneo »

k, i have it installed, how do i change the theme for a certain forum?

http://FGServers.com
- Low Ping Gaming Servers for $2.99 / Slot!
PM me if you need PHP, Design, or forum work done for cheap paypal $
User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Post by Ptirhiik »

[edit cause easiest way to proceed with the v 0.0.2]
Last edited by Ptirhiik on Fri Apr 04, 2003 6:22 am, edited 1 time in total.
User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Post by Ptirhiik »

[edit : admin part done]
Last edited by Ptirhiik on Fri Apr 04, 2003 7:28 am, edited 1 time in total.
Syntroll
Registered User
Posts: 12
Joined: Thu Jan 09, 2003 8:30 pm
Location: Rouen // France
Contact:

Post by Syntroll »

It's a good mod !!
And it works perfectly (in my case) ...
good job Ptirhiik

i'll try to install this mod on my custom version (who is in preparation)

THX for this mod
I'm french and not accustomed with English !
My website : Commun-0-Troll
netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

Cool, i can use this :)
Defend the game:
Image
User avatar
muse2001
Registered User
Posts: 20
Joined: Mon Dec 30, 2002 7:27 pm

Post by muse2001 »

works very well, very good job :)
Tchocky / muse2001 - French MOD Team Leader
Contact: [email protected]
Translations & development of phpBB MODs
If I'm not here, I'm certainly there: http://mods.phpbb-fr.org
User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Post by Ptirhiik »

[edit : admin done]
Last edited by Ptirhiik on Sat Apr 05, 2003 2:34 am, edited 2 times in total.
User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Post by Ptirhiik »

And here we are :) v 0.0.2

You can now link the sub-templates within the admin configuration panel to the forums and categories (no database modifications required).

To install it, just follow the instruction of the mod description. The zip file includes two basic sub-templates (images directory and an overall_header.tpl) which have to be installed in the directory subSilver (assuming this is your main theme ;)).

A sub-template is basicly a standard templates, but most of the files can be deleted, as the sub-template process use the main template files by default (if not found in the sub-templates dir, the main template file will be used).

In each main template directory you are using, you have to create a clear file named sub_templates.cfg being writable (CHMOD 666). In this file will be stored the sub-template configuration (links to forums and cats, and the image file).

You can set many images set for the same sub-template, only by having different images config file in the same sub-template. A sub-template can be also only a reduce images set (ie only a logo ;)).

The mod only requires to use in the overall_header.tpl the external css sheet, rather than the ugly style redifining. So you'll have to :
  • inhibate (or delete) all the redifined "<style></style>",
  • activate in the sub-template overall_header.tpl the line :

    Code: Select all

    <link rel="stylesheet" href="templates/subSilver/{T_HEAD_STYLESHEET}" type="text/css">

When your sub-templates will be ready, just go to the admin control panel, choose "Sub-template", create a new sub-template ref, then link it to the forums or categories you want it to appear ;).


[edited to suit the v 1.0.0 RC-1]
Last edited by Ptirhiik on Sat Apr 05, 2003 2:32 am, edited 1 time in total.
netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

Sounds good, sounds like this is going somewhere interesting!
Defend the game:
Image
User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Post by Ptirhiik »

In fact, one of the last point I want to have a look on is on the ability to only have to not qualify the css on the overall_header.tpl, also in the main templates : this will avoid to duplicate the overall_header.tpl, which is often a hardly moded file. The better way I found till now is to split it, keeping in a separate file the real header (from begining to the <a name=top>) and the rest of the file in the standard overall_header.tpl. Doing this will allow to not duplicate the overall_header.tpl until you have the need to. But I want to find other solutions before doing this one, to choose the easiest and/or the smarter ;).
Last edited by Ptirhiik on Sat Apr 05, 2003 2:33 am, edited 1 time in total.
netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

I'm not entirly sure what you're getting at there, but in the past i've modified my overall_header to use a variable assigned in page_header to get the css file, e.g.

in page_header.php

Code: Select all

'U_CSS' => $template->root . '/' . $theme['head_stylesheet'],
and in overall_header.tpl

Code: Select all

<link rel="stylesheet" href="{U_CSS}" type="text/css" />
would something like that be the kind of thing you're thinking of?
Defend the game:
Image
User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Post by Ptirhiik »

Yep, this is my second option, but both of them implicate a modification of the main templates, without no direct effect on the display of this main template. I think also to override the board_config theme css var within the templates.php, but I have to check if doing this there will work.


Edit: dev done, and problem solved ;). The solution I choose is to overwrite the value of $theme['head_stylesheet'] when just before the display. It works very well, but you have to activate the external css in the main template overall_header.tpl. BTW, it's a good thing to do :). I have to finalize some test, and I will post them what will be the 1.0.0 RC-1 version, with a short period of RC test before releasing it ;).
User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Post by Ptirhiik »

And then we're going to an RC step for the version that will be the first release ;).
gbm
Registered User
Posts: 11
Joined: Fri Nov 15, 2002 4:44 am

Post by gbm »

I installed, but now when I go to my message board it says

Fatal error: Call to undefined function: phpbb_realpath() in template.php on line 235


I have tried to mod and re- mod, but it just wont work.... does anyone have a template file that works with the sub forum? I havent modded this file before now, and it would probably work. thanks.
Image
Locked

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