Here is what I use to make a backup library of MySQL daily that will keep backups for 30 days.
Posted by Mr PHP on May 14, 2008
Quick example of how to set default expires headers. This will help prevent browsers from re-downloading the same images more than once and therefore reduce the load on your image server.
Some notes and commands I want to keep handy the next time I setup MySQL replication.
Posted by Mr PHP on April 16, 2008
This JavaScript function will resize the inside of a browser window to the dimensions provided.
Posted by Mr PHP on February 20, 2008
Generate thumbs by visiting a URL such as your.com/thumbs/50x50/images/image.jpg. This will create a 50x50px thumbnail of your.com/images/image.jpg.
your.com/thumbs/50x50/images/image.jpg
your.com/images/image.jpg
The thumb will be stored on your server at your.com/thumbs/50x50/images/image.jpg so the next request for the same image will be loaded without loading php for ultra fast image cache.
Posted by Mr PHP on December 11, 2007
Recursively removes array keys with null values.
Posted by Mr PHP on October 30, 2007
Function similar to in_array() but it recursively searches a multi-depth array.
Recursively reverses a multi-depth array.
This simple snippet will provide you with a HTTP or HTTPS Fully Qualified Domain Name URL and Base Path to your CakePHP installation. I use it for the HTML base tag.
Posted by Mr PHP on September 22, 2007
I searched and I could not find something similar already out there, so here is a simple slideshow that will pause when you mouseover. With JavaScript disabled only the contents of the div inside the slideshow will be displayed.
Multiple slideshows per page are supported.
Posted by Mr PHP on September 14, 2007
This php code can be used in a drupal block to display the most popular searches on your site.
Posted by Mr PHP on August 2, 2007
If you want to use a view to get the power of pagers but you need it to render in a block then follow this guide.
Posted by Mr PHP on July 27, 2007
This code snippet will allow you to only display a block on the node types you select. Simply paste into the PHP options.
Posted by Mr PHP on July 25, 2007
This function will download the contents of any URL and return it as a string that you can save to a file or database.
It will use curl if it is installed. Otherwise it will use fopen/fread.
Posted by Mr PHP on July 24, 2007
This example module will provide a form where you can enter your name and upon submission will display your name as a message on the following page. It is very basic but will give you a start to making your first module.
Posted by Mr PHP on July 21, 2007
This snippet will allow you to create a cPanel account using PHP.
This snippet will allow you to create a cPanel subdomain using PHP.
This snippet will allow you to create a cPanel FTP account using PHP.
This snippet will allow you to create a cPanel database using PHP.
This example will show you how to choose which node types use the TinyMCE module.
Posted by Mr PHP on July 5, 2007