SMF For Free Support Forum
Signup For Free Forum
March 16, 2010, 01:51:50 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to SMF For Free. The best free SMF Host
 
   Home   Help Search Arcade Gallery Login Register  

Pages: [1]
  Print  
Author Topic: [Code] Member/Guest Text  (Read 1337 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Moderator
*****
Offline Offline

Posts: 806


Do not PM me for Code Support or Request


View Profile
« on: June 01, 2007, 01:46:42 pm »

Footers
Code:
<script>
var username = $('td.titlebg2 span b').not($("td.titlebg2 span b:contains(News)").html();
if(username){
var name = "WHAT YOU WANT THE MEMBERS TO SEE"
}else{
var name = "WHAT YOU WANT THE GUESTS TO SEE"
}
document.getElementById("bodyarea").innerHTML = name + document.getElementById("bodyarea").innerHTML;
</script>

This is really simple, but usefull code.  This code will show different text if it is a guest, and it will also show different text if your logged in.  the text will show right above the #bodyarea...if you don't know what that is, then figure it out...it is easy to see.

Preview = http://smfffhacks.smfforfree2.com/index.php?

You may use HTML if you wish, just remember, use sinlge quotes, not double.  Also, if you want it to show the members name where you put what you want the members to see, you will use this:
Quote
"+usernam+"
You will need the quotaion marks too.  Here is an example, If I want it to say Hello [Insert Username Here], then I would use this code:
Code:
<script>
var username = $('td.titlebg2 span b').not($("td.titlebg2 span b").contains("News")).html()
if(username){
var name = "Hello "+username+""
}else{
var name = "Hello Guest"
}
document.getElementById("bodyarea").innerHTML = name + document.getElementById("bodyarea").innerHTML;
</script>
« Last Edit: November 03, 2008, 03:17:04 pm by Agent Moose » Logged

Check out Revolution X's Brand new Code Index!
deathwilldie
Style Designer
****
Offline Offline

Posts: 765


Give me an idea for a Stylesheet


View Profile WWW
« Reply #1 on: June 01, 2007, 02:03:31 pm »

Thats a pretty nice code. I am going to use it.
Logged

Laugh-nd-kid
SMF For Free Master
*
Offline Offline

Posts: 1409


Thankyou for this great software SMF For Free!


View Profile
« Reply #2 on: June 01, 2007, 04:34:15 pm »

Veery good, not going to use though, not really needed for me but great work.
Logged

Agent Moose
Moderator
*****
Offline Offline

Posts: 806


Do not PM me for Code Support or Request


View Profile
« Reply #3 on: June 01, 2007, 07:54:35 pm »

Veery good, not going to use though, not really needed for me but great work.

That is waht they all say...lol.  Thanks!

EDIT:
Nice font in sig by the way.
Logged

Check out Revolution X's Brand new Code Index!
Laugh-nd-kid
SMF For Free Master
*
Offline Offline

Posts: 1409


Thankyou for this great software SMF For Free!


View Profile
« Reply #4 on: June 02, 2007, 04:24:37 am »

Thanks again, but yes, I like it, I just don't think it's needed for some forums, eg: mine Smiley Tongue lol
Logged



Pages: [1]
  Print  
 
Jump to:  



Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
ServerBeach Coupon
Page created in 0.275 seconds with 16 queries. (Pretty URLs adds 0.081s, 2q)