blog->settings->__get(basename(dirname('../' . __DIR__))); # Not active if (!$s->zoneclearFeedServer_active) { self::p404(); return null; } # Update feeds (from ajax or other post resquest) if ($args == '/zcfsupd' && 3 == $s->zoneclearFeedServer_bhv_pub_upd) { $msg = ''; if (!empty($_POST['blogId']) && html::escapeJS(dcCore::app()->blog->id) == $_POST['blogId']) { try { $zc = new zoneclearFeedServer(); if ($zc->checkFeedsUpdate()) { $msg = sprintf( '%ss%', 'ok', 'Feeds updated successfully' ); } } catch (Exception $e) { } } if (empty($msg)) { $msg = sprintf( '%ss%', 'failed', 'Failed to update feeds' ); } header('Content-Type: application/xml; charset=UTF-8'); echo ' ' . "\n" . '' . "\n" . $msg . "\n" . ''; exit(1); # Server js } elseif ($args == '/zcfsupd.js' && 3 == $s->zoneclearFeedServer_bhv_pub_upd) { dcCore::app()->tpl->setPath(dcCore::app()->tpl->getPath(), __DIR__ . '/default-templates'); self::serveDocument( 'zcfsupd.js', 'text/javascript', false, false ); # Server feeds description page } elseif (in_array($args, ['', '/']) && $s->zoneclearFeedServer_pub_active) { $tplset = dcCore::app()->themes->moduleInfo(dcCore::app()->blog->settings->system->theme, 'tplset'); $path = __DIR__ . '/default-templates/'; if (!empty($tplset) && is_dir($path . $tplset)) { dcCore::app()->tpl->setPath(dcCore::app()->tpl->getPath(), $path . $tplset); } else { dcCore::app()->tpl->setPath(dcCore::app()->tpl->getPath(), $path . DC_DEFAULT_TPLSET); } self::serveDocument('zcfeeds.html'); } # Unknow else { self::p404(); } return null; } }