$v) { $row[$k]=preg_replace('/\(pic: ([^\)]*)\)/','

',$v); $row[$k]=preg_replace('/^\|([^\n]*)/','

$1
',$row[$k]); $row[$k]=preg_replace('/^\s+/ms','
    ',$row[$k]); } $row['link']=make_link($row); include "question_template.php"; } function print_questions_sql($sql,$search=false) { $res=mysql_query($sql) or print mysql_error().$sql; print_questions_res($res,$search); } function print_questions_res($res,$search=false) { global $limit; $kvo=mysql_num_rows($res); if ($search) { if ($kvo==$limit) { print "More than $limit results"; } else print "$kvo results"; while ($row=mysql_fetch_assoc($res)) { print_question($row); } } } function make_link ($row) { $row['tFileName']=preg_replace('/\.txt/','',$row['tFileName']); $row['t1FileName']=preg_replace('/\.txt/','',$row['t1FileName']); $row['tFileName']=preg_replace('/\./','_',$row['tFileName']); $row['t1FileName']=preg_replace('/\./','_',$row['t1FileName']); $text_id=$row['tFileName'] or $text_id=$row['tFileName']; $text_id.="_".$row['Number'].".html"; return $text_id; } ?>