3 require_once('Photo.php');
4 require_once('include/items.php');
5 require_once('view/acl_selectors.php');
7 function photos_init(&$a) {
11 $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1",
18 $a->data['user'] = $r[0];
20 $albums = q("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = %d",
21 intval($a->data['user']['uid'])
25 $a->data['albums'] = $albums;
27 $o .= '<h4><a href="' . $a->get_baseurl() . '/profile/' . $a->data['user']['nickname'] . '">' . $a->data['user']['username'] . '</a></h4>';
28 $o .= '<h4>' . '<a href="' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '">' . t('Photo Albums') . '</a></h4>';
31 foreach($albums as $album) {
32 if((! strlen($album['album'])) || ($album['album'] == t('Contact Photos')))
34 $o .= '<li>' . '<a href="photos/' . $a->argv[1] . '/album/' . bin2hex($album['album']) . '" />' . $album['album'] . '</a></li>';
38 $a->page['aside'] .= $o;
46 function photos_post(&$a) {
50 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",
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",
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",
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');
127 $proc_debug = get_config('system','proc_debug');
129 // send the notification upstream/downstream as the case may be
132 proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"drop\" \"$drop_id\" $proc_debug & ",
138 goaway($a->get_baseurl() . '/photos/' . $a->data['user']['nickname']);
139 return; // NOTREACHED
142 if(($a->argc > 1) && (x($_POST,'delete')) && ($_POST['delete'] == t('Delete Photo'))) {
143 $r = q("SELECT `id` FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s' LIMIT 1",
148 q("DELETE FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'",
150 dbesc($r[0]['resource-id'])
152 $i = q("SELECT * FROM `item` WHERE `resource-id` = '%s' AND `uid` = %d LIMIT 1",
153 dbesc($r[0]['resource-id']),
157 q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
158 dbesc(datetime_convert()),
159 dbesc(datetime_convert()),
164 $url = $a->get_baseurl();
165 $drop_id = intval($i[0]['id']);
166 $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
168 $proc_debug = get_config('system','proc_debug');
170 // send the notification upstream/downstream as the case may be
173 proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"drop\" \"$drop_id\" $proc_debug & ",
178 goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
179 return; // NOTREACHED
184 if(($a->argc > 1) && (x($_POST,'desc') !== false)) {
185 $desc = notags(trim($_POST['desc']));
186 $tags = notags(trim($_POST['tags']));
187 $item_id = intval($_POST['item_id']);
188 $resource_id = $a->argv[1];
190 $p = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d ORDER BY `scale` DESC",
195 $r = q("UPDATE `photo` SET `desc` = '%s' WHERE `resource-id` = '%s' AND `uid` = %d",
204 $basename = basename($filename);
205 $uri = item_new_uri($a->get_hostname(),get_uid());
206 // Create item container
210 $arr['uid'] = get_uid();
212 $arr['parent-uri'] = $uri;
213 $arr['type'] = 'photo';
215 $arr['resource-id'] = $p[0]['resource-id'];
216 $arr['contact-id'] = $contact_record['id'];
217 $arr['owner-name'] = $contact_record['name'];
218 $arr['owner-link'] = $contact_record['url'];
219 $arr['owner-avatar'] = $contact_record['thumb'];
220 $arr['title'] = $title;
221 $arr['allow_cid'] = $p[0]['allow_cid'];
222 $arr['allow_gid'] = $p[0]['allow_gid'];
223 $arr['deny_cid'] = $p[0]['deny_cid'];
224 $arr['deny_gid'] = $p[0]['deny_gid'];
225 $arr['last-child'] = 1;
226 $arr['body'] = '[url=' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $p[0]['resource-id'] . ']'
227 . '[img]' . $a->get_baseurl() . '/photo/' . $p[0]['resource-id'] . '-' . $p[0]['scale'] . '.jpg' . '[/img]'
230 $item_id = item_store($arr);
234 $r = q("UPDATE `item` SET `tag` = '%s', `edited` = '%s', `changed` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1",
236 dbesc(datetime_convert()),
237 dbesc(datetime_convert()),
242 goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
243 return; // NOTREACHED
249 if(! x($_FILES,'userfile'))
252 if($_POST['partitionCount'])
255 $java_upload = false;
257 $album = notags(trim($_POST['album']));
258 $newalbum = notags(trim($_POST['newalbum']));
260 if(! strlen($album)) {
261 if(strlen($newalbum))
264 $album = datetime_convert('UTC',date_default_timezone_get(),'now', 'Y');
267 $r = q("SELECT * FROM `photo` WHERE `album` = '%s' AND `uid` = %d",
271 if((! count($r)) || ($album == t('Profile Photos')))
277 $str_group_allow = perms2str($_POST['group_allow']);
278 $str_contact_allow = perms2str($_POST['contact_allow']);
279 $str_group_deny = perms2str($_POST['group_deny']);
280 $str_contact_deny = perms2str($_POST['contact_deny']);
282 $src = $_FILES['userfile']['tmp_name'];
283 $filename = basename($_FILES['userfile']['name']);
284 $filesize = intval($_FILES['userfile']['size']);
286 $imagedata = @file_get_contents($src);
287 $ph = new Photo($imagedata);
289 if(! $ph->is_valid()) {
290 notice( t('Unable to process image.') . EOL );
297 $width = $ph->getWidth();
298 $height = $ph->getHeight();
302 $photo_hash = photo_new_resource();
304 $r = $ph->store(get_uid(), 0, $photo_hash, $filename, $album, 0 , 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
307 notice( t('Image upload failed.') . EOL );
311 if($width > 640 || $height > 640) {
312 $ph->scaleImage(640);
313 $ph->store(get_uid(), 0, $photo_hash, $filename, $album, 1, 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
317 if($width > 320 || $height > 320) {
318 $ph->scaleImage(320);
319 $ph->store(get_uid(), 0, $photo_hash, $filename, $album, 2, 0, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
323 $basename = basename($filename);
324 $uri = item_new_uri($a->get_hostname(), get_uid());
326 // Create item container
331 $arr['uid'] = get_uid();
333 $arr['parent-uri'] = $uri;
334 $arr['type'] = 'photo';
336 $arr['resource-id'] = $photo_hash;
337 $arr['contact-id'] = $contact_record['id'];
338 $arr['owner-name'] = $contact_record['name'];
339 $arr['owner-link'] = $contact_record['url'];
340 $arr['owner-avatar'] = $contact_record['thumb'];
341 $arr['title'] = $title;
342 $arr['allow_cid'] = $str_contact_allow;
343 $arr['allow_gid'] = $str_group_allow;
344 $arr['deny_cid'] = $str_contact_deny;
345 $arr['deny_gid'] = $str_group_deny;
346 $arr['last-child'] = 1;
347 $arr['visible'] = $visible;
348 $arr['body'] = '[url=' . $a->get_baseurl() . '/photos/' . $contact_record['nickname'] . '/image/' . $photo_hash . ']'
349 . '[img]' . $a->get_baseurl() . "/photo/{$photo_hash}-{$smallest}.jpg" . '[/img]'
352 $item_id = item_store($arr);
355 goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
356 return; // NOTREACHED
360 return; // NOTREACHED
366 function photos_content(&$a) {
370 // photos/name/upload
371 // photos/name/album/xxxxx
372 // photos/name/album/xxxxx/edit
373 // photos/name/image/xxxxx
374 // photos/name/image/xxxxx/edit
377 if(! x($a->data,'user')) {
378 notice( t('No photos selected') . EOL );
382 $_SESSION['photo_return'] = $a->cmd;
389 $datatype = $a->argv[2];
390 $datum = $a->argv[3];
392 elseif(($a->argc > 2) && ($a->argv[2] === 'upload'))
393 $datatype = 'upload';
395 $datatype = 'summary';
403 // Setup permissions structures
406 $owner_uid = $a->data['user']['uid'];
411 $remote_contact = false;
414 $contact_id = $_SESSION['visitor_id'];
415 $groups = init_groups_visitor($contact_id);
416 $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
422 $remote_contact = true;
426 if(! $remote_contact) {
428 $contact_id = $_SESSION['cid'];
429 $contact = $a->contact;
434 // default permissions - anonymous user
436 $sql_extra = " AND `allow_cid` = '' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = '' ";
438 // Profile owner - everything is visible
440 if(local_user() && (get_uid() == $owner_uid)) {
443 elseif(remote_user()) {
444 // authenticated visitor - here lie dragons
445 $gs = '<<>>'; // should be impossible to match
447 foreach($groups as $g)
448 $gs .= '|<' . intval($g) . '>';
450 $sql_extra = sprintf(
451 " AND ( `allow_cid` = '' OR `allow_cid` REGEXP '<%d>' )
452 AND ( `deny_cid` = '' OR NOT `deny_cid` REGEXP '<%d>' )
453 AND ( `allow_gid` = '' OR `allow_gid` REGEXP '%s' )
454 AND ( `deny_gid` = '' OR NOT `deny_gid` REGEXP '%s') ",
456 intval($_SESSION['visitor_id']),
457 intval($_SESSION['visitor_id']),
468 if($datatype === 'upload') {
469 if( ! (local_user() && (get_uid() == $a->data['user']['uid']))) {
470 notice( t('Permission denied.'));
473 $albumselect = '<select id="photos-upload-album-select" name="album" size="4">';
475 $albumselect .= '<option value="" selected="selected" > </option>';
476 if(count($a->data['albums'])) {
477 foreach($a->data['albums'] as $album) {
478 if(($album['album'] === '') || ($album['album'] == t('Contact Photos')))
480 $albumselect .= '<option value="' . $album['album'] . '">' . $album['album'] . '</option>';
484 $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
486 $albumselect .= '</select>';
487 $tpl = load_view_file('view/photos_upload.tpl');
488 $o .= replace_macros($tpl,array(
489 '$pagename' => t('Upload Photos'),
490 '$sessid' => session_id(),
491 '$newalbum' => t('New album name: '),
492 '$existalbumtext' => t('or existing album name: '),
493 '$filestext' => t('Select files to upload: '),
494 '$albumselect' => $albumselect,
495 '$permissions' => t('Permissions'),
496 '$aclselect' => populate_acl($a->user, $celeb),
497 '$archive' => $a->get_baseurl() . '/jumploader_z.jar',
498 '$nojava' => t('Use the following controls only if the Java uploader [above] fails to launch.'),
499 '$uploadurl' => $a->get_baseurl() . '/photos',
500 '$submit' => t('Submit')
507 if($datatype === 'album') {
509 $album = hex2bin($datum);
511 $r = q("SELECT `resource-id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` = '%s'
512 $sql_extra GROUP BY `resource-id`",
513 intval($a->data['user']['uid']),
517 $a->set_pager_total(count($r));
520 $r = q("SELECT `resource-id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` = '%s'
521 $sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d",
522 intval($a->data['user']['uid']),
524 intval($a->pager['start']),
525 intval($a->pager['itemspage'])
528 $o .= '<h3>' . $album . '</h3>';
530 if($cmd === 'edit') {
531 if(($album != t('Profile Photos')) && ($album != t('Contact Photos'))) {
532 if(local_user() && (get_uid() == $a->data['user']['uid'])) {
533 $edit_tpl = load_view_file('view/album_edit.tpl');
534 $o .= replace_macros($edit_tpl,array(
535 '$nametext' => t('New album name: '),
537 '$hexalbum' => bin2hex($album),
538 '$submit' => t('Submit'),
539 '$dropsubmit' => t('Delete Album')
545 if(($album != t('Profile Photos')) && ($album != t('Contact Photos'))) {
546 if(local_user() && (get_uid() == $a->data['user']['uid'])) {
547 $o .= '<div id="album-edit-link"><a href="'. $a->get_baseurl() . '/photos/'
548 . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit' . '">'
549 . t('Edit Album') . '</a></div>';
553 $tpl = load_view_file('view/photo_album.tpl');
556 $o .= replace_macros($tpl,array(
558 '$photolink' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id'],
559 '$phototitle' => t('View Photo'),
560 '$imgsrc' => $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['scale'] . '.jpg',
561 '$imgalt' => $rr['filename']
565 $o .= '<div id="photo-album-end"></div>';
571 if($datatype === 'image') {
573 require_once('security.php');
574 require_once('bbcode.php');
576 // fetch image, item containing image, then comments
578 $ph = q("SELECT * FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'
579 $sql_extra ORDER BY `scale` ASC ",
580 intval($a->data['user']['uid']),
585 notice( t('Photo not available') . EOL );
590 $hires = $lores = $ph[0];
592 if($ph[1]['scale'] == 2) {
593 // original is 640 or less, we can display it directly
594 $hires = $lores = $ph[0];
603 $o .= '<h3>' . '<a href="' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($ph[0]['album']) . '">' . $ph[0]['album'] . '</a></h3>';
605 if(local_user() && ($ph[0]['uid'] == get_uid())) {
606 $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>';
610 $o .= '<a href="' . $a->get_baseurl() . '/photo/'
611 . $hires['resource-id'] . '-' . $hires['scale'] . '.jpg" title="'
612 . t('View Full Size') . '" ><img src="' . $a->get_baseurl() . '/photo/'
613 . $lores['resource-id'] . '-' . $lores['scale'] . '.jpg' . '" /></a>';
616 // Do we have an item for this photo?
618 $i1 = q("SELECT * FROM `item` WHERE `resource-id` = '%s' $sql_extra LIMIT 1",
623 $r = q("SELECT COUNT(*) AS `total`
624 FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
625 WHERE `parent-uri` = '%s' AND `uri` != '%s' AND `item`.`deleted` = 0
626 AND NOT `item`.`type` IN ( 'remote', 'net-comment')
627 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
629 dbesc($i1[0]['uri']),
635 $a->set_pager_total($r[0]['total']);
638 $r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
639 `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`network`,
640 `contact`.`rel`, `contact`.`thumb`, `contact`.`self`,
641 `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
642 FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
643 WHERE `parent-uri` = '%s' AND `uri` != '%s' AND `item`.`deleted` = 0
644 AND NOT `item`.`type` IN ( 'remote', 'net-comment')
645 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
647 ORDER BY `parent` DESC, `id` ASC LIMIT %d ,%d ",
648 dbesc($i1[0]['uri']),
649 dbesc($i1[0]['uri']),
650 intval($a->pager['start']),
651 intval($a->pager['itemspage'])
656 $o .= '<div id="photo-caption" >' . $ph[0]['desc'] . '</div>';
658 if(count($i1) && strlen($i1[0]['tag'])) {
659 // parse tags and add links
660 $o .= '<div id="in-this-photo-text">' . t('In this photo: ') . '</div>';
661 $o .= '<div id="in-this-photo">' . $i1[0]['tag'] . '</div>';
664 if($cmd === 'edit') {
665 $edit_tpl = load_view_file('view/photo_edit.tpl');
666 $o .= replace_macros($edit_tpl, array(
667 '$id' => $ph[0]['id'],
668 '$resource_id' => $ph[0]['resource-id'],
669 '$capt_label' => t('Caption'),
670 '$caption' => $ph[0]['desc'],
671 '$tag_label' => t('Tags'),
672 '$tags' => $i1[0]['tag'],
673 '$item_id' => ((count($i1)) ? $i1[0]['id'] : 0),
674 '$submit' => t('Submit'),
675 '$delete' => t('Delete Photo')
681 // pull out how many people like the photo
683 $cmnt_tpl = load_view_file('view/comment_item.tpl');
684 $tpl = load_view_file('view/photo_item.tpl');
685 $return_url = $a->cmd;
687 if(can_write_wall($a,$a->data['user']['uid'])) {
688 if($i1[0]['last-child']) {
689 $o .= replace_macros($cmnt_tpl,array(
690 '$return_path' => $return_url,
691 '$type' => 'wall-comment',
692 '$id' => $i1[0]['id'],
693 '$parent' => $i1[0]['id'],
694 '$profile_uid' => $a->data['user']['uid'],
695 '$mylink' => $contact['url'],
696 '$mytitle' => t('This is you'),
697 '$myphoto' => $contact['thumb'],
706 foreach($r as $item) {
710 $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
712 if(can_write_wall($a,$a->data['user']['uid'])) {
713 if($item['last-child']) {
714 $comment = replace_macros($cmnt_tpl,array(
715 '$return_path' => $return_url,
716 '$type' => 'wall-comment',
717 '$id' => $item['item_id'],
718 '$parent' => $item['parent'],
719 '$profile_uid' => $a->data['user']['uid'],
720 '$mylink' => $contact['url'],
721 '$mytitle' => t('This is you'),
722 '$myphoto' => $contact['thumb'],
729 if(local_user() && ($item['contact-uid'] == get_uid())
730 && ($item['network'] == 'dfrn') && (! $item['self'] )) {
731 $profile_url = $redirect_url;
732 $sparkle = ' sparkle';
735 $profile_url = $item['url'];
739 $profile_name = ((strlen($item['author-name'])) ? $item['author-name'] : $item['name']);
740 $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']);
741 $profile_link = $profile_url;
745 if(($item['contact-id'] == $_SESSION['visitor_id']) || ($item['uid'] == get_uid()))
746 $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id']));
749 $o .= replace_macros($template,array(
750 '$id' => $item['item_id'],
751 '$profile_url' => $profile_link,
752 '$name' => $profile_name,
753 '$thumb' => $profile_avatar,
754 '$sparkle' => $sparkle,
755 '$title' => $item['title'],
756 '$body' => bbcode($item['body']),
757 '$ago' => relative_date($item['created']),
758 '$indent' => (($item['parent'] != $item['item_id']) ? ' comment' : ''),
760 '$comment' => $comment
770 // Default - show recent photos with upload link (if applicable)
772 $r = q("SELECT `resource-id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` != '%s'
773 $sql_extra GROUP BY `resource-id`",
774 intval($a->data['user']['uid']),
775 dbesc( t('Contact Photos'))
778 $a->set_pager_total(count($r));
781 $r = q("SELECT `resource-id`, `album`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` != '%s'
782 $sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d",
783 intval($a->data['user']['uid']),
784 dbesc( t('Contact Photos')),
785 intval($a->pager['start']),
786 intval($a->pager['itemspage'])
789 $o .= '<h3>' . t('Recent Photos') . '</h3>';
791 if( local_user() && (get_uid() == $a->data['user']['uid'])) {
792 $o .= '<div id="photo-top-links"><a id="photo-top-upload-link" href="'. $a->get_baseurl() . '/photos/'
793 . $a->data['user']['nickname'] . '/upload' . '">' . t('Upload New Photos') . '</a></div>';
796 $tpl = load_view_file('view/photo_top.tpl');
799 $o .= replace_macros($tpl,array(
801 '$photolink' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname']
802 . '/image/' . $rr['resource-id'],
803 '$phototitle' => t('View Photo'),
804 '$imgsrc' => $a->get_baseurl() . '/photo/'
805 . $rr['resource-id'] . '-' . $rr['scale'] . '.jpg',
806 '$albumlink' => $a->get_baseurl . '/photos/'
807 . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']),
808 '$albumname' => $rr['album'],
809 '$albumalt' => t('View Album'),
810 '$imgalt' => $rr['filename']
814 $o .= '<div id="photo-top-end"></div>';