function _phorum_recursive_sort($rows, &$threads, $seed=0, $indent=0) { global $PHORUM; if($seed>0){ $threads[$rows[$seed]["message_id"]]=$rows[$seed]; // old style of indenting $threads[$rows[$seed]["message_id"]]["indent"]=str_repeat($PHORUM['TMP']['indentstring'], $indent); if(!empty($indent)){ $threads[$rows[$seed]["message_id"]]["indent"].=$PHORUM['TMP']['marker']; } // new style of indenting by padding-left $threads[$rows[$seed]["message_id"]]["indent_cnt"]=$indent*$PHORUM['TMP']['indentmultiplier']; if($indent < 31) { $wrapnum=80-($indent*2); } else { $wrapnum=20; } $threads[$rows[$seed]["message_id"]]["subject"]=wordwrap($rows[$seed]['subject'],$wrapnum," ",1); $indent++; } if(isset($rows[$seed]["children"])){ foreach($rows[$seed]["children"] as $child){ _phorum_recursive_sort($rows, $threads, $child, $indent); } } }
function _phorum_recursive_sort($rows, &$threads, $seed = 0, $indent = 0) { if ($seed > 0) { $threads[$rows[$seed]['post_id']] = $rows[$seed]; $threads[$rows[$seed]['post_id']]['indent_cnt'] = $indent; $indent++; } if (isset($rows[$seed]['children'])) { foreach ($rows[$seed]['children'] as $child) { _phorum_recursive_sort($rows, $threads, $child, $indent); } } }