mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Date field added to documents.
This commit is contained in:
parent
b3e900cee6
commit
ecebdf0e6e
@ -1,10 +1,12 @@
|
||||
CREATE TABLE IF NOT EXISTS `prefix_search_documents` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`docid` int(11) NOT NULL,
|
||||
`doctype` varchar(12) NOT NULL default 'none',
|
||||
`title` varchar(100) NOT NULL default '',
|
||||
`url` varchar(100) NOT NULL default '',
|
||||
`docdate` timestamp NOT NULL default '0',
|
||||
`updated` timestamp NOT NULL default CURRENT_TIMESTAMP,
|
||||
`courseid` int(11) NOT NULL default '0',
|
||||
`groupid` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=1;
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=1;
|
||||
|
@ -1,9 +1,11 @@
|
||||
CREATE TABLE prefix_search_documents (
|
||||
id SERIAL8 PRIMARY KEY,
|
||||
docid int4 NOT NULL,
|
||||
doctype varchar(12) NOT NULL DEFAULT 'none',
|
||||
title varchar(100) NOT NULL default '',
|
||||
url varchar(100) NOT NULL default '',
|
||||
docdate timestamp NOT NULL,
|
||||
updated timestamp NOT NULL DEFAULT NOW(),
|
||||
courseid int4,
|
||||
groupid int4
|
||||
);
|
||||
);
|
||||
|
@ -10,6 +10,7 @@
|
||||
$this->addField(Zend_Search_Lucene_Field::Text('author', $doc->author));
|
||||
$this->addField(Zend_Search_Lucene_Field::UnStored('contents', $doc->contents));
|
||||
$this->addField(Zend_Search_Lucene_Field::UnIndexed('url', $doc->url));
|
||||
$this->addField(Zend_Search_Lucene_Field::UnIndexed('date', $doc->date));
|
||||
|
||||
$this->addField(Zend_Search_Lucene_Field::Binary('data', serialize($data)));
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
$doc->title = $post['subject'];
|
||||
$doc->author = $post['firstname']." ".$post['lastname'];
|
||||
$doc->contents = $post['message'];
|
||||
$doc->date = $post['created'];
|
||||
|
||||
$doc->url = forum_make_link($post['discussion'], $post['id']);
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
// generic information; required
|
||||
$doc->docid = $entry['id'];
|
||||
$doc->title = $entry['concept'];
|
||||
$doc->date = $entry['timecreated'];
|
||||
|
||||
$user = get_recordset('user', 'id', $entry['userid'])->fields;
|
||||
|
||||
@ -38,7 +39,7 @@
|
||||
//preserve glossary pop-up, be careful where you place your ' and "s
|
||||
//this function is meant to return a url that is placed between href='[url here]'
|
||||
return "$CFG->wwwroot/mod/glossary/showentry.php?eid=$entry_id' onclick='return openpopup(\"/mod/glossary/showentry.php?eid=$entry_id\", \"entry\", \"menubar=0,location=0,scrollbars,resizable,width=600,height=450\", 0);";
|
||||
} //glossary_make_link
|
||||
} //glossary_make_link
|
||||
|
||||
function glossary_iterator() {
|
||||
return get_all_instances_in_courses("glossary", get_courses());
|
||||
@ -61,9 +62,23 @@
|
||||
|
||||
return $documents;
|
||||
} //glossary_get_content_for_index
|
||||
|
||||
function glossary_single_document($id) {
|
||||
$entries = get_recordset('glossary_entries', 'id', $id);
|
||||
$entry = $entries->fields;
|
||||
|
||||
$glossaries = get_recordset('glossary', 'id', $entry['glossaryid']);
|
||||
$glossary = $glossaries->fields;
|
||||
|
||||
return new GlossarySearchDocument($entry, $entry['glossaryid'], $glossary['course'], -1);
|
||||
} //glossary_single_document
|
||||
|
||||
function glossary_delete($info) {
|
||||
return $info;
|
||||
} //glossary_delete
|
||||
} //glossary_delete
|
||||
|
||||
function glossary_db_names() {
|
||||
return array('id', 'glossary_entries', 'timemodified');
|
||||
} //glossary_db_names
|
||||
|
||||
?>
|
@ -7,6 +7,7 @@
|
||||
// generic information; required
|
||||
$doc->docid = $resource['id'];
|
||||
$doc->title = strip_tags($resource['name']);
|
||||
$doc->date = $resource['timemodified'];
|
||||
|
||||
$doc->author = '';
|
||||
$doc->contents = strip_tags($resource['summary']).' '.strip_tags($resource['alltext']);
|
||||
|
@ -21,6 +21,7 @@
|
||||
// generic information; required
|
||||
$doc->docid = $page->id;
|
||||
$doc->title = $page->pagename;
|
||||
$doc->date = $page->timemodified;
|
||||
|
||||
//remove '(ip.ip.ip.ip)' from wiki author field
|
||||
$doc->author = preg_replace('/\(.*?\)/', '', $page->author);
|
||||
|
Loading…
x
Reference in New Issue
Block a user