Welcome Guest [Log In] [Register]
Viewing Single Post From: Add "New Topic" Button to View Topic Page
Eureka
Member
[ *  *  * ]
Wait there's a bug there. Sorry Dennis. I hurried out a code :(

This one works:

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 newtopicimage = "http://209.85.62.24/static/1/t_newtopic.png";

$(function(){if (location.href.match(/topic/i)){var xnum = $("#nav li a:last").attr("href").split("forum")[1].split("/")[1], boardurl=location.hostname+location.pathname.split("topic")[0];$("div.topic-buttons").append("<a href='http://" + boardurl + "post/?type=1&mode=1&f=" + xnum + "'><img src='" + newtopicimage + "' alt='Make New Topic' /></a>");}});
</script>


Shorten it too :D I implemented my code for the Forum ID instead of using GS's, which works but oddly worded to me. GS, you have to explain to me how you did that. lol

Also, you didn't have to re-implement the add reply button. It's already there. I took that part out and appended the new button only.

Anyways, I plan to automate the new reply button so it'll change accordingly for each skin :). Though ZB should have this implemented and this code will be useless. lol
Edited by Eureka, Dec 2 2007, 12:54 AM.
Offline Profile Quote Post
Add "New Topic" Button to View Topic Page · User Created Codes