function spiderContent($item = null)
 {
     global $db;
     $i18n = exponent_lang_loadFile('modules/newsmodule/class.php');
     if (!defined('SYS_SEARCH')) {
         include_once BASE . 'subsystems/search.php';
     }
     $search = null;
     $search->category = $i18n['search_category'];
     $search->ref_module = 'newsmodule';
     $search->ref_type = 'newsitem';
     if ($item) {
         $db->delete('search', "ref_module='newsmodule' AND ref_type='newsitem' AND original_id=" . $item->id);
         $search->original_id = $item->id;
         $search->title = ' ' . $item->title . ' ';
         $search->view_link = 'index.php?module=newsmodule&action=view&id=' . $item->id;
         $search->body = ' ' . exponent_search_removeHTML($item->body) . ' ';
         $search->location_data = $item->location_data;
         $db->insertObject($search, 'search');
     } else {
         $db->delete('search', "ref_module='newsmodule' AND ref_type='newsitem'");
         foreach ($db->selectObjects('newsitem') as $item) {
             $search->original_id = $item->id;
             $search->title = ' ' . $item->title . ' ';
             $search->view_link = 'index.php?module=newsmodule&action=view&id=' . $item->id;
             $search->body = ' ' . exponent_search_removeHTML($item->body) . ' ';
             $search->location_data = $item->location_data;
             $db->insertObject($search, 'search');
         }
     }
     return true;
 }
 function spiderContent($item = null)
 {
     global $db;
     if (!defined('SYS_SEARCH')) {
         require_once BASE . 'subsystems/search.php';
     }
     $search = null;
     $search->category = exponent_lang_loadKey('modules/WeblogModule/class.php', 'search_category');
     $search->view_link = "";
     // FIXME : need a view action
     $search->ref_module = 'WeblogModule';
     $search->ref_type = 'weblog_post';
     $view_link = array('module' => 'WeblogModule', 'action' => 'view', 'id' => 0);
     if ($item && $item->is_draft == 0) {
         $db->delete('search', "ref_module='WeblogModule' AND ref_type='weblog_post' AND original_id=" . $item->id);
         $search->original_id = $item->id;
         $search->body = " " . exponent_search_removeHTML($item->body) . " ";
         $search->title = " " . $item->title . " ";
         $search->location_data = $item->location_data;
         $view_link['id'] = $item->id;
         $search->view_link = exponent_core_makeLink($view_link, true);
         $db->insertObject($search, 'search');
     } else {
         $db->delete('search', "ref_module='WeblogModule' AND ref_type='weblog_post'");
         foreach ($db->selectObjects('weblog_post', 'is_private=0 AND is_draft=0') as $item) {
             $search->original_id = $item->id;
             $search->body = ' ' . exponent_search_removeHTML($item->body) . ' ';
             $search->title = ' ' . $item->title . ' ';
             $search->location_data = $item->location_data;
             $view_link['id'] = $item->id;
             $search->view_link = exponent_core_makeLink($view_link, true);
             $db->insertObject($search, 'search');
         }
     }
     return true;
 }
 function spiderContent($item = null)
 {
     global $db;
     if (!defined('SYS_SEARCH')) {
         include_once BASE . 'subsystems/search.php';
     }
     $search = null;
     $search->title = '';
     $search->view_link = '';
     $search->category = exponent_lang_loadKey('modules/TextModule/class.php', 'search_post_type');
     $search->ref_module = 'TextModule';
     $search->ref_type = 'textitem';
     if ($item) {
         $db->delete('search', "ref_module='TextModule' AND ref_type='textitem' AND original_id=" . $item->id);
         $search->original_id = $item->id;
         $search->body = ' ' . exponent_search_removeHTML($item->text) . ' ';
         $search->location_data = $item->location_data;
         $db->insertObject($search, 'search');
     } else {
         $db->delete('search', "ref_module='TextModule' AND ref_type='textitem'");
         foreach ($db->selectObjects('textitem') as $item) {
             $search->original_id = $item->id;
             $search->body = ' ' . exponent_search_removeHTML($item->text) . ' ';
             $search->location_data = $item->location_data;
             $db->insertObject($search, 'search');
         }
     }
     return true;
 }