Dodaj ('PAGE_TITLE' , strip($index_meta['page_title']) ); $index -> Dodaj ('META_KEY' , strip($index_meta['page_key']) ); $index -> Dodaj ('META_DESC' , strip($index_meta['page_desc']) ); $index_page_obj = new Template ("template/index-page.html"); $check = "SELECT cid FROM " . TABLE_CATEGORIES . " "; $count = mysql_num_rows ( mysql_query ($check)); $count_rows = ceil($count/2); $get = "SELECT * FROM " . TABLE_CATEGORIES . " ORDER BY cat_name ASC LIMIT 0,$count_rows "; $query = mysql_query ($get) or die (mysql_error()); while ($res = mysql_fetch_array ($query)){ $get_count = "SELECT sid FROM " . TABLE_SITES . " WHERE cid = '" . $res['cid'] . "' "; $count_sites = mysql_num_rows ( mysql_query ($get_count)); $row1 .= '
  • (' . $count_sites . ') ' . strip($res['cat_name']) . '
  • '; } $page_obj = new Template ("template/index-categories.html"); $page_obj -> Dodaj ('ROW' , $row1 ); $page_obj -> Dodaj ('N' , '1' ); $page .= $page_obj -> Tworz(); $get = "SELECT * FROM " . TABLE_CATEGORIES . " ORDER BY cat_name ASC LIMIT $count_rows,$count "; /* $get = "SELECT count(s.sid) as count_sid, c.* FROM " . TABLE_CATEGORIES . " c, " . TABLE_SITES . " s WHERE s.cid = c.cid GROUP BY cid, cat_name LIMIT $count_rows,$count "; */ $query = mysql_query ($get) or die (mysql_error()); while ($res = mysql_fetch_array ($query)){ $get_count = "SELECT sid FROM " . TABLE_SITES . " WHERE cid = '" . $res['cid'] . "' "; $count_sites = mysql_num_rows ( mysql_query ($get_count)); $row2 .= '
  • (' . $count_sites . ') ' . strip($res['cat_name']) . '
  • '; } $page_obj = new Template ("template/index-categories2.html"); $page_obj -> Dodaj ('ROW' , $row2 ); $page_obj -> Dodaj ('N' , '2' ); $page .= $page_obj -> Tworz(); $index_page_obj -> Dodaj ('PAGE' , $page ); $index_page_obj -> Dodaj ('INDEX_TEXT' , $index_meta['index_text'] ); // $index_page_obj -> Dodaj ('PAGE' , $page ); $index_page .= $index_page_obj -> Tworz(); $index -> Dodaj ('OVERALL_PAGE' , $index_page ); $index -> Dodaj ('FOOT_TXT' , $index_meta['footer_text'] ); $adds_txt = strip ( file_get_contents ("adds_txt.txt")); $index -> Dodaj ('ADDS_TXT' , $adds_txt ); $get = "SELECT sid FROM " . TABLE_SITES . " "; $count = mysql_num_rows ( mysql_query ($get)); $index -> Dodaj ('COUNT_SITES' , $count ); $index -> Tworz(); $index -> Wyswietl(); ?>