aboutsummaryrefslogtreecommitdiffstats
path: root/mod/photos.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-04-03 21:36:29 -0400
committerAndrew Manning <tamanning@zoho.com>2016-04-03 21:36:29 -0400
commit0523b4b2f1012a8b5f3bffb7f136a20dc9a4e43f (patch)
treea92197de4503ec52889dc05483493f4df1a305b8 /mod/photos.php
parent99d9456b3addc651a68874ddd391d25684252c4d (diff)
parentb4c1baada1fba46d4d75f40a7e78111d70d54e7a (diff)
downloadvolse-hubzilla-0523b4b2f1012a8b5f3bffb7f136a20dc9a4e43f.tar.gz
volse-hubzilla-0523b4b2f1012a8b5f3bffb7f136a20dc9a4e43f.tar.bz2
volse-hubzilla-0523b4b2f1012a8b5f3bffb7f136a20dc9a4e43f.zip
Merge branch 'master' of https://github.com/redmatrix/hubzilla into contextual-help
Diffstat (limited to 'mod/photos.php')
-rw-r--r--mod/photos.php168
1 files changed, 84 insertions, 84 deletions
diff --git a/mod/photos.php b/mod/photos.php
index 07138e6cf..0adbf752a 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -29,16 +29,16 @@ function photos_init(&$a) {
if(! $channelx)
return;
- $a->data['channel'] = $channelx;
+ App::$data['channel'] = $channelx;
- $observer = $a->get_observer();
- $a->data['observer'] = $observer;
+ $observer = App::get_observer();
+ App::$data['observer'] = $observer;
$observer_xchan = (($observer) ? $observer['xchan_hash'] : '');
- head_set_icon($a->data['channel']['xchan_photo_s']);
+ head_set_icon(App::$data['channel']['xchan_photo_s']);
- $a->page['htmlhead'] .= "<script> var ispublic = '" . t('everybody') . "'; var profile_uid = " . (($a->data['channel']) ? $a->data['channel']['channel_id'] : 0) . "; </script>" ;
+ App::$page['htmlhead'] .= "<script> var ispublic = '" . t('everybody') . "'; var profile_uid = " . ((App::$data['channel']) ? App::$data['channel']['channel_id'] : 0) . "; </script>" ;
}
@@ -61,7 +61,7 @@ function photos_post(&$a) {
$can_post = false;
- $page_owner_uid = $a->data['channel']['channel_id'];
+ $page_owner_uid = App::$data['channel']['channel_id'];
if(perm_is_allowed($page_owner_uid,get_observer_hash(),'write_storage'))
$can_post = true;
@@ -85,7 +85,7 @@ function photos_post(&$a) {
$owner_record = $s[0];
- $acl = new Zotlabs\Access\AccessList($a->data['channel']);
+ $acl = new Zotlabs\Access\AccessList(App::$data['channel']);
if((argc() > 3) && (argv(2) === 'album')) {
@@ -93,12 +93,12 @@ function photos_post(&$a) {
if($album === t('Profile Photos')) {
// not allowed
- goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
+ goaway(z_root() . '/' . $_SESSION['photo_return']);
}
if(! photos_album_exists($page_owner_uid,$album)) {
notice( t('Album not found.') . EOL);
- goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
+ goaway(z_root() . '/' . $_SESSION['photo_return']);
}
@@ -111,12 +111,12 @@ function photos_post(&$a) {
// @fixme - syncronise with DAV or disallow completely
- goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
+ goaway(z_root() . '/' . $_SESSION['photo_return']);
// $x = photos_album_rename($page_owner_uid,$album,$newalbum);
// if($x) {
// $newurl = str_replace(bin2hex($album),bin2hex($newalbum),$_SESSION['photo_return']);
-// goaway($a->get_baseurl() . '/' . $newurl);
+// goaway(z_root() . '/' . $newurl);
// }
}
@@ -140,7 +140,7 @@ function photos_post(&$a) {
$str = null;
}
if(! $str) {
- goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
+ goaway(z_root() . '/' . $_SESSION['photo_return']);
}
$r = q("select id from item where resource_id in ( $str ) and resource_type = 'photo' and uid = %d " . item_normal(),
@@ -165,7 +165,7 @@ function photos_post(&$a) {
}
- goaway($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address']);
+ goaway(z_root() . '/photos/' . App::$data['channel']['channel_address']);
}
if((argc() > 2) && (x($_REQUEST,'delete')) && ($_REQUEST['delete'] === t('Delete Photo'))) {
@@ -174,12 +174,12 @@ function photos_post(&$a) {
$ob_hash = get_observer_hash();
if(! $ob_hash)
- goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
+ goaway(z_root() . '/' . $_SESSION['photo_return']);
$r = q("SELECT `id`, `resource_id` FROM `photo` WHERE ( xchan = '%s' or `uid` = %d ) AND `resource_id` = '%s' LIMIT 1",
dbesc($ob_hash),
intval(local_channel()),
- dbesc($a->argv[2])
+ dbesc(App::$argv[2])
);
if($r) {
@@ -197,16 +197,16 @@ function photos_post(&$a) {
);
if(count($i)) {
drop_item($i[0]['id'],true,DROPITEM_PHASE1);
- $url = $a->get_baseurl();
+ $url = z_root();
}
*/
}
- goaway($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . $_SESSION['album_return']);
+ goaway(z_root() . '/photos/' . App::$data['channel']['channel_address'] . '/album/' . $_SESSION['album_return']);
}
- if(($a->argc > 2) && ((x($_POST,'desc') !== false) || (x($_POST,'newtag') !== false)) || (x($_POST,'albname') !== false)) {
+ if((App::$argc > 2) && ((x($_POST,'desc') !== false) || (x($_POST,'newtag') !== false)) || (x($_POST,'albname') !== false)) {
$desc = ((x($_POST,'desc')) ? notags(trim($_POST['desc'])) : '');
@@ -218,7 +218,7 @@ function photos_post(&$a) {
$acl->set_from_array($_POST);
$perm = $acl->get();
- $resource_id = $a->argv[2];
+ $resource_id = App::$argv[2];
if(! strlen($albname))
$albname = datetime_convert('UTC',date_default_timezone_get(),'now', 'Y');
@@ -349,7 +349,7 @@ function photos_post(&$a) {
$visibility = 1;
if(! $item_id) {
- $item_id = photos_create_item($a->data['channel'],get_observer_hash(),$p[0],$visibility);
+ $item_id = photos_create_item(App::$data['channel'],get_observer_hash(),$p[0],$visibility);
}
@@ -401,7 +401,7 @@ function photos_post(&$a) {
$rawtags = '@' . $rawtags;
require_once('include/text.php');
- $profile_uid = $a->profile['profile_uid'];
+ $profile_uid = App::$profile['profile_uid'];
$results = linkify_tags($a, $rawtags, (local_channel()) ? local_channel() : $profile_uid);
@@ -440,7 +440,7 @@ function photos_post(&$a) {
}
- goaway($a->get_baseurl() . '/' . $_SESSION['photo_return']);
+ goaway(z_root() . '/' . $_SESSION['photo_return']);
return; // NOTREACHED
}
@@ -450,8 +450,8 @@ function photos_post(&$a) {
* default post action - upload a photo
*/
- $channel = $a->data['channel'];
- $observer = $a->data['observer'];
+ $channel = App::$data['channel'];
+ $observer = App::$data['observer'];
$_REQUEST['source'] = 'photos';
require_once('include/attach.php');
@@ -470,9 +470,9 @@ function photos_post(&$a) {
}
if($_REQUEST['newalbum'])
- goaway($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($_REQUEST['newalbum']));
+ goaway(z_root() . '/photos/' . App::$data['channel']['channel_address'] . '/album/' . bin2hex($_REQUEST['newalbum']));
else
- goaway($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex(datetime_convert('UTC',date_default_timezone_get(),'now', 'Y')));
+ goaway(z_root() . '/photos/' . App::$data['channel']['channel_address'] . '/album/' . bin2hex(datetime_convert('UTC',date_default_timezone_get(),'now', 'Y')));
}
@@ -497,7 +497,7 @@ function photos_content(&$a) {
require_once('include/security.php');
require_once('include/conversation.php');
- if(! x($a->data,'channel')) {
+ if(! x(App::$data,'channel')) {
notice( t('No photos selected') . EOL );
return;
}
@@ -505,13 +505,13 @@ function photos_content(&$a) {
$ph = photo_factory('');
$phototypes = $ph->supportedTypes();
- $_SESSION['photo_return'] = $a->cmd;
+ $_SESSION['photo_return'] = App::$cmd;
//
// Parse arguments
//
- $can_comment = perm_is_allowed($a->profile['profile_uid'],get_observer_hash(),'post_comments');
+ $can_comment = perm_is_allowed(App::$profile['profile_uid'],get_observer_hash(),'post_comments');
if(argc() > 3) {
$datatype = argv(2);
@@ -538,10 +538,10 @@ function photos_content(&$a) {
$visitor = 0;
- $owner_uid = $a->data['channel']['channel_id'];
- $owner_aid = $a->data['channel']['channel_account_id'];
+ $owner_uid = App::$data['channel']['channel_id'];
+ $owner_aid = App::$data['channel']['channel_account_id'];
- $observer = $a->get_observer();
+ $observer = App::get_observer();
$can_post = perm_is_allowed($owner_uid,$observer['xchan_hash'],'write_storage');
$can_view = perm_is_allowed($owner_uid,$observer['xchan_hash'],'view_storage');
@@ -555,13 +555,13 @@ function photos_content(&$a) {
$o = "";
- $o .= "<script> var profile_uid = " . $a->profile['profile_uid']
- . "; var netargs = '?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
+ $o .= "<script> var profile_uid = " . App::$profile['profile_uid']
+ . "; var netargs = '?f='; var profile_page = " . App::$pager['page'] . "; </script>\r\n";
// tabs
$_is_owner = (local_channel() && (local_channel() == $owner_uid));
- $o .= profile_tabs($a,$_is_owner, $a->data['channel']['channel_address']);
+ $o .= profile_tabs($a,$_is_owner, App::$data['channel']['channel_address']);
/**
* Display upload form
@@ -571,7 +571,7 @@ function photos_content(&$a) {
$uploader = '';
- $ret = array('post_url' => $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'],
+ $ret = array('post_url' => z_root() . '/photos/' . App::$data['channel']['channel_address'],
'addon_text' => $uploader,
'default_upload' => true);
@@ -580,11 +580,11 @@ function photos_content(&$a) {
/* Show space usage */
$r = q("select sum(size) as total from photo where aid = %d and scale = 0 ",
- intval($a->data['channel']['channel_account_id'])
+ intval(App::$data['channel']['channel_account_id'])
);
- $limit = service_class_fetch($a->data['channel']['channel_id'],'photo_upload_limit');
+ $limit = service_class_fetch(App::$data['channel']['channel_id'],'photo_upload_limit');
if($limit !== false) {
$usage_message = sprintf( t("%1$.2f MB of %2$.2f MB photo storage used."), $r[0]['total'] / 1024000, $limit / 1024000 );
}
@@ -593,7 +593,7 @@ function photos_content(&$a) {
}
if($_is_owner) {
- $channel = $a->get_channel();
+ $channel = App::get_channel();
$acl = new Zotlabs\Access\AccessList($channel);
$channel_acl = $acl->get();
@@ -613,10 +613,10 @@ function photos_content(&$a) {
$selname = (($datum) ? hex2bin($datum) : '');
- $albums = ((array_key_exists('albums', $a->data)) ? $a->data['albums'] : photos_albums_list($a->data['channel'],$a->data['observer']));
+ $albums = ((array_key_exists('albums', App::$data)) ? App::$data['albums'] : photos_albums_list(App::$data['channel'],App::$data['observer']));
if(! $selname) {
- $def_album = get_pconfig($a->data['channel']['channel_id'],'system','photo_path');
+ $def_album = get_pconfig(App::$data['channel']['channel_id'],'system','photo_path');
if($def_album) {
$selname = filepath_macro($def_album);
$albums['album'][] = array('text' => $selname);
@@ -628,7 +628,7 @@ function photos_content(&$a) {
'$pagename' => t('Upload Photos'),
'$sessid' => session_id(),
'$usage' => $usage_message,
- '$nickname' => $a->data['channel']['channel_address'],
+ '$nickname' => App::$data['channel']['channel_address'],
'$newalbum_label' => t('Enter an album name'),
'$newalbum_placeholder' => t('or select an existing album (doubleclick)'),
'$visible' => array('visible', t('Create a status post for this upload'), 0,'', array(t('No'), t('Yes')), 'onclick="showHideBodyTextarea();"'),
@@ -669,7 +669,7 @@ function photos_content(&$a) {
$album = (($datum) ? hex2bin($datum) : '');
- $a->page['htmlhead'] .= "\r\n" . '<link rel="alternate" type="application/json+oembed" href="' . z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . $a->cmd) . '" title="oembed" />' . "\r\n";
+ App::$page['htmlhead'] .= "\r\n" . '<link rel="alternate" type="application/json+oembed" href="' . z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . App::$cmd) . '" title="oembed" />' . "\r\n";
$r = q("SELECT `resource_id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` = '%s'
@@ -681,10 +681,10 @@ function photos_content(&$a) {
intval($unsafe)
);
if(count($r)) {
- $a->set_pager_total(count($r));
- $a->set_pager_itemspage(60);
+ App::set_pager_total(count($r));
+ App::set_pager_itemspage(60);
} else {
- goaway($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address']);
+ goaway(z_root() . '/photos/' . App::$data['channel']['channel_address']);
}
if($_GET['order'] === 'posted')
@@ -702,8 +702,8 @@ function photos_content(&$a) {
intval(PHOTO_NORMAL),
intval(PHOTO_PROFILE),
intval($unsafe),
- intval($a->pager['itemspage']),
- intval($a->pager['start'])
+ intval(App::$pager['itemspage']),
+ intval(App::$pager['start'])
);
//edit album name
@@ -711,7 +711,7 @@ function photos_content(&$a) {
if(($album !== t('Profile Photos')) && ($album !== 'Profile Photos') && ($album !== 'Contact Photos') && ($album !== t('Contact Photos'))) {
if($can_post) {
$album_e = $album;
- $albums = ((array_key_exists('albums', $a->data)) ? $a->data['albums'] : photos_albums_list($a->data['channel'],$a->data['observer']));
+ $albums = ((array_key_exists('albums', App::$data)) ? App::$data['albums'] : photos_albums_list(App::$data['channel'],App::$data['observer']));
// @fixme - syncronise actions with DAV
@@ -719,7 +719,7 @@ function photos_content(&$a) {
// $album_edit = replace_macros($edit_tpl,array(
// '$nametext' => t('Enter a new album name'),
// '$name_placeholder' => t('or select an existing one (doubleclick)'),
-// '$nickname' => $a->data['channel']['channel_address'],
+// '$nickname' => App::$data['channel']['channel_address'],
// '$album' => $album_e,
// '$albums' => $albums['albums'],
// '$hexalbum' => bin2hex($album),
@@ -731,9 +731,9 @@ function photos_content(&$a) {
}
if($_GET['order'] === 'posted')
- $order = array(t('Show Newest First'), $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($album));
+ $order = array(t('Show Newest First'), z_root() . '/photos/' . App::$data['channel']['channel_address'] . '/album/' . bin2hex($album));
else
- $order = array(t('Show Oldest First'), $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($album) . '?f=&order=posted');
+ $order = array(t('Show Oldest First'), z_root() . '/photos/' . App::$data['channel']['channel_address'] . '/album/' . bin2hex($album) . '?f=&order=posted');
$photos = array();
if(count($r)) {
@@ -750,7 +750,7 @@ function photos_content(&$a) {
$imgalt_e = $rr['filename'];
$desc_e = $rr['description'];
- $imagelink = ($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $rr['resource_id']
+ $imagelink = (z_root() . '/photos/' . App::$data['channel']['channel_address'] . '/image/' . $rr['resource_id']
. (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''));
$photos[] = array(
@@ -758,7 +758,7 @@ function photos_content(&$a) {
'twist' => ' ' . $twist . rand(2,4),
'link' => $imagelink,
'title' => t('View Photo'),
- 'src' => $a->get_baseurl() . '/photo/' . $rr['resource_id'] . '-' . $rr['scale'] . '.' .$ext,
+ 'src' => z_root() . '/photo/' . $rr['resource_id'] . '-' . $rr['scale'] . '.' .$ext,
'alt' => $imgalt_e,
'desc'=> $desc_e,
'ext' => $ext,
@@ -790,7 +790,7 @@ function photos_content(&$a) {
'$album_id' => bin2hex($album),
'$album_edit' => array(t('Edit Album'), $album_edit),
'$can_post' => $can_post,
- '$upload' => array(t('Upload'), $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/upload/' . bin2hex($album)),
+ '$upload' => array(t('Upload'), z_root() . '/photos/' . App::$data['channel']['channel_address'] . '/upload/' . bin2hex($album)),
'$order' => $order,
'$upload_form' => $upload_form,
'$usage' => $usage_message
@@ -816,7 +816,7 @@ function photos_content(&$a) {
if($datatype === 'image') {
- $a->page['htmlhead'] .= "\r\n" . '<link rel="alternate" type="application/json+oembed" href="' . z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . $a->cmd) . '" title="oembed" />' . "\r\n";
+ App::$page['htmlhead'] .= "\r\n" . '<link rel="alternate" type="application/json+oembed" href="' . z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . App::$cmd) . '" title="oembed" />' . "\r\n";
// fetch image, item containing image, then comments
@@ -871,8 +871,8 @@ function photos_content(&$a) {
}
}
- $prevlink = $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $prvnxt[$prv]['resource_id'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
- $nextlink = $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $prvnxt[$nxt]['resource_id'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
+ $prevlink = z_root() . '/photos/' . App::$data['channel']['channel_address'] . '/image/' . $prvnxt[$prv]['resource_id'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
+ $nextlink = z_root() . '/photos/' . App::$data['channel']['channel_address'] . '/image/' . $prvnxt[$nxt]['resource_id'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
}
@@ -889,14 +889,14 @@ function photos_content(&$a) {
}
}
- $album_link = $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($ph[0]['album']);
+ $album_link = z_root() . '/photos/' . App::$data['channel']['channel_address'] . '/album/' . bin2hex($ph[0]['album']);
$tools = Null;
$lock = Null;
if($can_post && ($ph[0]['uid'] == $owner_uid)) {
$tools = array(
- 'profile'=>array($a->get_baseurl() . '/profile_photo/use/'.$ph[0]['resource_id'], t('Use as profile photo')),
- 'cover'=>array($a->get_baseurl() . '/cover_photo/use/'.$ph[0]['resource_id'], t('Use as cover photo')),
+ 'profile'=>array(z_root() . '/profile_photo/use/'.$ph[0]['resource_id'], t('Use as profile photo')),
+ 'cover'=>array(z_root() . '/cover_photo/use/'.$ph[0]['resource_id'], t('Use as cover photo')),
);
}
@@ -906,20 +906,20 @@ function photos_content(&$a) {
? array('lock', t('Private Photo'))
: array('unlock', Null));
- $a->page['htmlhead'] .= '<script>$(document).keydown(function(event) {' . "\n";
+ App::$page['htmlhead'] .= '<script>$(document).keydown(function(event) {' . "\n";
if($prevlink)
- $a->page['htmlhead'] .= 'if(event.ctrlKey && event.keyCode == 37) { event.preventDefault(); window.location.href = \'' . $prevlink . '\'; }' . "\n";
+ App::$page['htmlhead'] .= 'if(event.ctrlKey && event.keyCode == 37) { event.preventDefault(); window.location.href = \'' . $prevlink . '\'; }' . "\n";
if($nextlink)
- $a->page['htmlhead'] .= 'if(event.ctrlKey && event.keyCode == 39) { event.preventDefault(); window.location.href = \'' . $nextlink . '\'; }' . "\n";
- $a->page['htmlhead'] .= '});</script>';
+ App::$page['htmlhead'] .= 'if(event.ctrlKey && event.keyCode == 39) { event.preventDefault(); window.location.href = \'' . $nextlink . '\'; }' . "\n";
+ App::$page['htmlhead'] .= '});</script>';
if($prevlink)
$prevlink = array($prevlink, t('Previous'));
$photo = array(
- 'href' => $a->get_baseurl() . '/photo/' . $hires['resource_id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
+ 'href' => z_root() . '/photo/' . $hires['resource_id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
'title'=> t('View Full Size'),
- 'src' => $a->get_baseurl() . '/photo/' . $lores['resource_id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . datetime_convert('','','','ymdhis')
+ 'src' => z_root() . '/photo/' . $lores['resource_id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . datetime_convert('','','','ymdhis')
);
if($nextlink)
@@ -992,7 +992,7 @@ function photos_content(&$a) {
$album_e = $ph[0]['album'];
$caption_e = $ph[0]['description'];
$aclselect_e = (($_is_owner) ? populate_acl($ph[0]) : '');
- $albums = ((array_key_exists('albums', $a->data)) ? $a->data['albums'] : photos_albums_list($a->data['channel'],$a->data['observer']));
+ $albums = ((array_key_exists('albums', App::$data)) ? App::$data['albums'] : photos_albums_list(App::$data['channel'],App::$data['observer']));
$_SESSION['album_return'] = bin2hex($ph[0]['album']);
@@ -1005,7 +1005,7 @@ function photos_content(&$a) {
'album' => $album_e,
'newalbum_label' => t('Enter a new album name'),
'newalbum_placeholder' => t('or select an existing one (doubleclick)'),
- 'nickname' => $a->data['channel']['channel_address'],
+ 'nickname' => App::$data['channel']['channel_address'],
'resource_id' => $ph[0]['resource_id'],
'capt_label' => t('Caption'),
'caption' => $caption_e,
@@ -1026,7 +1026,7 @@ function photos_content(&$a) {
$cmnt_tpl = get_markup_template('comment_item.tpl');
$tpl = get_markup_template('photo_item.tpl');
- $return_url = $a->cmd;
+ $return_url = App::$cmd;
$like_tpl = get_markup_template('like_noshare.tpl');
@@ -1123,7 +1123,7 @@ function photos_content(&$a) {
if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) && ($item['id'] != $item['parent']))
continue;
- $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
+ $redirect_url = z_root() . '/redir/' . $item['cid'] ;
$profile_url = zid($item['author']['xchan_url']);
@@ -1233,7 +1233,7 @@ function photos_content(&$a) {
'$paginate' => $paginate,
));
- $a->data['photo_html'] = $o;
+ App::$data['photo_html'] = $o;
return $o;
}
@@ -1241,12 +1241,12 @@ function photos_content(&$a) {
// Default - show recent photos with upload link (if applicable)
//$o = '';
- $a->page['htmlhead'] .= "\r\n" . '<link rel="alternate" type="application/json+oembed" href="' . z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . $a->cmd) . '" title="oembed" />' . "\r\n";
+ App::$page['htmlhead'] .= "\r\n" . '<link rel="alternate" type="application/json+oembed" href="' . z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . App::$cmd) . '" title="oembed" />' . "\r\n";
$r = q("SELECT `resource_id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s'
and photo_usage in ( %d, %d ) and is_nsfw = %d $sql_extra GROUP BY `resource_id`",
- intval($a->data['channel']['channel_id']),
+ intval(App::$data['channel']['channel_id']),
dbesc('Contact Photos'),
dbesc( t('Contact Photos')),
intval(PHOTO_NORMAL),
@@ -1254,8 +1254,8 @@ function photos_content(&$a) {
intval($unsafe)
);
if(count($r)) {
- $a->set_pager_total(count($r));
- $a->set_pager_itemspage(60);
+ App::set_pager_total(count($r));
+ App::set_pager_itemspage(60);
}
$r = q("SELECT p.resource_id, p.id, p.filename, p.type, p.album, p.scale, p.created FROM photo p INNER JOIN
@@ -1263,14 +1263,14 @@ function photos_content(&$a) {
WHERE uid=%d AND album != '%s' AND album != '%s'
AND photo_usage IN ( %d, %d ) and is_nsfw = %d $sql_extra group by resource_id) ph
ON (p.resource_id = ph.resource_id and p.scale = ph.scale) ORDER by p.created DESC LIMIT %d OFFSET %d",
- intval($a->data['channel']['channel_id']),
+ intval(App::$data['channel']['channel_id']),
dbesc('Contact Photos'),
dbesc( t('Contact Photos')),
intval(PHOTO_NORMAL),
intval(PHOTO_PROFILE),
intval($unsafe),
- intval($a->pager['itemspage']),
- intval($a->pager['start'])
+ intval(App::$pager['itemspage']),
+ intval(App::$pager['start'])
);
@@ -1285,7 +1285,7 @@ function photos_content(&$a) {
$twist = 'rotright';
$ext = $phototypes[$rr['type']];
- if($a->get_template_engine() === 'internal') {
+ if(App::get_template_engine() === 'internal') {
$alt_e = template_escape($rr['filename']);
$name_e = template_escape($rr['album']);
}
@@ -1297,12 +1297,12 @@ function photos_content(&$a) {
$photos[] = array(
'id' => $rr['id'],
'twist' => ' ' . $twist . rand(2,4),
- 'link' => $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $rr['resource_id'],
+ 'link' => z_root() . '/photos/' . App::$data['channel']['channel_address'] . '/image/' . $rr['resource_id'],
'title' => t('View Photo'),
- 'src' => $a->get_baseurl() . '/photo/' . $rr['resource_id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.' . $ext,
+ 'src' => z_root() . '/photo/' . $rr['resource_id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.' . $ext,
'alt' => $alt_e,
'album' => array(
- 'link' => $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/album/' . bin2hex($rr['album']),
+ 'link' => z_root() . '/photos/' . App::$data['channel']['channel_address'] . '/album/' . bin2hex($rr['album']),
'name' => $name_e,
'alt' => t('View Album'),
),
@@ -1331,7 +1331,7 @@ function photos_content(&$a) {
'$title' => t('Recent Photos'),
'$album_id' => bin2hex(t('Recent Photos')),
'$can_post' => $can_post,
- '$upload' => array(t('Upload'), $a->get_baseurl().'/photos/'.$a->data['channel']['channel_address'].'/upload'),
+ '$upload' => array(t('Upload'), z_root().'/photos/'.App::$data['channel']['channel_address'].'/upload'),
'$photos' => $photos,
'$upload_form' => $upload_form,
'$usage' => $usage_message