MyBB Central

Full Version: Bot on mybb
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a irc bot on a irc chan Smile and i have put some code in newthread.php so the bot announce to a given chan, but would it be possible so when a staff member post inside a staff topic and i wont be shown i main irc chan (hope someone knowns what iam talking about)

here is the code i have now in newthread.php

Something that switch between the topics

here is something that i have from els where...
in this case our staff section has fid=13
PHP Code:
$fid $arr["fid"];
    switch(
$forid)
    {
    case 
13:  
    
$bot['password'] = "xxxxxxxxxxxx";
    break;
    default:
    
$bot['password'] = "xxxxxxxxxxxxxxx";
    } 

PHP Code:
        if(!$mybb->input['postpoll'])
        {
            
$lang->redirect_newthread .= sprintf($lang->redirect_return_forum$fid);
        }
//Bot            
$bot['password'] = "xxxxxxxxxxxxxxx";
$bot['ip'] ="xxx.xxxx.xxxx.xxxx";
$bot['port'] = "xxxxx";
$bot['message'] = "..:: Topic: ".$mybb->input['subject']." :: Link - http://www.xxxxxxxxx/showthread.php?tid=".htmlspecialchars($tid)." :: Startet af: $username ::..";
$fp fsockopen($bot['ip'], $bot['port'], $errno$errstr40);
if(
$fp)
{
fputs($fp$bot['password'] . " " $bot['message'] . "\n");
sleep(5);
fclose($fp);
}
//End
redirect($url$lang->redirect_newthread); 
Put the whole bot code in another if statement

Code:
if($fid != 13)
{
// BOT CODE
}
Don't follow... Sad
You don't want to post 'new threads' of your Staff Section on IRC ... so if the $fid == Staff Section, do nothing else post the new thread ...

$fid : FID of Current ForumSection
!= : not equal to
13 : FID of your Staff Section

So you put the code; that thing you or someone else added to the newthread.php page and you put it between that if statement i posted 2posts up.

If that's to hard to follow; don't bother my posts then.
Reference URL's