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
IPB Modifications; Assorted codes to make your ZB resemble IPB
Topic Started: Aug 2 2008, 10:09 AM (5,560 Views)
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
IPB - Forum Layout
IPB - Submenu
IPB - Userlinks
IPB - Newslinks
IPB - Statlinks
IPB - Guestlinks
IPB - MultiQuote



I'm creating a few IPB Modifications (well, most have already been created), and here is the first.

What it does: Changes the submenu style to what it looked like in IPB.
Where it goes: Below the board / Above Copyright / Bottom of Theme Layout (for specific themes).
Browsers: FF3.0 · Opera 9 · IE 7 · IE 8 · Safari 3
Code:
Code: HTML
 
<script type="text/javascript">
//<![CDATA[
var submenu_links = $("#submenu").html();
$("#submenu").html('<div style="float:left"><a href="'+main_url+'boardrules/">Board Rules</a></div><div style="float:right">'+submenu_links+'</div>');
//]]>
</script>


If you have the Board Rules link activated, it is best to de-activate it so it doesn't appear twice.

Note: This does not give any of the hover effects shown in the preview. This only changes the layout to the IPB style.

Preview: http://s1.zetaboards.com/viralajax/index/
Edited by Viral, Aug 25 2008, 08:52 AM.
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
IPB Userlinks.

What it does: Changes the layout of the #top to look like the ipb .userlinks
Where it goes: Below the board / Above Copyright / Bottom of Theme Layout (for specific themes).
Browsers: FF3.0 · Opera 9 · IE 7 · IE 8 · Safari 3
Code:
Code: HTML
 
<script type="text/javascript">
//<![CDATA[
// ipb userlinks by Viral of Panacea >> http://www.zetaresources.com
if(!document.getElementById("top_info").innerHTML.match(/guest/gi)){
var ipb_top_i = $("#top_info strong a").eq(0);
var ipb_username = $(ipb_top_i).html();
var ipb_profilelink = $(ipb_top_i).attr("href");
$("#top_info").html('<b>Logged in as: <a href="'+ipb_profilelink+'">'+ipb_username+'</a></b> ( <a id="logout" href="'+main_url+'login/logout/">Log Out</a> )');
$("#menu_ucp a").eq(0).html('<b>My Controls</b>');
$("#top_menu").prepend('<li id="menu_rtyt"><a href="'+main_url+'search/?c=6">My topics</a></li>');
$("#menu_ucp").clone().prependTo("#top_menu").end().remove();
$("#menu_rcp a img").remove();
var ipb_report = $("#menu_rcp a").html();
$("#menu_rcp a").insertAfter("#logout").before(" · ").html("<b>"+ipb_report+"</b>");}
$("#menu_acp a img").remove();
$("#menu_acp a").insertAfter("#logout").before(" · ").html("<b>Admin CP</b>");
//]]>
</script>


Note: This changes the layout, but leaves the drop down boxes as it is. It will not look exactly like IPB asthetically, unless you modify the CSS. This adds the Report CP and Admin CP link next to the Log out button, if you are Admin.

Preview: http://s1.zetaboards.com/viralajax/index/
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
IPB Newslinks.

What it does: If you are on the index page, and you are logged out, it will add a table which says something like
Welcome to boardname
Latest News: latest topic in chosen forum
It also has a quick login box.

Where it goes: Below the board / Above Copyright / Bottom of Theme Layout (for specific themes).
Browsers: FF3.0 · Opera 9 · IE 7 · IE 8 · Safari 3
Code:
Code: HTML
 
<script type="text/javascript">
//<![CDATA[
// ipb newslinks by Viral of Panacea >> http://www.zetaresources.com
ipb_news_forum = 1; // the number of the forum to get the latest news (1 = first, 2 = second, 3 = third etc..)
if(location.href == main_url+"index/"&&document.getElementById("top_info").innerHTML.match(/guest/gi)){
var latest_news = $("tr.forum td.c_last").eq((ipb_news_forum-1)).children("a").eq(0);
var l_n_href = $(latest_news).attr("href");
$("div#main").before('<table class="newslink" cellspacing="0"><tbody><tr><td><b>Welcome back to '+$("ul#nav a").eq(0).text()+'</b><br /><b>'+$("ul#nav a").eq(0).text()+'\'s Latest News: </b><i><a href="'+l_n_href+'">'+$(latest_news).html()+'</a></i></td><td valign="middle" align="right"><form method="post" action="'+main_url+'login/log_in/"><input type="text" name="uname" onfocus=\'this.value="";\' value="User Name" maxlength="250" size="20"/> <input type="password" onfocus=\'this.value="";\' value="------" name="pw" size="20"/> <input class="button" type="image" src="http://aquate.us/u/login-b.gif" /></form></td></tr></tbody></table>');}
//]]>
</script>


Note: If you want to make it look like IPB, add this to the bottom of the CSS:

Code: HTML
 
.newslink {
background:#EEEEEE none repeat scroll 0 0;
width:98%;
margin-left:1%;
}
.newslink td {
background:#EEEEEE none repeat scroll 0 0;
color:#222222;
font-size:11px;
padding:5px 5px 5px 10px;
border:0 none;
}
.newslink span {
background:transparent none repeat scroll 0 0;
font-style:italic;
font-weight:normal;
}
.newslink input {
font-family:verdana,helvetica,sans-serif;
font-size:10px;
padding:3px;
vertical-align:middle;
width:auto;
color:#072A66;
line-height:12px;
border: 1px solid #999999;
}
.newslink input.button {
background:transparent none repeat scroll 0 0;
border:0 none;
color:#072A66;
vertical-align:middle;
}
.newslink a, .newslink a:hover {
color:#222222;
text-decoration:underline;
}


Preview: http://s1.zetaboards.com/viralajax/index/
Offline Profile Quote Post Goto Top
 
obxbiker
Member Avatar
U.S.M.C.R.
[ *  *  * ]
very nice, we are using this on one theme, like the additions it gives you ''Report cp's'' and ''My Topics''.
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
Thanks obx. It adds Report CP and Admin CP next to Log Out only if you were able to view it in the first place. The My Topics is actually the link to Replies to my topics, but that didn't fit on Zeta Original.

Glad you're using it.
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
IPB Statlinks.

What it does: Moves the Today's Top 10 posters, and other links above the stats.
Where it goes: Below the board / Above Copyright / Bottom of Theme Layout (for specific themes).
Browsers: FF3.0 · Opera 9 · IE 7 · IE 8 · Safari 3
Code:
Code: HTML
 
<script type="text/javascript">
//<![CDATA[
// ipb userlinks by Viral of Panacea >> http://www.zetaresources.com
$("td.c_foot span.right").remove();
$("div#stats.category table.forums tbody tr th[colspan=2]").eq(0).parent().before('<tr class="titlemedium"><th colspan="2"><div id="foot_right" style="text-align:right;"><a href="'+main_url+'search/?c=5">Active topics</a> · <a href="'+main_url+'stats/staff/">The moderating team</a> · <a href="'+main_url+'stats/top_posters/">Today\'s top 10 posters</a> · <a href="'+main_url+'members/?topten">Overall top 10 posters</a></div></th></tr>');
//]]>
</script>


Note: The CSS will still have to be changed to make it look perfect.

Preview: http://s1.zetaboards.com/viralajax/index/
Offline Profile Quote Post Goto Top
 
obxbiker
Member Avatar
U.S.M.C.R.
[ *  *  * ]
Looks great !
We are only having one problem, the link that shows does not take you to the topic but back to the index.
What have we missed here ?


Code:
 

<script type="text/javascript">
//<![CDATA[
// ipb newslinks by Viral of Panacea >> http://www.zetaresources.com
ipb_news_forum = 1; // the number of the forum to get the latest news (1 = first, 2 = second, 3 = third etc..)
if(location.href ==
main_url+"index/"&&document.getElementById("top_info").innerHTML.match(/guest/gi)){
var latest_news = $("tr.forum td.c_last").eq((ipb_news_forum-1)).children("a").eq(0);
var l_n_href = $(latest_news).attr("http://s9.zetaboards.com/PrideInWhatYouRide/forum/20877/");
$("div#main").before('<table class="newslink" cellspacing="0"><tbody><tr><td><b>Welcome back to '+$("ul#nav a").eq(0).text()+'</b><br /><b>'+$("ul#nav a").eq(0).text()+'\'s Latest News: </b><i><a href="'+l_n_href+'">'+$(latest_news).html()+'</a></i></td><td valign="middle" align="right"><form method="post" action="'+main_url+'login/log_in/"><input type="text" name="uname" onfocus=\'this.value="";\' value="User Name" maxlength="250" size="20"/> <input type="password" onfocus=\'this.value="";\' value="------" name="pw" size="20"/> <input class="button" type="image" src="http://aquate.us/u/login-b.gif" /></form></td></tr></tbody></table>');}
//]]>
</script>
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
You don't edit anything at all besides the 1 on the 4th line.
Offline Profile Quote Post Goto Top
 
obxbiker
Member Avatar
U.S.M.C.R.
[ *  *  * ]
OK ..Thanks its perfect now

Any thought to a ''latest news'' to show here all the time ?
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
IPB Forum Layout.

What it does: Changes the forum layout to look like ipb. (The topics / replies / viewers)
Where it goes: Below the board / Above Copyright / Bottom of Theme Layout (for specific themes).
Browsers: FF3.0 · Opera 9 · IE 7 · IE 8 · Safari 3
Browser Note: IE 7 couldn't handle the tables very well so it had to be handled a different way. Because of that, if you use IE 7, the td.c_foot will be removed, but it still works perfectly.
Code:
Code: HTML
 
<script type="text/javascript">
//<![CDATA[
// ipb forum layout by Viral of Panacea >> http://www.zetaresources.com
if(location.href.match(/\/index[\/]?$/i)){
$("table.forums").each(function(){
$(this).children("tbody").eq(0).children("tr.forum").eq(0).before('<tr class="titlemedium"><td/><td>Forum</td><td>Viewers</td><td>Topics</td><td>Replies</td><td>Last Past Info</td></tr>');
});
$(".c_mark,.c_forum").attr("rowspan","1");
if($("div#stats.category"))$("#stats_members").prev().attr("rowspan","2");
$(".c_info").each(function(e){
var viewers = $(this).children(".c_info-v").html();
if(viewers){if(viewers.match(/^1/)){viewers = 1;}else{viewers = viewers.split(" viewers")[0];}
var topics = $(this).children(".c_info-t").html().split("Topics: ")[1];
var replies = $(this).children(".c_info-r").html().split("Replies: ")[1];
$(".c_forum").eq(e).after('<td class="c_info-v">'+viewers+'</td><td class="c_info-t">'+topics+'</td><td class="c_info-r">'+replies+'</td>');}
});
$("td.c_subforum").attr("colspan","6");
if(navigator.appName == "Microsoft Internet Explorer" && parseFloat(navigator.appVersion)<=7){
$(".c_info").html("");
$(".c_foot").remove();
} else {
$(".c_info").remove();
$(".c_foot").not(":last").attr("colspan","6");
$("td.c_last").attr("colspan","4");
$("#trash .c_last").attr("colspan","4");
}}
//]]>
</script>


Note: --

Preview: http://s1.zetaboards.com/viralajax/index/
Edited by Viral, Sep 7 2008, 11:21 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