PHP Bookmarks - v1.15 A quick little script to keep track of your book marks, IP addresses, whatever.. anything you want to keep groups of in simple list form. It's easy to customize so use it for what you want. Requires PHP and MySQL. PHP Bookmarks has no built in security as of this revision but you can use .htaccess to limit access to the admin.php to prevent unwanted updates. ** License ** This software is licensed under the CC-GNU GPL http://creativecommons.org/licenses/GPL/2.0/ ** Installation ** Prerequisites: download and install MySQL. download and install Apache and PHP 4.1.0 or greater. do the following modify the header.php, footer.php, and *.css files to make things look how you want. As of release v1.10, PHP Bookmarks has an auto-installer feature that makes the initial setup much easier. copy all the files into your htdocs directory on your web server make sure your web server has the rights to create a file in your htdocs directory. As of release v1.14, PHP Bookmarks requires that you have http authentication turned on. Included are sample .htaccess and .htpassword files. cp sample.htaccess .htaccess cp sample.htpasswd .htpasswd The default user in htpasswd is "admin", password "admin". You'll want to change this of course, so just do the following to delete the admin user and add your own. htpasswd -D .htpasswd admin htpasswd -m .htpasswd htpasswd then prompts you for the password. ** Automated Install ** If you have the mysql admin username and password you can use the automated setup. Open indxe.php in your browser. It will prompt you for values it needs to perform the installation. Click on setup and it will create the database for you and populate it. That's it. Open index.php in your web browser, enter admin mode and start adding categories, bookmarks, etc... To customize your web browser with a "Quick Link" to add new bookmarks, click on the [ add ] link while in Admin mode, and drag the link "Add to bookmarks" to your browser tool bar. To add links to PHP bookmarks, you can click on the "Add to bookmarks" link, which will take your current location and allow you to add a bookmark. ** Manual Install ** If you don't have mysql admin access, you'll have to do a manual install. Create, or have created for you a database with the following in mysql, replacing the variables , , , and with the desired values.: CREATE DATABASE ; GRANT CREATE, ALTER, DROP, SELECT, INSERT, UPDATE, DELETE ON .* TO @ IDENTIFIED BY '' ; Open indxe.php in your browser. It will prompt you for values it needs to perform the installation. Delete the database administrator user name, so PHP Bookmarks will know the database already exists. Click on setup and it will populate the database for you. That's it. Open index.php in your web browser, enter admin mode and start adding categories, bookmarks, etc... To customize your web browser with a "Quick Link" to add new bookmarks, click on the [ add ] link while in Admin mode, and drag the link "Add to bookmarks" to your browser tool bar. To add links to PHP bookmarks, you can click on the "Add to bookmarks" link, which will take your current location and allow you to add a bookmark. ** Upgrading ** PHP Bookmarks handles any database upgrades automatically. To upgrade just copy the files index.php, admin.php, and functions.php into your PHP Bookmarks directory. Read the change log at the end of this file for further details. As of v1.13, it was noticed that previous installs had used too restrictive of a grant statement for the database user, which may hinder future upgrades. Running the following mysql command will fix that. GRANT CREATE, ALTER, DROP, SELECT, INSERT, UPDATE, DELETE ON .* TO @ IDENTIFIED BY '' ; I should also add in a check at the next version (or when I have to create/alter/drop a table) that will make sure the database user has sufficient rights before upgrading. ** Customizing ** Included in the distro are several themes that can by changed by copying the style.css file into the PHP Bookmarks directory. Additionally you can edit the style.css yourself, as well as the header.php and footer.php files. If you want even greater control, you can edit the source code itself and change the overall look, or make the program do something entirely different. That's the beauty of open source software. ** Security ** To keep things simple, no security was written into PHP Bookmarks, but instead it was written to expect Apache's http user authenication to be in place. It was originally intended to be a down an dirty quick little program to keep track of lists of things grouped by category, be it bookmarks, CDs, or games. Since it's unlikely you want to open your bookmarks to the world for editing, deleting, etc.. I've included a sample .htaccess and .htpasswd file for use with apache. If you must run PHP Bookmarks without security, just add the following variable in the conf.php file: $insecure = 1; In addition to the .htaccess files, I have had to add in a section in my Apache httpd.conf such as the following to get it to prompt me for a pasword if I try to submit something. ------------------------------------------------------------ Options Indexes Includes FollowSymLinks AllowOverride All Order allow,deny Deny from all ------------------------------------------------------------ That was due to a quirky install of Apache, and it is no longer needed, but I figured I would include this in case someone else had the same problem. Since the conf.php file contains the plaintext password to your database, it is not advisable to make this world readable, so permissions should be setup so just the web server has access to read this file. On my system I have a user and group that apache runs under, and have set the user to myself, the group to that of apache. Then I set the file permissions to 640, or read write for the user, read for the group, and no access for everyone else. The commands to do this would be: chown krux:wwwdata conf.php chmod 640 conf.php ** Changelog ** 1.1 - Initial public release. Theme support added with the help of Ruebella. 1.2 - Added sub-category support. 1.3 - Added link to add another item after adding an item. Added the ability to move items and categories between categories. Added an admin toggle to not display any editing links unless validated. (Note: this security is just to turn on and off the display. It is easily circumvented by just putting ?admin=1 in the URL. PHP Bookmarks still requires that you use the security in your web server to limit POST actions to validated users.) 1.4 - Added the ability to change the sort order to ID and manually reorder links. Added additional error checking when trying to open the database. 1.5 - Fixed width of last column so it doesn't wrap when viewed in Internet Explorer. Made the name a html link as well as the URL. Added a comments field. Added a toggle for the comments. Added a toggle for the URLs. Added bodyalt style which alternates with the body style create a "greenbar" look which makes things easier to read. 1.6 - Added comments to categories. 1.7 - Fixed a security bug where submits were not being checked against HTTP_VARS_POST Added nowrap to the last column so longer URL's don't mess with the display. Rewrote the category selection code to sort correctly. Fixed bug in category selection code which would allow you to move a parent category into a child category, creating a loop. 1.8 - Opps, forgot to remove a line and it appears Konqueror was smart enough not to let it bother rendering a select form element, so while editing items worked for me, they didn't work for anyone else. 1.9 - Updated calls for external variables using $_GET, $_POST, etc... so PHP Bookmarks no longer requires registerglobals to be turned on. Added a "Quick Link" javascript that you can add to your browser tool bar that lets you quickly bookmark pages into PHP Bookmarks. Note: The "Quick Link" feature requires you to have the full admin url specified in the conf.php configuration file. Fixed bug where category comments were not moved with category when reordering. 1.10 - Fixed bug with the category selector filtering incorrectly. $baseurl and $adminurl are now auto set and are no longer required to be placed in the conf.php file. Setup auto installer. Setup a default category and sample bookmarks to be added on initial install. Added the ability for top level categories to be closed. Top level categories are dynamically placed in a "Categories" category which can be positioned at the top or bottom of the list. Added a basic search engine. 1.11 - Limited the length of urls to be displayed to 70 characters. (thanks to Jaap Tollenaar) Updated add to bookmarks function to give a link to return to page being bookmarked. Note this required updating your browser toolbar link with the new version. fixed a bug where the add to bookmarks link would not work correctly if register globals was turned off. added detection for blazer phone browser, so that phpbookmarks returns an optimized page with out tables or other extra information. 1.12 - Added ability to hide items or comments to users not in admin mode. Fixed a couple variable which still required registerglobals to be on. 1.13 - Added ability to lock the open/close category function so only authenticated admin users are able to do so. This feature prevents search bots, random users, etc.. from closing/opening all your categories. Now checks that when admin is requested, that the user has been authenticated with Apache. Prevents trying to make changes or view hidden items by placing admin=1 in the URL. Fixed the handling of special characters when using the "Add to bookmarks" toolbar link, and input fields. Updated the example .htpasswd to include better protection for admin.php. Added the ability to have database created prior, for users without administrative access to their servers. Updated the documentation to reflect the above. (Thanks to Adriana Mikolaskova Nautsch) Previous auto installs did not grant database user the ability to create, alter or drop tables. Added note to fix. ** Final Words ** If you like this program, or have any modifications, suggestions, or requests, send an email to me at krux@thcnet.net. http://devel.thcnet.net/phpbookmarks/