benjaminbih |
31st December 2009 04:24 |
[FTS 1.1] Announce new forum topics on shoutbox
Add announcing of new forum topics to the shoutbox bot.
open /include/libs/config/tweak.php and change:
PHP Code:
$shoutduty = FFactory::configoption($TWEAK['shoutduty'],'torrents,cleanups,requests,users');
to:
PHP Code:
$shoutduty = FFactory::configoption($TWEAK['shoutduty'],'torrents,cleanups,requests,users,topics');
open /administrator/options.php and change:
PHP Code:
tr( "ShoutBot Duties", makehelp('L48')."<input type='text' size='45' name=shoutduty value='" . ($shoutduty ? $shoutduty : "torrents,cleanups,requests,users") . "'>", 1 ) ;
to:
PHP Code:
tr( "ShoutBot Duties", makehelp('L48')."<input type='text' size='45' name=shoutduty value='" . ($shoutduty ? $shoutduty : "torrents,cleanups,requests,users,topics") . "'>", 1 ) ;
Open /administrator/js/fts_vars.js and change:
PHP Code:
L48: 'ShoutBot can do only those listed below actions.<BR><b>Announce Torrents</b>(if you want this to be enabled write \'torrents\' separated by commas to the other duties.)<BR><b>Announce Cleanups</b>(if you want this to be enabled write \'cleanups\' separated by commas to the other duties)<BR><b>Announce Requests</b>(if you want this to be enabled write \'requests\' separated by commas to the other duties)<BR><b>Announce New Users</b>(if you want this to be enabled write \'users\' separated by commas to the other duties)<BR>EG: To use all the duties write \'torrents,cleanups,requests,users\'',
to:
PHP Code:
L48: 'ShoutBot can do only those listed below actions.<BR><b>Announce Torrents</b>(if you want this to be enabled write \'torrents\' separated by commas to the other duties.)<BR><b>Announce Cleanups</b>(if you want this to be enabled write \'cleanups\' separated by commas to the other duties)<BR><b>Announce Requests</b>(if you want this to be enabled write \'requests\' separated by commas to the other duties)<BR><b>Announce New Users</b>(if you want this to be enabled write \'users\' separated by commas to the other duties)<BR><b>Announce New Topics</b>(if you want this to be enabled write \'topcics\' separated by commas to the other duties)<BR>EG: To use all the duties write \'torrents,cleanups,requests,users,topics\'',
open /forums/post.php and find:
PHP Code:
$topicid = mysql_insert_id() or stderr("Error", "No topic ID returned");
below it add:
PHP Code:
$user_row = sql_query("SELECT * FROM users WHERE id = $userid"); while($row = mysql_fetch_assoc($user_row)) $message = "User [URL=".$BASEURL."/userdetails.php?id=".$row["id"]."]".$row["username"]."[/URL] has create new topic [url=".$BASEURL."/forums/viewtopic.php?topicid=".$topicid."]".$subject."[/url]"; if(duty('topics')) add_shout($message);
Thats all
|