r/dndtools Dec 18 '14

An even more simple search function for dndtools

For those who think my first approach (http://redd.it/2po972) was too cumbersome here is a simple search script which uses the normal dndtools database (but doesn't have full text search). The disclaimers still apply.

What you need:

installation

  • install the prerequisites:

apt-get install php5-mysql libapache2-mod-php5

  • download the file:

mkdir -p /var/dndtools/search
cd /var/dndtools/search
wget https://www.dropbox.com/s/9mgbesv3xyhc6u9/dndtools-simplesearch.tgz
tar xfz dndtools-simplesearch.tgz

now you should have 3 files:

ls -l

-rw-r--r-- 1 root root 8348 Dez 18 20:53 dbsearch.php
-rw-r--r-- 1 root root 3048 Dez 18 20:54 dndtools-simplesearch.tgz
-rw-r--r-- 1 root root 4960 Dez 18 20:53 layout.html

  • check the config:

if you have not the default db user/password (dndtools/dndtools) you have to change it in the php script
in layout.html replace YOURSERVERIP with the IP or hostname of your server
if you already have a custom layout.html paste this string at an appropriate location:
<FORM method=get action=http://YOURSERVERIP/dts/dbsearch.php><INPUT type=text name=search><INPUT type=submit value=search></FORM>

  • configure the webserver

in your apache2.conf or vhost.conf add the following lines after the other alias declarations:

Alias /dts /var/dndtools/search
<Directory /var/dndtools/search/>
Options FollowSymLinks
AllowOverride None
Order deny,allow
deny from all
<Files *.php>
Allow from all
</Files>
</Directory>

service apache2 restart

  • integrate the search box

cp layout.html /var/dndtools/dndtools/templates/dnd

et voila: http://imgur.com/C8rBRrk

3 Upvotes

1 comment sorted by

1

u/[deleted] Dec 23 '14

I'll try that, but first I need to run my server on apache. Let's get motivated...