Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Feb 9th, 2010 | Syntax: PHP | Size: 0.89 KB | Hits: 24 | Expires: Never
Copy text to clipboard
  1.         function systemHelper(&$irc, &$data) {
  2.                 //explode their text to pull apart the topic and target.
  3.                 $topic = explode(":",$data->message);
  4.                 $nickname = explode(" ", $data->message);
  5.                 if(!isset($topic[1])) {
  6.                         $irc->message(SMARTIRC_TYPE_CHANNEL, '#help', "The correct syntax is !help <user>:<topic>");
  7.                         }
  8.                 else {
  9.                         $getHelp = systemHelp($topic[1]);
  10.                         if($getHelp == "ERROR") {
  11.                                 $irc->message(SMARTIRC_TYPE_CHANNEL, '#help', $topic[1]." is not a valid help string");
  12.                                 }
  13.                         foreach ($irc->channel['#help']->users as $key => $value) {
  14.                                 print_r($key);
  15.                                 if(stristr($nickname[1],$key)===TRUE) {
  16.                                         $foundNick = TRUE;
  17.                                         }
  18.                                 else {
  19.                                         $foundNick =  FALSE;
  20.                                         }
  21.                                 }
  22.                         if($foundNick == TRUE) {
  23.                                 $irc->message(SMARTIRC_TYPE_CHANNEL, '#help', $nickname[1].": ".$getHelp);
  24.                                 }
  25.                         else {
  26.                                 $irc->message(SMARTIRC_TYPE_CHANNEL, '#help', $getHelp);
  27.                                 }
  28.                         }
  29.                 }