berkes


Member since 11/27/2006

Name: Bèr Kessels

berkes

Location: Nijmegen, Netherlands

Website: http://webschuur.com

The way of the Hacker - Long term #Drupal developer - owner of webschuur.com - OpenSource lover - Long term #linux user - Rails user

27 snippets

14 profile views

View their favorites

Profile

All time reputation: 59

Achievement

first submission:submitting first snipplet

berkes's Recent SnippetsTagged drupal



« Prev 1 Next »
  1. FAV

    Routine to update and set variables in Drupal using hook_update

    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...
    PHP saved by 4 people 3 views posted 9 years ago berkes
  2. FAV

    Howto run your own functions on any forms submission.

    By using hook_form_alter, you can add your own callback functions to any Drupal form. These functions will be called when Drupal validates the form and when Drupal submits it. In example below, a module called 'simple_checkout' adds its own hand...
    PHP saved by 3 people 2 views posted 10 years ago berkes
  3. FAV

    Remove Drupal's search block "search this site" label.

    Wizzlern, a Dutch Drupal trainer, has a Dutch article online on how to remove the "search this site" label in the Drupal search-block.
    PHP saved by 6 people 3 views posted 10 years ago berkes
  4. FAV

    Drupal on PCextreme

    http://pcextreme.nl is one of the Best hosters for Drupal in Netherlands. But they require one change to the .htaccess in order to run.
    Apache 3 views posted 10 years ago berkes
  5. FAV

    Target=_blank in Drupal link

    PHP saved by 2 people 0 views posted 10 years ago berkes
  6. FAV

    move Drupal tags from one vocabulary into another

    I had several vocabularies but wanted to merge them into one. A simple query does this for you. The vocabulary_id where I wanted to merge all the tags into is 3 The vocabulary_id where the tags are to be merged from is 7, 8 and 12
    SQL saved by 4 people 2 views posted 10 years ago berkes
  7. FAV

    Track block/views/cck etc changes in RCS and migrate with Drupal updates.

    Takes a .sql file and runs trough that, each line as an update_sql. Very usefull to track and migrate your blocks/views/cck etc changes.
    PHP 2 views posted 10 years ago berkes
  8. FAV

    Store Drupal blockconfiguration in SVN.

    A common Drupal problem: how to save e.g. your blocks configuration without dragging an X Gig database around. A simple command that dumps a table in a way that it can be inserted into SVN. Every row is dumped as a single line, and they are sor...
    Bash saved by 2 people 1 views posted 10 years ago berkes
  9. FAV

    Return list of modules for each Drupal multisite

    A bash script that calls Drush for all your multisite sites and returns a list of available and installed modules for each site.
    Bash saved by 4 people 0 views posted 11 years ago berkes
  10. FAV

    Drupal function to return contents of a databasetable (for Debugging)

    Drupal helper function to debug a table. Returns the contents and some explanation of a database table in a rendered format (HTML table). **NOTE** You REALLY do not want to put this function behind any kind of menu_callback and/or on other pages....
    PHP saved by 3 people 4 views posted 11 years ago berkes
  11. FAV

    Allow per-region template overrides.

    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.
    PHP saved by 3 people 1 views posted 12 years ago berkes
  12. FAV

    Easy debug variable to find what vars are available in a tpl.php file

    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.
    PHP saved by 5 people 4 views posted 12 years ago berkes
  13. FAV

    Override specific links in theme_links based on their class.

    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...
    PHP saved by 6 people 1 views posted 12 years ago berkes
  14. FAV

    Assure hooks in a Drupal module are ran before the others.

    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...
    PHP saved by 2 people 1 views posted 12 years ago berkes
  15. FAV

    Print errors to screen on default php5 in Drupal

    Add these lines to Drupals settings.php. Probably works on other systems, then Drupal too.
    PHP saved by 3 people 0 views posted 12 years ago berkes
  16. FAV

    Drupal - Unset (not include) all core stylesheets - Theme variable overrides.

    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.
    PHP saved by 9 people 0 views posted 12 years ago berkes
  17. FAV

    Drupal - Shorten a string - general API

    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.
    PHP saved by 3 people 2 views posted 12 years ago berkes
  18. FAV

    Drupal - Theme table with columstriping

    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'
    PHP saved by 6 people 2 views posted 12 years ago berkes
  19. FAV

    Put classes around your body

    Put classes around your bodyy, to allow different colors for seperate pages and areas on your site. IT will simply add a css-safe version of the first argument in an url. Say the url is /about_us/our_company the class will be body.about-us Require...
    PHP saved by 12 people 2 views posted 12 years ago berkes
  20. FAV

    Drupal formalter for a separate teaser field

    A form alter to gove Drupal a separate teaser field.
    PHP saved by 3 people 0 views posted 12 years ago berkes
  21. FAV

    Form alter to force exposed views filters to fllow filter options

    callback in a form alter to enforce an exposed filter to use only the options set in filter. Works for selectlists only.
    PHP saved by 4 people 1 views posted 12 years ago berkes
  22. FAV

    Per node type flag.

    A form alter implementation to create variables to flag certain features per node type. E.g. Show foo on blogs only: example_blog == 1;
    PHP saved by 1 person 1 views posted 12 years ago berkes
  23. FAV

    link images to their own node.

    This snippet is for use with image module, a small contributed module for image handling. (Yes: in Drupal you need a /contributed/ module for this o_O. The template snippet links the images to their own node.
    PHP saved by 10 people 3 views posted 12 years ago berkes
  24. FAV

    Count amout of nodeviews in a year

    Counts the total amout of nodeviews between now and a year ago (the last 31536000 seconds).
    SQL saved by 1 person 1 views posted 13 years ago berkes
  25. FAV

    image_attach theme image in the node

    This snippet is for use with image_attach, a small contributed module that uses image module to create nice thumbs in any node type. The template snippet makes the images show up larger in the body node, and instead of linking to itself, it links t...
    PHP saved by 4 people 0 views posted 13 years ago berkes
  26. FAV

    list of users that never logged in

    Grab all users that never logged in.
    SQL saved by 1 person 0 views posted 13 years ago berkes
  27. FAV

    Get admin menuID

    menu_get_item does not return a menu ID.
    PHP saved by 2 people 1 views posted 13 years ago berkes
« Prev 1 Next »