You are hereDrupal 6

Drupal 6


Webform block redirect page

You hate it when webform block redirects to webform page and your visitor loses the page he/she was on when submiting form. Well you can sort this out. Make a form "No redirect (reload current page)" on webform/configure but you also need to go and edit block on block admin screen and add "Show all webform pages in block" that will make it work on the same page and not leave page when you submit.

Override “Submitted by” text for Drupal nodes?

This is the code you put in your template when overriding submitted by text, there is also a module that helps do some of this things http://drupal.org/project/submitted_by
also take a note that when you want to translate you need to use setting.php technique.
http://drupal.org/node/134002

function [your_theme_name]_node_submitted($node) {
return t('Some text about sumbiting !username on @datetime',
array(
'!username' => theme('username', $node),
'@datetime' => format_date($node->created),
));
}

Enable String Translation for Different Input Formats - Block translation

You want to translate a block but it is not showing, there is a bit hidden setting for this to be enabled, catch it here. Adminster -> Site configuration -> Languages -> Configure - "String translation Tab"

http://eureka.ykyuen.info/2011/08/14/drupal-enable-string-translation-fo...

also refresh all the strings in

../admin/build/translate/refresh tab in languge link, otherwise they wouldn't shop up and you will be pulling your hair out :-)

Checking variables - actions for VBO and other modules

If you are creating some actions for VBO module, so you can do some operations on fields over view. You would probably first check what is there to fetch in object you are using. So for example to get a listing of user objects variables you make this submodule

function profilecopy_action_info() {
return array('profilecopy_action' => array(
'type' => 'user',
'description' => t('Get profile data'),
'configurable' => FALSE,
));
}

function profilecopy_action(&$user, $context) {
drupal_set_message('

'.print_r($user, TRUE).'

');
}

User terms mass change

User terms module is best module for user taxonomy terms you can have in drupal 6. Mostly it works as it should and there is no lack of functionality. However, if you want to bulk change user terms, you are out of luck, VBO doesnt work with it so you have to do this manually. I created a query to change, well to add many terms to users, all user who don't have particular term to have it after query.

insert ignore into term_user (uid, tid) select uid, 372 from term_user where not tid=372

Imagecache external add-on

There is a good module imageache external that creates variants of images from external links, it's in sort of API mode as you have to code to use it. Also for purpose of FBSMP module I am using with it and better SEO, I changed how it works and made it possible to have image filename correspond to status which is third parametar in

function imagecache_external_generate_path($url, $preset, $name_img) {

this third parametar is adde by me and the rest, well u can find it in zip below and check differences with http://diffchecker.com/

Drupal Clean-URL's don't work

I just had a stupid problem, had a drupal installation in subfolder and there is much info how to solve this on the official clean-url page, but this problem isn't there. Sometimes when you copy files to windows and then copy it back to linux .htaccess will lose it's dot and then clean-urls and something else might not work but you won't notice it because you don't look for it.

Views Send - mailing logs

Views Send is a great module for mass sending of mails/messages, kind of like newsletter but you can use whole power of views and VBO module, which gives you great flexibility.
There is one thing missing though, evidence of what is sent and to whome, kind of a like some sent items folder in email. So I created this hack to make it work, hope one day this gets better solved and a standard part of module.

this is a node create function that creates data for what is sent and to who

function views_send_evidence($from_name, $from_mail, $to_mail, $subject, $body){

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/')