Page 1 of 1

[BBCode] Welcome BBCode

Posted: 11 Dec 2011, 22:36
by all4phone
Title: Welcome BBCode

Description:
Displays the welcome note depending on the time of day (You can add your own texts)
and
displays username with color of group
and
displays the text depending on the week day (You can add your own texts).

Author(s)/or Link: all4phone (I took advantage of an idea from 4seven's bbcode: Topic Viewer BBCode and from two others bbcodes: Quotes for every day and Greeting BBCode)

bbcode usage:

Code: Select all

[welcome][/welcome]
HTML replacement:

Code: Select all

<script type="text/javascript">d=new Date();time=d.getHours();if(time>5 && time<=11){document.write("Good morning!");}else if(time>=12 && time<18){document.write("Good afternoon!");}else if(time>=19 && time<=22){document.write("Good evening!");}else{document.write("Good night!");}</script> <strong>{L_TOPIC_VIEWER}</strong>, <SCRIPT LANGUAGE="JavaScript">
    <!--
    document.write()
    now = new Date()
    if (now.getDay() == 5)
    document.write("finally friday ;)")

    if (now.getDay() == 6)
    document.write("you are not in a pub ? ;)")

    if (now.getDay() == 0)
    document.write("sunday rest :)")

    if (now.getDay() == 1)
    document.write("the beginning of week :|")

    if (now.getDay() == 2)
    document.write("what are you doing today ?")

    if (now.getDay() == 3)
    document.write("nice you spend your time ?")

    if (now.getDay() == 4)
    document.write("welcome on the board :)")
    document.write()

    //-->
    </SCRIPT>
Helpline:

Code: Select all

[welcome][/welcome]
Example:

Code: Select all

[welcome][/welcome]
necessary edits:

Open: language/en/viewtopic.php
Find:

Code: Select all

$lang = array_merge($lang, array(
Add before:

Code: Select all

global $user; 
Add after:

Code: Select all

'TOPIC_VIEWER'      => get_username_string('full',  $user->data['user_id'],  $user->data['username'],  $user->data['user_colour']),
example:
Good evening! all4phone, sunday rest :)

[BBCode] Welcome BBCode

Posted: 12 Dec 2011, 12:37
by Terr0r
Thanks for this one

Greets Terr0r

[BBCode] Welcome BBCode

Posted: 05 Jan 2012, 15:12
by Forumgratis
Cool BBCode! [welcome][/welcome]