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
Add more boxes to Board Statistics; *UPDATED*
Topic Started: Nov 29 2007, 09:56 PM (3,846 Views)
RyuraGS
Member Avatar
Member
[ *  *  * ]
Location: Admin CP > Themes > Board Template > Javascripts OR Below the Board (Prefer Javascripts)
Demo: http://s1.zetaboards.com/GenerationStudio/index/ (Look at Board Statistics)
Instructions:
Define a new box with $().newZBBS({Options}); Check the example if you are confused.
You must define a new set of options for each separate box, like in the example.
Options:
isOn - Set to true to turn on the box. Set to false to turn it off. This is useful if you must switch in boxes for whatever reason, or want to see if one box is causing a problem.
Info - This is the data that goes inside the box. Values include any HTML. Use single quotes(') instead of double(")
Title - This is the title of the box. Values include any HTML. Use single quotes(') instead of double(")
Image - This image goes to the box to the left. Values are URLs.
imageLink - This links the image to another site. Values are URLs. Leave blank if you want no link.
Quote:
 
<script type="text/javascript" src="http://generationstudio.net/codes/zbboardstats2.js">/* Add more boxes to Board Statistics */</script>
<script type="text/javascript">
//<![CDATA[
/* Add more boxes to Board Statistics
Code created by Ryura */
$(function(){
$().newZBBS({
isOn: true,
Title: "MyTitle",
Info: "MyText",
Image: "http://209.85.62.24/static/1/s_stats.png"
});

$().newZBBS({
isOn: true,
Title: "MyTitle2",
Info: "MyTex2t",
Image: "http://209.85.62.24/static/1/s_stats.png",
imageLink: "http://generationstudio.net"
});
});
//]]>
</script>
Edited by RyuraGS, Feb 10 2008, 06:37 PM.
Offline Profile Quote Post Goto Top
 
Chris
Member Avatar
Member
[ *  *  *  * ]
What would be nice is if you used an array of objects instead of only one. That way certain ones can be turned off and others can be turned on :)

Ex:

Quote:
 
zbbsSettings = new Array();
zbbsSettings[0] = new Object({
isOn: true,
Title: "Title Here",
Info: "Info Here",
Image: "http://209.85.62.24/static/1/s_stats.png"
}


:)

Then use the for() to check each object.
Edited by Chris, Nov 29 2007, 10:02 PM.
Offline Profile Quote Post Goto Top
 
RyuraGS
Member Avatar
Member
[ *  *  * ]
Chris
Nov 29 2007, 10:01 PM
What would be nice is if you used an array of objects instead of only one. That way certain ones can be turned off and others can be turned on :)

Ex:

Quote:
 
zbbsSettings = new Array();
zbbsSettings[0] = new Object({
isOn: true,
Title: "Title Here",
Info: "Info Here",
Image: "http://209.85.62.24/static/1/s_stats.png"
}


:)

Then use the for() to check each object.
I like clean code, but it's true that's incredibly more useful. I will make that as an alternate option this weekend.
Offline Profile Quote Post Goto Top
 
badtzmaru
Member Avatar
Member
[ *  *  * ]
Thank you so much for this code and the specific directions, Generationstudio!! :D I'm going to put my affiliates in here. :)

Is it okay if we take out the /* comments */?
Offline Profile Quote Post Goto Top
 
RyuraGS
Member Avatar
Member
[ *  *  * ]
badtzmaru
Nov 29 2007, 10:04 PM
Thank you so much for this code and the specific directions, Generationstudio!! :D I'm going to put my affiliates in here. :)

Is it okay if we take out the /* comments */?
Yes, this code may be modified in any way you wish.
Offline Profile Quote Post Goto Top
 
badtzmaru
Member Avatar
Member
[ *  *  * ]
Thanks! :D I'll leave your name in there for credits, though.
Offline Profile Quote Post Goto Top
 
Mysticwizard2005
Member Avatar
Member
[ * ]
Nice code. Works great :) Thanks
Offline Profile Quote Post Goto Top
 
James
Imagine♥
[ *  * ]
Very nice, good job ;0
Offline Profile Quote Post Goto Top
 
RyuraGS
Member Avatar
Member
[ *  *  * ]
I've now included what Chris requested :) Check "alternate method".
Please test this and tell me any bugs, especially with IE!
Offline Profile Quote Post Goto Top
 
Coty Stargazer
Member Avatar
-*-
[ *  * ]
Works great, no bugs for me in Safari. Thanks for the great directions, also. 10/10!
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