We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Disable Link
Topic Started: Aug 12 2012, 06:06 PM (191 Views)
Deleted User
Deleted User

Board Address: (Link to your board or class it as 'Private')
Board Software: (ZetaBoards or InvisionFree)
Description: (What you want your code to do)

I want a code disable link for one section forum not the whole board.

Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
What link are you wanting to disable in one section, all of them or a particular one?
Offline Profile Goto Top
 
Deleted User
Deleted User

Cory
Aug 13 2012, 03:31 PM
What link are you wanting to disable in one section, all of them or a particular one?
I want it disable one section.
Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
That didn't answer my question, so I'm going to assume all posted links in a particular forum.
Code:
 
<script type="text/javascript">
var forumID = 'FORUM_ID';

if ($('#nav a[href*="/forum/' + forumID + '"]').length) {
$('td.c_post a, #topic_review a').click(function (e) {
e.returnValue = e.preventDefault && e.preventDefault() ? false : false;
alert('Links are disabled in this forum');
});
}
</script>
Edit FORUM_ID as necessary.

This can still easily be bypassed, for a foolproof method, you would want to remove the links instead.
Offline Profile Goto Top
 
Deleted User
Deleted User

Thanks

Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
I forgot something, you might want to use this instead in case a different script uses forumID as a variable:
Code:
 
<script type="text/javascript">
(function ($) {
var forumID = 'FORUM_ID';

if ($('#nav a[href*="/forum/' + forumID + '"]').length) {
$('td.c_post a, #topic_review a').click(function (e) {
e.returnValue = e.preventDefault && e.preventDefault() ? false : false;
alert('Links are disabled in this forum');
});
}
})(jQuery);
</script>
Offline Profile Goto Top
 
Steve
Member Avatar
patriot
[ *  *  *  *  *  *  *  *  *  * ]
Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic