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 ] Forum
Topic Started: Jul 17 2011, 03:17 PM (280 Views)
wilders
Member
[ *  * ]
Board Address:Private
Board Software:Zetaboard
Description: Can i make something that if your not registered and you want to to check a forum where your not allowed show this : Protected Forum like for registered members ; Hello 17 minutes ago, By test1234 but if your not a member Protected Forum 17 minutes ago, By test1234 is that possible ? i know you can not let them show it with masks but i want something like this and if they click on the forum a board message will come with "you must register to see this forum" Hope you guys can make a code if its possible

Thanks.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Admin CP Posted Image Themes Posted Image Board Template Posted Image Below the Board
Code:
 
<script type="text/javascript">
var forum_num = "1521804";

if(document.getElementById('top_info').innerHTML.match('Register')) {
$('#inlinetopic[action*="f=' + forum_num + '"] table.posts').html('<table cellspacing="0" id="error_box"><thead><tr><th>Error:</th></tr></thead><tbody><tr class="generic"><td>You must be registered to view this forum</small></td></tr></tbody></table>');
$('#inlinetopic[action*="f=' + forum_num + '"]').next().remove();
$('#inlinetopic[action*="f=' + forum_num + '"]').next().remove();
$('#inlinetopic[action*="f=' + forum_num + '"]').prev().remove();
}
</script>
Replace 1521804 on the first line with the forum number you wish to activate this in. It will allow guests to view the forum on the index, but when they access it, they will receive an error message.
Offline Profile Goto Top
 
wilders
Member
[ *  * ]
Thanks but is this possible aswell ? Hello 17 minutes ago, By test1234 but if your not a member Protected Forum 17 minutes ago, By test1234 is that possible ?
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
<script type="text/javascript">
var forum_num = "1521804";

if(document.getElementById('top_info').innerHTML.match('Register')) {
$('#inlinetopic[action*="f=' + forum_num + '"] table.posts').html('<table cellspacing="0" id="error_box"><thead><tr><th>Error:</th></tr></thead><tbody><tr class="generic"><td>You must be registered to view this forum</small></td></tr></tbody></table>');
$('#inlinetopic[action*="f=' + forum_num + '"]').next().remove();
$('#inlinetopic[action*="f=' + forum_num + '"]').next().remove();
$('#inlinetopic[action*="f=' + forum_num + '"]').prev().remove();
$('td.c_forum:has(a[href*="' + forum_num + '"])').next().find('a[href*="topic"]').remove();
}
</script>
Use that instead to get rid of the topic title as well.
Offline Profile Goto Top
 
wilders
Member
[ *  * ]
Thanks how can i add more forum numbers also u made the topic title delete can't i show the title as Protected Forum?
Edited by wilders, Jul 17 2011, 05:36 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
<script type="text/javascript">
var forum_num = "1521804";

if(document.getElementById('top_info').innerHTML.match('Register')) {
$('#inlinetopic[action*="f=' + forum_num + '"] table.posts').html('<table cellspacing="0" id="error_box"><thead><tr><th>Error:</th></tr></thead><tbody><tr class="generic"><td>You must be registered to view this forum</small></td></tr></tbody></table>');
$('#inlinetopic[action*="f=' + forum_num + '"]').next().remove();
$('#inlinetopic[action*="f=' + forum_num + '"]').next().remove();
$('#inlinetopic[action*="f=' + forum_num + '"]').prev().remove();
$('td.c_forum:has(a[href*="' + forum_num + '"])').next().find('a[href*="topic"]').replaceWith('<div style="font-style: italic">Protected Forum</div>').attr('href', '');
}
</script>
That will fix the text, as for using it for multiple forums, I'll leave that to the experts, what I thought would have worked didn't work.
Offline Profile Goto Top
 
wilders
Member
[ *  * ]
Thanks working hope someone can tell me how to add more forums to it :P

also if you copy a link in that forum and open it when your logged off you can see it is there a way to fix that ? if not no problem :P
Edited by wilders, Jul 17 2011, 05:55 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Nicolas helped me figure it out, you must repeat the bottom line for every forum you wish to do this for. The example will affect two forums.
Code:
 
<script type="text/javascript">
function change(forum_num) {
if(document.getElementById('top_info').innerHTML.match('Register')) {
$('#inlinetopic[action*="f=' + forum_num + '"] table.posts').html('<table cellspacing="0" id="error_box"><thead><tr><th>Error:</th></tr></thead><tbody><tr class="generic"><td>You must be registered to view this forum</small></td></tr></tbody></table>');
$('#inlinetopic[action*="f=' + forum_num + '"]').next().remove();
$('#inlinetopic[action*="f=' + forum_num + '"]').next().remove();
$('#inlinetopic[action*="f=' + forum_num + '"]').prev().remove();
$('td.c_forum:has(a[href*="' + forum_num + '"])').next().find('a[href*="topic"]').replaceWith('<div style="font-style: italic">Protected Forum</div>').attr('href', '');
}
}

change("1521804");
change("1488698");
</script>
Offline Profile Goto Top
 
wilders
Member
[ *  * ]
Thanks working good!
Offline Profile Goto Top
 
Minato
Member Avatar
Let Me Be With You
[ *  *  *  *  * ]
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