allow comments on other folks wall-to-wall postings
This commit is contained in:
parent
f7c4b033c7
commit
1478229abc
|
@ -394,12 +394,34 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr
|
||||||
$thumb = $item['thumb'];
|
$thumb = $item['thumb'];
|
||||||
$indent = '';
|
$indent = '';
|
||||||
$osparkle = '';
|
$osparkle = '';
|
||||||
|
$visiting = false;
|
||||||
$lastcollapsed = false;
|
$lastcollapsed = false;
|
||||||
$firstcollapsed = false;
|
$firstcollapsed = false;
|
||||||
$total_children += count_descendants($item);
|
$total_children += count_descendants($item);
|
||||||
|
|
||||||
$toplevelpost = (($item['id'] == $item['parent']) ? true : false);
|
$toplevelpost = (($item['id'] == $item['parent']) ? true : false);
|
||||||
|
|
||||||
|
|
||||||
|
if($item['uid'] == local_user())
|
||||||
|
$dropping = true;
|
||||||
|
elseif(is_array($_SESSION['remote'])) {
|
||||||
|
foreach($_SESSION['remote'] as $visitor) {
|
||||||
|
if($visitor['cid'] == $item['contact-id']) {
|
||||||
|
$dropping = true;
|
||||||
|
$visiting = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$item_writeable = (($item['writable'] || $item['self']) ? true : false);
|
$item_writeable = (($item['writable'] || $item['self']) ? true : false);
|
||||||
|
|
||||||
|
// This will allow us to comment on wall-to-wall items owned by our friends
|
||||||
|
// and community forums even if somebody else wrote the post.
|
||||||
|
|
||||||
|
if($visiting && $mode == 'profile')
|
||||||
|
$item_writeable = true;
|
||||||
|
|
||||||
$show_comment_box = ((($page_writeable) && ($item_writeable)) ? true : false);
|
$show_comment_box = ((($page_writeable) && ($item_writeable)) ? true : false);
|
||||||
$lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|
$lock = ((($item['private'] == 1) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|
||||||
|| strlen($item['deny_cid']) || strlen($item['deny_gid']))))
|
|| strlen($item['deny_cid']) || strlen($item['deny_gid']))))
|
||||||
|
@ -412,17 +434,6 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr
|
||||||
else
|
else
|
||||||
$edpost = false;
|
$edpost = false;
|
||||||
|
|
||||||
if($item['uid'] == local_user())
|
|
||||||
$dropping = true;
|
|
||||||
elseif(is_array($_SESSION['remote'])) {
|
|
||||||
foreach($_SESSION['remote'] as $visitor) {
|
|
||||||
if($visitor['cid'] == $item['contact-id']) {
|
|
||||||
$dropping = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$drop = array(
|
$drop = array(
|
||||||
'dropping' => $dropping,
|
'dropping' => $dropping,
|
||||||
'select' => t('Select'),
|
'select' => t('Select'),
|
||||||
|
|
|
@ -152,17 +152,17 @@ function parseurl_getsiteinfo($url) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($siteinfo["image"] == "") {
|
if ($siteinfo["image"] == "") {
|
||||||
$list = $xpath->query("//img[@src]");
|
$list = $xpath->query("//img[@src]");
|
||||||
foreach ($list as $node) {
|
foreach ($list as $node) {
|
||||||
$attr = array();
|
$attr = array();
|
||||||
if ($node->attributes->length)
|
if ($node->attributes->length)
|
||||||
foreach ($node->attributes as $attribute)
|
foreach ($node->attributes as $attribute)
|
||||||
$attr[$attribute->name] = $attribute->value;
|
$attr[$attribute->name] = $attribute->value;
|
||||||
|
|
||||||
$src = completeurl($attr["src"], $url);
|
$src = completeurl($attr["src"], $url);
|
||||||
$photodata = getimagesize($src);
|
$photodata = @getimagesize($src);
|
||||||
|
|
||||||
if (($photodata[0] > 150) and ($photodata[1] > 150)) {
|
if (($photodata) && ($photodata[0] > 150) and ($photodata[1] > 150)) {
|
||||||
if ($photodata[0] > 300) {
|
if ($photodata[0] > 300) {
|
||||||
$photodata[1] = round($photodata[1] * (300 / $photodata[0]));
|
$photodata[1] = round($photodata[1] * (300 / $photodata[0]));
|
||||||
$photodata[0] = 300;
|
$photodata[0] = 300;
|
||||||
|
@ -176,15 +176,15 @@ function parseurl_getsiteinfo($url) {
|
||||||
"height"=>$photodata[1]);
|
"height"=>$photodata[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$src = completeurl($siteinfo["image"], $url);
|
$src = completeurl($siteinfo["image"], $url);
|
||||||
|
|
||||||
unset($siteinfo["image"]);
|
unset($siteinfo["image"]);
|
||||||
|
|
||||||
$photodata = getimagesize($src);
|
$photodata = @getimagesize($src);
|
||||||
|
|
||||||
if (($photodata[0] > 10) and ($photodata[1] > 10))
|
if (($photodata) && ($photodata[0] > 10) and ($photodata[1] > 10))
|
||||||
$siteinfo["images"][] = array("src"=>$src,
|
$siteinfo["images"][] = array("src"=>$src,
|
||||||
"width"=>$photodata[0],
|
"width"=>$photodata[0],
|
||||||
"height"=>$photodata[1]);
|
"height"=>$photodata[1]);
|
||||||
|
|
Loading…
Reference in a new issue