/** * Saves the meta tags for the page * * @return @e void */ public function save() { //----------------------------------------- // Save em //----------------------------------------- /* Delete any DB entries for this page as we're about to rebuild them */ $escapedPage = $this->DB->addSlashes($this->request['url']); $this->DB->delete('seo_meta', "url='{$escapedPage}'"); /* Insert Tags */ foreach ($this->request['meta-tags-title'] as $k => $v) { if ($v) { $cache[$this->request['url']][$v] = $this->request['meta-tags-content'][$k]; $this->DB->insert('seo_meta', array('url' => $this->request['url'], 'name' => $v, 'content' => $this->request['meta-tags-content'][$k])); } } /* Rebuild Cache */ ips_CacheRegistry::instance()->rebuildCache('meta_tags'); /* Boink */ $this->registry->output->silentRedirect(ipsRegistry::$settings['base_url'] . $this->request['url']); }
/** * Action: Delete */ protected function delete() { /* Rebuild Cache */ $cache = ips_CacheRegistry::instance()->getCache('meta_tags'); unset($cache[$this->request['page']]); ips_CacheRegistry::instance()->setCache('meta_tags', serialize($cache)); /* Delete any DB entries for this page */ $page = IPSText::base64_decode_urlSafe($this->request['page']); $escapedPage = $this->DB->addSlashes($page); $this->DB->delete('seo_meta', "url='{$escapedPage}'"); /* Rebuild Cache */ $this->rebuildMetaTagCache(); /* Boink */ $this->registry->output->silentRedirect(ipsRegistry::$settings['base_url'] . "module=templates§ion=meta"); }
/** * Initiate class * * @return @e void */ private function init() { if (self::$initiated !== TRUE) { //-------------------------------- // Eaccelerator... //-------------------------------- if (function_exists('eaccelerator_get') and ipsRegistry::$settings['use_eaccelerator'] == 1) { require IPS_KERNEL_PATH . 'interfaces/interfaceCache.php'; /*noLibHook*/ require IPS_KERNEL_PATH . 'classCacheEaccelerator.php'; /*noLibHook*/ self::$cacheLib = new classCacheEaccelerator(ipsRegistry::$settings['board_url']); } else { if (function_exists('memcache_connect') and ipsRegistry::$settings['use_memcache'] == 1) { require IPS_KERNEL_PATH . 'interfaces/interfaceCache.php'; /*noLibHook*/ require IPS_KERNEL_PATH . 'classCacheMemcache.php'; /*noLibHook*/ self::$cacheLib = new classCacheMemcache(ipsRegistry::$settings['board_url'], ipsRegistry::$settings); } else { if (function_exists('xcache_get') and ipsRegistry::$settings['use_xcache'] == 1) { require IPS_KERNEL_PATH . 'interfaces/interfaceCache.php'; /*noLibHook*/ require IPS_KERNEL_PATH . 'classCacheXcache.php'; /*noLibHook*/ self::$cacheLib = new classCacheXcache(ipsRegistry::$settings['board_url']); } else { if (function_exists('apc_fetch') and ipsRegistry::$settings['use_apc'] == 1) { require IPS_KERNEL_PATH . 'interfaces/interfaceCache.php'; /*noLibHook*/ require IPS_KERNEL_PATH . 'classCacheApc.php'; /*noLibHook*/ self::$cacheLib = new classCacheApc(ipsRegistry::$settings['board_url']); } else { if (function_exists('wincache_ucache_get') and ipsRegistry::$settings['use_wincache'] == 1) { require IPS_KERNEL_PATH . 'interfaces/interfaceCache.php'; /*noLibHook*/ require IPS_KERNEL_PATH . 'classCacheWincache.php'; /*noLibHook*/ self::$cacheLib = new classCacheWincache(ipsRegistry::$settings['board_url']); } else { if (!empty(ipsRegistry::$settings['use_diskcache'])) { require IPS_KERNEL_PATH . 'interfaces/interfaceCache.php'; /*noLibHook*/ require IPS_KERNEL_PATH . 'classCacheDiskcache.php'; /*noLibHook*/ self::$cacheLib = new classCacheDiskcache(ipsRegistry::$settings['board_url']); } } } } } } if (is_object(self::$cacheLib) and self::$cacheLib->crashed) { // There was a problem - not installed maybe? // unset(self::$cacheLib); self::$cacheLib = NULL; } $caches = array(); $_caches = array(); $_load = array(); $_pre_load = IPSDebug::getMemoryDebugFlag(); //----------------------------------------- // Get default cache list //----------------------------------------- $CACHE = ipsRegistry::_fetchCoreVariables('cache'); $_LOAD = ipsRegistry::_fetchCoreVariables('cacheload'); if (is_array($CACHE)) { foreach ($CACHE as $key => $data) { if (!empty($data['acp_only']) and IPS_AREA != 'admin') { continue; } $_caches[$key] = $CACHE; if ($data['default_load']) { $caches[$key] = $key; } } if (count($_LOAD)) { foreach ($_LOAD as $key => $one) { $_load[$key] = $key; } } } //----------------------------------------- // Get application cache list //----------------------------------------- if (IPS_APP_COMPONENT) { $CACHE = ipsRegistry::_fetchAppCoreVariables(IPS_APP_COMPONENT, 'cache'); $_LOAD = ipsRegistry::_fetchAppCoreVariables(IPS_APP_COMPONENT, 'cacheload'); if (is_array($CACHE)) { foreach ($CACHE as $key => $data) { if (!empty($data['acp_only']) and IPS_AREA != 'admin') { continue; } $_caches[$key] = $CACHE; if ($data['default_load']) { $caches[$key] = $key; } } if (count($_LOAD)) { foreach ($_LOAD as $key => $one) { $_load[$key] = $key; } } } } //----------------------------------------- // Get global caches list //----------------------------------------- if (is_file(GLOBAL_CACHE_PATH)) { $GLOBAL_CACHES = array(); include GLOBAL_CACHE_PATH; /*noLibHook*/ if (is_array($GLOBAL_CACHES) and count($GLOBAL_CACHES)) { foreach ($GLOBAL_CACHES as $key) { $_load[$key] = $key; } } } //----------------------------------------- // Add caches to the load list //----------------------------------------- if (is_array($_load) and count($_load)) { foreach ($_load as $key) { $caches[$key] = $key; } } //----------------------------------------- // Load 'em //----------------------------------------- self::_loadCaches($caches); } self::$initiated = TRUE; }
/** * Action: Clear Warnings */ public function clearWarnings() { ips_CacheRegistry::instance()->setCache('ipseo_ignore_messages', array(), array('array' => 1)); $this->registry->output->silentRedirect(ipsRegistry::$settings['base_url'] . "module=seo"); }