Advertise Here

Author Topic: [Code] Member/Guest Text  (Read 3164 times)

0 Members and 1 Guest are viewing this topic.

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
[Code] Member/Guest Text
« on: June 01, 2007, 01:46:42 pm »
Footers
Code: [Select]
<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: [Select]
<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 »
Check out Revolution X's Brand new Code Index!

Offline deathwilldie

  • Style Designer
  • *
  • Posts: 770
  • Give me an idea for a Stylesheet
    • View Profile
    • Revolution X

  • Total Badges: 28
    Badges: (View All)
    Tenth year Anniversary Nineth year Anniversary Search Eighth year Anniversary Seventh year Anniversary
Re: Member/Guest Text
« Reply #1 on: June 01, 2007, 02:03:31 pm »
Thats a pretty nice code. I am going to use it.

Offline Laugh-nd-kid

  • SMF For Free Master
  • *
  • Posts: 1409
  • Thankyou for this great software SMF For Free!
    • View Profile

  • Total Badges: 21
    Badges: (View All)
    Topic Starter Combination Level 4 Level 3 Level 2
Re: Member/Guest Text
« 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.

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
Re: Member/Guest Text
« 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.
Check out Revolution X's Brand new Code Index!

Offline Laugh-nd-kid

  • SMF For Free Master
  • *
  • Posts: 1409
  • Thankyou for this great software SMF For Free!
    • View Profile

  • Total Badges: 21
    Badges: (View All)
    Topic Starter Combination Level 4 Level 3 Level 2
Re: Member/Guest Text
« 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 :) :P lol

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
1240 Views
Last post September 02, 2006, 09:27:57 pm
by Battousai
5 Replies
2179 Views
Last post December 08, 2006, 06:24:12 pm
by Sassy
0 Replies
1329 Views
Last post March 29, 2008, 02:31:19 am
by i untouched
3 Replies
1547 Views
Last post February 15, 2009, 09:46:06 am
by simply sibyl
13 Replies
5609 Views
Last post April 28, 2010, 10:00:00 pm
by Agent Moose