How to koha OPAC New Arrivals Books Display
Coverflow plugin allows you to display new arrival books of your koha library system. The plugin is developed by Bywater solution
Downloading
From the release page, you can download the relevant *.kpz file
Installing
Koha's Plugin System allows for you to add additional tools and reports to Koha that are specific to your library. Plugins are installed by uploading KPZ ( Koha Plugin Zip ) packages. A KPZ file is just a zip file containing the Perl files, template files, and any other files necessary to make the plugin work.
First, you will need to turn on the koha plugin system
Open the koha-config.xml file
sudo vim /etc/koha/sites/library/koha-conf.xml
Change <enable_plugins>0<enable_plugins> to
<enable_plugins>1</enable_plugins> in your koha-conf.xml file
Confirm that the path to <pluginsdir> exists, in my case the path is
<pluginsdir>/var/lib/koha/library/plugins</pluginsdir>
Restart web server and Memcached
sudo systemctl restart apache2 memcached koha-common
SELECT b.biblionumber, SUBSTRING_INDEX(m.isbn, ' ', 1) AS isbn, b.title
FROM items i
LEFT JOIN biblioitems m USING (biblioitemnumber)
LEFT JOIN biblio b ON (i.biblionumber=b.biblionumber)
WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= i.dateaccessioned AND m.isbn IS NOT NULL AND m.isbn != ''
GROUP BY biblionumber
HAVING isbn != ""
ORDER BY rand()
LIMIT 30
For New arrivals under branch libraries, use this SQL query
SELECT b.biblionumber, SUBSTRING_INDEX(m.isbn, ' ', 1) AS isbn, b.title
FROM items i
LEFT JOIN biblioitems m USING (biblioitemnumber)
LEFT JOIN biblio b ON (i.biblionumber=b.biblionumber)
WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= i.dateaccessioned AND m.isbn IS NOT NULL AND m.isbn != ''
AND i.homebranch = <<Branch|branches>>
GROUP BY biblionumber
HAVING isbn != ""
ORDER BY rand()
LIMIT 30
Configure the plugin
Administration --> Plugins --> Manage Plugins --> Select the installed plugin --> Click configure and put the below code replacing the New Arrival public report id.
---
- id: 5
selector: "#coverflow"
options:
buttons: true
autoplay: 4000
loop: true
Here id: 5 is the public report that we created
Web Server Configuration
Open Applications > System Tools > Terminal
Apply the following command
sudo su (Enter the mysql password)
sudo mousepad /etc/apache2/sites-enabled/library.conf
Add the following line at the bottom of the file. replace the library with your koha instance name
ScriptAlias /coverflow.pl "/var/lib/koha/library/plugins/Koha/Plugin/Com/ByWaterSolutions/CoverFlow/coverflow.pl"
Alias /plugin/ "/var/lib/koha/library/plugins/"
# The stanza below is needed for Apache 2.4+
<Directory /var/lib/koha/library/plugins/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Alias /plugin/ "/var/lib/koha/library/plugins/"
# The stanza below is needed for Apache 2.4+
<Directory /var/lib/koha/library/plugins/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Restart memcached:
sudo service memcached restart
Restart your webserver:
sudo service apache2 restart
Restart web server and Memcached
sudo systemctl restart apache2 memcached koha-common
Now go to Koha Tools --> News (from v20.05) and in OpacMainUserBlock add the following html tag
<center><span style="font-family: merriweather; color: #e3031d;">WHATS A NEW!/ NEW ARRIVALS <br /><br /></span></center><span id="coverflow">Loading...</span>
Now check your OPAC page to view the coverflow.
No comments:
Post a Comment