Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Resources
  • Code Requests
  • Completed Requests
  • [Completed] [ZB] New Topic Button when viewing topics
Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ;)

Interested in joining? Click here.


If you are already a member of ZBCode, feel free to login right here:

Username:   Password:
Locked Topic
[Completed] [ZB] New Topic Button when viewing topics
Tweet Topic Started: Oct 9 2009, 05:56 AM (381 Views)
yankeesrule3526 Oct 9 2009, 05:56 AM Post #1


Posts:
51
Group:
Member
Member
#1,760
Joined:
Dec 11, 2008
Coding language
HTML/CSS
Before Zeta upgraded, I used this code from Viral. When viewing a topic, it would put the New Topic button next to the Add Reply button.

Spoiler: click to toggle
<script type="text/javascript">
//<![CDATA[
// new topic button - all themes by Viral
if(location.href.match(/\/topic\/[0-9]+[\/[0-9+]?/gi)){var fo = $("div.topic-buttons a[href@=mode\=2]");var f=fo.attr("href").split("f=")[1].split("&t=")[0];if(f){$.post(main_url+"forum/"+f,{},function(data){fo.before(data.split('<div class="cat-buttons">')[1].split("</a>")[0]+"</a> ");});}}
//]]>
</script>

However, it no longer works so I need a new one or someone to get permission from Viral to update it.


Thanks.
Edited by yankeesrule3526, Oct 9 2009, 05:56 AM.
Offline Profile Goto Top
 
Gorgor Oct 9 2009, 02:17 PM Post #2
Hello

Posts:
1,187
Group:
Former Staff
Member
#2,728
Joined:
Apr 2, 2009
Coding language
PHP
Try this
Code:
 
<script type="text/javascript">
//<![CDATA[
// new topic button - all themes by Viral
if(location.href.match(/\/topic\/[0-9]+[\/[0-9+]?/gi)){var fo = $("div.topic-buttons a[href=mode\=2]");var f=fo.attr("href").split("f=")[1].split("&t=")[0];if(f){$.post(main_url+"forum/"+f,{},function(data){fo.before(data.split('<div class="cat-buttons">')[1].split("</a>")[0]+"</a> ");});}}
//]]>
</script>
Offline Profile Goto Top
 
yankeesrule3526 Oct 9 2009, 07:35 PM Post #3


Posts:
51
Group:
Member
Member
#1,760
Joined:
Dec 11, 2008
Coding language
HTML/CSS
Nope.
Offline Profile Goto Top
 
Desire Law Oct 10 2009, 03:18 PM Post #4


Posts:
114
Group:
Dedicated
Member
#3,362
Joined:
Jul 26, 2009
Coding language
None
Here's one: http://zbcode.com/topic/549805/1/
Offline Profile Goto Top
 
yankeesrule3526 Oct 10 2009, 08:42 PM Post #5


Posts:
51
Group:
Member
Member
#1,760
Joined:
Dec 11, 2008
Coding language
HTML/CSS
I saw that, but I would prefer one that would go under Board Templates and grab the image for each theme by itself.
Offline Profile Goto Top
 
RedBldSandman Oct 11 2009, 06:54 AM Post #6
Member Avatar
ZIPPY!

Posts:
482
Group:
Coding Staff
Member
#2,122
Joined:
Jan 25, 2009
Try this:
Code:
 
<script type="text/javascript">
//<![CDATA[
if (location.href.match('/topic')) {
if ($("div.topic-buttons a").html()) {
var f_link = $("#nav li a:last").attr("href")

$.get(f_link,function(d) {
var t_link = $("div.cat-buttons:eq(0)",d).html()
$("div.topic-buttons a[href*=mode\=2]").before(t_link)
})
}
}
//]]>
</script>
Posted Image
"To iterate is human, to recurse divine."

Offline Profile Goto Top
 
yankeesrule3526 Oct 11 2009, 07:24 AM Post #7


Posts:
51
Group:
Member
Member
#1,760
Joined:
Dec 11, 2008
Coding language
HTML/CSS
Works. :)
Thanks.
Offline Profile Goto Top
 
RedBldSandman Oct 11 2009, 10:01 AM Post #8
Member Avatar
ZIPPY!

Posts:
482
Group:
Coding Staff
Member
#2,122
Joined:
Jan 25, 2009
No problem :D
Posted Image
"To iterate is human, to recurse divine."

Offline Profile Goto Top
 
Reid Oct 11 2009, 02:28 PM Post #9
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
You're welcome.
See? We can read thoughts too. ;)

Your request has been completed, and we're moving it to the correct forum. We hope it works for you; if it doesn't, feel free to post another request topic in the requests forum. Just remember: read the rules first!

Thanks,
The ZBCode Staff
The Resource Board
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Completed Requests · Next Topic »
Locked Topic

Track Topic · E-mail Topic Time: 2:27 PM Jul 11
Hosted for free by ZetaBoards · Privacy Policy