Weird Drupal pager behaviour

Uncategorized No Comments »

Can be because of your SQL is formatted with whitespaces, linebreaks

patch

--- pager.inc.orig 2007-07-30 09:49:13.000000000 -0400
+++ pager.inc 2007-07-30 09:47:36.000000000 -0400
@@ -62,7 +62,7 @@

// Construct a count query if none was given.
if (!isset($count_query)) {
- $count_query = preg_replace(array('/SELECT.*?FROM /As', '/ORDER BY .*/'), array('SELECT COUNT(*) FROM ', ''), $query);
+ $count_query = preg_replace(array('/\s*?SELECT.*?FROM /As', '/ORDER BY .*/'), array('SELECT COUNT(*) FROM ', ''), $query);
}

// Convert comma-separated $page to an array, used by other functions.

How to handle data from a Drupal 6.x AHAH callback with a custom javascript function

Drupal, Javascript, jQuery No Comments »

I’ve achieved it with a bit of hack.

in misc/ahah.js +2 rows

Drupal.ahah.prototype.success = function (response, status) {
eval("if(typeof "+this.callbackfunc+" == 'function') { "+this.callbackfunc+"('"+escape(response.data)+"'); }");

Drupal.ahah = function(base, element_settings) {
this.callbackfunc = element_settings.callbackfunc;

in includes/form.inc +1 row:

function form_expand_ahah($element) {
...
$ahah_binding = array(
...
add line: 'callbackfunc' => $element['#ahah']['callbackfunc'],

Thats all.

now you can use a custom javascript callback name like:

$form['cim']['irszam'] = array(
'#type' => 'textfield',
'#title' => t('Irszám'),
'#size' => 4,
'#maxlength' => 4,
'#ahah' => array(
'event' => 'blur',
'path' => 'get_varos_by_irszam',
'callbackfunc' => 'somefunctiontoreceive',
),
);

and in one of your JS files:

function somefunctiontoreceive(data){
alert(data); // you can do with it whatever you want
}

This should be a drupal patch, but I’m a beginner, I will learn it sometime and add it here.

Must have Android apps

android No Comments »

Handcent SMS, WiSyncPlus, IntelligentHomeScreen, EasyMoney, Twitdroid, Androidvnc, iMusic, Nimbuzz, Shazam, Call Meter

SMS backup: http://code.google.com/p/android-sms/
write SMS from/via PC: http://code.google.com/p/desktopsms/downloads/list

Selecting the first matching parent element with jquery

Uncategorized No Comments »

Very very simle

$(this).parents(”.kategoriak:first”)

or

$(”.arr_h”,$(this).closest(”TR”))

How to test your webpage under different IE versions?

Uncategorized No Comments »

Download Microsoft Virtual PC and different OP system / browser images from here:

VPC: http://www.microsoft.com/downloads/details.aspx?FamilyId=28C97D22-6EB8-4A09-A7F7-F6C7A1F000B5&displaylang=en

Images: http://www.microsoft.com/downloads/details.aspx?familyid=21eabb90-958f-4b64-b5f1-73d0a413c8ef&displaylang=en

15 jQuery Plugins to Fix and Beautify Browser Issues

Uncategorized No Comments »

http://devsnippets.com/article/15-jquery-plugins-to-fix-and-beautify-browser-issues.html

- vertical align

Simple object transmitting between Javascript - PHP via AJAX call

Javascript, PHP No Comments »

I suppose, you know how to make an AJAX call, the simplest solution as long as I know is use JSON.

PHP:
$data = array( 'name'=>'John' , 'age'=>'23');
echo json_encode($data);


Javascript:

data = eval("(" + data + ")");
alert(data.name); // John

Hello coderZ!

Uncategorized 1 Comment »

This blog is created because as a programmer i sometime run into problems which are very easy to solve, but can take hors to find out the best solution.

Thus I blog all my solutions for different problems, if at least one helps someone, it was already worth it.

Enjoy!


WordPress Theme & Icons by N.Design Studio. Packaged by Edublogs - education blogs.
Entries RSS Comments RSS Login