3 require_once('Photo.php');
4 require_once('view/acl_selectors.php');
6 function photos_init(&$a) {
10 $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1",
17 $a->data['user'] = $r[0];
19 $albums = q("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = %d",
20 intval($a->data['user']['uid'])
24 $a->data['albums'] = $albums;
26 $o .= '<h4><a href="' . $a->get_baseurl() . '/profile/' . $a->data['user']['nickname'] . '">' . $a->data['user']['username'] . '</a></h4>';
27 $o .= '<h4>' . '<a href="' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '">' . t('Photo Albums') . '</a></h4>';
30 foreach($albums as $album) {
31 if((! strlen($album['album'])) || ($album['album'] == t('Contact Photos')))
33 $o .= '<li>' . '<a href="photos/' . $a->argv[1] . '/album/' . bin2hex($album['album']) . '" />' . $album['album'] . '</a></li>';
37 $a->page['aside'] .= $o;
45 function photos_post(&$a) {
49 notice( t('Permission denied.') . EOL );
55 $r = q("SELECT `contact`.* `user`.`nickname` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid`
56 WHERE `user`.`uid` = %d AND `self` = 1 LIMIT 1",
57 intval($_SESSION['uid'])
60 $contact_record = $r[0];
63 if(($a->argc > 2) && ($a->argv[1] == 'album')) {
64 $album = hex2bin($a->argv[2]);
66 if($album == t('Profile Photos') || $album == t('Contact Photos')) {
67 goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
71 $r = q("SELECT count(*) FROM `photo` WHERE `album` = '%s' AND `uid` = %d",
73 intval($_SESSION['uid'])
76 notice( t('Album not found.') . EOL);
77 goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
81 $newalbum = notags(trim($_POST['albumname']));
82 if($newalbum != $album) {
83 q("UPDATE `photo` SET `album` = '%s' WHERE `album` = '%s' AND `uid` = %d",
86 intval($_SESSION['uid'])
88 $newurl = str_replace(bin2hex($album),bin2hex($newalbum),$_SESSION['photo_return']);
89 goaway($a->get_baseurl() . '/' . $newurl);
93 if($_POST['dropalbum'] == t('Delete Album')) {
96 $r = q("SELECT distinct(`resource-id`) as `rid` FROM `photo` WHERE `uid` = %d AND `album` = '%s'",
102 $res[] = "'" . dbesc($rr['rid']) . "'" ;
106 goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
107 return; // NOTREACHED
109 $str_res = implode(',', $res);
111 q("DELETE FROM `photo` WHERE `resource-id` IN ( $str_res ) AND `uid` = %d",
114 $r = q("SELECT `parent-uri` FROM `item` WHERE `resource-id` IN ( $str_res ) AND `uid` = %d",
119 q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
120 dbesc(datetime_convert()),
121 dbesc($rr['parent-uri']),
125 $drop_id = intval($rr['id']);
126 $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
128 // send the notification upstream/downstream as the case may be
131 proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"drop\" \"$drop_id\" & ",
137 goaway($a->get_baseurl() . '/photos/' . $a->data['user']['nickname']);
138 return; // NOTREACHED
141 if(($a->argc > 1) && (x($_POST,'delete')) && ($_POST['delete'] == t('Delete Photo'))) {
142 $r = q("SELECT `id` FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s' LIMIT 1",
147 q("DELETE FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'",
149 dbesc($r[0]['resource-id'])
151 $i = q("SELECT * FROM `item` WHERE `resource-id` = '%s' AND `uid` = %d LIMIT 1",
152 dbesc($r[0]['resource-id']),
156 q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
157 dbesc(datetime_convert()),
158 dbesc(datetime_convert()),
163 $url = $a->get_baseurl();
164 $drop_id = intval($i[0]['id']);
165 $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
167 // send the notification upstream/downstream as the case may be
170 proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"drop\" \"$drop_id\" & ",
175 goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
176 return; // NOTREACHED
181 if(($a->argc > 1) && (x($_POST,'desc') !== false)) {
182 $desc = notags(trim($_POST['desc']));
183 $tags = notags(trim($_POST['tags']));
184 $item_id = intval($_POST['item_id']);
185 $resource_id = $a->argv[1];
187 $p = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d ORDER BY `scale` DESC",
192 $r = q("UPDATE `photo` SET `desc` = '%s' WHERE `resource-id` = '%s' AND `uid` = %d",
201 $basename = basename($filename);
203 // Create item container
205 $body = '[url=' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $p[0]['resource-id'] . ']'
206 . '[img]' . $a->get_baseurl() . '/photo/' . $p[0]['resource-id'] . '-' . $p[0]['scale'] . '.jpg' . '[/img]'
209 $uri = item_new_uri($a->get_hostname(),get_uid());
211 $r = q("INSERT INTO `item` (`uid`, `type`, `wall`, `resource-id`, `contact-id`,
212 `owner-name`,`owner-link`,`owner-avatar`, `created`,
213 `edited`, `changed`, `uri`, `parent-uri`, `title`, `body`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`)
214 VALUES( %d, '%s', %d, '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )",
218 dbesc($p[0]['resource-id']),
219 intval($contact_record['id']),
220 dbesc($contact_record['name']),
221 dbesc($contact_record['url']),
222 dbesc($contact_record['thumb']),
223 dbesc(datetime_convert()),
224 dbesc(datetime_convert()),
225 dbesc(datetime_convert()),
230 dbesc($p[0]['allow_cid']),
231 dbesc($p[0]['allow_gid']),
232 dbesc($p[0]['deny_cid']),
233 dbesc($p[0]['deny_gid'])
238 $r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' LIMIT 1",
242 $item_id = $r[0]['id'];
243 q("UPDATE `item` SET `parent` = %d, `last-child` = 1 WHERE `id` = %d LIMIT 1",
250 $r = q("UPDATE `item` SET `tag` = '%s', `edited` = '%s', `changed` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1",
252 dbesc(datetime_convert()),
253 dbesc(datetime_convert()),
258 goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
259 return; // NOTREACHED
265 if(! x($_FILES,'userfile'))
268 if($_POST['partitionCount'])
271 $java_upload = false;
273 $album = notags(trim($_POST['album']));
274 $newalbum = notags(trim($_POST['newalbum']));
276 if(! strlen($album)) {
277 if(strlen($newalbum))
280 $album = datetime_convert('UTC',date_default_timezone_get(),'now', 'Y');
283 $r = q("SELECT * FROM `photo` WHERE `album` = '%s' AND `uid` = %d",
287 if((! count($r)) || ($album == t('Profile Photos')))
293 $str_group_allow = perms2str($_POST['group_allow']);
294 $str_contact_allow = perms2str($_POST['contact_allow']);
295 $str_group_deny = perms2str($_POST['group_deny']);
296 $str_contact_deny = perms2str($_POST['contact_deny']);
298 $src = $_FILES['userfile']['tmp_name'];
299 $filename = basename($_FILES['userfile']['name']);
300 $filesize = intval($_FILES['userfile']['size']);
302 $imagedata = @file_get_contents($src);
303 $ph = new Photo($imagedata);
305 if(! ($image = $ph->getImage())) {
306 notice( t('Unable to process image.') . EOL );
313 $width = $ph->getWidth();
314 $height = $ph->getHeight();
318 $photo_hash = hash('md5',uniqid(mt_rand(),true));
320 $r = $ph->store(get_uid(), 0, $photo_hash, $filename, $album, 0 , 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
323 notice( t('Image upload failed.') . EOL );
327 if($width > 640 || $height > 640) {
328 $ph->scaleImage(640);
329 $ph->store(get_uid(), 0, $photo_hash, $filename, $album, 1, 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
333 if($width > 320 || $height > 320) {
334 $ph->scaleImage(320);
335 $ph->store(get_uid(), 0, $photo_hash, $filename, $album, 2, 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
339 $basename = basename($filename);
341 // Create item container
343 $body = '[url=' . $a->get_baseurl() . '/photos/' . $contact_record['nickname'] . '/image/' . $photo_hash . ']'
344 . '[img]' . $a->get_baseurl() . "/photo/{$photo_hash}-{$smallest}.jpg" . '[/img]'
347 $uri = item_new_uri($a->get_hostname(), get_uid());
349 $r = q("INSERT INTO `item` (`uid`, `type`, `wall`, `resource-id`, `contact-id`,`owner-name`,`owner-link`,`owner-avatar`, `created`,
350 `edited`, `changed`, `uri`, `parent-uri`, `title`, `body`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `visible`)
351 VALUES( %d, '%s', %d, '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d )",
356 intval($contact_record['id']),
357 dbesc($contact_record['name']),
358 dbesc($contact_record['url']),
359 dbesc($contact_record['thumb']),
360 dbesc(datetime_convert()),
361 dbesc(datetime_convert()),
362 dbesc(datetime_convert()),
367 dbesc($str_contact_allow),
368 dbesc($str_group_allow),
369 dbesc($str_contact_deny),
370 dbesc($str_group_deny),
375 $r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' LIMIT 1",
379 q("UPDATE `item` SET `parent` = %d, `last-child` = 1 WHERE `id` = %d LIMIT 1",
387 goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
388 return; // NOTREACHED
392 return; // NOTREACHED
398 function photos_content(&$a) {
402 // photos/name/upload
403 // photos/name/album/xxxxx
404 // photos/name/album/xxxxx/edit
405 // photos/name/image/xxxxx
406 // photos/name/image/xxxxx/edit
409 if(! x($a->data,'user')) {
410 notice( t('No photos selected') . EOL );
414 $_SESSION['photo_return'] = $a->cmd;
421 $datatype = $a->argv[2];
422 $datum = $a->argv[3];
424 elseif(($a->argc > 2) && ($a->argv[2] == 'upload'))
425 $datatype = 'upload';
427 $datatype = 'summary';
435 // Setup permissions structures
438 $owner_uid = $a->data['user']['uid'];
441 $contact_id = $_SESSION['visitor_id'];
442 $groups = init_groups_visitor($contact_id);
445 // default permissions - anonymous user
447 $sql_extra = " AND `allow_cid` = '' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = '' ";
449 // Profile owner - everything is visible
451 if(local_user() && (get_uid() == $owner_uid)) {
454 elseif(remote_user()) {
455 // authenticated visitor - here lie dragons
456 $gs = '<<>>'; // should be impossible to match
458 foreach($groups as $g)
459 $gs .= '|<' . intval($g) . '>';
461 $sql_extra = sprintf(
462 " AND ( `allow_cid` = '' OR `allow_cid` REGEXP '<%d>' )
463 AND ( `deny_cid` = '' OR NOT `deny_cid` REGEXP '<%d>' )
464 AND ( `allow_gid` = '' OR `allow_gid` REGEXP '%s' )
465 AND ( `deny_gid` = '' OR NOT `deny_gid` REGEXP '%s') ",
467 intval($_SESSION['visitor_id']),
468 intval($_SESSION['visitor_id']),
479 if($datatype == 'upload') {
480 if( ! (local_user() && (get_uid() == $a->data['user']['uid']))) {
481 notice( t('Permission denied.'));
484 $albumselect = '<select id="photos-upload-album-select" name="album" size="4">';
486 $albumselect .= '<option value="" selected="selected" > </option>';
487 if(count($a->data['albums'])) {
488 foreach($a->data['albums'] as $album) {
489 if(($album['album'] == '') || ($album['album'] == t('Contact Photos')))
491 $albumselect .= '<option value="' . $album['album'] . '">' . $album['album'] . '</option>';
494 $albumselect .= '</select>';
495 $tpl = file_get_contents('view/photos_upload.tpl');
496 $o .= replace_macros($tpl,array(
497 '$pagename' => t('Upload Photos'),
498 '$sessid' => session_id(),
499 '$newalbum' => t('New album name: '),
500 '$existalbumtext' => t('or existing album name: '),
501 '$filestext' => t('Select files to upload: '),
502 '$albumselect' => $albumselect,
503 '$permissions' => t('Permissions'),
504 '$aclselect' => populate_acl($a->user),
505 '$archive' => $a->get_baseurl() . '/jumploader_z.jar',
506 '$nojava' => t('Use the following controls only if the Java uploader (above) fails to launch.'),
507 '$uploadurl' => $a->get_baseurl() . '/photos',
508 '$submit' => t('Submit')
515 if($datatype == 'album') {
517 $album = hex2bin($datum);
519 $r = q("SELECT `resource-id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` = '%s'
520 $sql_extra GROUP BY `resource-id`",
521 intval($a->data['user']['uid']),
525 $a->set_pager_total(count($r));
528 $r = q("SELECT `resource-id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` = '%s'
529 $sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d",
530 intval($a->data['user']['uid']),
532 intval($a->pager['start']),
533 intval($a->pager['itemspage'])
536 $o .= '<h3>' . $album . '</h3>';
539 if(($album != t('Profile Photos')) && ($album != t('Contact Photos'))) {
540 if(local_user() && (get_uid() == $a->data['user']['uid'])) {
541 $edit_tpl = file_get_contents('view/album_edit.tpl');
542 $o .= replace_macros($edit_tpl,array(
543 '$nametext' => t('New album name: '),
545 '$hexalbum' => bin2hex($album),
546 '$submit' => t('Submit'),
547 '$dropsubmit' => t('Delete Album')
553 if(($album != t('Profile Photos')) && ($album != t('Contact Photos'))) {
554 if(local_user() && (get_uid() == $a->data['user']['uid'])) {
555 $o .= '<div id="album-edit-link"><a href="'. $a->get_baseurl() . '/photos/'
556 . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit' . '">'
557 . t('Edit Album') . '</a></div>';
561 $tpl = file_get_contents('view/photo_album.tpl');
564 $o .= replace_macros($tpl,array(
566 '$photolink' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id'],
567 '$phototitle' => t('View Photo'),
568 '$imgsrc' => $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['scale'] . '.jpg',
569 '$imgalt' => $rr['filename']
573 $o .= '<div id="photo-album-end"></div>';
579 if($datatype == 'image') {
581 require_once('security.php');
582 require_once('bbcode.php');
584 // fetch image, item containing image, then comments
586 $ph = q("SELECT * FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'
587 $sql_extra ORDER BY `scale` ASC ",
588 intval($a->data['user']['uid']),
593 notice( t('Photo not available') . EOL );
598 $hires = $lores = $ph[0];
600 if($ph[1]['scale'] == 2) {
601 // original is 640 or less, we can display it directly
602 $hires = $lores = $ph[0];
611 $o .= '<h3>' . '<a href="' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($ph[0]['album']) . '">' . $ph[0]['album'] . '</a></h3>';
613 if(local_user() && ($ph[0]['uid'] == get_uid())) {
614 $o .= '<div id="photo-edit-link-wrap" ><a id="photo-edit-link" href="' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $datum . '/edit' . '">' . t('Edit photo') . '</a></div>';
618 $o .= '<a href="' . $a->get_baseurl() . '/photo/'
619 . $hires['resource-id'] . '-' . $hires['scale'] . '.jpg" title="'
620 . t('View Full Size') . '" ><img src="' . $a->get_baseurl() . '/photo/'
621 . $lores['resource-id'] . '-' . $lores['scale'] . '.jpg' . '" /></a>';
624 // Do we have an item for this photo?
626 $i1 = q("SELECT * FROM `item` WHERE `resource-id` = '%s' $sql_extra LIMIT 1",
631 $r = q("SELECT COUNT(*) AS `total`
632 FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
633 WHERE `parent-uri` = '%s' AND `uri` != '%s' AND `item`.`deleted` = 0
634 AND NOT `item`.`type` IN ( 'remote', 'net-comment')
635 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
637 dbesc($i1[0]['uri']),
643 $a->set_pager_total($r[0]['total']);
646 $r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
647 `contact`.`name`, `contact`.`photo`, `contact`.`url`,
648 `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
649 `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
650 FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
651 WHERE `parent-uri` = '%s' AND `uri` != '%s' AND `item`.`deleted` = 0
652 AND NOT `item`.`type` IN ( 'remote', 'net-comment')
653 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
655 ORDER BY `parent` DESC, `id` ASC LIMIT %d ,%d ",
656 dbesc($i1[0]['uri']),
657 dbesc($i1[0]['uri']),
658 intval($a->pager['start']),
659 intval($a->pager['itemspage'])
664 $o .= '<div id="photo-caption" >' . $ph[0]['desc'] . '</div>';
666 if(count($i1) && strlen($i1[0]['tag'])) {
667 // parse tags and add links
668 $o .= '<div id="in-this-photo-text">' . t('In this photo: ') . '</div>';
669 $o .= '<div id="in-this-photo">' . $i1[0]['tag'] . '</div>';
673 $edit_tpl = file_get_contents('view/photo_edit.tpl');
674 $o .= replace_macros($edit_tpl, array(
675 '$id' => $ph[0]['id'],
676 '$resource_id' => $ph[0]['resource-id'],
677 '$capt_label' => t('Caption'),
678 '$caption' => $ph[0]['desc'],
679 '$tag_label' => t('Tags'),
680 '$tags' => $i1[0]['tag'],
681 '$item_id' => ((count($i1)) ? $i1[0]['id'] : 0),
682 '$submit' => t('Submit'),
683 '$delete' => t('Delete Photo')
689 // pull out how many people like the photo
691 $cmnt_tpl = file_get_contents('view/comment_item.tpl');
692 $tpl = file_get_contents('view/photo_item.tpl');
693 $return_url = $a->cmd;
695 if(can_write_wall($a,$a->data['user']['uid'])) {
696 if($i1[0]['last-child']) {
697 $o .= replace_macros($cmnt_tpl,array(
698 '$return_path' => $return_url,
699 '$type' => 'wall-comment',
700 '$id' => $i1[0]['id'],
701 '$parent' => $i1[0]['id'],
702 '$profile_uid' => $a->data['user']['uid'],
711 foreach($r as $item) {
715 $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
717 if(can_write_wall($a,$a->data['user']['uid'])) {
718 if($item['last-child']) {
719 $comment = replace_macros($cmnt_tpl,array(
720 '$return_path' => $return_url,
721 '$type' => 'wall-comment',
722 '$id' => $item['item_id'],
723 '$parent' => $item['parent'],
724 '$profile_uid' => $a->data['user']['uid'],
730 $profile_url = $item['url'];
732 if(local_user() && ($item['contact-uid'] == get_uid())
733 && ($item['rel'] == DIRECTION_IN || $item['rel'] == DIRECTION_BOTH) && (! $item['self'] ))
734 $profile_url = $redirect_url;
736 $profile_name = ((strlen($item['author-name'])) ? $item['author-name'] : $item['name']);
737 $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']);
738 $profile_link = $profile_url;
742 if(($item['contact-id'] == $_SESSION['visitor_id']) || ($item['uid'] == get_uid()))
743 $drop = replace_macros(file_get_contents('view/wall_item_drop.tpl'), array('$id' => $item['id']));
746 $o .= replace_macros($template,array(
747 '$id' => $item['item_id'],
748 '$profile_url' => $profile_link,
749 '$name' => $profile_name,
750 '$thumb' => $profile_avatar,
751 '$title' => $item['title'],
752 '$body' => bbcode($item['body']),
753 '$ago' => relative_date($item['created']),
754 '$indent' => (($item['parent'] != $item['item_id']) ? ' comment' : ''),
756 '$comment' => $comment
766 // Default - show recent photos with upload link (if applicable)
768 $r = q("SELECT `resource-id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` != '%s'
769 $sql_extra GROUP BY `resource-id`",
770 intval($a->data['user']['uid']),
771 dbesc( t('Contact Photos'))
774 $a->set_pager_total(count($r));
777 $r = q("SELECT `resource-id`, `album`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` != '%s'
778 $sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d",
779 intval($a->data['user']['uid']),
780 dbesc( t('Contact Photos')),
781 intval($a->pager['start']),
782 intval($a->pager['itemspage'])
785 $o .= '<h3>' . t('Recent Photos') . '</h3>';
787 if( local_user() && (get_uid() == $a->data['user']['uid'])) {
788 $o .= '<div id="photo-top-links"><a id="photo-top-upload-link" href="'. $a->get_baseurl() . '/photos/'
789 . $a->data['user']['nickname'] . '/upload' . '">' . t('Upload New Photos') . '</a></div>';
792 $tpl = file_get_contents('view/photo_top.tpl');
795 $o .= replace_macros($tpl,array(
797 '$photolink' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname']
798 . '/image/' . $rr['resource-id'],
799 '$phototitle' => t('View Photo'),
800 '$imgsrc' => $a->get_baseurl() . '/photo/'
801 . $rr['resource-id'] . '-' . $rr['scale'] . '.jpg',
802 '$albumlink' => $a->get_baseurl . '/photos/'
803 . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']),
804 '$albumname' => $rr['album'],
805 '$albumalt' => t('View Album'),
806 '$imgalt' => $rr['filename']
810 $o .= '<div id="photo-top-end"></div>';