merged 2 if() into one three times

Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2017-03-30 21:48:46 +02:00
parent de5125a4c7
commit 192f6d7cf4
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78

View file

@ -1628,9 +1628,7 @@ function photos_content(App $a) {
$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']) {
if (($can_post || can_write_wall($a,$owner_uid)) && $link_item['last-child']) {
$comments .= replace_macros($cmnt_tpl,array(
'$return_path' => '',
'$jsreload' => $return_url,
@ -1650,7 +1648,6 @@ function photos_content(App $a) {
));
}
}
}
$alike = array();
$dlike = array();
@ -1673,9 +1670,7 @@ function photos_content(App $a) {
$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']) {
if (($can_post || can_write_wall($a, $owner_uid)) && $link_item['last-child']) {
$comments .= replace_macros($cmnt_tpl,array(
'$return_path' => '',
'$jsreload' => $return_url,
@ -1694,7 +1689,6 @@ function photos_content(App $a) {
'$rand_num' => random_digits(12)
));
}
}
foreach ($r as $item) {
@ -1756,9 +1750,7 @@ function photos_content(App $a) {
'$comment' => $comment
));
/// @TODO merge into one if() ?
if ($can_post || can_write_wall($a, $owner_uid)) {
if ($item['last-child']) {
if (($can_post || can_write_wall($a, $owner_uid)) && $item['last-child']) {
$comments .= replace_macros($cmnt_tpl, array(
'$return_path' => '',
'$jsreload' => $return_url,
@ -1779,7 +1771,6 @@ function photos_content(App $a) {
}
}
}
}
$paginate = paginate($a);
}