SMF For Free Support Forum
Signup For Free Forum
July 04, 2009, 11:28:06 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 1097 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Moderator
*****
Offline Offline

Posts: 776


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

Want to know how good your board is?  Why not get it reviewed at Revolution X!
deathwilldie
Style Designer
****
Offline Offline

Posts: 755


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: 1412


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: 776


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

Want to know how good your board is?  Why not get it reviewed at Revolution X!
Laugh-nd-kid
SMF For Free Master
*
Offline Offline

Posts: 1412


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:  

cheap low cost web hosting reviews

Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC
ServerBeach Coupon
Page created in 0.195 seconds with 17 queries.