Webcams for Drupal 6?
albertc - April 11, 2008 - 18:45
| Project: | Webcams |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | moonray |
| Status: | closed |
Description
Hi, is there some preliminary version of this module for Drupal 6? I'm very interested. Thanks

#1
Nope, not yet, as my time is limited.
Any patches are welcome.
#2
subscription: I just would like to know if someone had time and knowledge to patch the 5 series for 6.x...
#3
I attempted to create a patch for D6, but it's not working. I got an error when I initially created my webcam content, but then could no longer reproduce the error. And, the webcam images are not displaying. Hopefully someone with some more skill can take what I've done and get this great mod working for D6!
If anyone wants to test my patches, please don't do it on a production site! I've attached two files, one for webcams.info and one for webcams.modules.
#4
Here's the error I get with my patch.
warning: Missing argument 2 for db_last_insert_id(), called in C:\xampp\htdocs\drupal-6\sites\default\modules\webcams\webcams.module on line 284 and defined in C:\xampp\htdocs\drupal-6\includes\database.mysql-common.inc on line 531.#5
did you run it through the coder.module ?
#6
Yup, that's exactly how I did it. :-)
#7
Over a month since I took a stab at a patch. Moonray, will you have any availability to see if you can make it work based on what I did? Thanks for your consideration.
#8
I just realized webcams.install needed to be updated for D6, so I took a stab at that, but that is generating errors as well. I replaced
function (webcams_install)with the following:/**
* Implementation of hook_install().
*/
function webcams_install() {
// Create tables.
drupal_install_schema('webcams');
}
/**
* Implementation of hook_schema().
*/
function webcams_schema() {
$schema['webcams'] = array(
'fields' => array(
'wid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE),
'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
'name' => array('type' => 'varchar', 'not null' => TRUE, 'default' => ''),
'default_url' => array('type' => 'varchar', 'not null' => TRUE, 'default' => ''),
'url' => array('type' => 'varchar', 'not null' => TRUE, 'default' => ''),
'width' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
'height' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
'thickbox' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
'link' => array('type' => 'varchar', 'not null' => TRUE, 'default' => ''),
'delay' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 30),
'timeout' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny')
),
'indexes' => array(
'nid' => array('nid'),
'vid' => array('vid')
),
'primary key' => array('wid'),
);
return $schema;
}
Which in turn created this scary error:
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL DEFAULT '', `default_url` VARCHAR NOT NULL DEFAULT '', `url` VARCHAR ' at line 5 query: CREATE TABLE webcams ( `wid` INT unsigned NOT NULL auto_increment, `vid` INT unsigned NOT NULL DEFAULT 0, `nid` INT unsigned NOT NULL DEFAULT 0, `name` VARCHAR NOT NULL DEFAULT '', `default_url` VARCHAR NOT NULL DEFAULT '', `url` VARCHAR NOT NULL DEFAULT '0', `width` INT unsigned NOT NULL DEFAULT '0', `height` INT unsigned NOT NULL DEFAULT '0', `thickbox` INT unsigned NOT NULL DEFAULT '0', `link` VARCHAR NOT NULL DEFAULT '', `delay` INT unsigned NOT NULL DEFAULT '30', `timeout` INT unsigned NOT NULL DEFAULT '0', `weight` TINYINT NOT NULL DEFAULT 0, PRIMARY KEY (wid), INDEX nid (nid), INDEX vid (vid) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ in C:\xampp\htdocs\drupal-6\includes\database.inc on line 514.While I was at it, I fixed (or I think I fixed) the error mentioned above in line 284 of webcams.module. I changed it to:
$webcam->wid = db_last_insert_id('{webcams}', '{webcams}_wid');I really feel like I've given this the old college try and would sure appreciate an expert taking over or giving me some guidance.
#9
I've started work on the conversion. There are a few issues with upgrading views integration to Views 2.0, though, which is holding things up.
#10
subscribe
#11
The development snapshot for D6 of webcams module should be available. It's fully functional, with the exception of Views 2 integration, which is proving more troublesome than I expected. Views integration is coming.
Please test it and give your feedback.
#12
#13
Drupal 6 version released.
#14
Thanks, Moonray!
#15
Thanks for the heads-up!
#16
Automatically closed -- issue fixed for two weeks with no activity.