Forums / Cotonti / General / section banners

Draeghonov
#1 2009-10-14 04:55
Hey guys,
sorry if this is a repost of some sort, but I could not find it anywhere...

This is what I am looking for:
Way back, in the days of LDU, there was a way (plugin?) thet enabled different banners for different sections.
The index had one banner, the forums had their own banner, administartion had it's banner etc.
I am NOT talking about the banner rotate plugin; that changes the site banner when the page is refreshed, while I'm looking for a way to get each section it's own banner.

Any help would be great :)
reg, Dave
Kilandor
#2 2009-10-14 06:05
enable $cfg['customhf'] in config.php, and use header.location.php this can be gotten from the main php files such as admin.php index.php etc
Draeghonov
#3 2009-10-14 07:00
Thanks Kilandor :)
I will try this!

Added 16 hours 10 minutes later:

Hmm...
In config.php I have set the value.
But: I have tried header.location.php, but to be honest, I have no clue as to what code should be in there...
I have tried header.location.tpl:
I have given the for example, the header.index.tpl the image source for the index banner.
BUT: When I look in the header.tpl, it says this in the file:

    <td colspan="3"><a href="index.php"><img src="skins/{PHP.skin}/img/main/banner2.gif" alt="" /></a></td>

So now my question is:
What is the code needed for let's say: header.index.tpl, and how do I activate it in the header.tpl?

thanks in advance, Dave :)

Added 5 hours 22 minutes later:

aaaaaaaaaaaargh!!!
I give up...

I have made the change in config.php,
I have made different header tpl files; each having its own banner...
I get a blanc page: fatal error: default skin not found...
This post was edited by Draeghonov (2009-10-15 04:34, 14 years ago)
pieter
#4 2009-10-15 16:17
For the index page, it should be header.home.tpl
For admin it is header.administration.tpl

Try it only with one before changing it for all.
Try nit with a copy of header.tpl without changing anything.
If that works try with the changes.
... can we help you ...
Kort
#5 2009-10-15 17:04
I used
	<div id="slogan" class="s-{PHP.z}">
		<h2>
			{PHP.cfg.subtitle}
		</h2>
	</div>
in the Cryo skin to display section-specific "banners". In the .css file use
.s-admin	{ background:url(img/blueish/slogan-admin-en.png) no-repeat 0 0; }
.s-forums	{ background:url(img/blueish/slogan-forums-en.png) no-repeat 0 0; }
.s-index	{ background:url(img/blueish/slogan-index-en.png) no-repeat 0 0; }
.s-message	{ background:url(img/blueish/slogan-message-en.png) no-repeat 0 0; }
.s-page		{ background:url(img/blueish/slogan-page-en.png) no-repeat 0 0; }
.s-pfs		{ background:url(img/blueish/slogan-pfs-en.png) no-repeat 0 0; }
.s-polls	{ background:url(img/blueish/slogan-polls-en.png) no-repeat 0 0; }
.s-pm		{ background:url(img/blueish/slogan-pm-en.png) no-repeat 0 0; }
.s-plug		{ background:url(img/blueish/slogan-plug-en.png) no-repeat 0 0; }
.s-users	{ background:url(img/blueish/slogan-users-en.png) no-repeat 0 0; }
or whatever fits your skin.
This way you can bypass custom header/footer thing
SED.by - создание сайтов, разработка плагинов и тем для Котонти
Draeghonov
#6 2009-10-16 01:37
WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOT!!!!!!!!!!!!! :-X :-X :-X

Thanks everyone that posted in this topic!!!!
And Thank You, Kort, for providing the solution!!!
This is awesome!

I really wanted to give my website a new impuls, and the section banners was 1 way of getting the result I was longing for.

Thanks to this solution, I can host another "competition" on my website, to get the creative work flowing!
This is awesome, THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Added 2 hours 24 minutes later:

Just a hopefully tiny expansion:

On the testsite: http://lanos.la.funpic.de you can see Kort's help in action.
It all works great, but I have a question:

As you can see, we have a downloads button. When clicked, you see the downloads banner. That page has two sections. Whenever one of the sections is clicked, the banner still remains the downloads banner.
Same goes for the videos and tutorial banners.
This is how it looks in css:

.s-admin	{ background:url(img/bann/administration.jpg) no-repeat 0 0; }
.s-forums	{ background:url(img/bann/forums.jpg) no-repeat 0 0; }
.s-index	{ background:url(img/bann/index.jpg) no-repeat 0 0; }
.s-message	{ background:url(img/blueish/slogan-message-en.png) no-repeat 0 0; }
.s-page		{ background:url(img/bann/downloads.jpg) no-repeat 0 0; }
.s-list.php?c=downloads		{ background:url(img/bann/downloads.jpg) no-repeat 0 0; }
.s-list.php?c=videos		{ background:url(img/bann/videos.jpg) no-repeat 0 0; }
.s-list.php?c=tutorial		{ background:url(img/bann/tutorials.jpg) no-repeat 0 0; }
.s-pfs		{ background:url(img/blueish/slogan-pfs-en.png) no-repeat 0 0; }
.s-polls	{ background:url(img/blueish/slogan-polls-en.png) no-repeat 0 0; }
.s-pm		{ background:url(img/blueish/slogan-pm-en.png) no-repeat 0 0; }
.s-plug		{ background:url(img/bann/plugins.jpg) no-repeat 0 0; }
.s-plug.php?e=toplastseen		{ background:url(img/bann/tls.jpg) no-repeat 0 0; }
.s-users	{ background:url(img/bann/users.jpg) no-repeat 0 0; }

Somehow, adding the categories doesn't seem to work.
Is it possible to make it work?
This post was edited by Draeghonov (2009-10-16 04:06, 14 years ago)
Kort
#7 2009-10-16 13:27
Draeghonov: I used {PHP.z} in the Cryo skin for a simple imitation of a banner rotate plugin. Nothing more. This way I got myself section-specific "banners" without enforcing testers to install a 3rd-party plugin. If you want to have page-category-dependent banners, you should go for {PHP.c} in the list.tpl or whatever you have. Basically, css-or-plugin choice depends on how complicated you want things to be. With your requirements however I would recommend that you use a plugin.
SED.by - создание сайтов, разработка плагинов и тем для Котонти
Draeghonov
#8 2009-10-16 23:19
Thanks again Kort :)

I have given it some thought,and just tried a n00bish thing: look at my current css:

#slogan		{ width:981px; height:154px; }
#slogan h2	{ display:none; }

#alogan		{ width:981px; height:154px; }
#alogan h2	{ display:none; }

.s-admin	{ background:url(img/bann/administration.jpg) no-repeat 0 0; }
.s-forums	{ background:url(img/bann/forums.jpg) no-repeat 0 0; }
.s-index	{ background:url(img/bann/index.jpg) no-repeat 0 0; }
.s-message	{ background:url(img/blueish/slogan-message-en.png) no-repeat 0 0; }
.s-page		{ background:url(img/bann/downloads.jpg) no-repeat 0 0; }
.s-list		{ background:url(img/bann/downloads.jpg) no-repeat 0 0; }
.a-videos	{ background:url(img/bann/videos.jpg) no-repeat 0 0; }
.a-tutorial	{ background:url(img/bann/tutorials.jpg) no-repeat 0 0; }
.s-pfs		{ background:url(img/blueish/slogan-pfs-en.png) no-repeat 0 0; }
.s-polls	{ background:url(img/blueish/slogan-polls-en.png) no-repeat 0 0; }
.s-pm		{ background:url(img/blueish/slogan-pm-en.png) no-repeat 0 0; }
.s-plug		{ background:url(img/bann/plugins.jpg) no-repeat 0 0; }
.s-users	{ background:url(img/bann/users.jpg) no-repeat 0 0; }

Before I did this, the downloads, videos and tutorials pages had the same banner; not anymore :D

This is how I have implemented it in header.tpl:

<div id="slogan" class="s-{PHP.z}"><div id="alogan" class="a-{PHP.c}"></div>
Yes, VERY n00bish indeed, but this works :)
Now all I have to do is expand on this, to see what can be done to show sub-sections and the different plugins, like top last seen and quickstats etc :)

Added 3 hours 13 minutes later:

Ok, just a tuny question:

{PHP.z}-->sections
{PHP.c}-->page category
{PHP.?}-->plugin category
What letter should the "?" be? :)
This post was edited by Draeghonov (2009-10-17 02:33, 14 years ago)