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

moonray - April 16, 2008 - 14:26

Nope, not yet, as my time is limited.
Any patches are welcome.

#2

didier973 - July 3, 2008 - 01:43

subscription: I just would like to know if someone had time and knowledge to patch the 5 series for 6.x...

#3

kriskd - July 5, 2008 - 14:46

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.

AttachmentSize
webcams6.module.patch 6.6 KB
webcams6.info_.patch 426 bytes

#4

kriskd - July 6, 2008 - 02:34

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

VM - July 6, 2008 - 02:45

did you run it through the coder.module ?

#6

kriskd - July 6, 2008 - 11:28

did you run it through the coder.module ?

Yup, that's exactly how I did it. :-)

#7

kriskd - August 6, 2008 - 10:48

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

kriskd - August 17, 2008 - 16:26

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

moonray - August 17, 2008 - 17:55
Assigned to:Anonymous» moonray

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

Tony Sharpe - September 26, 2008 - 14:55

subscribe

#11

moonray - October 9, 2008 - 19:16
Status:active» needs work

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

moonray - October 9, 2008 - 19:19
Version:5.x-1.x-dev» 6.x-1.x-dev
Category:support request» task

#13

moonray - November 18, 2008 - 22:40
Status:needs work» fixed

Drupal 6 version released.

#14

kriskd - November 19, 2008 - 02:17

Thanks, Moonray!

#15

albertc - November 19, 2008 - 08:18

Thanks for the heads-up!

#16

System Message - December 3, 2008 - 08:25
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.