https://www.icyphoenix.com/viewtopic.php?f=35&t=1088
-----------------------------------
charades
Wed 07 Feb, 2007 00:24

Where To Change The Call To Overall_header.tpl
-----------------------------------
I appreciate if anyone can suggest me if it i spossible 

What if I make a copy of overall_header.tpl and call it with different names and call each one depending on which forum it is.

Where exactly I can change the call Lets say for example 

I copied overall_header.tpl and create another tpl file with different name like music_header.tpl.

Where exactly I can put the if condition so that whenever user enters music forum he will see music_header.tpl instead of overall_header.tpl.


Any help in this regard is greatly appreciated.

Thanks


-----------------------------------
difus
Wed 07 Feb, 2007 17:45

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
if for quick answer
I'm thinking that you have to leave original header only minimized [without logo ,change height to minimum]
and add new different pictures like header


-----------------------------------
Mighty Gorgon
Mon 12 Feb, 2007 02:32

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
You have to edit the page_header.php

[code]	$template->set_filenames(array('overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl'));[/code]

You need to add a condition check there... :wink:

Or you can use the simple_header and add everything you need in the tpl... to do this add:
[code]$gen_simple_header = true;[/code]

In the page you are parsing... of course before the inclusion of page_header... :roll:


-----------------------------------
charades
Tue 27 Feb, 2007 19:44

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
[quote user="Mighty Gorgon" post="8689"]You have to edit the page_header.php

[code]	$template->set_filenames(array('overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl'));[/code]

You need to add a condition check there... :wink:

Or you can use the simple_header and add everything you need in the tpl... to do this add:
[code]$gen_simple_header = true;[/code]

In the page you are parsing... of course before the inclusion of page_header... :roll:[/quote]

Wow How did I missed this post...

I failed to understand and I sincerely request you to be please explain me.

I feel stupid but I don't want to change something with half knowledge.

Please Mighty ...


-----------------------------------
Mighty Gorgon
Wed 28 Feb, 2007 02:11

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
It means that you have at least 2 ways to apply what you want to apply...

If you want to use the first one you should use a condition check before that assignment.

Something like this:
[codeblock]if ( isset($_GET[POST_FORUM_URL]) )
{
	$tmp_forum_id = intval($_GET[POST_FORUM_URL]);
}
if ($tmp_forum_id == 1)
{
...
}[/codeblock]
Add your code instead of the dots.

Let me know it this is just fine for you.


-----------------------------------
charades
Fri 02 Mar, 2007 03:56

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
[quote user="Mighty Gorgon" post="9255"]It means that you have at least 2 ways to apply what you want to apply...

If you want to use the first one you should use a condition check before that assignment.

Something like this:
[codeblock]if ( isset($_GET[POST_FORUM_URL]) )
{
	$tmp_forum_id = intval($_GET[POST_FORUM_URL]);
}
if ($tmp_forum_id == 1)
{
...
}[/codeblock]
Add your code instead of the dots.

Let me know it this is just fine for you.[/quote]

I really did suck MG in making this change.  :cry:  :cry:  

I sincerely request you to please let me know what's wrong in this coding....and please keep in mind I don't have any knowledge of PHP whatsoever.


[color=#ff0000]// Parse and show the overall header.
include($phpbb_root_path . 'includes/functions_rate.'.$phpEx);
if ( isset($_GET[POST_FORUM_URL]) ) 
{ 
 $tmp_forum_id = intval($_GET[POST_FORUM_URL]); 

	if ($tmp_forum_id == 1) 
	{ 
	$template->set_filenames(array(
		'overall_header' => ( empty($gen_simple_header) ) ? 'instrumental_header.tpl' : 'simple_header.tpl')
	);
	}
	else if ($tmp_forum_id == 2) 
	{ 
	$template->set_filenames(array(
		'overall_header' => ( empty($gen_simple_header) ) ? 'vocal_header.tpl' : 'simple_header.tpl')
	);
	}
                else
	{
		$template->set_filenames(array(
		'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
	);
	}
}
//
// Generate logged in/logged out status
//[/color]


-----------------------------------
Mighty Gorgon
Sun 04 Mar, 2007 12:59

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
The code you posted should work... isn't it? :roll:


-----------------------------------
charades
Sun 04 Mar, 2007 23:13

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
[quote user="Mighty Gorgon" post="9460"]The code you posted should work... isn't it? :roll:[/quote]

No mighty it is not working. These are the situation's after I modified the code.
[list]
[*][color=#3300ff]First situation is overall forum.

It is appearing without any borders and totally white back ground similar to Lo-Fi Version instead of Full version[/color]

[*][color=#ff00e5]For those forums for which there is no special overall header

Everything is fine[/color]

[*].[color=#ff0000]And For those forums which are in the IF condition where I wanted to see the new header files this is what I get.

Template->loadfile(): No files found for handle instrumental_header  

or

Template->loadfile(): No files found for handle vocal_header  
[/color]
[/list]
I am sure these is something else which I need to do along with the code which I modified above but unable to find out what and where exactly I need to change


-----------------------------------
Mighty Gorgon
Thu 08 Mar, 2007 01:49

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
Are you sure to have used this code and the files are present in the template folders?

[code]// Parse and show the overall header.
include($phpbb_root_path . 'includes/functions_rate.'.$phpEx);
if ( isset($_GET[POST_FORUM_URL]) )
{
	$tmp_forum_id = intval($_GET[POST_FORUM_URL]);

	if ($tmp_forum_id == 1)
	{
		$template->set_filenames(array('overall_header' => ( empty($gen_simple_header) ) ? 'instrumental_header.tpl' : 'simple_header.tpl'));
	}
	elseif ($tmp_forum_id == 2)
	{
		$template->set_filenames(array('overall_header' => ( empty($gen_simple_header) ) ? 'vocal_header.tpl' : 'simple_header.tpl'));
	}
	else
	{
		$template->set_filenames(array('overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl'));
	}
}
//
// Generate logged in/logged out status
//[/code]


-----------------------------------
charades
Thu 08 Mar, 2007 04:09

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
[quote user="Mighty Gorgon" post="9729"]Are you sure to have used this code and the files are present in the template folders?

[code]// Parse and show the overall header.
include($phpbb_root_path . 'includes/functions_rate.'.$phpEx);
if ( isset($_GET[POST_FORUM_URL]) )
{
	$tmp_forum_id = intval($_GET[POST_FORUM_URL]);

	if ($tmp_forum_id == 1)
	{
		$template->set_filenames(array('overall_header' => ( empty($gen_simple_header) ) ? 'instrumental_header.tpl' : 'simple_header.tpl'));
	}
	elseif ($tmp_forum_id == 2)
	{
		$template->set_filenames(array('overall_header' => ( empty($gen_simple_header) ) ? 'vocal_header.tpl' : 'simple_header.tpl'));
	}
	else
	{
		$template->set_filenames(array('overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl'));
	}
}
//
// Generate logged in/logged out status
//[/code][/quote]

Yes Mighty I made sure all the files are present and I have coded exactly what you have in your post.


-----------------------------------
Mighty Gorgon
Sun 11 Mar, 2007 12:15

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
It is strange, because the header is parsed correctly, while the error shows that you don't have those files... :roll:

Can you attach here in a zip file what you did? I need the page_header and the files you are going to include with the full path.

Thanks.


-----------------------------------
charades
Sun 11 Mar, 2007 16:05

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
[quote user="Mighty Gorgon" post="9891"]It is strange, because the header is parsed correctly, while the error shows that you don't have those files... :roll:

Can you attach here in a zip file what you did? I need the page_header and the files you are going to include with the full path.

Thanks.[/quote]

I Sent you in the PM MG. 

I sincerely appreciate your help in this regard.

God Bless you along with me :)


-----------------------------------
Mighty Gorgon
Wed 14 Mar, 2007 02:51

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
I've checked your files and they are modified in the right way.

Are you sure to uploading the tpl files in the right folder?

I can't see no reason for this code not working correctly. :roll:


-----------------------------------
charades
Thu 15 Mar, 2007 04:35

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
[quote user="Mighty Gorgon" post="10075"]I've checked your files and they are modified in the right way.

Are you sure to uploading the tpl files in the right folder?

I can't see no reason for this code not working correctly. :roll:[/quote]

Up on further research this is what I found which might give you an idea on why it is happenning.

http://www.phpbbstyles.com/viewtopic.php?p=86224

I will also work on this in Trial and Error method for a while until I hear from you.

This would be gret help if somehow i can get this thing working in my board.

and last but not least is WYSIWYG.  :) 

But I sincerely request to find a solution for this and let me know while 
I also do some tweaking to the code.

I wish I learnt PHP but neverthless will give it a shot. :(


-----------------------------------
charades
Mon 19 Mar, 2007 17:30

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
[quote user="charades" post="10146"][quote user="Mighty Gorgon" post="10075"]I've checked your files and they are modified in the right way.

Are you sure to uploading the tpl files in the right folder?

I can't see no reason for this code not working correctly. :roll:[/quote]

Up on further research this is what I found which might give you an idea on why it is happenning.

http://www.phpbbstyles.com/viewtopic.php?p=86224

I will also work on this in Trial and Error method for a while until I hear from you.

This would be gret help if somehow i can get this thing working in my board.

and last but not least is WYSIWYG.  :) 

But I sincerely request to find a solution for this and let me know while 
I also do some tweaking to the code.

I wish I learnt PHP but neverthless will give it a shot. :([/quote]

If I open ths specific sub forum in the sense the one's which has 
forum_id 10 or 20 then I can see my new banner. 

When I open any other forum or any other page I see the 

Template Load file error message.

Any help is greatly appreciated.


-----------------------------------
Mighty Gorgon
Fri 23 Mar, 2007 23:47

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
[quote user="charades" post="10363"]If I open ths specific sub forum in the sense the one's which has 
forum_id 10 or 20 then I can see my new banner. 

When I open any other forum or any other page I see the 

Template Load file error message.

Any help is greatly appreciated.[/quote]
I've tested your code and it was working for me.

I think you have some other error somewhere... but at the moment I have no time to try to investigate further.

If you just want a different banner for each forum I think you can use the forum rules feature and include there the code you wish... If I remember well, it supports HTML.


-----------------------------------
charades
Sun 06 May, 2007 04:57

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
[quote user="Mighty Gorgon" post="10681"][quote user="charades" post="10363"]If I open ths specific sub forum in the sense the one's which has 
forum_id 10 or 20 then I can see my new banner. 

When I open any other forum or any other page I see the 

Template Load file error message.

Any help is greatly appreciated.[/quote]
I've tested your code and it was working for me.

I think you have some other error somewhere... but at the moment I have no time to try to investigate further.

If you just want a different banner for each forum I think you can use the forum rules feature and include there the code you wish... If I remember well, it supports HTML.[/quote]

Thanks Mighty. I have found the issue with my code and fixed it. 

However this banner is only visible as long as user doesn't click any topic and stays on the main forum page.

In other words if user comes to General Support forum user sees the banner that I want but once user clicks any topic in General support, main banner shows up but not the one which is for the General support Forum.

I appreciate any help regarding this.


-----------------------------------
Mighty Gorgon
Mon 07 May, 2007 01:11

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
That's because the forum id isn't in the url anymore... you need to add an extra SQL for this... :roll:


-----------------------------------
charades
Mon 07 May, 2007 15:43

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
[quote user="Mighty Gorgon" post="13591"]That's because the forum id isn't in the url anymore... you need to add an extra SQL for this... :roll:[/quote]

Should it be added in page_header.php or viewtopic.php?

I also appreciate if you can help me out in writing the SQL. 

Hope I am not asking too much...

Thanks in Advance Mighty :)


-----------------------------------
charades
Sun 13 May, 2007 01:13

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
[quote user="Mighty Gorgon" post="13591"]That's because the forum id isn't in the url anymore... you need to add an extra SQL for this... :roll:[/quote]

Can anyone please help me in figuring out how to do this. 

I somehow need to capture the forum url when opening a topic of that forum. 

I have made my changes to page_header.php so as to show different banner for different forum. 

However when any topic in the forum is being clicked main banner is appearing instead of the banner I wanted.

Many thanks in advance .


-----------------------------------
Mighty Gorgon
Sun 20 May, 2007 13:37

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
The SQL may be something like this, but you have to adjust it.

[codeblock]	$sql = 'SELECT p.forum_id FROM ' . POSTS_TABLE . ' AS p WHERE p.post_id = ' . $post_id . ' LIMIT 1';[/codeblock]


-----------------------------------
charades
Thu 31 May, 2007 00:21

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
[quote user="Mighty Gorgon" post="14352"]The SQL may be something like this, but you have to adjust it.

[codeblock]	$sql = 'SELECT p.forum_id FROM ' . POSTS_TABLE . ' AS p WHERE p.post_id = ' . $post_id . ' LIMIT 1';[/codeblock][/quote]

I know I am bugging alot . But I appreciate if you can let me know to which file I should write or tweak this SQL :(


-----------------------------------
charades
Wed 06 Jun, 2007 14:35

Re: Where To Change The Call To Overall_header.tpl
-----------------------------------
Please Please Please help me in figuring this stuff out. 

I am unable to understand. You can call me a bummer but I sincerely appreciate if anyone can help me in this.

I want different headers for different forums.

I was able to go half way through meaning I can see the header I wanted to for a specific forum.

But once I open any topic in that forum I see my original header and not the one which is specific to that forum.

Reason is forum_id is not part of the url anymore. 

I have tried n number of ways but may be I am unable to understand some things properly.

I beg you guys to please help me in figuring this thing out. 

 :cry:  :cry:  :cry:


