<?php /** * phpwcms content management system * * @author Oliver Georgi <*****@*****.**> * @copyright Copyright (c) 2002-2015, Oliver Georgi * @license http://opensource.org/licenses/GPL-2.0 GNU GPL-2 * @link http://www.phpwcms.de * **/ // ---------------------------------------------------------------- // obligate check for phpwcms constants if (!defined('PHPWCMS_ROOT')) { die("You Cannot Access This Script Directly, Have a Nice Day."); } // ---------------------------------------------------------------- // ensure max allowed packet is big enough _dbSetVar('max_allowed_packet', 16 * 1024 * 1024, '<'); // Form $SQL .= "acontent_form=" . _dbEscape(serialize($content['form'])) . " ";
function get_struct_data($root_name = '', $root_info = '') { //returns the complete active and public struct data as array //so it is reusable by many menu functions -> lower db access // first check pre-rendered structure for current user mode $sysvalue_key = 'structure_array_vmode_' . get_user_vmode(); $data = _getConfig($sysvalue_key); if (is_array($data)) { return $data; } global $db; global $indexpage; $data = array(); $data[0] = array("acat_id" => 0, "acat_name" => $indexpage['acat_name'], "acat_info" => $indexpage['acat_info'], "acat_struct" => 0, "acat_sort" => 0, "acat_hidden" => intval($indexpage['acat_hidden']), "acat_regonly" => intval($indexpage['acat_regonly']), "acat_ssl" => intval($indexpage['acat_ssl']), "acat_template" => intval($indexpage['acat_template']), "acat_alias" => $indexpage['acat_alias'], "acat_topcount" => intval($indexpage['acat_topcount']), "acat_maxlist" => intval($indexpage['acat_maxlist']), "acat_redirect" => $indexpage['acat_redirect'], "acat_order" => intval($indexpage['acat_order']), "acat_timeout" => $indexpage['acat_timeout'], "acat_nosearch" => $indexpage['acat_nosearch'], "acat_nositemap" => $indexpage['acat_nositemap'], "acat_permit" => !empty($indexpage['acat_permit']) && is_array($indexpage['acat_permit']) ? $indexpage['acat_permit'] : array(), "acat_pagetitle" => empty($indexpage['acat_pagetitle']) ? '' : $indexpage['acat_pagetitle'], "acat_paginate" => empty($indexpage['acat_paginate']) ? 0 : 1, "acat_overwrite" => empty($indexpage['acat_overwrite']) ? '' : $indexpage['acat_overwrite'], "acat_archive" => empty($indexpage['acat_archive']) ? 0 : 1, "acat_class" => empty($indexpage['acat_class']) ? '' : $indexpage['acat_class'], "acat_keywords" => empty($indexpage['acat_keywords']) ? '' : $indexpage['acat_keywords'], "acat_disable301" => empty($indexpage['acat_disable301']) ? 0 : 1, "acat_opengraph" => isset($indexpage['acat_opengraph']) ? $indexpage['acat_opengraph'] : 1, "acat_canonical" => empty($indexpage['acat_canonical']) ? '' : $indexpage['acat_canonical']); $sql = "SELECT * FROM " . DB_PREPEND . "phpwcms_articlecat WHERE "; // VISIBLE_MODE: 0 = frontend (all) mode, 1 = article user mode, 2 = admin user mode if (VISIBLE_MODE != 2) { // for 0 AND 1 $sql .= "acat_aktiv=1 AND "; } $sql .= "acat_trash=0 ORDER BY acat_struct, acat_sort"; if ($result = mysql_query($sql, $db)) { while ($row = mysql_fetch_assoc($result)) { $data[$row["acat_id"]] = array("acat_id" => $row["acat_id"], "acat_name" => $row["acat_name"], "acat_info" => $row["acat_info"], "acat_struct" => $row["acat_struct"], "acat_sort" => $row["acat_sort"], "acat_hidden" => $row["acat_hidden"], "acat_regonly" => $row["acat_regonly"], "acat_ssl" => $row["acat_ssl"], "acat_template" => $row["acat_template"], "acat_alias" => $row["acat_alias"], "acat_topcount" => $row["acat_topcount"], "acat_maxlist" => $row["acat_maxlist"], "acat_redirect" => $row["acat_redirect"], "acat_order" => $row["acat_order"], "acat_timeout" => $row["acat_cache"], "acat_nosearch" => $row["acat_nosearch"], "acat_nositemap" => $row["acat_nositemap"], "acat_permit" => empty($row["acat_permit"]) ? array() : explode(',', $row["acat_permit"]), "acat_pagetitle" => $row["acat_pagetitle"], "acat_paginate" => $row["acat_paginate"], "acat_overwrite" => $row["acat_overwrite"], "acat_archive" => $row["acat_archive"], "acat_class" => $row["acat_class"], "acat_keywords" => $row["acat_keywords"], "acat_disable301" => $row["acat_disable301"], "acat_opengraph" => $row["acat_opengraph"], "acat_canonical" => $row["acat_canonical"]); } mysql_free_result($result); } // set max_allowed_package to bigger value _dbSetVar('max_allowed_packet', 16 * 1024 * 1024, '<'); // store pre-rendered serialized array in database _setConfig($sysvalue_key, $data, 'frontend_render', 1); return $data; }