function apply() { //Ilo¶æ pozycji w kategorii if ($this->id) { if ($this->old_cat != $this->data['cat']) { SetItems($this->old_cat, -1); if ($this->data['access'] == 1) { SetItems($this->data['cat'], 1); } } else { if ($this->old['access'] > $this->data['access']) { SetItems($this->old_cat, 1); } if ($this->old['access'] < $this->data['access']) { SetItems($this->old_cat, -1); } } } else { if ($this->data['access'] == 1) { SetItems($this->data['cat'], 1); } } #Najnowsze Latest(); #OK try { global $db; $db->commit(); return true; } catch (PDOException $e) { throw new Exception($e->errorInfo[2]); } }
<?php if (iCMSa != 1 || !admit('CFG')) { exit; } #Update links if (isset($_SESSION['renew'])) { try { require './lib/mcache.php'; require './lib/categories.php'; RenderMenu(); Latest(); RSS(); if (function_exists('glob') && ($glob = glob('cache/cat*.php'))) { foreach ($glob as $x) { unlink($x); } } unset($_SESSION['renew'], $glob, $x); include './admin/config.php'; return 1; } catch (Exception $e) { $view->info($lang['saved']); } } #Save if ($_POST) { $opt = array('url' => $_POST['url'], 'path' => $_POST['path'], 'nice' => (int) $_POST['nice']); require './lib/config.php'; $f = new Config('db'); try {