1
0
Fork 0

added spaces + some curly braces

Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2017-01-26 16:01:56 +01:00 committed by Roland Haeder
commit ed0d858f98
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78
6 changed files with 27 additions and 18 deletions

View file

@ -309,8 +309,9 @@ function localize_item(&$item){
$matches = null;
if (preg_match_all('/@\[url=(.*?)\]/is',$item['body'],$matches,PREG_SET_ORDER)) {
foreach ($matches as $mtch) {
if (! strpos($mtch[1],'zrl='))
if (! strpos($mtch[1],'zrl=')) {
$item['body'] = str_replace($mtch[0],'@[url=' . zrl($mtch[1]). ']',$item['body']);
}
}
}
@ -1360,20 +1361,25 @@ function conv_sort($arr,$order) {
$arr = $newarr;
foreach ($arr as $x)
if ($x['id'] == $x['parent'])
$parents[] = $x;
foreach ($arr as $x) {
if ($x['id'] == $x['parent']) {
$parents[] = $x;
}
}
if (stristr($order,'created'))
if (stristr($order,'created')) {
usort($parents,'sort_thr_created');
elseif (stristr($order,'commented'))
} elseif (stristr($order,'commented')) {
usort($parents,'sort_thr_commented');
}
if (count($parents))
foreach ($parents as $i=>$_x)
if (count($parents)) {
foreach($parents as $i=>$_x) {
$parents[$i]['children'] = get_item_children($arr, $_x);
}
}
/*foreach ($arr as $x) {
/*foreach($arr as $x) {
if ($x['id'] != $x['parent']) {
$p = find_thread_parent_index($parents,$x);
if ($p !== false)