Board Logo

 Username:    Password:    Stay logged in: Welcome Guest. Please Login or Register.  Aug 21st, 2017, 4:25pm


Board Hacks
Important News
Please read the notes posted with any codes carefully, as they will usually tell you where they need to go.
Welcome to the Conforums Hacks Board!

All codes here have been tested but we accept no responsibility if these codes do not work on your board, or have an adverse effect when used in combination with other codes.

This board is read only. Any queries or requests for codes should be made on the Coding Forum

Helpful sites
Google
Dynamic Drive

The Staff
Roger
Dave
GIzzy



« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Good morning / afternoon script (updates)  (Read 5699 times)
Dave
I've always wanted one of these wink
Conforums Administrator


member is offline

Avatar

Mr Fixit...


Homepage PM

Gender: Male
Posts: 17644
xx Good morning / afternoon script (updates)
« Thread started on: Feb 5th, 2004, 3:06pm »

Posted by Jaws...


I posted this script once before, but it wasn't really that great, especially since it was my first :P

And since we got a hacks board, i will be posting alot of my codes, (unless told to stop lol :P)

Anyway, down to business. This code replaces "Hey user" with "Good morning user" or "Good afternoon user"

Code:
<script language="javascript">
/*
Written by Willie Wilson
Add Good Morning/good afternoon to welcome box
Use freely but PLEASE do not post in other locations
*/

var td = document.getElementsByTagName("TD")[2].innerHTML

var x = new Date()
var hour = x.getHours()

var I = document.getElementsByTagName("TD")[2].innerText.split(/\W\s/i)

if(hour < 12)
{
var txt="morning"
}
else
{
var txt="afternoon"
}

if(I[1]=="Please Login or Register")
{
document.getElementsByTagName("TD")[2].innerHTML=td.replace("Welcome", "Good "+txt)
}
else
{
document.getElementsByTagName("TD")[2].innerHTML=td.replace("Hey", "Good "+txt)
}
</script> 

NO MODIFYING REQUIRED!

PLACE IN ALL HEADERS!

Hope you guys enjoy it :)

-willie (jaws)

Modified> This code will on work correctly for users using Internet Explorer ( or browsers set to mimic IE).

Edit by garet - If you'd like to see a preview of this code click here
« Last Edit: Jul 6th, 2006, 12:36am by Garet » User IP Logged

Have you read the FAQ or checked the Hacks board before posting?
No?
Then please do so...
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Back To Top
Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls