miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Specific miniBB Support Forums / Specific /   

How to restrict something only to homepage when used in header?

Author PurpleCow
Registered
#1 | Posted: 18 Jan 2011 05:45 | Edited by: PurpleCow 
Hi,

lets say, I am moving {$user_logging} to header.
How can I restrict this option to appear only in homepage (or a set of pages) and not on any other pages.
Is there is any IF condition I can use in the header template to restrict this?

Thanks

Author Paul
Lead Developer
#2 | Posted: 18 Jan 2011 06:55 
Which header do you mean? Your own custom header of the website?

Or are you about templates/main_header.html of miniBB?

Author PurpleCow
Registered
#3 | Posted: 18 Jan 2011 07:09 
I was referring to main_header.html of miniBB

Thanks

Author Paul
Lead Developer
#4 | Posted: 18 Jan 2011 07:20 | Edited by: Paul 
I don't understand the nature of your question. This login field already appears only on the homepage of forums and not in the other headers. You don't have to move it somewhere and surround it with the extra code. It's already working that way.

Except it appears on the message reply/topic form, but it should be there. It's miniBB feature that you can login and post a message at once.

All conditions can't be build in templates. Templates contain only static content and variables, BUT variable could be build dynamically. Here's some additional topic to read.

Author Bluesplayer
Registered
#5 | Posted: 18 Jan 2011 14:39 | Edited by: Bluesplayer 
I wrote some javascript for a problem similar to this. It looks at the url and if it contains any particular word it then posts certain code. It was for porn search terms initially but can be used for anything really. It worked for over 500 google banned words without any problem. When a particular porn related word was found in the url it would display a different banner. I have used it since to display or not display titles on pages by incorporating the display: none tag. The code might come in handy for some and can be seen here.

A 2 javascript setup can be used to show complete blocks of any code Bit crude using 2 javascripts but it does work well for me.

Regards

Author Paul
Lead Developer
#6 | Posted: 19 Jan 2011 05:03 | Edited by: Paul 
Bluesplayer
For me it seems your code is not related to the question above at all :-) Or at least I didn't get the idea what exactly it is about...

Author Bluesplayer
Registered
#7 | Posted: 19 Jan 2011 05:08 
Well if the design on his or her site is a bit complex with a need to show the login on only certain pages my code can be used. Pretty simple matter to put the login code inside the 2 javascript version and put the page number or whatever else is unique in the url to activate the javascript. The login box will either show or not show depending as a result.

Author Paul
Lead Developer
#8 | Posted: 19 Jan 2011 06:23 
It's too difficult, and JavaScript should not be involved where it's possible to solve it with PHP.

Author Bluesplayer
Registered
#9 | Posted: 19 Jan 2011 06:41 
Could come in handy for certain situations. I also wrote a php version too come to think of it. Good thing about it is you can include any number of pages to display stuff or not, or link it to search terms to display content or not just like my porn filter.

As I said it could come in handy for someone for something or other.

Specific miniBB Support Forums / Specific / How to restrict something only to homepage when used in header? Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Get the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB