templateName = "./templatepage.html"; $master->content["Lang_Bar"] = $lang_bar; $master->content["Menu"] = $menu; $master->content["Lang"] = $lang; $master->content["Description"] = $text_title[28]; $master->content["Keywords"] = $text_title[29]; $master->content["Charset"] = get_charset($lang); // ======================================== $master->content["Sign"] = "sign_".$lang."_drugi"; $master->title = $text_title[2]; if ($translation == 1) // TITLE $a = $a."Page title: ".$text_title[2]."


"; $a = $a."

".$text[0][1].""; if ($translation==1) { $a = $a." "; } $a = $a."




"; $a = $a.""; $drugi_pages = get_col_amount_massive($res_width); $pos_per_page = $drugi_pages["Drugi_col"]; // сколько колонок с фотками соседей на странице $pic_per_page = $drugi_pages["Drugi_pic"]; // сколько всего картинок с фотками будет на странице $counter = 1; $max_columns = $pos_per_page; $autocounter = 1; $query = "SELECT * FROM Friends ORDER BY Ordernum ASC"; $result = mysqli_query($query) or die ("Ошибка выполнения запроса: ".mysqli_error()); while ($row = mysqli_fetch_array ($result)) { $id_friend[$autocounter] = $row ['ID_Friend']; $url[$autocounter] = $row ['URL']; $sh[$autocounter] = $row ['Screenshot']; $id_country = $row ['ID_Country']; $flag[$autocounter] = flag($id_country); $autocounter++; } $c = count($text); for ($z=0;$z<$autocounter;$z++) { if ($counter == 1) $a = $a.""; if ( ($counter > 1) && ($counter <= $max_columns) ) { for ($x=0;$x<=$c;$x++) { if ($text[$x][0] == $id_friend[$z]) { $text2 = $text[$x][1]; $mark2 = $text[$x][0]; } } $a = $a.""; } if ($counter == $max_columns) { $a = $a.""; $counter = 1; } $counter++; } $a = $a."
".$text2; if ($translation==1) { $a = $a." "; } $a = $a."

"; // выводим результат $master->content["Content"] = $a; $master->Fill(); function flag($country) { $query = "SELECT Domain FROM `Countries` WHERE ID_Country=".$country.""; $result = mysqli_query ($query) or die ("Ошибка выполнения запроса: ".mysqli_error()); while ($row = mysqli_fetch_array ($result)) $flag = $row ['Domain']; $flag = $flag.".png"; return $flag; //флаг страны } ?>