Hey
Looks great on the demo page. Where do the PHP code go? What file?

Thanks

CommentFileSizeAuthor
#9 dfgallery_example.zip999 bytesfengtan

Comments

eastcn’s picture

Try:

Copied to the page.tpl.php file


  echo dfgallery_html(array('url' => 'http://album.cmsns.com/photos/data/album/1?type=json.json'));

andy_read’s picture

I understand where the dfgallery_html() code can be put, but I can't work out where the dfgallery_json() code should be put.

seath_49’s picture

Hello guys,
I have the same problem. Where to put the code to generate json data?
Thnx

cakka’s picture

same question, please give me know where i must put every code..
thanks

---
Drupal Development Services

dabellator’s picture

I have yet to dive much into this module, but I can already see the issue mentioned in this thread. I'm going to work on it to see if I can figure it out, but figured I would also add my request for help! I'm also a little unsure how to interact with this module, is it through cck or is there an upload folder like flash gallery? If I discover anything I'll report back!
-JB

satujamsaja’s picture

Yes what i have found is what kind of field required for generate image data.It is possible to create custom data from cck for this ? But the main problem is this module did't clearly explain how to pass generated json data to dfgallery.swf.

Thanks

-ds-

eastcn’s picture

dfgallery_json($albums); // $albums = array();

try:

  while ($images = db_fetch_array($result)){
    $array[] = array(
      'title' => $image['filename'],
      'timestamp' => $image['timestamp'],
      'thumbnail' => _photos_l($image['thumb'][$thumb]),
      'image' => _photos_l($image['thumb'][$view])
    );
  }
  $albums = array(
    array(
      'properties' => array(
        'title' => 'my album1',
        'description' => 'description',
        //'icon' => 'http://www.cmsns.com/misc/CMSNS.png',
      ),
      'images' => $array,
    ),
//    array(
//      'properties' => array(
//        'title' => 'my album2',
//        'description' => 'description',
//        //'icon' => 'http://www.cmsns.com/misc/CMSNS.png',
//      ),
//      'images' => $array,
//    ),
  );
  return dfgallery_json($albums);//url: myimage.json
tianqiang0316’s picture

I also want to know where to put the code.

who can help me !

fengtan’s picture

StatusFileSize
new999 bytes

Here is a solution to generate the JSON data for Dfgallery.

Enable this example module and check that you can actually access the data by browsing /albums.json. It uses hard coded pictures.

Then write the following code where you want the gallery to be displayed (you may have to customize the path according to your drupal installation :

<?php
echo dfgallery_html(array('url' =>  'http://localhost/drupal/albums.json'));
?>

If you wish to display your own images in the gallery just edit dfgallery_example.module and customize the array returned by dfgallery_example_json() with your own picture URLs.