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
Add "New Topic" Button to View Topic Page
Topic Started: Dec 2 2007, 12:26 AM (5,665 Views)
Dennis
Member Avatar
Member Extraordinaire

badtzmaru
Dec 2 2007, 02:53 AM
Thanks, you four! :D Which code should we use?
So far as I know, my first post and Ken's most recent work. Ken's a much better Javascript coder than me, so whatever improvements he can make are welcome by me.
Offline Profile Quote Post Goto Top
 
RyuraGS
Member Avatar
Member
[ *  *  * ]
This is pretty insignificant, but ZetaBoards comes with a global variable for the board URL called main_url .

Has anyone found a problem with using this instead of defining your own boardURL?

Also, Ken, the way I did the forum number:

Quote:
 
var a = $('#nav a:last').attr('href'); << Starting the same as you.
var b = a.split("/forum/"); << splitting it off into an array of two:
b[0] = http://s1.zetaboards.com/boardname
b[1] = 4188/

var c = new RegExp("[^/]","g"); << RegExp'ing for everything not a /
var d = b[1].match(c); << checking b for everything not a /, we get an array of
d[0] = 4
d[1] = 1
d[2] = 8
d[3] = 8
var fid = d.join(""); << joins d[0] through d[3] together, separated by nothing. We get 4188.


It's very incoherent but it works :p
Offline Profile Quote Post Goto Top
 
Phlip (S)
Member Avatar
Member
[ *  *  *  * ]
I like it and will deffo use it. (Although there seriously needs to be a bit more of a space between the buttons. ;) )
Offline Profile Quote Post Goto Top
 
Tim
Member Avatar
Timmeh
[ *  *  *  * ]
Usefull :D

Nice code.
Offline Profile Quote Post Goto Top
 
CrAzYsHoT
Member
[ *  * ]
HAHA PRAISE THE LORD!
Offline Profile Quote Post Goto Top
 
Dennis
Member Avatar
Member Extraordinaire

GS, I noticed that too. Just changed it.

Phlip, You can just add some non-breaking spaces between the URLs.

Quote:
 
<a href='" + main_url + "post/?mode=2&type=1&f=3767&t=" + tid + "'><img src='" + replyimage + "' alt='Add Reply' /></a> &nbsp; &nbsp; <a href='" + main_url + "post/?type=1&mode=1&f=" + fid + "'><img src='" + newtopicimage + "' alt='Make New Topic' /></a>
Edited by Dennis, Dec 2 2007, 04:14 PM.
Offline Profile Quote Post Goto Top
 
Eureka
Member
[ *  *  * ]
Hey guys. I'm sorry for delaying this.

I've automated the new reply button. Now you don't have to worry about skin changing.

Code:
 

<script src='http://209.85.62.24/3/66/0/p544/newreplybutton.js'>
/* Add New Reply Button by Dennis @ support.zetaboards.com */
</script>
Edited by Eureka, Dec 2 2007, 11:58 PM.
Offline Profile Quote Post Goto Top
 
Dennis
Member Avatar
Member Extraordinaire

Not my code. :P Looks nice. :)
Offline Profile Quote Post Goto Top
 
Eureka
Member
[ *  *  * ]
o.O It is your code. I just automated it so it's more user-friendly. I didn't really change anything you made.

You should update your first post so people won't get confused on which code to use.
Edited by Eureka, Dec 2 2007, 11:59 PM.
Offline Profile Quote Post Goto Top
 
aeronex
Member
[ *  * ]
Thanks, works great! :)
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