Index: flashnode.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/flashnode/flashnode.info,v retrieving revision 1.3 diff -u -F '^f' -r1.3 flashnode.info --- flashnode.info 5 Dec 2007 22:35:36 -0000 1.3 +++ flashnode.info 30 Nov 2009 11:38:43 -0000 @@ -2,3 +2,10 @@ name = Flash node description = Allows easy uploading and display of Flash content. core = 6.x + +; Information added by drupal.org packaging script on 2009-03-06 +version = "6.x-3.1" +core = "6.x" +project = "flashnode" +datestamp = "1236334232" + Index: flashnode.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/flashnode/flashnode.install,v retrieving revision 1.12 diff -u -F '^f' -r1.12 flashnode.install --- flashnode.install 17 Aug 2008 22:30:15 -0000 1.12 +++ flashnode.install 30 Nov 2009 11:38:43 -0000 @@ -43,15 +43,15 @@ function flashnode_schema() { 'not null' => TRUE, ), 'height' => array( - 'description' => t('Display height, in pixels, of the Flash file.'), - 'type' => 'int', - 'unsigned' => TRUE, + 'description' => t('Display height, in pixels or percentage, of the Flash file.'), + 'type' => 'varchar', + 'length' => '20', 'not null' => TRUE, ), 'width' => array( - 'description' => t('Display width, in pixels, of the Flash file.'), - 'type' => 'int', - 'unsigned' => TRUE, + 'description' => t('Display width, in pixels or percentage, of the Flash file.'), + 'type' => 'varchar', + 'length' => '20', 'not null' => TRUE, ), 'display' => array( @@ -211,3 +211,25 @@ function flashnode_update_6001() { return $ret; } + +/** + * Changes column width and height to varchar in order to handle percentage widths correctly. + */ +function flashnode_update_6002() { + // Initialise array for results + $ret = array(); + + db_change_field($ret, 'flashnode', 'width', 'width', array( + 'type' => 'varchar', + 'length' => '255', + 'not null' => TRUE, + )); + + db_change_field($ret, 'flashnode', 'height', 'height', array( + 'type' => 'varchar', + 'length' => '255', + 'not null' => TRUE, + )); + + return $ret; +} Index: flashnode.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/flashnode/flashnode.module,v retrieving revision 1.48.2.4 diff -u -F '^f' -r1.48.2.4 flashnode.module --- flashnode.module 6 Mar 2009 10:04:13 -0000 1.48.2.4 +++ flashnode.module 30 Nov 2009 11:38:44 -0000 @@ -170,12 +170,12 @@ function flashnode_validate(&$node) { } // Check width is valid (if not empty it must be numeric) - if (!empty($node->flashnode['width']) && !is_numeric($node->flashnode['width'])) { + if (!empty($node->flashnode['width']) && !is_numeric(str_replace('%', '', $node->flashnode['width']))) { form_set_error('flashnode][width', t('You must enter a valid width.')); } // Check height is valid (if not empty it must be numeric) - if (!empty($node->flashnode['height']) && !is_numeric($node->flashnode['height'])) { + if (!empty($node->flashnode['height']) && !is_numeric(str_replace('%', '', $node->flashnode['height']))) { form_set_error('flashnode][height', t('You must enter a valid height.')); } @@ -420,7 +420,7 @@ function flashnode_insert($node) { } // Insert data into {flashnode} - db_query("INSERT INTO {flashnode} (nid, height, width, display, substitution, flashvars, base, fid, vid, params) VALUES (%d, %d, %d, %d, '%s', '%s', '%s', %d, %d, '%s')", $node->nid, $node->flashnode['height'], $node->flashnode['width'], $node->flashnode['display'], $node->flashnode['substitution'], $node->flashnode['flashvars'], $node->flashnode['base'], $node->flashnode['fid'], $node->vid, $node->flashnode['params']); + db_query("INSERT INTO {flashnode} (nid, height, width, display, substitution, flashvars, base, fid, vid, params) VALUES (%d, '%s', '%s', '%s', '%s', '%s', %d, %d, '%s')", $node->nid, $node->flashnode['height'], $node->flashnode['width'], $node->flashnode['display'], $node->flashnode['substitution'], $node->flashnode['flashvars'], $node->flashnode['base'], $node->flashnode['fid'], $node->vid, $node->flashnode['params']); } @@ -480,7 +480,7 @@ function flashnode_update($node) { } // Update {flashnode} and {files} with new data - db_query("UPDATE {flashnode} SET nid = %d, height = %d, width = %d, display = %d, substitution = '%s', flashvars = '%s', base = '%s', fid = %d, params = '%s' WHERE vid = %d", $node->nid, $node->flashnode['height'], $node->flashnode['width'], $node->flashnode['display'], $node->flashnode['substitution'], $node->flashnode['flashvars'], $node->flashnode['base'], $node->flashnode['fid'], $node->flashnode['params'], $node->vid); + db_query("UPDATE {flashnode} SET nid = %d, height = '%s', width = '%s', display = %d, substitution = '%s', flashvars = '%s', base = '%s', fid = %d, params = '%s' WHERE vid = %d", $node->nid, $node->flashnode['height'], $node->flashnode['width'], $node->flashnode['display'], $node->flashnode['substitution'], $node->flashnode['flashvars'], $node->flashnode['base'], $node->flashnode['fid'], $node->flashnode['params'], $node->vid); db_query("UPDATE {files} SET status = %d, filepath = '%s' WHERE fid = %d", FILE_STATUS_PERMANENT, $node->flashnode['filepath'], $node->flashnode['fid']); } @@ -684,7 +684,7 @@ function flashnode_content($args = array // Set height or width to specific value case 'height': case 'width': - if (is_numeric($value)) { + if (str_replace('%', '', is_numeric($value))) { $node->flashnode[$parameter] = $value; } break;