root/trunk/inc/metalbum/album.inc.php

Revision 27, 2.4 KB (checked in by alexx, 7 years ago)
  • Add support for .node album in Meta album (not usefull for dotnode.com user, but good for other "Open .node" installation that want to import dotnode.com album)
  • Add REST api to access .node Album (must be extented later with other module of .node)
  • Add forgotten icons for meta album
  • Add dPics scripts to automagicaly resize requested image with size put in his url (<dpics script>/500x400/<file_path>.jpg => give you <file_path>.jpg in 500x400)
Line 
1<?php
2/****************************************************** Open .node ***
3 * Description:   
4 * Status:        Stable.
5 * Author:        Alexandre Dath <alexandre@dotnode.com>
6 * $Id$
7 *
8 * Copyright (C) 2005 Alexandre Dath <alexandre@dotnode.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 ******************** http://opensource.ikse.net/projects/dotnode ***/
24
25include(INCLUDESPATH.'/metalbum.class.php');
26include(INCLUDESPATH.'/pager.inc.php');
27
28
29$_SMARTY['user']['info'] = get_cache_user_info($url_id);
30$_SMARTY['user']['photo'] = build_image_url($url_id);
31
32
33if(is_valid('metalbum_name', $token[2]))
34    $album_name = $token[2];
35else
36{
37    header('Location: /metalbum/'.$url_id);
38    exit();
39}
40
41$_SMARTY['Title'] = 'Meta Album: '.$album_name;
42
43list($login, $type) = split('@', $album_name);
44
45$album =& Metalbum::factory($type, $login, $config['metalbum'][$type]);
46if(is_a($album,'Metalbum'))
47{
48    $_SMARTY['photos'] = $album->getPhotos($_GET['p'], 18);
49    $_SMARTY['metalbum']['name'] = $album_name;
50    $_SMARTY['metalbum']['login'] = $login;
51    $_SMARTY['metalbum']['type'] = $type;
52    $_SMARTY['metalbum']['url'] = $album->getUrlAlbum();
53
54    $pager =& Pager_dotnode::factory (null, array('perPage' => 18, 'totalItems' => $album->getNbItems()) );
55    $_SMARTY['pager'] = $pager->getLinks();
56}
57else
58{
59    $_SESSION['error']['title'] = _('Error in connection with remote album');
60    $_SESSION['error']['msg'] = $type.': '.$album;
61}
62$metalbumSet =& new MetalbumSet($db, $url_id);
63
64$_SMARTY['leftmenu']["/profile/$url_id"] = 'Profile';
65$_SMARTY['leftmenu']['/metalbum/'.$url_id] = 'Meta Album';
66foreach($metalbumSet->albums as $albumset)
67    $_SMARTY['leftmenu']['/metalbum/'.$url_id.'/album/'.$albumset['login'].'@'.$albumset['type']] = $albumset['login'].'@'.$albumset['type'];
68
69
70?>
Note: See TracBrowser for help on using the browser.