rendered paste bodyfunction db_update($table,$names,$values,$condition){
$an=explode(",",$names);
$t="";
$cnt=count($an)-1;
for($i=0;$i<$cnt;$i++){
$t.=$an[$i]."='".$values[$i]."'";
$t.=',';
}
$t.=$an[$i]."='".$values[$i]."'";
if($condition!="") mysql_query("UPDATE ".$table." SET ".$t." WHERE ".$condition."");
else mysql_query("UPDATE ".$table." SET ".$t."");
}
$tv=db_select("f_topics","topic_views","forum_id='".$forum_id."' AND topic_id='".$topic_id."' LIMIT 1");
$ntv=$tv[0]['topic_views']+1;
db_update("f_topics","topic_views",Array($ntv),"forum_id='".$forum_id."' AND topic_id='".$topic_id."'");