$matches = false;
$terms = array();
- $cnt = preg_match_all('/<(.*?)>/',$saved,$matches,PREG_SET_ORDER);
- if ($cnt) {
- foreach ($matches as $mtch) {
- $unescaped = xmlify(file_tag_decode($mtch[1]));
+ $cnt = preg_match_all('/<(.*?)>/',$saved,$matches,PREG_SET_ORDER);
+
+ if ($cnt) {
+ foreach ($matches as $mtch) {
+ $unescaped = xmlify(file_tag_decode($mtch[1]));
$terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : ''));
}
}
$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']);
+ }
}
}
$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)
$href = "";
$width = 0;
foreach ($avatar->attributes AS $attributes) {
- /// @TODO Rewrite these similar if() to one switch
+ /// @TODO Rewrite these similar if () to one switch
if ($attributes->name == "href") {
$href = $attributes->textContent;
}
$title = "";
foreach ($links AS $link) {
foreach ($link->attributes AS $attributes) {
- /// @TODO Rewrite these repeated (same) if() statements to a switch()
+ /// @TODO Rewrite these repeated (same) if () statements to a switch()
if ($attributes->name == "href") {
$href = $attributes->textContent;
}
continue;
}
- /// @TODO One statment is okay (until if() )
+ /// @TODO One statment is okay (until if () )
$arr = array();
$arr["network"] = $details["network"];
$arr["uri"] = $single_conv->id;
$gs = '<<>>'; // should be impossible to match
if (is_array($groups) && count($groups)) {
- foreach ($groups as $g)
+ foreach ($groups as $g) {
$gs .= '|<' . intval($g) . '>';
+ }
}
$sql = sprintf(
$t = str_replace('<','',$s);
$a = explode('>',$t);
foreach ($a as $aa) {
- if (intval($aa))
+ if (intval($aa)) {
$ret[] = intval($aa);
+ }
}
}
return $ret;