Welcome To Snipplr


Everyone's Recent PHP Snippets



1 ... 66 67 68 69 70 ... 152
0 266 posted 10 years ago by focal55
Put in /sites/default/settings.php
0 297 posted 10 years ago by resting
1 308 posted 10 years ago by focal55
Automatically add a class to the body tag on each page. Remember to add <?php> to your body tag in the page.tpl.php file. You can also override or insert PHPTemplate variables into the templates with this function.
1 300 posted 10 years ago by focal55
0 238 posted 10 years ago by focal55
When adding a link to a form say for instance a login form you can use drupal_get_destination() to return the user to the page they were on when they finish loging in. This show you how to do this programatically in a link l(); function.
0 316 posted 11 years ago by Onfire60
0 316 posted 11 years ago by hejaaa
0 290 posted 11 years ago by whak
1 400 posted 11 years ago by fackz
If post thumbnail doesn't exist, then get the first uploaded image. Change sizes as needed.
0 497 posted 11 years ago by vagrantradio
0 321 posted 11 years ago by Waldio
Using shortcode to retrieve the author page url (ex. abc.com/?author=123), using the WP Shortcode API as reference.
1 278 posted 11 years ago by sdxxx
With this customizable code you can add google weather showing current temps, conditions, and forecast for any location to your website. User prompts are included to allow the user to change the default location easily then hit the "go" button. Auto...
0 301 posted 11 years ago by stevethomas2011
0 302 posted 11 years ago by Farhan
How to display your page or categories list within a definition list instead of the default unordered list. The first block is about pages and the second one is about categories.
0 213 posted 11 years ago by brunohstein
Example set of files for data mapping objects to db records. (Not perfect, but funcional)
0 316 posted 11 years ago by nikefido
A sample wrapper class around Zend_File_Transfer_Adapter_Http
0 297 posted 11 years ago by nikefido
I’ve implemented something similar a couple of months ago. What we wanted was to prevent the cart from the old session from merging into the cart of the current session at the point when the customer login. If that describes what you want as well,...
0 315 posted 11 years ago by TioSolid
Adjust the size of the body field window. For use in hook_form_alter().
0 283 posted 11 years ago by tgbdad
Save in a php file and run in the directory. Remove directory files through ftp. Remove php file
0 275 posted 11 years ago by resting
0 224 posted 11 years ago by baires
Only this portion needed // Add page template suggestions based on node type, if we aren't editing the node. if ($vars['node'] && arg(2) != 'edit') { $vars['template_files'][] = 'page-nodetype-'. $vars['node']->type;...
1 327 posted 11 years ago by resting
This will make all errors be shown and logged. Useful for when you want to figure out what's wrong but the production server doesn't display any errors.
1 315 posted 11 years ago by BrunoDeBarros
Как сделать вывод из нескольких таблиц (php mysql) Итак, имеем: Три таблицы - articles, categories и sections. По иерархии - в sections включаются categories, а в catego...
0 314 posted 11 years ago by graceman9
0 291 posted 11 years ago by dmistriotis
You can use this code under MIT licence.
0 427 posted 11 years ago by digitalzoomstudio
1 ... 66 67 68 69 70 ... 152