? LICENSE.txt ? bot_git ? bot_log_search.patch ? bot_whereis Index: bot_karma/bot_karma.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/bot/bot_karma/Attic/bot_karma.module,v retrieving revision 1.1.2.6 diff -u -p -r1.1.2.6 bot_karma.module --- bot_karma/bot_karma.module 5 Mar 2009 14:09:36 -0000 1.1.2.6 +++ bot_karma/bot_karma.module 11 Oct 2010 02:10:13 -0000 @@ -64,7 +64,7 @@ function bot_karma_irc_msg_channel($data // addressing is required. "bot_module: karma foo?". if (preg_match("/^${addressed}karma\s+(.*?)[!\?\.]*\s*$/i", $data->message, $matches)) { - $result = db_fetch_object(db_query('SELECT term, karma FROM {bot_karma} WHERE term = "%s"', trim(drupal_strtolower($matches[2])))); + $result = db_fetch_object(db_query("SELECT term, karma FROM {bot_karma} WHERE term = '%s'", trim(drupal_strtolower($matches[2])))); $karma = $result->term ? $result->karma : 0; // instead of saying "no results", everything has a karma of 0. it's true! life sucks. bot_message($to, t('!term has karma of !karma.', array('!term' => trim($matches[2]), '!karma' => $karma))); // maintain user case! } Index: bot_log/bot_log.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/bot/bot_log/Attic/bot_log.module,v retrieving revision 1.1.2.7.2.9 diff -u -p -r1.1.2.7.2.9 bot_log.module --- bot_log/bot_log.module 10 May 2010 12:38:27 -0000 1.1.2.7.2.9 +++ bot_log/bot_log.module 11 Oct 2010 02:10:13 -0000 @@ -422,3 +422,25 @@ function bot_log_settings(){ return system_settings_form($form); } +/** + * Implements hook_search(). + */ +function bot_log_search($op = 'search', $keys = NULL) { + switch($op) { + case 'name': + return t('IRC Logs'); + break; + case 'search': + $result = db_query("SELECT * FROM {bot_log} WHERE message LIKE '%%%s%%' ORDER BY timestamp DESC", $keys); + while($item = db_fetch_object($result)) { + + $search_results[] = array( + 'link' => url('bot/log/'. preg_replace('!^#!', '', $item->channel) .'/' . date('Y-m-d', $item->timestamp)), + 'title' => t('@channel @timestamp', array('@channel' => $item->channel, '@timestamp' => format_date($item->timestamp, 'short'))), + 'snippet' => t(check_plain('<@nick> @message'), array('@nick' => $item->nick, '@message' => $item->message)), + ); + } + return $search_results; + break; + } +} \ No newline at end of file