Modal Frame - close modalframe by clicking outside frame

Nice JS code to add to your theme when using modal frames is this one. Closes window when you click outside the frame.


    /* close the modal box when the user clicks outside its bounds */
    $('.ui-widget-overlay').live('click', function(e){
      Drupal.modalFrame.close();
    });

Filepath change when moving sites

I just run into problem of having a site under subdomain and moving it to live domain. Image paths in file table were all wrong, but there is simple fix for this.


UPDATE files SET filepath = REPLACE(filepath, 'old/path', 'new/path');

run this in phpmyadmin and chage paths completly, something like is what I used

Moving site, Server settings and 500 error

Recently I was envolved with moving a site from one server (VPS) to other. I had to make a VPS installation also and setup of the server. I used Debian 6 which usually comes with php 5.3. Sometimes some modules have problems with 5.3 version of PHP.

Authoring information and permissions

User 1 has all the privilegies. But for other you need to set them. If you want that user has ability to change who authored node you will need to give him "administer nodes" permission. Usually overlooked, this permission is unde node module permission set.

Views Arguments validation "Gotcha"

People usually set argument and often don't mind about validation. Just leave basic validation thinking most will pass. But that is not the case. For example you can use User ID ad argument and think both UID and User Name would pass, but that is not the case. You have to go and select "User" Validator and use "Allow both numeric UIDs and string usernames" for this to work.

CSS in IE8 list tag(LI) in one row

I just encontured stupid problem with IE and listing LI tags in one a row, If you want to list them properly and not skip into second you need to add some
white-space: no-wrap; to work to LI or in fact A tag inside LI. Those having that problem will know what I am talking about.

Theming filters in Views 2.x differently

Most will use views 3.x in future and they should as they are really better, from UI point of view to other parts but for some old sites that are not updated and you want to theme exposed filters differently, you can't from default. You need to change some template as all your filters have the same classes.

Views Fluid Grid - jQuery Masonry Fix for images

There is a great module currently to simulate pinterest tiles on drupal views. Unfortionatly it's not properly maintaind and most import thing, image tileing is currently not working.

Converting Date timestamp to proper Date

If you have some variable in your node object or somewhere else like [created] = 1328281634 then you need to convert this to date format you like, so you can do it
with line like this, where you choose custom date format

format_date($timestamp, 'custom', 'D, j M, Y \a\\t G:i' );

or use some predefined date format on your site like