Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
Значит теперь ты знаешь за что они отвечают. Так какая версия php?в догонку : а когда я закоментарил проблемные строки , скрипт перестал выводить разделы
function fid_tree ($fid, $tree, $a){
$loopcode = '';
function DrawChilds($code, $a) {
if (is_array($a) && sizeof($a) > 0) {
foreach($a as $row) {
$tempcode = $code;
foreach ($row as $key => $value) {
if (!is_array($value)) $tempcode = str_replace('{'.$key.'}',$value, $tempcode);
if (strpos($tempcode,"<if $key") !== false ) {
if ($value) {
$tempcode=preg_replace("|<if $key>(.*)</if $key>|Ums", "\\1",$tempcode);
$tempcode=preg_replace("|<if \!$key>(.*)</if \!$key>|Ums", "",$tempcode);
} else {
$tempcode=preg_replace("|<if $key>(.*)</if $key>|Ums","",$tempcode);
$tempcode=preg_replace("|<if \!$key>(.*)</if \!$key>|Ums", "\\1",$tempcode);
}
}
}
$childs = DrawChilds($code, $row["childs"]);
$result .= str_replace("<childs>", $childs, $tempcode);
}
return $result;
} else {
return "";
}
}
$n = count($a);
if (!is_array($a) || !preg_match_all("/<tree $tree>(.*)<\/tree $tree>/Ums", $this->files[$fid], $rec, PREG_SET_ORDER)) {
preg_replace("/<tree $tree>(.*)<\/tree $tree>/Ums", "", $this->files[$fid]);
return;
}
foreach($rec as $child) {
$this->files[$fid] = str_replace($child[0], DrawChilds($child[1], $a), $this->files[$fid]);
}
}
function fid_tree ($fid, $tree, $a){
$loopcode = '';
$n = count($a);
if (!is_array($a) || !preg_match_all("/<tree $tree>(.*)<\/tree $tree>/Ums", $this->files[$fid], $rec, PREG_SET_ORDER)) {
preg_replace("/<tree $tree>(.*)<\/tree $tree>/Ums", "", $this->files[$fid]);
return;
}
foreach($rec as $child) {
$this->files[$fid] = str_replace($child[0], Template::DrawChilds($child[1], $a), $this->files[$fid]);
}
}
function DrawChilds($code, $a) {
if (is_array($a) && sizeof($a) > 0) {
foreach($a as $row) {
$tempcode = $code;
foreach ($row as $key => $value) {
if (!is_array($value)) $tempcode = str_replace('{'.$key.'}',$value, $tempcode);
if (strpos($tempcode,"<if $key") !== false ) {
if ($value) {
$tempcode=preg_replace("|<if $key>(.*)</if $key>|Ums", "\\1",$tempcode);
$tempcode=preg_replace("|<if \!$key>(.*)</if \!$key>|Ums", "",$tempcode);
} else {
$tempcode=preg_replace("|<if $key>(.*)</if $key>|Ums","",$tempcode);
$tempcode=preg_replace("|<if \!$key>(.*)</if \!$key>|Ums", "\\1",$tempcode);
}
}
}
$childs = Template::DrawChilds($code, $row["childs"]);
$result .= str_replace("<childs>", $childs, $tempcode);
}
return $result;
} else {
return "";
}
}
php_flag zend.ze1_compatibility_mode on
<?
ini_set('zend.ze1_compatibility_mode', true);
?>
ERROR!!!
SELECT menu.*, m1.menu_name as menu_owner_name, IF(m1.menu_name IS NULL, 'Первый уровень', m1.menu_name) as menu_owner_name, m1.menu_id as owner_id FROM menu LEFT JOIN menu as m1 ON (m1.menu_id=menu.menu_owner) WHERE menu.menu_id=2
return mysql_query($query);
$result = mysql_query($query);
if (!$result) {
echo mysql_error();
}
return $result;
switch(true) {
case $action == "edit":
if ($_GET["menu_id"] > 0) {
$action = $lang["caption_editing_item"];
if (empty($ErrorMessage)) {
вот здесь ошибка -> $query="SELECT menu.*, m1.menu_name as menu_owner_name, IF(m1.menu_name IS NULL, 'Первый уровень', m1.menu_name) as menu_owner_name, m1.menu_id as owner_id FROM menu LEFT JOIN menu as m1 ON (m1.menu_id=menu.menu_owner) WHERE menu.menu_id=".$_GET["menu_id"];
$result = @$db->query ($query) or die ("<p><b>ERROR!!!</b></p><BR>".$query."<BR>");
$menu = $db ->fetch($db->query($query));
} else {
$menu = $_POST;
$ifs["ErrorMessage"] = true;
$query = "SELECT menu_id as menu_owner, menu_name as menu_owner_name FROM menu WHERE menu_id = ".$_POST["menu_owner"];
$menu = array_merge($menu, $db->fetch($db->query($query)));
}
$crlf2 = chr(13).chr(10);
$crlf = chr(10);
$menu["menu_content"] = htmlspecialchars($menu["menu_content"]);
} else {
$action = $lang["caption_adding_item"];
if (empty($ErrorMessage)) {
$_GET["menu_owner"] = ($_GET["menu_owner"] > 0) ? $_GET["menu_owner"] : 1;
$query = "SELECT menu_id as menu_owner, menu_name as menu_owner_name FROM menu WHERE menu_id = ".$_GET["menu_owner"];
$menu = $db ->fetch($db->query($query));
} else {
$menu = $_POST;
foreach($menu as $key => $value) {
if (get_magic_quotes_gpc()) $menu[$key] = stripslashes($value);
$menu[$key] = convert($menu[$key], q);
}
$ifs["ErrorMessage"] = true;
$query = "SELECT menu_id as menu_owner, menu_name as menu_owner_name FROM menu WHERE menu_id = ".$_POST["menu_owner"];
$menu = array_merge($menu, $db->fetch($db->query($query)));
}
}
$menu["menu_full_edit"] = $menu["menu_id"] < 1 || $menu["menu_id"] > 4;
$menu["menu_dir_edit"] = $menu["menu_owner"] == 0 || ($menu["menu_id"] > 0 && $menu["menu_id"] < 6);
$menu["menu_content"] = str_replace("{DOWNLOAD_IMAGES_DIR_HTTP}", DOWNLOAD_IMAGES_DIR_HTTP, $menu["menu_content"]);
$menu["menu_content"] = str_replace("{HTTP_ROOT}", HTTP_ROOT, $menu["menu_content"]);
$tpl->fid_load("content", "menu.edit.html", "referer, action,ErrorMessage,HOST,HTTP_ROOT");
$tpl->fid_array("content", $menu, true);
//$tpl->fid_select("content", "menu_order", $order, $menu["menu_order"]);
break;
case $action == "access":
$action = "Права доступа для групп";
$ErrorMessage = "Указанный раздел меню не существует!";
if ($_GET["menu_id"] > 0) {
$menu = $db ->fetch($db->query ("SELECT menu.* FROM menu WHERE menu_id=".$_GET["menu_id"]));
if ($menu["menu_id"] > 0) {
$action .= " к странице \"".$menu["menu_name"]."\"";
$users_groups = $db->fetchall($db->query("select users_groups.users_groups_id, users_groups_name, IF(users_groups_access.menu_id IS NULL, '', 'selected') as selected from users_groups left join users_groups_access on (users_groups_access.users_groups_id = users_groups.users_groups_id and users_groups_access.menu_id = ".$_GET["menu_id"].") order by users_groups_name"));
$ErrorMessage = "";
}
}
$tpl->fid_load("content", "menu.access.html", "referer,action,ErrorMessage");
if (empty($ErrorMessage)) {
$tpl->fid_array("content", $menu);
$tpl->fid_loop("content", "users_groups", $users_groups);
}
$tpl->fid_if("content", Array("ErrorMessage" => !empty($ErrorMessage), "!ErrorMessage" => empty($ErrorMessage)));
break;
default:
$count_items = $db ->fetch($db->query("SELECT count(menu_id) as num FROM menu"), 0);
$action = "Список разделов";
$tpl->fid_load("content", "menu.items.html", "action,pages,page,count_items,HTTP_ROOT");
$level = 0;
$menu = GetData($level, 0);
$ifs["add"] = ($menu_id != 1);
$ifs["items"] = (is_array($menu) && sizeof($menu) > 0);
if (is_array($menu)) $tpl->fid_tree("content", "menu", $menu);
break;
}