*/ extract($_SERVER); extract($_REQUEST); //error_reporting(E_ALL); //ini_set('error_reporting', E_ALL); //ini_set("display_errors", 1); function wojtus_dsp($nr,$ile) { global $max, $aktualny; if ($nr == $aktualny) echo "[".$nr."]"; else echo "[$nr]"; for ($a=0; $a<$ile; $a++) echo " "; return(0); } $bn_action="list"; $bn_action_mode="L"; require ("./init.inc"); $header_footer = ($bn_frames==0) ? true : false; /* Execute before_access program */ if ($bn_before_access) { include "$bn_dir/$bn_before_access"; } display_header ("List", $header_footer); echo "
"; Dspmsg (83); DspMsg (11); $first=(isset($first)) ? $first : 0; $last=(isset($last)) ? $last : 0; $sort=(isset($sort)) ? stripSlashes($sort) : ""; $where=(isset($where)) ? stripSlashes($where) : ""; if ($bn_cookies && isSet($cookies->s_cookies["LastVisit"]) && ($expnd=="new") ) { $where = "unixdate > " . $cookies->s_cookies["LastVisit"]; } if ( ($last>0) && ($first>0) ) { $bn_maxthreads=0; } if (!empty ($sort) || !empty($where) ) { $ret = $db->listNotes ($bn_db, $first, $last, $sort, $where); } else $ret = $db->listThreads ($bn_db, $first, $last); if (!is_array ($ret) || ($ret < 0)) { echo "
"; DspMsg (6); echo "
"; } elseif ($ret["total"] == 0) { $total = $ret["total"]; echo "
"; DspMsg (16); echo "
"; } else { $last= $ret["last"]; $first = $ret["first"]; $l=addSlashes(stripSlashes($bn_list_header)); eval ("echo stripSlashes(\"$l\");"); $db->getChild (0, "list"); $l=addSlashes(stripSlashes($bn_list_footer)); eval ("echo stripSlashes(\"$l\");"); if (!isset($ret["prev"])) $ret["prev"] = 0; if (!isset($ret["next"])) $ret["next"] = 0; if ( ($ret["prev"] || $ret["next"]) && ($bn_action!="list") ){ echo "
"; if ($ret["prev"]) { $help=msg(65); displayURL ("$WA_SELF?bn=$bn&expnd=$expnd&last=$first&sort=$sort&where=$where", "", "$help", $help); } echo ""; if ($ret["next"]) { $help=msg(66); displayURL ("$WA_SELF?bn=$bn&expnd=$expnd&first=$last&sort=$sort&where=$where", "", " $help", $help); } echo "
\n"; } } // Wojtus was here ;-) // threads - ile wyswietlonych // tlist - ilosc wszystkich $max=12; if ($bn_action == "list") { //echo '$ret["tlist"]='.$ret["tlist"].'
'; //echo 'max='.$max.'
'; $b=$ret["tlist"]%$max; //echo 'b='.$b.'
'; $a=($ret["tlist"]-$b)/$max; $max_str=$a+1; //echo 'a='.$a.'
'; if ($b != 0) $a++; $ile_stron=$a; $aktualny=$ret["aktualny"]; //echo '$ret["aktualny"]='.$ret["aktualny"].'
'; echo "  Strona $aktualny z $ile_stron. NastÄ™pne strony:   "; wojtus_dsp(1,2); $max_a=5; $b=$max_a; if ($ile_stron <= $max_a) $b=$max_a; if ($ile_stron == ($max_a+1)) $b=$max_a+1; if ($ile_stron <=$b) { for ($a=2; $a<=$ile_stron; $a++) wojtus_dsp($a,2); } else { //echo "...  "; $r=$ile_stron-$aktualy; //echo 'r='.$r.'
'; echo 'max_a='.$max_a.'
'; if ($r >= $max_a) $b=$max_a; else $b=$r; //echo 'b='.$b.'
'; for ($a=0; $a<$b; $a++) { if (($ile_stron)>($aktualny+$a)) { if ($b == $max_a) wojtus_dsp(($aktualny+$a)+1,2); else wojtus_dsp($aktualny+$a,2); } } //if (($ile_stron)>($aktualny+$a)) echo "  ..."; } } # Display form if option set # ---------------------------- if ($bn_list_post) { $setUserField = true; // Set username and password in form fields $mail_reply = 1; // set default to checked in the form $form_action = "./insert.$ext"; $bn_action="post"; $back_form="list"; $bn_popup=0; # Execute before_access program # ----------------------------- if ($bn_before_access) { include "$bn_dir/$bn_before_access"; } # allows user to set a password so that he can later edit/delete his message # -------------------------------------------------------------------------- if ( $bn_modify || $bn_delete ) { $checkPassword = true; } include "$inc_dir/form.$ext"; } display_footer ($header_footer); ?>