Hi. First of all, thanks for your efforts in developing this module - its simplicity (compared to flashvideo) was a breath of fresh air.

I have a several multi-page webforms. On one of the pages, the user is asked to score a video. The video (using a webform "markup" field) and scoring form (using a "grid" field) are side-by-side.

==========================
=BANNER===================
==========================
---nav--------------------

*HEADER*******************
_________ ________________
|       | |          1  2|
| VIDEO | |1. xyz?   •   |
|       | |2. bcd?      •|
|>------| |3. efg?   •   |
|_______| |______________|

<prev    draft    submit

==========================
=FOOTER===================

With flashvideo, the [video] tag successfully dropped a video into the markup field.

With jwplayer, all I get is the tags ([jwplayer|config....]). I've confirmed that the tags I'm using work correctly in the same node's body.

I don't think I can put PHP code into the markup field (I've tried), and I'd prefer not to hardwire it via template files, as the people I pass the site on to will not have good enough knowledge of PHP to maintain it.

Is there a way around this?

Thanks,
JB

Comments

jdcb’s picture

Several hours of work later...

I compared the tag find/replace functions of jwplayermodule and flashvideo, and have cobbled together an inelegant solution, but one that is currently working adequately.

In both jwplayermodule and flashvideo, the function examines the $node object to get its contents, then uses reg exp matching to replace the tag with the player html.

In jwplayermodule, the function only looks in
$text = $node->content["body"]["#value"];
but, in a webform, the code is actually held in
$text = $node->content["webform"]["#value"];

Flashvideo, on the other hand, looks in either the body or the teaser:
$body = (isset($node->teaser) && $node->body == '') ? $node->teaser : $node->body;
However, when I tried this code in jwplayermodule.module, $body was empty, so I don't know what flashvideo is doing to $node...

Anyway, I've told jwplayermodule to determine which of webform and body is empty, and use the other one:

  if ( rtrim($node->content["body"]["#value"]) == '' && rtrim($node->content["webform"]["#value"]) != '' ) {
    $text = $node->content["webform"]["#value"];
    $where = "webform";
  } else {
    $text = $node->content["body"]["#value"];
    $where = "body";
  }

And at the end of the routine updated the correct part of $node

$node->content[$where]["#value"] = $text;

I realise it's not pretty, and apologise for my muddled description of what's going on, but it works.

A proper solution by the developers would, of course, by lovely.

JB

JW Player’s picture

@jdcb,

Thanks for posting your solution to the webform issue. I'll take a look into this issue and see how it can be incorporated into the module.

Thanks.

JW Player’s picture

Status: Active » Needs review
avpaderno’s picture

Issue summary: View changes
Priority: Major » Normal
Status: Needs review » Closed (outdated)

I am closing this issue, as Drupal 6 is now not supported.