/** * Mark all forums and topics as read * * @access public * @return void */ public function markBoardAsRead() { //----------------------------------------- // Check //----------------------------------------- if ($this->request['k'] != $this->member->form_hash) { $this->registry->getClass('output')->showError('no_permission', 20312); } /* Turn off instant updates and write back tmp markers in destructor */ $this->registry->classItemMarking->disableInstantSave(); //----------------------------------------- // Reset board markers //----------------------------------------- $apps = new IPSApplicationsIterator(); foreach ($apps as $app) { if ($apps->isActive()) { $this->registry->classItemMarking->markAppAsRead($apps->fetchAppDir()); } } $this->registry->getClass('output')->silentRedirect($this->settings['base_url'] . 'act=idx', 'false'); }
/** * Generate XML Archive for skin set * * @access public * @param int Skin set ID * @param boolean Modifications in this set only * @param array [Array of apps to export from. Default is all] * @return string XML */ public function generateSetXMLArchive($setID = 0, $setOnly = FALSE, $appslimit = null) { //----------------------------------------- // INIT //----------------------------------------- $templates = array(); $csss = array(); $replacements = ""; $css = ""; $setData = $this->fetchSkinData($setID); //----------------------------------------- // Reset handlers //----------------------------------------- $this->_resetErrorHandle(); $this->_resetMessageHandle(); //----------------------------------------- // First up... fetch templates //----------------------------------------- $apps = new IPSApplicationsIterator(); foreach ($apps as $app) { if (is_array($appslimit) and !in_array($apps->fetchAppDir(), $appslimit)) { continue; } if ($apps->isActive()) { $templates[$apps->fetchAppDir()] = $this->generateTemplateXML($apps->fetchAppDir(), $setID, $setOnly); $csss[$apps->fetchAppDir()] = $this->generateCSSXML($apps->fetchAppDir(), $setID, $setOnly); } } //----------------------------------------- // Replacements //----------------------------------------- $replacements = $this->generateReplacementsXML($setID, $setOnly); //----------------------------------------- // Information //----------------------------------------- $info = $this->generateInfoXML($setID); //----------------------------------------- // De-bug //----------------------------------------- foreach ($templates as $app_dir => $templateXML) { IPSDebug::addLogMessage("Template Export: {$app_dir}\n" . $templateXML, 'admin-setExport'); } foreach ($csss as $app_dir => $cssXML) { IPSDebug::addLogMessage("CSS Export: {$app_dir}\n" . $cssXML, 'admin-setExport'); } IPSDebug::addLogMessage("Replacements Export:\n" . $replacements, 'admin-setExport'); IPSDebug::addLogMessage("Info Export:\n" . $info, 'admin-setExport'); //----------------------------------------- // Create new XML archive... //----------------------------------------- require_once IPS_KERNEL_PATH . 'classXMLArchive.php'; $xmlArchive = new classXMLArchive(); # Templates foreach ($templates as $app_dir => $templateXML) { $xmlArchive->add($templateXML, "templates/" . $app_dir . ".xml"); } # CSS foreach ($csss as $app_dir => $cssXML) { $xmlArchive->add($cssXML, "css/" . $app_dir . ".xml"); } # Replacements $xmlArchive->add($replacements, "replacements.xml"); # Information $xmlArchive->add($info, 'info.xml'); return $xmlArchive->getArchiveContents(); }
/** * Method constructor * * @access public * @param object Registry Object * @return void */ public function __construct(ipsRegistry $registry) { $_NOW = IPSDebug::getMemoryDebugFlag(); /* Make object */ $this->registry = $registry; $this->DB = $this->registry->DB(); $this->settings =& $this->registry->fetchSettings(); $this->request =& $this->registry->fetchRequest(); $this->member = $this->registry->member(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->cache = $this->registry->cache(); $this->caches =& $this->registry->cache()->fetchCaches(); /* Task? */ if (IPS_IS_TASK === TRUE) { return; } /* Search engine? */ if ($this->member->is_not_human === TRUE) { return; } /* Use cookie marking for guests */ if (!$this->memberData['member_id']) { $this->settings['topic_marking_enable'] = 0; } /* Build */ $this->memberData['item_markers'] = $this->_generateIncomingItemMarkers(); /* Generate last saved time */ $this->_lastSaved = time(); /* Set Up */ if (is_array($this->memberData['item_markers'])) { foreach ($this->memberData['item_markers'] as $app => $key) { foreach ($this->memberData['item_markers'][$app] as $key => $data) { if ($app and $key) { if ($data['item_last_saved']) { $data['item_last_saved'] = intval($data['item_last_saved']); if ($data['item_last_saved'] < $this->_lastSaved) { $this->_lastSaved = $data['item_last_saved']; } } $this->_itemMarkers[$app][$key] = $data; } } } } /* Fetch cookies */ $apps = new IPSApplicationsIterator(); foreach ($apps as $app) { if ($apps->isActive()) { $_app = $apps->fetchAppDir(); $_value = IPSCookie::get('itemMarking_' . $_app); $_value2 = IPSCookie::get('itemMarking_' . $_app . '_items'); $this->_cookie['itemMarking_' . $_app] = is_array($_value) ? $_value : array(); $this->_cookie['itemMarking_' . $_app . '_items'] = is_array($_value2) ? $_value2 : array(); /* Clean up */ if (is_array($this->_cookie['itemMarking_' . $_app . '_items'])) { $_items = is_array($this->_cookie['itemMarking_' . $_app . '_items']) ? $this->_cookie['itemMarking_' . $_app . '_items'] : unserialize($this->_cookie['itemMarking_' . $_app . '_items']); $this->_cookieCounter = 0; arsort($_items, SORT_NUMERIC); $_newData = array_filter($_items, array($this, 'arrayFilterCookieItems')); $this->_cookie['itemMarking_' . $_app . '_items'] = $_newData; IPSDebug::addMessage('Cookie loaded: itemMarking_' . $_app . '_items' . ' - ' . serialize($_newData)); IPSDebug::addMessage('Cookie loaded: itemMarking_' . $_app . ' - ' . serialize($_value)); } } } IPSDebug::setMemoryDebugFlag("Topic markers initialized", $_NOW); }