[BBCode] Welcome BBCode

Mods, snippets and styles postet and supported by the users
Forum rules
As the forum title says this is for User Contributions
Post a support request in this forum and you will be banned!
Locked
User avatar
all4phone
BBCoder IV
BBCoder IV
Posts: 150
Joined: 11 Feb 2011, 13:50
BBCodes: 28
Favourite BBCode: Random text signature
Favourite MOD: BBCode Strikethrough MOD
Location: Poland
Contact:

[BBCode] Welcome BBCode

Post 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 :)
User avatar
Terr0r
BBCoder V
BBCoder V
Posts: 339
Joined: 04 May 2011, 00:47
BBCodes: 100
Location: The Netherlands
Contact:

[BBCode] Welcome BBCode

Post by Terr0r »

Thanks for this one

Greets Terr0r
If you can't fix it with ducktape you ain't using enough
For my MODS and BBCodes or other things that I have made take a look here
Forumgratis
BBCoder II
BBCoder II
Posts: 5
Joined: 05 Jan 2012, 11:06
BBCodes: 9

[BBCode] Welcome BBCode

Post by Forumgratis »

Cool BBCode! [welcome][/welcome]
Locked