You are here

function photos_data_user in Album Photos 6.2

1 string reference to 'photos_data_user'
photos_menu in ./photos.module

File

inc/photos.data.inc, line 13

Code

function photos_data_user($ac) {
  drupal_set_header('Content-Type: text/plain;');
  drupal_set_header('Cache-Control: no-cache, must-revalidate');
  drupal_set_header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
  $result = db_query_range(db_rewrite_sql('SELECT n.nid, n.title, f.fid, f.filepath, f.filemime, f.timestamp, f.filename, f.filesize FROM {files} f INNER JOIN {x_image} p ON f.fid = p.fid INNER JOIN {node} n ON p.pid = n.nid INNER JOIN {x_album} x ON n.nid = x.pid WHERE n.uid = %d AND x.count > 0 ORDER BY f.fid DESC'), $ac->uid, 0, 500);
  $thumb = variable_get('photos_slide_show_thumb', 0);
  $view = variable_get('photos_slide_show_view', 0);
  $true = false;
  while ($image = db_fetch_array($result)) {
    $t[$image['nid']]['node'] = array(
      'title' => $image['title'],
      'link' => _photos_l('photos/album/' . $image['nid']),
    );
    $images = photos_get_info(0, $image);
    $t[$image['nid']]['image'][] = array(
      'title' => $images['filename'],
      'timestamp' => $images['timestamp'],
      'thumbnail' => _photos_l($images['thumb'][$thumb]),
      'image' => _photos_l($images['thumb'][$view]),
    );
    $true = true;
  }
  if ($_GET['type'] != 'xml' && $true) {
    foreach ($t as $key => $v) {
      $album[] = array(
        'properties' => $t[$key]['node'],
        'images' => $t[$key]['image'],
      );
    }
    if (variable_get('photos_slide_music', false)) {
      $setting['config']['theme']['config_theme_music'] = variable_get('photos_slide_music', false);
    }
    print dfgallery_json($album, $setting);
  }
}