Welcome Guest [Log In] [Register]
Viewing Single Post From: Add "New Topic" Button to View Topic Page
Eureka
Member
[ *  *  * ]
Nice one dude! I love it :) But use this one as it's more safe. I bet you someone will screw up the board url thing with no / at the end. :)

Code:
 

<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>


Nice code.
Offline Profile Quote Post
Add "New Topic" Button to View Topic Page · User Created Codes