SnipsManager is a free and open source PHP script for creating websites to share source code and plain text like emails, poems and articles with others. It has an easy-to-use Ajax interface that can be customized using its admin pages. It also provides a simple developer API that can be used to integrate it with other websites, as well as features like syntax highlighting, one-click downloading of the submitted text in a file with the appropriate extension, social bookmarking and password protection.
To install SnipsManager:
Now SnipsManager should be working without any problems. If you need to change the database details after deleting the file install.php read the next section.
If you changed the database name, username, password or installation location and would like to change the settings in SnipsManager to reflect that you’ll find these details in the config.php page. You will not be able to view or modify the contents of the file if you open it in a web browser; you’ll have to edit the file using your control panel's text editor or download it and make the changes locally on your computer then upload it to your website. The contents of the file are:
<?php $sitename = 'http://localhost/snipsmanager/'; function connect() { mysql_connect(<DB_Location>, <DB_User>, <DB_Password>); mysql_select_db(<DB_Name>); } ?>
For the contact page to work you will need to enter your name and email address in the last two fields in the General tab of the Settings page in the Admin area.
If you would prefer to hide the contact page you can remove it from the top menu by editing the Interface Settings page.
You can modify the design to add banners where you see fit, but if you do not want to mess with HTML and CSS you can display a banner at the bottom of every page by editing the footer.php page and pasting the code immediately after the:
<!– Advertising –>
line. The ideal size for banners in this location is 468 pixels by 60 pixels.
To hide index.php from the homepage URL, i.e. redirect http://example.com/index.php to http://example.com/ open the file .htaccess in the root folder with a text editor. Its contents should be:
RewriteEngine On #shortens URLs from /show.php?id=123 to /123 RewriteRule ^([0-9].*) show.php?id=$1 [L] #uncomment and modify domain to redirect www.example.com to example.com #RewriteCond %{HTTP_HOST} ^www.example.com [NC] #RewriteRule ^(.*)$ http://example.com/$1 [L,R=301] #uncomment and modify domain to redirect /index.php to / #RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(([^/]+/)*)index\.php\ HTTP/ #RewriteRule index\.php$ http://example.com/%1 [R=301,L]
Then:
As of version 2.3 SnipsManager has URL shortening enabled by default. So snippet URLs will be http://example.com/123 instead of http://example.com/show.php?id=123. If you would like to disable it:
$link = $sitename . "show.php?id=" . $row['id'];
//$link = $sitename . $row['id'];
#RewriteRule ^([0-9].*) show.php?id=$1 [L]