Board Logo

 Username:    Password:    Stay logged in: Welcome Guest. Please Login or Register.  Mar 22nd, 2018, 06:58am

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
Dynamic Drive

The Staff

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

member is offline


Mr Fixit...

Homepage PM

Gender: Male
Posts: 17664
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"

<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"
var txt="afternoon"

if(I[1]=="Please Login or Register")
document.getElementsByTagName("TD")[2].innerHTML=td.replace("Welcome", "Good "+txt)
document.getElementsByTagName("TD")[2].innerHTML=td.replace("Hey", "Good "+txt)



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?
Then please do so...
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Back To Top
| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls