/[drupal]/contributions/modules/bot/bot_factoid/bot_factoid.module
ViewVC logotype

Diff of /contributions/modules/bot/bot_factoid/bot_factoid.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.6.2.1 by morbus, Wed Apr 9 02:02:32 2008 UTC revision 1.1.2.6.2.2 by morbus, Fri Apr 25 01:29:03 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: bot_factoid.module,v 1.1.2.6 2007/11/09 14:35:12 morbus Exp $  // $Id: bot_factoid.module,v 1.1.2.6.2.1 2008/04/09 02:02:32 morbus Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 14  function bot_factoid_help($path, $arg) { Line 14  function bot_factoid_help($path, $arg) {
14      case 'irc:features':      case 'irc:features':
15        return array(t('Factoids'));        return array(t('Factoids'));
16      case 'irc:features#factoids':      case 'irc:features#factoids':
17        return t('Set factoids with "BOTNAME: cats are furry", "BOTNAME: Drupal is great.", "No, BOTNAME, Morbus is awesome.", "BOTNAME: Drupal is also powerful.", "BOTNAME: cheer is <action>cheers for !who in !channel!", or "BOTNAME: ping is <reply>WHAT?!". Retrieve factoids with: "Drupal?" or "BOTNAME: cheer!" Forget factoids with "BOTNAME: forget ping". Factoids can be browsed online at <!url>.', array('!url' => url('bot/factoid', array('absolute' => TRUE))));        return t('Set factoids with "BOTNAME: cats are furry", "BOTNAME: Drupal is great.", "No, BOTNAME, Morbus is awesome.", "BOTNAME: Drupal is also powerful.", "BOTNAME: cheer is <action>cheers for !who in !channel!", or "BOTNAME: ping is <reply>WHAT?!". Retrieve factoids with: "Drupal?" or "BOTNAME: cheer!" Forget factoids with "BOTNAME: forget ping". Factoids are also online at <!url>.', array('!url' => url('bot/factoid', array('absolute' => TRUE))));
18      case 'bot/factoid':      case 'bot/factoid':
19        return '<p>'. t('Browse all the factoids the bot knows about.') .'</p>';        return '<p>'. t('Browse all the factoids the bot knows about.') .'</p>';
20      case 'admin/settings/bot/factoid':      case 'admin/settings/bot/factoid':
# Line 25  function bot_factoid_help($path, $arg) { Line 25  function bot_factoid_help($path, $arg) {
25  /**  /**
26   * Implementation of hook_menu().   * Implementation of hook_menu().
27   */   */
28  function bot_factoid_menu($may_cache) {  function bot_factoid_menu() {
29    $items['bot/factoid'] = array(    $items['bot/factoid'] = array(
30      'access arguments'  => array('access content'),      'access arguments'  => array('access content'),
31      'description'       => "Browse all the factoids the bot knows about.",      'description'       => "Browse all the factoids the bot knows about.",
# Line 227  function bot_factoid_save($string) { Line 227  function bot_factoid_save($string) {
227      // if "also" starts the statement, we're adding.      // if "also" starts the statement, we're adding.
228      if (preg_match("/^also\s+/i", $statement)) {      if (preg_match("/^also\s+/i", $statement)) {
229        $statement = preg_replace("/^also\s+/i", '', $statement);        $statement = preg_replace("/^also\s+/i", '', $statement);
230    print $statement;
231      } else { bot_factoid_delete($subject); }      } else { bot_factoid_delete($subject); }
232    
233      db_query("INSERT INTO {bot_factoid} SET subject = '%s', is_are = '%s', statement = '%s'", $subject, $is_are, $statement);      db_query("INSERT INTO {bot_factoid} SET subject = '%s', is_are = '%s', statement = '%s'", $subject, $is_are, $statement);

Legend:
Removed from v.1.1.2.6.2.1  
changed lines
  Added in v.1.1.2.6.2.2

  ViewVC Help
Powered by ViewVC 1.1.3