Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Resources
  • Zetaboards Modifications
  • Board Panel
Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ;)

Interested in joining? Click here.


If you are already a member of ZBCode, feel free to login right here:

Username:   Password:
Locked Topic
  • Pages:
  • 1
  • 2
  • 3
Board Panel; A little extra info for your index...
Tweet Topic Started: Dec 16 2009, 06:24 PM (3,997 Views)
RedBldSandman Dec 16 2009, 06:24 PM Post #1
Member Avatar
ZIPPY!

Posts:
482
Group:
Coding Staff
Member
#2,122
Joined:
Jan 25, 2009
Name: Board Panel
Function: Inserts a Panel above the categories on the forum index which has useful information and links similar to some other forum systems.
Bugs: None known (Reported that it works fine in FF,IE8 and Chrome)
Preview: None at the moment...try it out :P
Installation: Just put this code anywhere in the Board Template:
Code:
 
<script type="text/javascript">
// Board Panel by RedBldSandman of ZBCode.com
$(function() {
if (location.href.match("/index")&&$("#top_info strong").text()!="Guest") {
$("#stats .forums td:contains('newest member is')").html().match(/newest member is (.+?)\)<br/i);var B_n = RegExp.$1;
var B_pf = $("#stats .forums td:contains('Total Forum Posts:') strong:eq(0)").text();
var B_m = $("#stats .forums td:contains('Total Forum Posts:') strong:eq(1)").text();
var B_pm = (parseInt($("#menu_pm a strong small").text())>0)?"<a href='"+main_url+"msg/'>"+$("#menu_pm a strong small").text()+"</a>":"0";
$.get($("#top_info strong a").attr("href"),function(d) {
var B_a = ($("img[class=avatar]",d).parent().parent().html()!=null)?$("img[class=avatar]",d).parent().parent().html():"<a href='"+main_url+"home/?c=10'>No Avatar!</a>";
var B_tim = $.trim($("td.c_desc:contains('Member\'s Local Time')",d).next().text());
var B_ppd = $.trim($("td.c_desc:contains('Average Posts Per Day')",d).next().text());
var B_p = $.trim($("dl.user_info dt:contains('Posts:')",d).next().text());
var B_j = $.trim($("dl.user_info dt:contains('Joined:')",d).next().text());
var B_pp = ((parseInt((B_p).replace(/,/g,""))/parseInt((B_pf).replace(/,/g,"")))*100).toFixed(2);

$.get(main_url+"stats/top_posters/",function(data) {
var B_pt = $.trim($("#top_posters tbody tr:last",data).children("td").text()).replace("Total posts today: ","");
$.get(main_url+"search/?c=6",function(dat) {
var B_top = $(".forums tbody tr:eq(1) td.c_cat-title",dat).clone();B_top.find("div.description,img").remove();B_top = $.trim(B_top.html());

var B_Panel = "<div id='BP_Panel' class='category' style='display:none;margin:0 auto 10px;'><table class='cat_head'><tbody><tr><td><h2>Welcome "+$('#top_info strong').html()+"</h2></td></tr></tbody></table>"
B_Panel += "<table class='forums' cellspacing='0' style='display: table;'><tbody><tr><td id='BP_Av' class='c_mark' style='width:20%;'>"+B_a+"</td><td style='text-align:right;vertical-align:top;'>"
B_Panel += "Your Current Time: <strong>"+B_tim+"</strong><br />Total Posts Today: <strong>"+B_pt+"</strong><br />You have <strong>"+B_pm+"</strong> new PMs in your inbox<br /><br /><a href='"+main_url+"search/?c=5'>Active Topics</a><br /><a href='"+main_url+"stats/top_posters/'>Today's Top Ten Posters</a><br /><a href='"+main_url+"search/?c=6'>Replies to your Topics</a></td><td style='vertical-align:top;'>"
B_Panel += "Your Total Forum Posts: <strong>"+B_p+"</strong> (<strong>"+B_pp+"%</strong> of All Forum Posts)<br />Average Posts Per Day: <strong>"+B_ppd+"</strong><br />Joining Date: <strong>"+B_j+"</strong><br />Latest Reply to your Topic: "+B_top+"<br /><br />Registered Members: <strong>"+B_m+"</strong> ยท Forum Posts: <strong>"+B_pf+"</strong><br />Newest Member: "+B_n+"</td></tr></tbody></table></div>"

$("div.category:first").before(B_Panel);
$("#BP_Panel").slideDown("slow");
});
});
});
}
});
</script>
Other Notes: Uses 3 extra Ad-Credits whenever the index page is viewed!

Made as a request and asked to post it in here so I thought I might as well, some people may like it :P
Feel free to edit the code as long as the Copyright is kept intact (that way you can change formatting and add links etc. so that it works best for your board). If you need any help just say and I'll give it a go! :D
Posted Image
"To iterate is human, to recurse divine."

Offline Profile Goto Top
 
IncomingGank Dec 16 2009, 08:10 PM Post #2
Member Avatar


Posts:
275
Group:
Dedicated
Member
#3,556
Joined:
Nov 5, 2009
Coding language
None
Is there a way to put this all into an external .js file ?
Posted Image
Offline Profile Goto Top
 
Anicho Dec 16 2009, 08:31 PM Post #3


Posts:
30
Group:
Member
Member
#3,585
Joined:
Nov 25, 2009
Coding language
HTML/CSS
Did you get the avatar with ajax?
Offline Profile Goto Top
 
Anicho Dec 16 2009, 08:32 PM Post #4


Posts:
30
Group:
Member
Member
#3,585
Joined:
Nov 25, 2009
Coding language
HTML/CSS
I learned heaps about jQuery from this code, thanks :P
Offline Profile Goto Top
 
Dorith Dec 16 2009, 08:54 PM Post #5
Member Avatar
Has just entered the Matrix

Posts:
2,069
Group:
Former Staff
Member
#1,854
Joined:
Dec 23, 2008
Warlock
Dec 16 2009, 08:10 PM
Is there a way to put this all into an external .js file ?
Yes, and you could do it manually for any code you have if you want. Copy and paste the code into Notepad. Then save it as:
Quote:
 
"code.js"

You do need the quotation marks when saving the file in notepad, otherwise it will not save it as a .js file. Of course, feel free to change the "code" from that, but yeah you get the idea.

And it's handy to know this little trick for any codes you might get :P
Posted Image
Posted Image
(Made emoticon using Codes Rock's Smiley Generator)
Offline Profile Goto Top
 
IncomingGank Dec 17 2009, 08:05 AM Post #6
Member Avatar


Posts:
275
Group:
Dedicated
Member
#3,556
Joined:
Nov 5, 2009
Coding language
None
Nothing appears for me some reason , can you make a preview cause I see no difference.

Edit : I see it.
Edited by IncomingGank, Dec 17 2009, 08:07 AM.
Posted Image
Offline Profile Goto Top
 
... Dec 17 2009, 08:10 AM Post #7
...

Posts:
451
Group:
Dedicated
Member
#311
Joined:
Jul 26, 2008
I have this:
Posted Image

but basically that's a saying what is at the bottom of the page, and in Preferences :)
Offline Profile Goto Top
 
IncomingGank Dec 17 2009, 08:21 AM Post #8
Member Avatar


Posts:
275
Group:
Dedicated
Member
#3,556
Joined:
Nov 5, 2009
Coding language
None
If someone wants an external .js code version then here it is :

Quote:
 
<script type="text/javascript" src="http://z3.ifrm.com/307/142/0/f483822/bpanel.js"></script>
Posted Image
Offline Profile Goto Top
 
RedBldSandman Dec 17 2009, 01:26 PM Post #9
Member Avatar
ZIPPY!

Posts:
482
Group:
Coding Staff
Member
#2,122
Joined:
Jan 25, 2009
Anicho
 
I learned heaps about jQuery from this code, thanks :P
Glad it helped :D
Nemomon
 
but basically that's a saying what is at the bottom of the page, and in Preferences :)
It grabs info from the index and 3 other pages for various reasons :D Some of the information's at the bottom of the page, but that's what the request was :D
Posted Image
"To iterate is human, to recurse divine."

Offline Profile Goto Top
 
viperver1 Dec 18 2009, 10:13 PM Post #10
Member Avatar


Posts:
100
Group:
Member
Member
#1,984
Joined:
Jan 9, 2009
Coding language
Everything
Thanks for this code. It'll make my webpage look more professional.

Maybe I'll use it at top of page.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Zetaboards Modifications · Next Topic »
Locked Topic
  • Pages:
  • 1
  • 2
  • 3

Track Topic · E-mail Topic Time: 7:41 PM Jul 10
Hosted for free by ZetaBoards · Privacy Policy