new"; // New topic $update="update"; // Update topic $bullet=""; # Search Function print "
"; search($search_title,$keyword); print "
"; print "\n"; print "
[ $topiclink_title ]

\n"; # Read count_loop.dat $exist_file=fopen("count_loop.dat","r"); $count_loop=fgets($exist_file,255); fclose($exist_file); $real_count=0; # Real Topic for ($i=$count_loop;$i>0;$i--) { # Check File title/$i.txt $check_file="title/$i.txt"; if (file_exists($check_file)) { $FILE=file("title/$i.txt"); // Read File $title[$i]=$FILE[0]; // Add array title=$FILE[0] $real_count++; } } $lest=$real_count%$max_topic; // Make $lest $total_page=(($real_count-$lest)/$max_topic); if ($lest!=0) { // Total Page + 1 $total_page=$total_page+1; } print "Total : $real_count topic Page \n"; # Make Menu Link for ($i=1;$i<=$total_page;$i++) { $link_page=$i-1; if ($page==$link_page) { print "[ $i ] "; // Make Bold link current page } else { print "[ $i ] "; } } print "

\n"; # Find null topic in before page if ($page==0) { // Bug $page=0 $null=0; } else { // Find null $page !=0 for ($i=$count_loop;$i>0;$i--) { if ($title[$i]=="") { // Null topic in page from array $null++; } else { // total topic in page from array $total_before++; } # Break if ($total_before==($count_loop-($link_page*$max_topic))) {break;} // Max topic before current } } # Find Topic in page $topic_in_page=(($count_loop-$null)-($page*$max_topic)); # Show Topic in page for ($i=$topic_in_page;$i>0;$i--) { if ($title[$i]!="") { // Show topic in page from array $read=file("counter/read/$i.txt"); // Read Counter $write=file("counter/write/$i.txt"); // Write Counter include("time/$i.inc"); // New topic title # Check new & update if ((($today-$oldday)<=$new_time) && (($today-$oldday)>=0)) { // Bug if ($write[0]==0) { $status=$new; // New topic } else { $status=$update; // Update topic } } else { $status=""; // Non New & Update } # End Check new & update print "$bullet - $title[$i] - ($read[0]/$write[0]) $status
\n"; // Show summerry title $total++; } # Break if ($total==$max_topic) {break;} // Max topic in page } powered(); print "
\n"; ?>