Welcome Guest [Log In] [Register]
This board has been archived and is no longer accepting new questions. If you have a support question for your ZetaBoard, please visit us at the new support board. Registration is free and easy.


Visit the NEW ZetaBoards Support forum!

Username:   Password:
Add Reply
Index Only Code; more random useful codes
Topic Started: Nov 28 2007, 01:52 AM (3,362 Views)
Mwr247
Member Avatar
Cæsaris Salutis!
[ *  * ]
Name:
Index Only Code (By Mwr247)

Description:
Just like it says, this code allows you to set certain things to only appear on the index.

Preview:
ZetaBox
Appears on index

Instructions:
Just put this anywhere in your board template (make sure the div stays above the script):
Quote:
 
<div class="indexonly">Index Only Code</div>
<script>
if(!location.href.match('/index')){document.write('<style>.indexonly\{display:none;\}</style>');}
</script>
Just change what's in red to whatever you want (could be an announcement box, or plain text, or an image, or etc). Also, you can add other boxes now as well, so you could have multiple index only areas. Just make a new div and set the class to "indexonly". Enjoy :)
Edited by Mwr247, Dec 5 2007, 10:41 AM.
Offline Profile Quote Post Goto Top
 
badtzmaru
Member Avatar
Member
[ *  *  * ]
Hmm, this sounds interesting, but what are some examples of things to show only on the index? ^o)

P.S. Do your avatar and signature changing colors?!? O_O
Offline Profile Quote Post Goto Top
 
Eureka
Member
[ *  *  * ]
No it's just random stuff. Whatever HTML you type in red there, it'll only appear in the index. An example can be an announcement box. An affiliation code also.
Offline Profile Quote Post Goto Top
 
Mwr247
Member Avatar
Cæsaris Salutis!
[ *  * ]
Actually, there is a small example at the bottom of my test board. Just says "Index Only Code" and it only shows up on the index. Redid my code though, so now you can have multiple index only boxes (thanks to Nicola for the idea :) )

Like Ken said, pretty much anything you can think of can be put in there. You could technically put the tags around your whole board and make it hide on any other page XD I recommend the 2 he brought up, but you can do whatever works for you best.

P.S.
Yup, it does :D My signature also changes designs every now if you keep refreshing.
Offline Profile Quote Post Goto Top
 
badtzmaru
Member Avatar
Member
[ *  *  * ]
Ohh, an announcement box is a good idea since ZB doesn't have one for the board index! Thanks, I think I'll use it for that, then!!!! :D I feel like there could be a lot more cool ideas to use this for, so I hope other members who use this will tell us their ideas! >_<

P.S. I've just signed up for Uzzisoft. @_@
Edited by badtzmaru, Dec 5 2007, 11:14 AM.
Offline Profile Quote Post Goto Top
 
Eureka
Member
[ *  *  * ]
badtzmaru
Dec 5 2007, 11:14 AM
Ohh, an announcement box is a good idea since ZB doesn't have one for the board index! Thanks, I think I'll use it for that, then!!!! :D I feel like there could be a lot more cool ideas to use this for, so I hope other members who use this will tell us their ideas! >_<

P.S. I've just signed up for Uzzisoft. @_@
You can just make your own random sig script rather than signing up. It's really simple actually.

If you modify the code, you can use this to hide forums, categories, etc. Just throwing it out there in case you guys didn't know or couldn't think of it. ;)
Offline Profile Quote Post Goto Top
 
badtzmaru
Member Avatar
Member
[ *  *  * ]
Ken
Dec 5 2007, 12:00 PM
It's really simple actually.
You're saying that to me???? @_@ Signing up is a lot more easier for me! :P

Hmm, I'm not using hidden categories, but I know some other members are... o_o Maybe I should post a link to this topic in that topic in case they don't see this... >_<
Offline Profile Quote Post Goto Top
 
Tim
Member Avatar
Timmeh
[ *  *  *  * ]
It can be shortend with $(".indexonly").remove();
Code:
 
if(!location.href.match('/index')){ $(".indexonly").remove(); }


Might be worth noting that the code can be expanded for Index only JS scripts.
Code:
 
<script>
if(!location.href.match('/index')){

/* Any old JS */

}
</script>
Edited by Tim, Dec 5 2007, 06:14 PM.
Offline Profile Quote Post Goto Top
 
Haze378
Member Avatar
Member
[ * ]
Awesome code! Works perfectly for the announcement box. :)
Offline Profile Quote Post Goto Top
 
Arrogant
Member Avatar
Vote Choco and Nicola!
[ *  *  * ]
Code:
 
<script type="text/javascript"> <!--
if(!/\/index\/?/.test(location.href)) $(".indexonly").remove();
// --> </script>


hate '`s, love /`s :D
Edited by Arrogant, Feb 23 2008, 12:11 AM.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · User Created Codes · Next Topic »
Add Reply