April 16, 2024, 01:10:10 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to Revolution X, where Coding meets Graphics.
 
  Home Help Search Arcade Affiliates Staff List Calendar Members Login Register  

Don't Show Links to Guests

Pages: [1]   Go Down
  Print  
Author Topic: Don't Show Links to Guests  (Read 324 times)
0 Members and 1 Guest are viewing this topic.
Celebrus
Artificially Conscious
Administrator
Adminitrator
Offline Offline

Gender: Male
Posts: 626



View Profile WWW
Badges: (View All)
Apple User
« on: May 28, 2009, 08:31:20 am »

Preview: http://9861.smfforfree.com/index.php/topic,9.0.html
Note that on my test forum it will only work for that topic. It should work everywhere for you.

Put this in either your headers or footers.
Code:
<script type="text/javascript">
// Don't show links to guests
// Script by Celebrus of Aetus Designs[aetus.net] and Revolution X[revolutionx.smfforfree3.com].
function logged_in() {
  return $('td.titlebg2 span b').not($("td.titlebg2 span b:contains(News)")).html() ? true : false;
}
$(document).ready(function() {
  if(!logged_in()) {
    $("div.post a").html("<span style='color:red'>[Only members can see links]</span>").removeAttr("href").wrap("<strong></strong>");
  }
});
</script>

Also note that if your guests disable javascript they would be able to see the links and there's no way to get around that.
Report Spam   Logged

Share on Facebook Share on Twitter

Andrew
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 539



View Profile WWW
Badges: (View All)
Combination Topic Starter Poll Voter
« Reply #1 on: May 28, 2009, 10:57:12 am »

Hey nice Code Cele, could work nicely if you want to keep links only to your members Smiley
Report Spam   Logged

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