Hi I have tried the demonstration of ubrowser and loving it!

Tried to implement on my webpage and generate the code as below

'#ubrowser',
'class' => '',
'vid' => 19,
'nids' => 'true',
'search' => 'true',
'view' => 'true',
'window' => 'new',
'close' => 'true',
'multi' => 'true',
'categ' => 'Tag',
'nodesg' => '',
'nodepl' => '',
'filter' => '',
'select' => "",
);

print ubrowser($settings, 'ubrowser');

?>

It looks like its an incomplete code. I have read the documentation and it says that to show ubrowser I will have to paste the code as below

function ubrowser($settings, $id = 'ubrowser') {
  // Adds CSS and JS files.
  // Validates $settings.
  // Returns the HTML output that displays the uBrowser. 
}

How do I combine the 2 sets of codes? If possible can you please show me an example? Thanks

Comments

acdtrp’s picture

the proper code should look like this:

<?php

$settings = array(
  'div' => '#ubrowser',
  'class' => '',
   ... and so on ...

My ubrowser also generated an incomplete code but I managed to figure it out.

rszrama’s picture

Status: Active » Postponed (maintainer needs more info)

I'm not getting this issue with the latest uBrowser code on the Livetest. Is there some specific setup you guys are using to cause the incomplete PHP snippet to appear?

joachim’s picture

Version: 5.x-1.3 » 5.x-1.4
Status: Postponed (maintainer needs more info) » Needs review

Seeing this on 1.4.

The culprit is this line:

    var output = "<?php\n\n$settings = array(\n";

change to:

    var output = "&lt;?php\n\n$settings = array(\n";