Simple Machine Codes
November 26, 2021, 11:03:01 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to SMC, the best place for your SMF For Free Codes
 
  Home Help Search Arcade Gallery Affiliates Code Index Staff List Calendar Members Login Register  

Hide Posts In Certain Forums from Guests

Pages: [1]   Go Down
  Print  
Author Topic: Hide Posts In Certain Forums from Guests  (Read 4052 times)
Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,672



View Profile WWW
« on: October 20, 2007, 01:15:51 pm »

Footers
Code:
<script>
var guests = '<span style="color:red;">This post has been protected. Login or register to view</span>';

var forum = new Array()
forum[forum.length] = ["Test"]

for(x=0;x<forum.length;x++){
$("a.nav").each(function(){
//Edited by Agent Moose (smcodes.smfforfree3.com)
if(this.innerHTML.match(forum[x][0])){
if($('td.titlebg2 span b').not($("td.titlebg2 span b:contains(News)")).html()){}else{
$("div.post").html(guests);
};};});
if (location.href.match("sa=showPosts")){
$("td.middletext a").each(function(){
if(this.innerHTML.match(forum[x][0])){
if($('td.titlebg2 span b').not($("td.titlebg2 span b:contains(News)")).html()){}else{
$(this).parent().parent().next().children("td.windowbg2").children("div.post").html(guests);
};};});};};
if (location.href.match("action=recent")){
if($('td.titlebg2 span b').not($("td.titlebg2 span b:contains(News)")).html()){}else{
$("div#bodyarea").hide()
$("div#bodyarea").before("<table border='0' width='100%' cellspacing='1' cellpadding='4' class='bordercolor'><tr><td class='titlebg' colspan='2'>Sorry</td></tr><tr><td class='windowbg2' width='100%'><span class='middletext'><br>"+guests+"<br></span></td></tr></table>")
};};
</script>

This will hide posts from guests in certain forums Smiley

FORUM = The forum that the posts will be hidden from guests.

If you want to add more forums, add more of these lines:
Code:
forum[forum.length] = ["FORUM NAME"]

Enjoy Smiley
« Last Edit: October 21, 2007, 06:52:58 am by Agent Moose » Report Spam   Logged

Share on Facebook Share on Twitter



Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy