Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged drupal



1 ... 7 8 9 10 11
1 1470 posted 17 years ago by wesbaker
Allow for easier editing of content by users who didn't make the site.
1 1395 posted 17 years ago by EvanL
Using this convention, you can override any system table setting.
1 1529 posted 17 years ago by shrop
I use this code to place in blocks or pages to show a link to the user registration page if the user is not currently logged in. An example is a block I have setup on the home page of http://www.lightentheload.net. If the user is logged in, the block...
0 1612 posted 17 years ago by shrop
This is a stipped-down version of the original page.tpl.php from Drupal 5.x's Bluemarine theme. Just add your own DIVs.
2 1380 posted 17 years ago by panatlantica
A Views export for Drupal 5. A block that only site admin and site manager roles can access, showing unpublished comments for blog entry content type.
3 1783 posted 17 years ago by shrop
Add this arg code plus set first argument as "OG: Group nid(s)"
2 1709 posted 18 years ago by metareason
This is a snippet I did for a project-- it relies on Drupal and the Flickr module for Drupal.
4 1729 posted 18 years ago by dewolfe001
The following block should live in your theme's page.tpl.php
2 1443 posted 18 years ago by zachharkey
A per-region override. ogt_blocks is ran for a region, if a region contains blocks, we search for a theme function named theme_region_regionname(). If exists, we run that, else we just return the concatenated blocks for that region.
1 1783 posted 18 years ago by berkes
An easy debug trick: gives you a variable that you can print in any tpl.php to find out what vars you have available there.
1 2141 posted 18 years ago by berkes
Place the first function, phptemplate_links() in your template.php file. Alternatively (and IMO better) is to name the function your_theme_name_links() where your_theme_name is the name of your theme. From here on, you can add theme functions like...
2 2069 posted 18 years ago by berkes
Sets a module's weight to the lowest number. This assures that your module is ran before all other modules. Userfull if you want your implementation of a hook to be ran first. Add this to your .install file. Replace your_modulename with the name of...
2 1586 posted 18 years ago by berkes
Add these lines to Drupals settings.php. Probably works on other systems, then Drupal too.
1 1984 posted 18 years ago by berkes
Display first article one way and following ones a different way
3 1788 posted 18 years ago by JuliaKM
0 1222 posted 18 years ago by WimLeers
2 1449 posted 18 years ago by WimLeers
1 1402 posted 18 years ago by WimLeers
With thanks to joshk :)
4 1775 posted 18 years ago by WimLeers
With thanks to emspace for the original code :)
1 1480 posted 18 years ago by WimLeers
With thanks to emspace for the original code :)
3 1724 posted 18 years ago by WimLeers
Removes the core, and node styles from the $style variable. You most morbably already defined _phptemplate_variables($hook, $vars), in that case just add the two lines there. _sympal_theme.. is the name of the theme where we use this.
3 1870 posted 18 years ago by berkes
Shortens a string, and adds a span with a title of the full string. Function is useful for listings where you don't want wraping; or for places where a long string liek a username can break the layout.
1 1850 posted 18 years ago by berkes
1 1668 posted 18 years ago by JuliaKM
2 1613 posted 18 years ago by JuliaKM
This snipped adds columnstriping to cells. It works fine for most cases, but will behave strange when combined with colspan. Cells get an additional class 'even-col' or 'odd-col'
2 2047 posted 18 years ago by berkes
2 1436 posted 18 years ago by JuliaKM
1 ... 7 8 9 10 11