Welcome Guest [Log In] [Register]
Viewing Single Post From: Add "New Topic" Button to View Topic Page
Dennis
Member Avatar
Member Extraordinaire

This code will add a New Topic button next to the Add Reply button on the View Topic page, similar to how InvisionFree displays.

This code goes in your Theme Layout. Doesn't matter where, just not in the middle of another code. ;)

The two variables in red should be changed to suit your needs.

See it in this Preview.

Quote:
 
<script type="text/javascript">

/*************************
* Add "New Topic" button
* to Zetaboard's View Topic page.
* Pieced together by Dennis,
* with code and assistance
* from Ken, GenerationStudio
* and Chireru. Thanks guys. :)
**************************/
var replyimage = "http://209.85.62.24/static/1/t_addreply.png";
var newtopicimage = "http://209.85.62.24/static/1/t_newtopic.png";

if(location.href.match(/topic/)){
var tid = location.href.split("/")[5];
$(function(){
var a = $('#nav a:last').attr('href');
var b = a.split("/forum/");
var c = new RegExp("[^/]","g");
var d = b[1].match(c);
var fid = d.join("");

$(function(){$("div .topic-buttons").html("<a href='http://" + location.hostname + location.pathname + "post/?mode=2&type=1&f=3767&t=" + tid + "'><img src='" + replyimage + "' alt='Add Reply' /><a href='" + boardurl + "post/?type=1&mode=1&f=" + fid + "'><img src='" + newtopicimage + "' alt='Make New Topic' /></a>")});});};
</script>
Edited by Dennis, Mar 14 2008, 01:19 AM.
Offline Profile Quote Post
Add "New Topic" Button to View Topic Page · User Created Codes