<?php
-require_once('include/Photo.php');
-require_once('include/photos.php');
-require_once('include/items.php');
-require_once('include/acl_selectors.php');
-require_once('include/bbcode.php');
-require_once('include/security.php');
-require_once('include/redir.php');
-require_once('include/tags.php');
-require_once('include/threads.php');
-require_once('include/Probe.php');
+require_once 'include/Photo.php';
+require_once 'include/photos.php';
+require_once 'include/items.php';
+require_once 'include/acl_selectors.php';
+require_once 'include/bbcode.php';
+require_once 'include/security.php';
+require_once 'include/redir.php';
+require_once 'include/tags.php';
+require_once 'include/threads.php';
+require_once 'include/Probe.php';
use \Friendica\Core\Config;
auto_redir($a, $a->argv[1]);
}
- if ((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
+ if ((get_config('system', 'block_public')) && (! local_user()) && (! remote_user())) {
return;
}
if (isset($profile)) {
unset($profile);
}
- if (strpos($tag,'@') === 0) {
+ if (strpos($tag, '@') === 0) {
$name = substr($tag,1);
- if ((strpos($name,'@')) || (strpos($name,'http://'))) {
+ if ((strpos($name, '@')) || (strpos($name, 'http://'))) {
$newname = $name;
$links = @Probe::lrdd($name);
if (count($links)) {
$profile = $link['@attributes']['href'];
}
if ($link['@attributes']['rel'] === 'salmon') {
- $salmon = '$url:' . str_replace(',','%sc',$link['@attributes']['href']);
+ $salmon = '$url:' . str_replace(',', '%sc', $link['@attributes']['href']);
if (strlen($inform)) {
$inform .= ',';
}
}
}
}
- $taginfo[] = array($newname,$profile,$salmon);
+ $taginfo[] = array($newname, $profile, $salmon);
} else {
$newname = $name;
$alias = '';
$tagcid = 0;
- if (strrpos($newname,'+')) {
- $tagcid = intval(substr($newname,strrpos($newname, '+') + 1));
+ if (strrpos($newname, '+')) {
+ $tagcid = intval(substr($newname, strrpos($newname, '+') + 1));
}
if ($tagcid) {
);
}
}
- /// @TODO maybe old-lost code to be removed
-/* elseif (strstr($name,'_') || strstr($name,' ')) {
- $newname = str_replace('_',' ',$name);
- $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
- dbesc($newname),
- intval($page_owner_uid)
- );
- } else {
- $r = q("SELECT * FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1",
- dbesc($name),
- dbesc($name),
- intval($page_owner_uid)
- );
- }*/
+
if (dbm::is_result($r)) {
$newname = $r[0]['name'];
$profile = $r[0]['url'];
$profile = str_replace(',', '%2c', $profile);
$str_tags .= '@[url='.$profile.']'.$newname.'[/url]';
}
- } elseif (strpos($tag,'#') === 0) {
+ } elseif (strpos($tag, '#') === 0) {
$tagname = substr($tag, 1);
- $str_tags .= '#[url='.App::get_baseurl()."/search?tag=".$tagname.']'.$tagname.'[/url]';
+ $str_tags .= '#[url=' . App::get_baseurl() . "/search?tag=" . $tagname . ']' . $tagname . '[/url]';
}
}
}
$visible = 0;
}
- $str_group_allow = perms2str(((is_array($_REQUEST['group_allow'])) ? $_REQUEST['group_allow'] : explode(',',$_REQUEST['group_allow'])));
- $str_contact_allow = perms2str(((is_array($_REQUEST['contact_allow'])) ? $_REQUEST['contact_allow'] : explode(',',$_REQUEST['contact_allow'])));
- $str_group_deny = perms2str(((is_array($_REQUEST['group_deny'])) ? $_REQUEST['group_deny'] : explode(',',$_REQUEST['group_deny'])));
- $str_contact_deny = perms2str(((is_array($_REQUEST['contact_deny'])) ? $_REQUEST['contact_deny'] : explode(',',$_REQUEST['contact_deny'])));
+ $str_group_allow = perms2str(((is_array($_REQUEST['group_allow'])) ? $_REQUEST['group_allow'] : explode(',', $_REQUEST['group_allow'])));
+ $str_contact_allow = perms2str(((is_array($_REQUEST['contact_allow'])) ? $_REQUEST['contact_allow'] : explode(',', $_REQUEST['contact_allow'])));
+ $str_group_deny = perms2str(((is_array($_REQUEST['group_deny'])) ? $_REQUEST['group_deny'] : explode(',', $_REQUEST['group_deny'])));
+ $str_contact_deny = perms2str(((is_array($_REQUEST['contact_deny'])) ? $_REQUEST['contact_deny'] : explode(',', $_REQUEST['contact_deny'])));
$ret = array('src' => '', 'filename' => '', 'filesize' => 0, 'type' => '');
$imagedata = @file_get_contents($src);
- $limit = service_class_fetch($a->data['user']['uid'],'photo_upload_limit');
+ $limit = service_class_fetch($a->data['user']['uid'], 'photo_upload_limit');
if ($limit) {
$r = q("SELECT SUM(OCTET_LENGTH(`data`)) AS `total` FROM `photo` WHERE `uid` = %d AND `scale` = 0 AND `album` != 'Contact Photos'",
$exif = $ph->orient($src);
@unlink($src);
- $max_length = get_config('system','max_image_length');
+ $max_length = get_config('system', 'max_image_length');
if (! $max_length) {
$max_length = MAX_IMAGE_LENGTH;
}
// photos/name/image/xxxxx/edit
- if ((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
+ if ((get_config('system', 'block_public')) && (! local_user()) && (! remote_user())) {
notice( t('Public access denied.') . EOL);
return;
}
));
$usage_message = '';
- $limit = service_class_fetch($a->data['user']['uid'],'photo_upload_limit');
+ $limit = service_class_fetch($a->data['user']['uid'], 'photo_upload_limit');
if ($limit !== false) {
$r = q("SELECT SUM(`datasize`) AS `total` FROM `photo` WHERE `uid` = %d AND `scale` = 0 AND `album` != 'Contact Photos'",
}
}
} else {
- /// @TODO merge else+if into elseif and 2 into one?
- if (($album !== t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== t('Contact Photos'))) {
- if ($can_post) {
- $edit = array(t('Edit Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit');
- }
+ if (($album !== t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== t('Contact Photos')) && $can_post) {
+ $edit = array(t('Edit Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit');
}
}
$tags = null;
if (count($linked_items) && strlen($link_item['tag'])) {
- $arr = explode(',',$link_item['tag']);
+ $arr = explode(',', $link_item['tag']);
// parse tags and add links
$tag_str = '';
foreach ($arr as $t) {
$comments = '';
if (! dbm::is_result($r)) {
- /// @TODO merge into one if() ?
- if ($can_post || can_write_wall($a,$owner_uid)) {
- if ($link_item['last-child']) {
- $comments .= replace_macros($cmnt_tpl,array(
- '$return_path' => '',
- '$jsreload' => $return_url,
- '$type' => 'wall-comment',
- '$id' => $link_item['id'],
- '$parent' => $link_item['id'],
- '$profile_uid' => $owner_uid,
- '$mylink' => $contact['url'],
- '$mytitle' => t('This is you'),
- '$myphoto' => $contact['thumb'],
- '$comment' => t('Comment'),
- '$submit' => t('Submit'),
- '$preview' => t('Preview'),
- '$sourceapp' => t($a->sourcename),
- '$ww' => '',
- '$rand_num' => random_digits(12)
- ));
- }
+ if (($can_post || can_write_wall($a,$owner_uid)) && $link_item['last-child']) {
+ $comments .= replace_macros($cmnt_tpl,array(
+ '$return_path' => '',
+ '$jsreload' => $return_url,
+ '$type' => 'wall-comment',
+ '$id' => $link_item['id'],
+ '$parent' => $link_item['id'],
+ '$profile_uid' => $owner_uid,
+ '$mylink' => $contact['url'],
+ '$mytitle' => t('This is you'),
+ '$myphoto' => $contact['thumb'],
+ '$comment' => t('Comment'),
+ '$submit' => t('Submit'),
+ '$preview' => t('Preview'),
+ '$sourceapp' => t($a->sourcename),
+ '$ww' => '',
+ '$rand_num' => random_digits(12)
+ ));
}
}
builtin_activity_puller($item, $conv_responses);
}
- $like = ((x($conv_responses['like'],$link_item['uri'])) ? format_like($conv_responses['like'][$link_item['uri']],$conv_responses['like'][$link_item['uri'] . '-l'],'like',$link_item['id']) : '');
- $dislike = ((x($conv_responses['dislike'],$link_item['uri'])) ? format_like($conv_responses['dislike'][$link_item['uri']],$conv_responses['dislike'][$link_item['uri'] . '-l'],'dislike',$link_item['id']) : '');
-
- /// @TODO merge into one if() ?
- if ($can_post || can_write_wall($a,$owner_uid)) {
- if ($link_item['last-child']) {
- $comments .= replace_macros($cmnt_tpl,array(
- '$return_path' => '',
- '$jsreload' => $return_url,
- '$type' => 'wall-comment',
- '$id' => $link_item['id'],
- '$parent' => $link_item['id'],
- '$profile_uid' => $owner_uid,
- '$mylink' => $contact['url'],
- '$mytitle' => t('This is you'),
- '$myphoto' => $contact['thumb'],
- '$comment' => t('Comment'),
- '$submit' => t('Submit'),
- '$preview' => t('Preview'),
- '$sourceapp' => t($a->sourcename),
- '$ww' => '',
- '$rand_num' => random_digits(12)
- ));
- }
+ $like = ((x($conv_responses['like'],$link_item['uri'])) ? format_like($conv_responses['like'][$link_item['uri']],$conv_responses['like'][$link_item['uri'] . '-l'], 'like',$link_item['id']) : '');
+ $dislike = ((x($conv_responses['dislike'],$link_item['uri'])) ? format_like($conv_responses['dislike'][$link_item['uri']],$conv_responses['dislike'][$link_item['uri'] . '-l'], 'dislike',$link_item['id']) : '');
+
+ if (($can_post || can_write_wall($a, $owner_uid)) && $link_item['last-child']) {
+ $comments .= replace_macros($cmnt_tpl,array(
+ '$return_path' => '',
+ '$jsreload' => $return_url,
+ '$type' => 'wall-comment',
+ '$id' => $link_item['id'],
+ '$parent' => $link_item['id'],
+ '$profile_uid' => $owner_uid,
+ '$mylink' => $contact['url'],
+ '$mytitle' => t('This is you'),
+ '$myphoto' => $contact['thumb'],
+ '$comment' => t('Comment'),
+ '$submit' => t('Submit'),
+ '$preview' => t('Preview'),
+ '$sourceapp' => t($a->sourcename),
+ '$ww' => '',
+ '$rand_num' => random_digits(12)
+ ));
}
'$comment' => $comment
));
- /// @TODO merge into one if() ?
- if ($can_post || can_write_wall($a, $owner_uid)) {
- if ($item['last-child']) {
- $comments .= replace_macros($cmnt_tpl, array(
- '$return_path' => '',
- '$jsreload' => $return_url,
- '$type' => 'wall-comment',
- '$id' => $item['item_id'],
- '$parent' => $item['parent'],
- '$profile_uid' => $owner_uid,
- '$mylink' => $contact['url'],
- '$mytitle' => t('This is you'),
- '$myphoto' => $contact['thumb'],
- '$comment' => t('Comment'),
- '$submit' => t('Submit'),
- '$preview' => t('Preview'),
- '$sourceapp' => t($a->sourcename),
- '$ww' => '',
- '$rand_num' => random_digits(12)
- ));
- }
+ if (($can_post || can_write_wall($a, $owner_uid)) && $item['last-child']) {
+ $comments .= replace_macros($cmnt_tpl, array(
+ '$return_path' => '',
+ '$jsreload' => $return_url,
+ '$type' => 'wall-comment',
+ '$id' => $item['item_id'],
+ '$parent' => $item['parent'],
+ '$profile_uid' => $owner_uid,
+ '$mylink' => $contact['url'],
+ '$mytitle' => t('This is you'),
+ '$myphoto' => $contact['thumb'],
+ '$comment' => t('Comment'),
+ '$submit' => t('Submit'),
+ '$preview' => t('Preview'),
+ '$sourceapp' => t($a->sourcename),
+ '$ww' => '',
+ '$rand_num' => random_digits(12)
+ ));
}
}
}