MySql alter table Collation - Views is not sorting national characters sollution

I recently had a problem with sorting of chars. I have some Eastern Europe chars. like čćžšđ and they didnt sort like I would like to in views. "Đ" would come at the end of the list after "Z" and it should be after "D" so I found the solution and the problem.

Problem is collation of tables in mysql database and solution is changing it. They were all set to "utf8_general_ci" so I just change node table "node" because I was sorting by title and I did this.

alter table node convert to character set utf8 collate utf8_unicode_ci

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

UPDATE files SET filepath = REPLACE(filepath, 'sites/mov.arabba.hr/files/', 'sites/miomirisni-vrt.hr/files/')

Display Block for specific Content Type

This is how to do this, choose PHP for block visibility mode and add the code below,
choose in types, array your content type

<?php
$match = FALSE;
$types = array('my_content_type' => 1);
if (arg(0) == 'node' && is_numeric(arg(1))) {
$nid = arg(1);
$node = node_load(array('nid' => $nid));
$type = $node->type;
if (isset($types[$type])) {
$match = TRUE;
}
}

return $match;
?>

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. So when i transfered drupal site(drupal 6) I kept getting 500 error on server and tought this was somehow due to 5.3 php and some module i had, as on original location I had 5.2 so i was trying to force 5.2 to this server and lost bunch of time on this.

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. Otherwise you could have a view that is showing nothing and left you wondering what is happening.

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.

Override the exposed form template in your theme -- take a look at /modules/views/theme/views-exposed-form.tpl.php

Change line 25 from <div class="views-exposed-widget">
to

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. So what you need to do is make some fixes, upload latest masonry files and add also jquery.imagesloaded.min.js to /js folder, then change code to already pretty messy integration to views to support imagesloaded js file. Should be changed as its here stated http://masonry.desandro.com/demos/images.html so to do that i changed module file, add to module this