How to set up Drumknott 0.91 1 . INSTALLATION 1.1 Requirements 1.2 Create the database 1.3 Create a database user 1.4 Create the table 1.5 Copy PHP files 2 CONFIGURATION 2.1 config.php 3 DESIGN 3.1 header.inc 3.2 Stylesheet 3.3 Heading Images 3.4 Description Subheadings 4 ADDING ENTRIES 4.1 Section/Subsection 4.2 Title 4.3 Body 4.4 Publish/Draft 4.5 Edit/Delete/Publish Entries 5 MISCELLANY 5.1 Securing the Admin Area 1 . INSTALLATION 1.1 Requirements You'll need a webserver running PHP, and MySQL. You'll also need root access to the Mysql server, or you'll have to find someone who does. 1.2 Create the database Unpack drumknott.tar. Doesn't matter too much where at this stage. Now cd to the dk directory that just got created. If you have root access to mysql, type this : mysqladmin -u root -p create drumknott Then enter the root MySQL password. If you are allowed to do this, it will create a database called Drumknott. If you don't have permission you'll have to get the MySQL admin to do it for you. If you get a database exists error, you'll have to give your database a different name. mysqladmin -u root -p create 1.3 Create a database user You'll need a username and password for MySQL, cos it's bad manners to do things as root. Oh yeah and a security risk. If you don't have root for the MySQL server then you'll have to get the database admin to do this for you too. mysql -u root -p Type the mysql root password, and at the promp, type : GRANT ALL PRIVILEGES ON .* TO @localhost IDENTIFIED BY '' WITH GRANT OPTION; is whatever you called it above (probably drumknott) your username and password can be whatever you like. It'll say 0 rows affected, but don't let that worry you, it's done what it has to. 1.4 Create the table mysql -u -p < blog.dump And put your mysql password in at the prompt. The blog.dump file creates a table in the Drumknott database, called blog. 1.5 Copy PHP files Now copy all the .php and .inc files to your web directory (probably public_html), as well as the admin directory, and you're done. On a *nix server cp *.inc ~/public_html/ cp *.php ~/public_html/ cp dk.gif ~/public_html/ cp admin/ public_html 2 CONFIGURATION 2.1 config.php config.php contains your MySQL username, password and database name. It also contains some other variables to affect the appearance of your Drumknott pages. It's unusually well documented, so you can pretty much just open config.php and follow the instructions in there. Note that you should only change the dbname variable here if you called it something other than Drumknott in 1.2 above. The $rmenuhome variable lets you choose what to do with the right hand menu on the home page. If you don't want to have a right hand menu, set this to zero and the centre section will expand to fill that space as well. If you want it to list all the sections and subsections (ie sitemap) then set this to 1. If you want to have it show a section specific menu, then choose 2 and set the $rhmsect variable to the section you want to use. $mytimezone isn't very well tested, cos every time I change the time on my laptop XMMS keels over, and you just can't code in silence. If you've set it right and it is giving you weird times, tell me and I'll see what I can do. In the meantime if it isn't right, just change this value to whatever gives you the right time :) We'll explain $imgext later, in simple terms it lets you choose what type of image you want to use for headings (ie, png, gif or jpg) Pick one of those now, but don't worry, cos you can change anything in the config.php file at any stage, so if you want to change the title of your site, or start using .png instead of .gif images you can. $itemsperpage should be fairly self explanatory. $nosubsects allows you to classify your posts into sections without subclassifying into subsections. Set this to 1 if you just want sections. And that's the config file. At this point Drumknott is functional, so you can go start adding entries and have a very plain and dirty looking set of pages. 3 DESIGN 3.1 header.inc You'll need to modify the header.inc file, to make things look the way you want them to. It's laid out roughly like this |-------------------------| | heading | |-------------------------| |static| body |auto| |menu | |menu| |-------------------------| You're stuck with this at the moment cos that's how I wanted my site :) In the future there may be other options. Use the header.inc to set background colour/image, font colours etc. The header.inc file contains the heading and static menu. You can put your section links in either of these. You can also put whatever the hell you like in these, but make sure you close any html tags you open or things might go funky on you! (don't close the tables though) When you create the links to your sections, do it thusly : text or You'll need to do one of these for each section. If you add a new section, don't forget to add a new link here. In future versions there'll be the option to have this happen automagically for you. 3.2 Stylesheet A new feature in 0.71 and above is the option to use a stylesheet. If you want to use this, uncomment the line in header.inc (it tells you where) If you know how to use stylesheets uncomment this line and edit dk.css, otherwise just ignore it. Each of the three columns have a class attached, lhmenu, main, and rhmenu. 3.3 Heading Images We need to explain the $imgext variable. To get images as your section/subsection headings, you need to choose what kind of images you want (ie, gif jpg or png) and put that in $image_ext in config.php. Then make your images be called section.ext (eg, if you have a news section and your images are .png files, have an image named news.png) and drumknott will find them for you. If you want subsection headings too, make sectionsubsection.ext (eg newstech.png for the Tech subsection of the News section) and Drumknott will use that, otherwise it'll use the section image. Put your images in a directory named images, in the same directory as the Drumknott scripts. If it can't find either of these, it'll just use text. As of 0.91, you can use images for the older/newer and start/end links. Just name them older.ext, newer.ext, start.ext, end.ext. Same as the headings, if Drumknott can't find them it'll just use text. 3.4 Description Subheadings If you want a subheading under each section/subsection title to tell you what the section is about, just create a file called
.txt or .txt in the same directory as your Drumknott files (not the admin directory) and write whatever you like in it. This will come up below the section/subsection heading. If you don't want these, just don't do anything. 4 USING DRUMKNOTT 4.1 Section/Subsection To start adding entries, go to http://your.domain.name/~username/admin and choose 'Input an entry'. When you first start there will be no section or subsection options, except for add new subsection. Once you add something, it'll turn up in the menu next time. You need to make new section/subsection names all lower case, Drunknott will capitalise them for you when it displays them. 4.2 Title Title is whatever you want it to be. Don't put links as your item titles, cos that will confuse the hell out of your browser when Drumknott makes a link to that item. 4.3 Body You can put HTML in the body, pretty much anything as far as I know. It's really important that you make sure you close any tags you open, as Drumknott doesn't validate your html yet, so you might mess the rest of the page up 4.4 Publish/Draft Once you've typed your entry, you can choose to publish it directly to your blog, or save it as a draft, in case you aren't finished or want to rethink or whatever. The buttons at the bottom of the input screen are pretty self explanatory. 4.5 Editing/Deleting/Publishing Entries From the admin index, choose Edit/Delete/Publish an Entry. This will bring up a table of all exisiting entries. Find the one you want and click either publish, edit or delete. If you choose delete you will be shown the entry and given the chance to confirm or change your mind. If you choose Edit, just change what you need to change and hit Enter Item. If you do need to change the date, make sure you follow the same date format it shows or you may end up with an entry from 64BC or something. Any items which you currently have saved as a draft will have the word Publish in red letters so you notice them. Items which are currently published will have the word redraft instead. Click that if you want to return the item to draft status. Items will be posted with the date they were published. 5 MISCELLANY 5.1 Securing the Admin Area You may want to secure your admin pages so nobody else can use them. On an Apache server, you can use the built in .htaccess security. Here's the instructions : In your admin directory, create a file called .htaccess. It should look like this : AuthType Basic AuthName "Secret Admin Area" AuthUserFile /home//.htpasswd require valid-user where is your UNIX username, not your mysql one. Then at the console type htpasswd -c /home//.htpasswd can be whatever, it'll be the one your web browser asks for when you go to the admin area. It'll then ask you for a password. Then you should be done.