Welcome To Snipplr


Everyone's Recent PHP Snippets



1 ... 91 92 93 94 95 ... 147
1 596 posted 14 years ago by phpleo
This set of headers works for me when I output file data from the database for the user to save or open.
0 1259 posted 14 years ago by bradless
0 844 posted 14 years ago by bradless
Frequently I like to make data more user friendly, so while I make it easy for them to add a date as a shorthand format (mm/dd/yyyy) I like to return it as something easier to digest (Day of Month in Year, etc). This is the simplest way to do that I'...
0 806 posted 14 years ago by xekonic
Add the PHP to custom_functions.php and the following CSS to custom.css .custom ul.menu li.search {float:right;} .custom ul.menu li.search form {padding:0.3em;} .custom ul.menu li.search form input {padding:0.4em;}
0 855 posted 14 years ago by kristarella
This is designed to show 10 posts on each of the pages after the home/blog page when the home page only shows 5 (because if you just use posts_per_page=10 without the offset you will lose the most recent posts numbered 6-10 in between the first and...
0 636 posted 14 years ago by kristarella
0 909 posted 14 years ago by fwso
Currenty getImagInfo() also call getImageXMP() so you only need the first function to get your infos.
0 995 posted 14 years ago by frankyfish
Annoyed by the "username's blog" links on your single-author Drupal blog? Don't reach for "display:none;"! Don't remove the $links variable from your node template! Just paste this code into your theme's template.php file. Be sure to replace...
1 819 posted 14 years ago by sheena_d
0 665 posted 14 years ago by gd6d
This example will return values -15 through 15 to be presented to the user in a select list for an integer CCK field.
0 835 posted 14 years ago by tgbdad
1 777 posted 14 years ago by frankyfish
0 719 posted 14 years ago by unravelme1
Calculate date time difference
0 978 posted 14 years ago by fwso
Used to generates fake orders for Zen-Cart.
0 758 posted 14 years ago by fwso
Very simple to use. **Calling:** $files = dirContents(DIR_PATH, [FILTER, [TYPE]]); **Examples:** $files = dirContens("my-dir"); _$files_ is array containing all, both files either directories $files = dirContens("my-dir",...
0 632 posted 14 years ago by Lostindream
A simple script to run with [drush](http://drupal.org/project/drush) to clean all Drupal nodes containing style tags.
1 871 posted 14 years ago by mongolito404
Resizing fields using a custom module You could also resize the field using a custom module. For example, if you created mysite.module, you could use something like this to reduce the field size to 30 characters
4 1016 posted 14 years ago by marcelodornelas
Put this line in your .bashrc. If the user has a directory named 'bin' then that will be added to the PATH. All scripts in that path (wich are executable) will be available as commands to that user.
0 1135 posted 14 years ago by berkes
This template code will work only in the WordPress Loop to include a map if the Geo Mashup plugin is active and the current post has a location.
0 871 posted 14 years ago by cyberhobo
This small function receive a text as input and returns an html text with links if the source text contains urls (http://www… but also ftp://… and every other protocol), emails, twitter’s usernames (with @ at the beginning) and also twitter tag...
0 1159 posted 14 years ago by ginoplusio
Drupal allows hook_update_N to run any sort of code. Most of the time, however, people only use this to alter the database scheme. But you can use it for much more. Like setting variables, creating nodes, importing views and so on. This code show...
2 1021 posted 14 years ago by berkes
1 ... 91 92 93 94 95 ... 147