Hi,
For Question Number 2 ...
I once asked the same thing, i want to add 'Year" and "Notes" fields so it can
be searchable, but i only succeed add "Year". I got these codes from Indra
Sutriadi, a member on this mailing list
okay, to add Year ...
you have to change file ./template/default/index_template.inc.php. than, add
lines :
...
<?php echo __('Year'); ?> :
<input type="text" name="publish_year" class="ajaxInputField" /><br />
...
Change this file too ./lib/contents/default.inc.php. and add these lines
...
$is_adv = isset($_GET['search']) || isset($_GET['title']) ||
isset($_GET['author'])
|| isset($_GET['isbn']) || isset($_GET['subject']) || isset($_GET['location'])
|| isset($_GET['publish_year']) || isset($_GET['gmd']) ||
isset($_GET['colltype']);
if ($is_adv) {
...
$publish_year = '';
if (isset($_GET['publish_year'])) {
$publish_year = trim(strip_tags(urldecode($_GET['publish_year'])));
}
...
}
// don't do search if all search field is empty
if ($title || $author || $subject || $isbn || $gmd || $colltype ||
$location || $node || $publish_year) {
...
if ($publish_year) { $criteria .= ' publishyear='.$publish_year; }
...
}
// search result info construction
if ($is_adv) {
...
if ($publish_year) { $info .= 'Publishing Year :
<strong><cite>'.$publish_year.'</cite></strong>, '; }
...
} else {
...
}
...
that's it. for more clear n detail codes, you can visit
http://pastebin.com/YrKz5a26 (to change file index_template.inc.php) and
http://pastebin.com/7pNEFQPa ( to change file default.inc.php)
now, to add "Notes" ....
Change file lib/contents/default.php. look for these lines :
if (isset($_GET['location'])) {
$location = trim(strip_tags(urldecode($_GET['location'])));
}
// don't do search if all search field is empty
if ($title || $author || $subject || $isbn || $gmd || $colltype ||
$location) {
$criteria = '';
if ($title) { $criteria .= ' title='.$title; }
if ($author) { $criteria .= ' author='.$author; }
change into these :
if (isset($_GET['location'])) {
$location = trim(strip_tags(urldecode($_GET['location'])));
}
if (isset($_GET['notes'])) {
$notes = trim(strip_tags(urldecode($_GET['notes'])));
}
// don't do search if all search field is empty
if ($title || $author || $subject || $isbn || $gmd || $colltype ||
$location) {
$criteria = '';
if ($title) { $criteria .= ' title='.$title; }
if ($author) { $criteria .= ' author='.$author; }
if ($notes) { $criteria .= ' notes='.$notes; }
if ($subject) { $criteria .= ' subject='.$subject; }
if ($isbn) { $criteria .= ' isbn='.$isbn; }
if ($gmd) { $criteria .= ' gmd="'.$gmd.'"'; }
if ($colltype) { $criteria .= ' colltype="'.$colltype.'"'; }
if ($location) { $criteria .= ' location="'.$location.'"'; }
$criteria = trim($criteria);
$biblio_list->setSQLcriteria($criteria);
}
and change
<?php echo $advsearch_topic; ?>
case 'notes' :
if ($_b == '-') {
$_sql_criteria .= " NOT (MATCH (biblio.notes)
AGAINST ('".$_q."', IN BOOLEAN MODE))";
} else { $_sql_criteria .= " (MATCH (biblio.notes)
AGAINST ('".$_q."', IN BOOLEAN MODE))"; }
break;
if you managed too add "Notes" please do share with us
Thanks,
Wuri
________________________________
From: Faculty of Transport <[email protected]>
To: [email protected]
Sent: Wed, March 9, 2011 6:14:23 PM
Subject: [ics-isis] how to show custom fields.... and some more hacks
Dear All,
I have some questions for group. How to show custom fields in OPAC?
Other questions are about few hacks in default fields :) I would like to make
some more fields to be searchable, not only authors,keywords etc. I tried with
some files in /lib but searching does not working. I think problem is in
passing
values to the MySql database. Is there any idea what to do?
Best regards to all users and Senayan Team.
SF Transport Library. Uni Belgrade
[Non-text portions of this message have been removed]
------------------------------------
--
Towards cyber libraries to support information society in Indonesia.
Joining ICS-isis by sending mailto:[email protected]
Visit ICS-Portal at http://digilib.binus.ac.id/ics/index.phpYahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ics-isis/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ics-isis/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/