8
|
1 |
<?php
|
|
2 |
|
|
3 |
eb_hook('event_raw_message', 'greeting_event($chan, $message);');
|
|
4 |
|
|
5 |
function greeting_event(&$chan, &$message)
|
|
6 |
{
|
|
7 |
static $part_list = array();
|
|
8 |
|
|
9 |
switch($message['action'])
|
|
10 |
{
|
|
11 |
case 'JOIN':
|
48
|
12 |
if ( $message['nick'] === $GLOBALS['nick'] )
|
|
13 |
break;
|
|
14 |
|
8
|
15 |
$wb = false;
|
|
16 |
if ( isset($part_list[$message['nick']]) )
|
|
17 |
{
|
|
18 |
if ( $part_list[$message['nick']] + 1800 >= time() )
|
|
19 |
{
|
|
20 |
$chan->msg("Welcome back.");
|
|
21 |
$wb = true;
|
|
22 |
}
|
|
23 |
}
|
|
24 |
if ( !$wb )
|
|
25 |
{
|
|
26 |
$append = '';
|
|
27 |
eval(eb_fetch_hook('event_greeting'));
|
|
28 |
$chan->msg(eb_censor_words("Hi, {$message['nick']}.$append"));
|
|
29 |
}
|
|
30 |
break;
|
|
31 |
case 'PART':
|
|
32 |
$part_list[$message['nick']] = time();
|
|
33 |
break;
|
|
34 |
}
|
|
35 |
}
|