From 2ef2d0b79f4024174292faa45840cee065b464a3 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Thu, 22 Dec 2011 16:33:14 +0100 Subject: quattro: contacts and first photo page --- mod/photos.php | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) (limited to 'mod/photos.php') diff --git a/mod/photos.php b/mod/photos.php index bf3299de0..12225b5c5 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1367,30 +1367,36 @@ function photos_content(&$a) { intval($a->pager['itemspage']) ); - $o .= '

' . t('Recent Photos') . '

'; - if($can_post) { - $o .= ''; - } - $tpl = get_markup_template('photo_top.tpl'); + $photos = array(); if(count($r)) { foreach($r as $rr) { - $o .= replace_macros($tpl,array( - '$id' => $rr['id'], - '$photolink' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id'], - '$phototitle' => t('View Photo'), - '$imgsrc' => $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.jpg', - '$albumlink' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']), - '$albumname' => template_escape($rr['album']), - '$albumalt' => t('View Album'), - '$imgalt' => template_escape($rr['filename']) - )); - + $photos[] = array( + 'id' => $rr['id'], + 'link' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id'], + 'title' => t('View Photo'), + 'src' => $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.jpg', + 'alt' => template_escape($rr['filename']), + 'album' => array( + 'link' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']), + 'name' => template_escape($rr['album']), + 'alt' => t('View Album'), + ), + + ); } - $o .= '
'; } + + $tpl = get_markup_template('photos_recent.tpl'); + $o .= replace_macros($tpl,array( + '$title' => t('Recent Photos'), + '$can_post' => $can_post, + '$upload' => array(t('Upload New Photos'), $a->get_baseurl().'/photos/'.$a->data['user']['nickname'].'/upload'), + '$photos' => $photos, + )); + + $o .= paginate($a); return $o; } -- cgit v1.2.3