include 'header.php'; $PageTitle = $Config["SiteName"]; $LastAdvImage = ""; $result = Adv::Select ( "10", "where AdvType = '0' and Photo <> '' " ); if ($result != 0) { while ( $result_fetch = mysql_fetch_array ( $result ) ) { extract ( $result_fetch ); $LastAdvImage .= Templates::Template_Array ( t_path . "lastAdvImage.html", 0 ); } } $FixedAdvs = ""; $result = Adv::Select ( "0", "where AdvType = '0' and Fix='1' " ); if ($result != 0) { while ( $result_fetch = mysql_fetch_array ( $result ) ) { extract ( $result_fetch ); $CityName = City::SelectName($CityID); $AdvMemberName = Member::SelectName($MemberID); $DDate = Util::DiffTime($Date); $HasPhoto = ""; if($Photo != "") $HasPhoto = Templates::Template_Array ( t_path . "eachadv.html", 1 ); $FixedAdvs .= Templates::Template_Array ( t_path . "eachadv.html", 2 ); //echo $FixedAdvs; } } $page = 0; if (isset ( $_GET ['page'] )) $page = $_GET ['page']; $pagenow = $page + 1; $CViewPage = 20; $fromNo = 0; $toNo = 0; $fromNo = $page * $CViewPage; $toNo = $fromNo + ($CViewPage - 1); $LastAdvs = ""; $result = Adv::Select ( "0", "where AdvType = '0' and Fix='0' " ); if ($result != 0) { $pageCount = mysql_num_rows ( $result ); if (($pageCount % $CViewPage) != 0) $pages = floor ( ($pageCount / $CViewPage) ) + 1; else $pages = ($pageCount / $CViewPage); $lastpage = $pages - 1; if ($page < 1) $disPrev = "none"; else { $disPrev = ""; $PrevPage = $page - 1; $lnkPrev = "?page=$PrevPage"; } if (($page == ($pages - 1)) || $pages == 1) { $disNext = "none"; } else { $disNext = ""; $PageNext = $page + 1; $lnkNext = "?page=$PageNext"; } $numbers = ""; $numbers .= Templates::Template_Array ( t_path . "numbers.html", 0 ); $pageNo = 0; $x = 0; $i = 0; while ( $result_fetch = mysql_fetch_array ( $result ) ) { extract ( $result_fetch ); if ($x >= $fromNo && $x <= $toNo) { $CityName = City::SelectName($CityID); $AdvMemberName = Member::SelectName($MemberID); $DDate = Util::DiffTime($Date); $CommentCount = ""; $CCount = Comment::Count(" where AdvID=$ID "); if($CCount > 0) $CommentCount = "$CCount "; $HasPhoto = ""; if($Photo != "") $HasPhoto = Templates::Template_Array ( t_path . "eachadv.html", 1 ); $LastAdvs .= Templates::Template_Array ( t_path . "eachadv.html", 0 ); } if ($x % $CViewPage == 0 && $x != 0) { $selectStyle = ""; $selected = 1; if ($page == $pageNo) { $selectStyle = "active"; $selected = 0; } if ($pageNo == 0) { $num = $pageNo + 1; $lnk = "?page=$pageNo"; $numbers .= Templates::Template_Array ( t_path . "numbers.html", 1 ); $pageNo ++; $selectStyle = ""; } if ($page == $pageNo && $selected == 1) { $selectStyle = "active"; } $num = $pageNo + 1; $lnk = "?page=$pageNo"; $numbers .= Templates::Template_Array ( t_path . "numbers.html", 1 ); $pageNo ++; } $x ++; } $numbers .= Templates::Template_Array ( t_path . "numbers.html", 2 ); } $LastAdvsRequest = ""; $result = Adv::Select ( "10", "where AdvType = '1' " ); if ($result != 0) { while ( $result_fetch = mysql_fetch_array ( $result ) ) { extract ( $result_fetch ); $CityName = City::SelectName($CityID); $AdvMemberName = Member::SelectName($MemberID); $DDate = Util::DiffTime($Date); $HasPhoto = ""; if($Photo != "") $HasPhoto = Templates::Template_Array ( t_path . "eachadv.html", 1 ); $LastAdvsRequest .= Templates::Template_Array ( t_path . "eachadv.html", 0 ); } } $temp = new Templates ( t_path . "main.html" ); $temp->template ( t_path . "main.html" ); eval ( $templates ); $sub = $templates; include 'footer.php'; ?>