Author |
Message |
Sylver Cheetah 53 Board Member
Joined: 17 Dec 2008
Posts: 426 Location: Milky Way
|
Posted: Thu Jan 07, 2010 10:56 am Post subject: Different image set on every forum (like sub-Templates) |
|
|
Hi!
What I want is to put different background image, different logo and different topic isons on some forums.
I've tryed Ptirhiik's sub templates mod on a test board, using EasyMOD, and now I get a blank page in Admin Panel. But not all page, only the left navigation part. I am not sure if sub-Templates is supposed to work on phpBB 2.0.23.
Ptirhiik, I've seen you around, can you please give me a hand?
Thanks! _________________ Image link
My Forum || My Blog
phpBB2 forever! |
|
Back to top |
|
|
Ram Board Member
Joined: 23 Dec 2008
Posts: 100 Location: Somewhere over the rainbow
|
Posted: Thu Jan 07, 2010 1:12 pm Post subject: Re: Different image set on every forum (like sub-Templates) |
|
|
I think it work.
For the blank page in Admin Panel that sometimes happen when a MOD don't work with php5. Could I suggest you something? |
|
Back to top |
|
|
Sylver Cheetah 53 Board Member
Joined: 17 Dec 2008
Posts: 426 Location: Milky Way
|
Posted: Thu Jan 07, 2010 4:35 pm Post subject: Re: Different image set on every forum (like sub-Templates) |
|
|
Of course! At this point, I'm open for any sugestion. _________________ Image link
My Forum || My Blog
phpBB2 forever! |
|
Back to top |
|
|
Ram Board Member
Joined: 23 Dec 2008
Posts: 100 Location: Somewhere over the rainbow
|
Posted: Thu Jan 07, 2010 6:19 pm Post subject: Re: Different image set on every forum (like sub-Templates) |
|
|
Supposing that is a problem with php5 ^^
- Delete all copies of saving files in admin directory (file like admin_board_bak.php)
- Open admin/index.php
Find :
Code: | if( preg_match("/^admin_.*?\." . $phpEx . "$/", $file) )
{
include('./' . $file);
} |
Replace with :
Code: | if( preg_match("/^admin_.*?\." . $phpEx . "$/", $file) )
{
echo "fichier $file<br />";
include('./' . $file);
echo "Loaded successfully<br />-----<br />";
} |
So the file which raises problem will be the shown last one and will not be followed of "Loaded successfully". |
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Thu Jan 07, 2010 11:50 pm Post subject: Re: Different image set on every forum (like sub-Templates) |
|
|
You might want to change "fichier" for "file", though, if you don't speak French |
|
Back to top |
|
|
Sylver Cheetah 53 Board Member
Joined: 17 Dec 2008
Posts: 426 Location: Milky Way
|
Posted: Fri Jan 08, 2010 4:59 pm Post subject: Re: Different image set on every forum (like sub-Templates) |
|
|
Now, this is what I get on admin's navigation panel:
Code: | file admin_board.php
Loaded successfully
-----
file admin_db_utilities.php
Loaded successfully
-----
file admin_disallow.php
Loaded successfully
-----
file admin_easymod.php
Loaded successfully
-----
file admin_forumauth.php
Loaded successfully
-----
file admin_forums.php
Loaded successfully
-----
file admin_forum_prune.php
Loaded successfully
-----
file admin_groups.php
Loaded successfully
-----
file admin_mass_email.php
Loaded successfully
-----
file admin_ranks.php
Loaded successfully
-----
file admin_smilies.php
Loaded successfully
-----
file admin_styles.php
Loaded successfully
-----
file admin_subtemplates.php |
_________________ Image link
My Forum || My Blog
phpBB2 forever! |
|
Back to top |
|
|
Ram Board Member
Joined: 23 Dec 2008
Posts: 100 Location: Somewhere over the rainbow
|
Posted: Sat Jan 09, 2010 3:23 am Post subject: Re: Different image set on every forum (like sub-Templates) |
|
|
As you can see, the file admin_subtemplates.php is not followed with "Loaded successfully", so this is the file that cause the trouble.
The MOD looks not working with php5. |
|
Back to top |
|
|
Acaria Board Member
Joined: 20 Feb 2009
Posts: 238
|
Posted: Sat Jan 09, 2010 7:05 am Post subject: Re: Different image set on every forum (like sub-Templates) |
|
|
So wait, what does this Mod do?
Could you upload it so I can take a look? I think if you're just going for custom icons for each forum, I can offer my own tidbit of code. |
|
Back to top |
|
|
Sylver Cheetah 53 Board Member
Joined: 17 Dec 2008
Posts: 426 Location: Milky Way
|
Posted: Sat Jan 09, 2010 8:47 am Post subject: Re: Different image set on every forum (like sub-Templates) |
|
|
Code: | ## MOD Title: Sub-templates
## MOD Author: Ptirhiik < ptirhiik@clanmckeen.com > (Pierre) http://rpgnet.clanmckeen.com
## MOD Description:
## This mod allows you to set a different template - or parts of template -
## for a forum or an entire category
## MOD Version: 1.0.4
##
## Installation Level: easy
## Installation Time: 15 Minutes
## Files To Edit:
## privmsg.php
## viewtopic.php
## includes/functions.php
## includes/functions_post.php
## includes/functions_search.php
## includes/template.php
## includes/topic_review.php
##
## Included Files:
## admin_subtemplates.php
## admin_subtpl_edit_body.tpl
## admin_subtpl_list_body.tpl
## admin_subtpl_styles_body.tpl
## lang_extend_sub_template.php
## sub_templates.cfg |
It does a little more then just different images on each forum, but I don't think I'll need all that some time soon.
There is also another MOD: Random Logo for Every Page, Forum or Category. But I remember testing it some time ago and it did not work.
If you can take a look here, you'll se a subforum for Fifa 08 championship. My intention is to put balls in stead of the topic icons, different background image and maybe even different logo. I want it to be as different as possible then the rest of my board. _________________ Image link
My Forum || My Blog
phpBB2 forever! |
|
Back to top |
|
|
hoimyr Board Member
Joined: 16 Apr 2009
Posts: 115 Location: Oslo
|
Posted: Sat Mar 10, 2012 10:33 am Post subject: Re: Different image set on every forum (like sub-Templates) |
|
|
Ok, i got a problem now with the ACP not showing up. And it is beqause of this mod and the admin_subtemplates.php file.
When i remove this part of the code(or whole file) i can see the acp again. Can someone see what we need to change to make it work with php5 again?
Code: |
//
// functions
//
function board_front_end( &$board, $main='Root', $level=0, $cur_stpl='c0' )
{
global $lang, $stylerow, $sub_templates;
global $tree;
// add the level
$row = array();
$this = isset($tree['keys'][$main]) ? $tree['keys'][$main] : -1;
if ($main == 'Root')
{
$row['type'] = POST_CAT_URL;
$row['id'] = 0;
$row['main'] = '';
$row['name'] = $lang['Index'];
$row['level'] = $level;
$row['stpl'] = isset( $sub_templates[ $row['type'] . $row['id'] ] ) ? $row['type'] . $row['id'] : $cur_stpl;
}
else
{
$row['type'] = $tree['type'][$this];
$row['id'] = $tree['id'][$this];
$row['main'] = $tree['type'][$this] . $tree['id'][$this];
$row['name'] = ($tree['type'][$this] == POST_FORUM_URL) ? $tree['data'][$this]['forum_name'] : $tree['data'][$this]['cat_title'];
$row['level'] = $level;
$row['stpl'] = isset( $sub_templates[ $row['type'] . $row['id'] ] ) ? $row['type'] . $row['id'] : $cur_stpl;
}
$board[] = $row;
// get sub-levels
for ($i=0; $i < count($tree['data']); $i++)
{
if ( $tree['main'][$i] == $main )
{
$cur = $tree['type'][$i] . $tree['id'][$i];
$stpl = isset( $sub_templates[ $cur ] ) ? $cur : $cur_stpl;
board_front_end( $board, $cur, $level+1, $stpl );
}
}
} |
|
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Sat Mar 10, 2012 1:57 pm Post subject: Re: Different image set on every forum (like sub-Templates) |
|
|
I honestly have no idea, but should there really be spaces there?
$sub_templates[ $row['type'] . $row['id'] ] |
|
Back to top |
|
|
hoimyr Board Member
Joined: 16 Apr 2009
Posts: 115 Location: Oslo
|
Posted: Sat Mar 10, 2012 4:25 pm Post subject: Re: Different image set on every forum (like sub-Templates) |
|
|
Thanks but no change. It generates php-cgi.core now so PHP crashes bigtime.. But i have not given up. Must figgure it out. |
|
Back to top |
|
|
hoimyr Board Member
Joined: 16 Apr 2009
Posts: 115 Location: Oslo
|
Posted: Sun Mar 11, 2012 7:46 am Post subject: Re: Different image set on every forum (like sub-Templates) |
|
|
Figgured it out. Ok do this:
Open:
admin_subtemplates.php
Find:
Code: | $this = isset($tree['keys'][$main]) ? $tree['keys'][$main] : -1; |
Replace with:
Code: | $this_key = (isset($tree['keys'][$main])) ? $tree['keys'][$main] : -1; |
Find: (multiple places! Change them all)
Replace with:
Works now with php5 |
|
Back to top |
|
|
hoimyr Board Member
Joined: 16 Apr 2009
Posts: 115 Location: Oslo
|
Posted: Fri Apr 20, 2012 4:55 am Post subject: Re: Different image set on every forum (like sub-Templates) |
|
|
Well i got problems with sub-templates and custom mods that wanted other paths so i ended up with a hardcode-fix. Here it is if someone also needs:
Open viewtopic.php
Find:
Code: | $template->set_filenames(array(
'body' => 'viewtopic_body.tpl')
); |
After add:
Code: |
// Start custom template
$res = mysql_fetch_object(mysql_query("SELECT forum_id FROM phpbb_posts WHERE topic_id = '" . intval($_GET['t']) . "'"));
if($res->forum_id == 1) {
$template->set_filenames(array(
'body' => 'my-custom-viewtopic.tpl')
);
}
else {
$template->set_filenames(array(
'body' => 'viewtopic_body.tpl')
);
}
//END custom template |
Change the 1 to what category you want the custom template to show up in.
Copy your viewtopic.tpl to my-custom-viewtopic.tpl(or what you like) and make your changes in the template. Banners, buttons, layout etc. |
|
Back to top |
|
|
|