function createMap() { global $database, $db; func::mkpath($this->cacheDir); if (!is_dir($this->cacheDir) || !is_writable($this->cacheDir)) return false; requireComponent('LZ.PHP.XMLStruct'); requireComponent('LZ.PHP.XMLWriter'); $case = array(); $program = array(); $xmls = new XMLStruct; $db->query("SELECT domain, program FROM {$database['prefix']}Exports WHERE status='on' ORDER BY id ASC"); // 활성화 된 플러그인 목록 while ($data = $db->fetch()) { if (!$xmls->openFile(ROOT . '/exports/'. $data->program . '/index.xml')) continue; for ($i=1; $func=$xmls->getValue("/export/binding/listener[$i]"); $i++) { $action = $xmls->getAttribute("/export/binding/listener[$i]", 'action'); if (!isset($case[$data->domain])) $case[$data->domain] = array(); if (!isset($program[$data->domain])) $program[$data->domain] = $data->program; array_push($case[$data->domain], array("program"=>$data->program, "action"=> $action, "listener"=>$func)); } } // bloglounge $xml = new XMLFile($this->cacheDir.'/export_1.xml.php'); $xml->startGroup('map'); foreach ($case as $domain=>$binders) { $xml->startGroup('event', array('domain'=>$domain, 'program'=>$program[$domain])); foreach ($binders as $bind) { $xml->write('bind', $bind['listener'], false, array('action'=>$bind['action'])); } $xml->endGroup(); } $xml->endAllGroups(); $xml->close(); return true; }
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT) $IV = array('GET' => array('Name' => array('string'), 'Tab' => array('string', 'default' => 'about'))); require ROOT . '/library/preprocessor.php'; $targetURL = $context->getProperty('uri.host') . preg_replace('/(currentSetting)$/', 'receiveConfig', $context->getProperty('uri.folder')); $pluginName = $_GET['Name']; $tabName = $_GET['Tab']; $active = in_array($pluginName, $activePlugins); $result = handleConfig($pluginName); if (is_null($result)) { Respond::NotFoundPage(); } $xmls = new XMLStruct(); if (!$xmls->open(file_get_contents(ROOT . "/plugins/{$pluginName}/index.xml"))) { Respond::NotFoundPage(); } else { $pluginAttrs = array("link" => $xmls->getValue('/plugin/link[lang()]'), "title" => htmlspecialchars($xmls->getValue('/plugin/title[lang()]')), "version" => htmlspecialchars($xmls->getValue('/plugin/version[lang()]')), "requirements" => $xmls->doesExist('/plugin/requirements/tattertools') ? $xmls->getValue('/plugin/requirements/tattertools') : $xmls->getValue('/plugin/requirements/textcube'), "description" => htmlspecialchars($xmls->getValue('/plugin/description[lang()]')), "authorLink" => $xmls->getAttribute('/plugin/author[lang()]', 'link'), "author" => htmlspecialchars($xmls->getValue('/plugin/author[lang()]')), "license" => htmlspecialchars($xmls->getValue('/plugin/license[lang()]')), "scope" => array()); if ($xmls->doesExist('/plugin/binding/adminMenu')) { array_push($pluginAttrs['scope'], '관리자'); } if ($xmls->doesExist('/plugin/binding/tag')) { array_push($pluginAttrs['scope'], '블로그'); } if ($xmls->doesExist('/plugin/binding/center')) { array_push($pluginAttrs['scope'], '대시보드'); } if ($xmls->doesExist('/plugin/binding/listener')) { array_push($pluginAttrs['scope'], '분류없음'); } if ($xmls->doesExist('/plugin/binding/sidebar')) { array_push($pluginAttrs['scope'], '사이드바'); }
function handleConfig($plugin) { global $service, $typeSchema, $pluginURL, $pluginPath, $pluginName, $configMappings, $configVal, $adminSkinSetting; $context = Model_Context::getInstance(); $typeSchema = array('text', 'textarea', 'select', 'checkbox', 'radio'); $manifest = @file_get_contents(ROOT . "/plugins/{$plugin}/index.xml"); $xmls = new XMLStruct(); $CDSPval = ''; $i = 0; $dfVal = Setting::fetchConfigVal(getCurrentSetting($plugin)); $name = ''; $clientData = '['; $title = $plugin; if ($manifest && $xmls->open($manifest)) { $title = $xmls->getValue('/plugin/title[lang()]'); //설정 핸들러가 존재시 바꿈 $config = $xmls->selectNode('/plugin/binding/config[lang()]'); unset($xmls); if (!empty($config['.attributes']['manifestHandler'])) { $handler = $config['.attributes']['manifestHandler']; $oldconfig = $config; $context->setProperty('plugin.uri', $context->getProperty('service.path') . "/plugins/{$plugin}"); $context->setProperty('plugin.path', ROOT . "/plugins/{$plugin}"); $context->setProperty('plugin.name', $plugin); $pluginURL = $context->getProperty('plugin.uri'); // Legacy plugin support. $pluginPath = $context->getProperty('plugin.path'); $pluginName = $context->getProperty('plugin.name'); include_once ROOT . "/plugins/{$plugin}/index.php"; if (function_exists($handler)) { if (!empty($configMappings[$plugin]['config'])) { $configVal = getCurrentSetting($plugin); $context->setProperty('plugin.config', Setting::fetchConfigVal($configVal)); } else { $configVal = ''; $context->setProperty('plugin.config', array()); } $manifest = call_user_func($handler, $plugin); if (!is_null($languageDomain)) { $locale->domain = $languageDomain; } } $newXmls = new XMLStruct(); if ($newXmls->open($manifest)) { unset($config); $config = $newXmls->selectNode('/config[lang()]'); } unset($newXmls); } if (is_null($config['fieldset'])) { return array('code' => _t('설정 값이 없습니다.'), 'script' => '[]'); } foreach ($config['fieldset'] as $fieldset) { $legend = !empty($fieldset['.attributes']['legend']) ? htmlspecialchars($fieldset['.attributes']['legend']) : ''; $CDSPval .= CRLF . TAB . "<fieldset>" . CRLF . TAB . TAB . "<legend><span class=\"text\">{$legend}</span></legend>" . CRLF; if (!empty($fieldset['field'])) { foreach ($fieldset['field'] as $field) { if (empty($field['.attributes']['name'])) { continue; } $name = $field['.attributes']['name']; $clientData .= getFieldName($field, $name); $CDSPval .= TreatType($field, $dfVal, $name); } } $CDSPval .= TAB . "</fieldset>" . CRLF; } } else { $CDSPval = _t('설정 값이 없습니다.'); } $clientData .= ']'; return array('code' => $CDSPval, 'script' => $clientData, 'title' => $title); }
function saveFeedItems($feedId, $xml) { global $database, $service; $xmls = new XMLStruct(); if (!$xmls->open($xml, $service['encoding'])) { return false; } if ($xmls->getAttribute('/rss', 'version')) { for ($i = 0; $link = $xmls->getValue("/rss/channel/item[{$i}]/link"); $i++) { $item = array('permalink' => rawurldecode($link)); if (!($item['author'] = $xmls->getValue("/rss/channel/item[{$i}]/author"))) { $item['author'] = $xmls->getValue("/rss/channel/item[{$i}]/dc:creator"); } $item['title'] = $xmls->getValue("/rss/channel/item[{$i}]/title"); if (!($item['description'] = $xmls->getValue("/rss/channel/item[{$i}]/content:encoded"))) { $item['description'] = $xmls->getValue("/rss/channel/item[{$i}]/description"); } $item['tags'] = array(); for ($j = 0; $tag = $xmls->getValue("/rss/channel/item[{$i}]/category[{$j}]"); $j++) { if (!empty($tag)) { array_push($item['tags'], $tag); } } for ($j = 0; $tag = $xmls->getValue("/rss/channel/item[{$i}]/subject[{$j}]"); $j++) { if (!empty($tag)) { array_push($item['tags'], $tag); } } $item['enclosures'] = array(); for ($j = 0; $url = $xmls->getAttribute("/rss/channel/item[{$i}]/enclosure[{$j}]", 'url'); $j++) { if (!empty($url)) { array_push($item['enclosures'], $url); } } if ($xmls->getValue("/rss/channel/item[{$i}]/pubDate")) { $item['written'] = parseDate($xmls->getValue("/rss/channel/item[{$i}]/pubDate")); } else { if ($xmls->getValue("/rss/channel/item[{$i}]/dc:date")) { $item['written'] = parseDate($xmls->getValue("/rss/channel/item[{$i}]/dc:date")); } else { $item['written'] = 0; } } saveFeedItem($feedId, $item); } } else { if ($xmls->doesExist('/feed')) { for ($i = 0; $link = $xmls->getValue("/feed/entry[{$i}]/id"); $i++) { for ($j = 0; $rel = $xmls->getAttribute("/feed/entry[{$i}]/link[{$j}]", 'rel'); $j++) { if ($rel == 'alternate') { $link = $xmls->getAttribute("/feed/entry[{$i}]/link[{$j}]", 'href'); break; } } $item = array('permalink' => rawurldecode($link)); $item['author'] = $xmls->getValue("/feed/entry[{$i}]/author/name"); $item['title'] = $xmls->getValue("/feed/entry[{$i}]/title"); if (!($item['description'] = $xmls->getValue("/feed/entry[{$i}]/content"))) { $item['description'] = $xmls->getValue("/feed/entry[{$i}]/summary"); } $item['tags'] = array(); for ($j = 0; $tag = $xmls->getValue("/feed/entry[{$i}]/dc:subject[{$j}]"); $j++) { if (!empty($tag)) { array_push($item['tags'], $tag); } } $item['enclosures'] = array(); for ($j = 0; $url = $xmls->getAttribute("/feed/entry[{$i}]/enclosure[{$j}]", 'url'); $j++) { if (!empty($url)) { array_push($item['enclosures'], $url); } } $item['written'] = parseDate($xmls->getValue("/feed/entry[{$i}]/issued")); saveFeedItem($feedId, $item); } } else { if ($xmls->getAttribute('/rdf:RDF', 'xmlns')) { for ($i = 0; $link = $xmls->getValue("/rdf:RDF/item[{$i}]/link"); $i++) { $item = array('permalink' => rawurldecode($link)); $item['author'] = $xmls->getValue("/rdf:RDF/item[{$i}]/dc:creator"); $item['title'] = $xmls->getValue("/rdf:RDF/item[{$i}]/title"); if (!($item['description'] = $xmls->getValue("/rdf:RDF/item[{$i}]/content:encoded"))) { $item['description'] = $xmls->getValue("/rdf:RDF/item[{$i}]/description"); } $item['tags'] = array(); $item['enclosures'] = array(); $item['written'] = parseDate($xmls->getValue("/rdf:RDF/item[{$i}]/dc:date")); saveFeedItem($feedId, $item); } } else { return false; } } } $deadLine = 0; $feedlife = POD::queryCell("SELECT feedlife FROM {$database['prefix']}FeedSettings"); if ($feedlife > 0) { $deadLine = gmmktime() - $feedlife * 86400; } if ($result = POD::queryAll("SELECT id FROM {$database['prefix']}FeedItems LEFT JOIN {$database['prefix']}FeedStarred ON id = item WHERE item IS NULL AND written < {$deadLine}")) { while (list($id) = array_shift($result)) { POD::query("DELETE FROM {$database['prefix']}FeedItems WHERE id = {$id}"); } } if ($result = POD::queryAll("SELECT blogid, item FROM {$database['prefix']}FeedReads LEFT JOIN {$database['prefix']}FeedItems ON id = item WHERE id IS NULL")) { while (list($readsOwner, $readsItem) = array_shift($result)) { POD::query("DELETE FROM {$database['prefix']}FeedReads WHERE blogid = {$readsOwner} AND item = {$readsItem}"); } } return true; }
<dl class="normal"> <dt></dt> <dd> <?php ob_start(); ?> <select name="welcomePack" id="welcomePack"> <?php $xmls=new XMLStruct(); $dir = opendir(ROOT . '/language/welcome'); while ($file = readdir($dir)) { if (func::getExt($file)=='xml') { $filename = substr($file, 0, strpos($file, '.xml')); $xmls->openFile(ROOT . '/language/welcome/'.$file); $name = $xmls->getValue('/welcome/information/name'); $author = $xmls->getValue('/welcome/information/author/name'); ?> <option value="<?php echo $filename;?>" <?php if ($filename == $config->welcomePack){?>selected="selected"<?php } ?>><?php echo $name;?> (<?php echo $author;?>)</option> <?php } } ?> </select> <?php $arg = ob_get_contents(); ob_end_clean(); echo _f('인사말 모음 : %1', $arg); ?> </dd>
function createMap() { global $database, $db; func::mkpath($this->cacheDir); if (!is_dir($this->cacheDir) || !is_writable($this->cacheDir)) return false; requireComponent('LZ.PHP.XMLStruct'); requireComponent('LZ.PHP.XMLWriter'); $case = array(); $tags = array(); $admins = array(); $xmls = new XMLStruct; $db->query("SELECT name FROM {$database['prefix']}Plugins WHERE status='on' ORDER BY name ASC"); // 활성화 된 플러그인 목록 while ($data = $db->fetch()) { if (!$xmls->openFile(ROOT . '/plugins/'. $data->name . '/index.xml')) continue; for ($i=1; $func=$xmls->getValue("/plugin/binding/listener[$i]"); $i++) { $event = $xmls->getAttribute("/plugin/binding/listener[$i]", 'event'); if (!isset($case[$event])) $case[$event] = array(); array_push($case[$event], array("plugin"=>$data->name, "listener"=>$func)); } for ($i=1; $func=$xmls->getValue("/plugin/binding/tag[$i]"); $i++) { $event = $xmls->getAttribute("/plugin/binding/tag[$i]", 'name'); if (!isset($tags[$event])) $tags[$event] = array(); array_push($tags[$event], array("plugin"=>$data->name, "listener"=>$func)); } if ($xmls->doesExist('/plugin/binding/admin')) { foreach ($xmls->selectNodes('/plugin/binding/admin') as $admin) { $menu = isset($admin['.attributes']['menu'])?$admin['.attributes']['menu']:'plugin'; if (!isset($admins[$menu])) $admins[$menu] = array(); $textFunc = isset($admin['text'][0]['.value'])?$admin['text'][0]['.value']:''; $pageFunc = isset($admin['page'][0]['.value'])?$admin['page'][0]['.value']:''; array_push($admins[$menu], array("plugin"=>$data->name, "text"=>$textFunc,"page"=>$pageFunc)); } } } // bloglounge $xml = new XMLFile($this->cacheDir.'/1.xml.php'); $xml->startGroup('map'); foreach ($case as $event=>$binders) { $xml->startGroup('event', array('name'=>$event)); foreach ($binders as $bind) { $xml->write('bind', $bind['listener'], false, array('plugin'=>$bind['plugin'])); } $xml->endGroup(); } foreach ($tags as $event=>$binders) { $xml->startGroup('tag', array('name'=>$event)); foreach ($binders as $bind) { $xml->write('bind', $bind['listener'], false, array('plugin'=>$bind['plugin'])); } $xml->endGroup(); } $xml->endAllGroups(); $xml->close(); // admin $xml = new XMLFile($this->cacheDir.'/admin.xml.php'); $xml->startGroup('map'); foreach ($admins as $event=>$binders) { $xml->startGroup('event', array('name'=>$event)); foreach ($binders as $bind) { $xml->write('bind', $bind['text'], false, array( 'plugin'=>$bind['plugin'],'event'=>'text')); $xml->write('bind', $bind['page'], false, array('plugin'=>$bind['plugin'],'event'=>'page')); } $xml->endGroup(); } // admin $xml->endAllGroups(); $xml->close(); return true; }
function getContentWidth() { $context = Model_Context::getInstance(); if ($context->getProperty('skin.contentWidth') == NULL) { // Legacy code. ( < 1.8.4 does not have contentWidth information in DB) $contentWidth = 550; if ($skin = $context->getProperty('skin.skin')) { if ($xml = @file_get_contents(ROOT . "/skin/blog/{$skin}/index.xml")) { $xmls = new XMLStruct(); $xmls->open($xml, $context->getProperty('service.encoding')); if ($xmls->getValue('/skin/default/contentWidth')) { $contentWidth = $xmls->getValue('/skin/default/contentWidth'); } } } Setting::setSkinSetting('contentWidth', $contentWidth); return $contentWidth; } else { return $context->getProperty('skin.contentWidth'); } }
" /> <?php } } ?> </div> <div class="information"> <?php if (file_exists(ROOT . "/skin/admin/{$currentAdminSkin}/index.xml")) { ?> <div id="currentInfo"> <?php $xml = file_get_contents(ROOT . "/skin/admin/{$currentAdminSkin}/index.xml"); $xmls = new XMLStruct(); $xmls->open($xml, $service['encoding']); writeValue('<span class="skin-name">' . $xmls->getValue('/adminSkin/information/name') . '</span> <span class="version">ver.' . $xmls->getValue('/adminSkin/information/version') . '</span>', _t('제목'), "title"); writeValue($xmls->getValue('/adminSkin/information/license'), _t('저작권'), "license"); writeValue($xmls->getValue('/adminSkin/author/name'), _t('만든이'), "maker"); writeValue($xmls->getValue('/adminSkin/author/homepage'), _t('홈페이지'), "homepage"); writeValue($xmls->getValue('/adminSkin/author/email'), _t('e-mail'), "email"); writeValue($xmls->getValue('/adminSkin/information/description'), _t('설명'), "explain"); ?> </div> <?php } else { ?> <div id="currentInfo"> <div id="customizedTable"> <?php echo _t('선택하신 스킨이 존재하지 않습니다. 다른 스킨을 선택해 주시기 바랍니다.') . CRLF; ?>
} } else { $xmls = new XMLStruct(); $editorCount = 0; $formatterCount = 0; if (!empty($activePlugins)) { if (file_exists(__TEXTCUBE_CACHE_DIR__ . "/code/plugins-" . getBlogId() . ".php")) { require_once __TEXTCUBE_CACHE_DIR__ . "/code/plugins-" . getBlogId() . ".php"; // TODO : set the editor / formatter count while using plugin php cache. } else { foreach ($activePlugins as $plugin) { $version = ''; $disablePlugin = false; $manifest = @file_get_contents(ROOT . "/plugins/{$plugin}/index.xml"); if ($manifest && $xmls->open($manifest)) { $requiredTattertoolsVersion = $xmls->getValue('/plugin/requirements/tattertools'); $requiredTextcubeVersion = $xmls->getValue('/plugin/requirements/textcube'); if (is_null($requiredTextcubeVersion) && !is_null($requiredTattertoolsVersion)) { $requiredTextcubeVersion = $requiredTattertoolsVersion; } $requiredMinVersion = $xmls->getValue('/plugin/requirements/textcube/minVersion'); $requiredMaxVersion = $xmls->getValue('/plugin/requirements/textcube/maxVersion'); if (!is_null($requiredMinVersion)) { if (version_compare($currentTextcubeVersion, $requiredMinVersion) < 0) { $disablePlugin = true; } } if (!is_null($requiredMaxVersion)) { if (version_compare($currentTextcubeVersion, $requiredMaxVersion) > 0) { $disablePlugin = true; }
<h3><?php echo _t("현재 사용중인 메타스킨");?></h3> </div> <div class="wrap select_skin_wrap"> <?php echo drawAdminBoxBegin('select_skin');?> <div class="select_skin_data"> <?php if(!empty($xmls->struct)) { ?> <div class="thumbnail"> <img src="<?php echo $n_skinpath;?>/preview.gif" alt="<?php echo _t('미리보기 이미지');?>" /> </div> <div class="data"> <dl class="normal"> <dt><?php echo _t("스킨명");?></dt> <dd class="text"><?php echo $xmls->getValue('/skin/information/name[lang()]');?> ver<?php echo $xmls->getValue('/skin/information/version');?> (<?php echo $n_skinname;?>)</dd> </dl> <dl class="normal"> <dt><?php echo _t("제작자");?></dt> <dd class="text"><?php echo $xmls->getValue('/skin/author/name[lang()]');?> <a href="mailto:<?php echo $xmls->getValue('/skin/author/email');?>"><img src="<?php echo $service['path'];?>/images/admin/icon_email.gif" alt="<?php echo _t('이메일 보내기');?>" align="absmiddle" /></a> , <a href="<?php echo $xmls->getValue('/skin/author/homepage[lang()]');?>" target="_blank"><?php echo $xmls->getValue('/skin/author/homepage[lang()]');?></a> </dd> </dl> <dl class="normal desc"> <dt><?php echo _t("설명");?></dt> <dd class="text"><?php echo nl2br($xmls->getValue('/skin/information/description[lang()]'));?></dd> </dl> <dl class="normal"> <dt><?php echo _t("라이센스");?></dt> <dd class="text"><?php echo nl2br($xmls->getValue('/skin/information/license[lang()]'));?></dd> </dl> <div class="tools"> <a href="<?php echo $service['path'];?>/admin/design/setting#meta" class="normalbutton"><span class="boldbutton"><?php echo _t('스킨설정');?></span></a>
function selectSkin($blogid, $skinName) { global $database, $service; requireComponent('Needlworks.Cache.PageCache'); requireLibrary('blog.skin'); $blogid = getBlogId(); if (empty($skinName)) { return _t('실패했습니다.'); } if (strncmp($skinName, 'customize/', 10) == 0) { if (strcmp($skinName, "customize/{$blogid}") != 0) { return _t('실패 했습니다'); } } else { $skinName = Path::getBaseName($skinName); if ($skinName === '.' || $skinName === '..') { return _t('실패 했습니다'); } } if (file_exists(ROOT . "/skin/blog/{$skinName}/index.xml")) { $xml = file_get_contents(ROOT . "/skin/blog/{$skinName}/index.xml"); $xmls = new XMLStruct(); if (!$xmls->open($xml, $service['encoding'])) { return _t('실패했습니다.'); } $assignments = array('skin' => $skinName); $value = $xmls->getValue('/skin/default/recentEntries'); if (!empty($value) || is_numeric($value)) { $assignments['entriesOnRecent'] = $value; } $value = $xmls->getValue('/skin/default/recentComments'); if (!empty($value) || is_numeric($value)) { $assignments['commentsOnRecent'] = $value; } $value = $xmls->getValue('/skin/default/itemsOnGuestbook'); if (!empty($value) || is_numeric($value)) { $assignments['commentsOnGuestbook'] = $value; } $value = $xmls->getValue('/skin/default/tagsInCloud'); if (!empty($value) || is_numeric($value)) { $assignments['tagsOnTagbox'] = $value; } $value = $xmls->getValue('/skin/default/sortInCloud'); if (!empty($value) || is_numeric($value)) { $assignments['tagboxAlign'] = $value; } $value = $xmls->getValue('/skin/default/recentTrackbacks'); if (!empty($value) || is_numeric($value)) { $assignments['trackbacksOnRecent'] = $value; } $value = $xmls->getValue('/skin/default/expandComment'); if (isset($value)) { $assignments['expandComment'] = $value ? '1' : '0'; } $value = $xmls->getValue('/skin/default/expandTrackback'); if (isset($value)) { $assignments['expandTrackback'] = $value ? '1' : '0'; } $value = $xmls->getValue('/skin/default/lengthOfRecentNotice'); if (!empty($value) || is_numeric($value)) { $assignments['recentNoticeLength'] = $value; } $value = $xmls->getValue('/skin/default/lengthOfRecentEntry'); if (!empty($value) || is_numeric($value)) { $assignments['recentEntryLength'] = $value; } $value = $xmls->getValue('/skin/default/lengthOfRecentComment'); if (!empty($value) || is_numeric($value)) { $assignments['recentCommentLength'] = $value; } $value = $xmls->getValue('/skin/default/lengthOfRecentTrackback'); if (!empty($value) || is_numeric($value)) { $assignments['recentTrackbackLength'] = $value; } $value = $xmls->getValue('/skin/default/lengthOfLink'); if (!empty($value) || is_numeric($value)) { $assignments['linkLength'] = $value; } $value = $xmls->getValue('/skin/default/contentWidth'); if (!empty($value) || is_numeric($value)) { $assignments['contentWidth'] = $value; } $value = $xmls->getValue('/skin/default/showListOnCategory'); if (isset($value)) { $assignments['showListOnCategory'] = $value; } $value = $xmls->getValue('/skin/default/showListOnArchive'); if (isset($value)) { $assignments['showListOnArchive'] = $value; } $value = $xmls->getValue('/skin/default/showListOnTag'); if (isset($value)) { $assignments['showListOnTag'] = $value; } $value = $xmls->getValue('/skin/default/showListOnSearch'); if (isset($value)) { $assignments['showListOnSearch'] = $value; } $value = $xmls->getValue('/skin/default/showListOnAuthor'); if (isset($value)) { $assignments['showListOnAuthor'] = $value; } $value = $xmls->getValue('/skin/default/tree/color'); if (isset($value)) { $assignments['colorOnTree'] = $value; } $value = $xmls->getValue('/skin/default/tree/bgColor'); if (isset($value)) { $assignments['bgcolorOnTree'] = $value; } $value = $xmls->getValue('/skin/default/tree/activeColor'); if (isset($value)) { $assignments['activecolorOnTree'] = $value; } $value = $xmls->getValue('/skin/default/tree/activeBgColor'); if (isset($value)) { $assignments['activebgcolorOnTree'] = $value; } $value = $xmls->getValue('/skin/default/tree/labelLength'); if (!empty($value) || is_numeric($value)) { $assignments['labelLengthOnTree'] = $value; } $value = $xmls->getValue('/skin/default/tree/showValue'); if (isset($value)) { $assignments['showValueOnTree'] = $value ? '1' : '0'; } foreach ($assignments as $name => $value) { Setting::setSkinSetting($name, $value, $blogid); } // none/single/multiple $value = $xmls->getValue('/skin/default/commentMessage/none'); if (is_null($value)) { Setting::setBlogSetting('noneCommentMessage', NULL, true); } else { Setting::setBlogSetting('noneCommentMessage', $value, true); } $value = $xmls->getValue('/skin/default/commentMessage/single'); if (is_null($value)) { Setting::setBlogSetting('singleCommentMessage', NULL, true); } else { Setting::setBlogSetting('singleCommentMessage', $value, true); } $value = $xmls->getValue('/skin/default/trackbackMessage/none'); if (is_null($value)) { Setting::setBlogSetting('noneTrackbackMessage', NULL, true); } else { Setting::setBlogSetting('noneTrackbackMessage', $value, true); } $value = $xmls->getValue('/skin/default/trackbackMessage/single'); if (is_null($value)) { Setting::setBlogSetting('singleTrackbackMessage', NULL, true); } else { Setting::setBlogSetting('singleTrackbackMessage', $value, true); } } else { Setting::setBlogSetting('noneCommentMessage', NULL, true); Setting::setBlogSetting('singleCommentMessage', NULL, true); Setting::setBlogSetting('noneTrackbackMessage', NULL, true); Setting::setBlogSetting('singleTrackbackMessage', NULL, true); Setting::setSkinSetting('skin', $skinName, $blogid); } Setting::removeBlogSetting("sidebarOrder", true); CacheControl::flushAll(); CacheControl::flushSkin(); Path::removeFiles(ROOT . "/skin/blog/customize/" . getBlogId() . "/"); Setting::getSkinSettings($blogid, true); // refresh skin cache return true; }
function makeWelcomeMsg($msgPack = 'default') { $useClockBase = false; $xmls=new XMLStruct(); if (!$xmls->openFile(ROOT . '/language/welcome/'.$msgPack.'.xml')) return msg::getRandomMsg('welcome'); if ($useClockBase) { $hour = date("H"); switch(true) { case (($hour >= 2) && ($hour <= 5)): $tick = 'daybreak'; break; case (($hour >= 6) && ($hour <= 11)): $tick = 'morning'; break; case (($hour >= 12) && ($hour <= 17)): $tick = 'afternoon'; case (($hour >= 18) && ($hour <= 19)): $tick = 'evening'; case (($hour >= 20) || ($hour <= 1)): $tick = 'night'; } } else { // common $tick = 'common'; } $max = $xmls->getNodeCount("/welcome/$tick/item"); $bingo = mt_rand(1, $max); return $xmls->getValue("/welcome/$tick/item[$bingo]"); }
function getFeedItems($xml) { if (preg_match('/^<\?xml[^<]*\s+encoding=["\']?([\w-]+)["\']?/', $xml, $matches)) // kor env $encoding = $matches[1]; if (strcasecmp($encoding, 'euc-kr') == 0) { $xml = UTF8::bring($xml, $encoding); $xml = preg_replace('/^(<\?xml[^<]*\s+encoding=)["\']?[\w-]+["\']?/', '$1"utf-8"', $xml, 1); } $xmls=new XMLStruct(); if (!$xmls->open($xml)) return false; $items = array(); if ($xmls->getAttribute('/rss','version')){ // rss element must have version attribute for ($i=1;$link=$xmls->getValue("/rss/channel/item[$i]/link");$i++){ $item=array('permalink'=>rawurldecode($link)); if (!$item['author']=$xmls->getValue("/rss/channel/item[$i]/author")) $item['author']=$xmls->getValue("/rss/channel/item[$i]/dc:creator"); $item['title']=$xmls->getValue("/rss/channel/item[$i]/title"); if (!$item['description']=$xmls->getValue("/rss/channel/item[$i]/content:encoded")) $item['description']=htmlspecialchars_decode($xmls->getValue("/rss/channel/item[$i]/description")); $item['tags']=array(); for ($j=1;$tag=$xmls->getValue("/rss/channel/item[$i]/category[$j]");$j++) if (!empty($tag)) { // array_push($item['tags'],$tag); $tags = explode('/', $tag); // allblog, blogkorea types foreach($tags as $tag) { array_push($item['tags'], trim($tag)); } } for ($j=1;$tag=$xmls->getValue("/rss/channel/item[$i]/subject[$j]");$j++) if (!empty($tag)) array_push($item['tags'],$tag); if ($youtubeTags = $xmls->getValue("/rss/channel/item[$i]/media:category")) { // for Youtube,Flickr Feed array_push($item['tags'], ''); // blank. first tag not equals category foreach (explode(' ', $youtubeTags) as $tag) { $tag = trim($tag); if(!empty($tag)) array_push($item['tags'], $tag); } } $item['enclosures']=array(); for ($j=1;$result=$xmls->getAttributes("/rss/channel/item[$i]/enclosure[$j]",array('url','type'));$j++) { if (!empty($result)) { array_push($item['enclosures'],array('url'=>$result[0],'type'=>$result[1])); } } $flickrContent=$xmls->getAttributes("/rss/channel/item[$i]/media:content[$j]",array('url','type')); // for flickr feed if(!empty($flickrContent)) { array_push($item['enclosures'],array('url'=>$flickrContent[0],'type'=>$flickrContent[1])); } if ($xmls->getValue("/rss/channel/item[$i]/pubDate")) $item['written']=Feed::parseDate($xmls->getValue("/rss/channel/item[$i]/pubDate")); elseif ($xmls->getValue("/rss/channel/item[$i]/dc:date")) $item['written']=Feed::parseDate($xmls->getValue("/rss/channel/item[$i]/dc:date")); else $item['written']=0; if (!$item['generator']=$xmls->getValue("/rss/channel/generator")) { if (strpos($item['permalink'], 'tvpot.daum.net') !== false) $item['generator'] = 'Daum Tvpot'; else $item['generator'] = 'Unknown'; } if (!$item['guid']=$xmls->getValue("/rss/channel/item[$i]/guid")) $item['guid'] = $item['permalink']; array_push($items, $item); } } elseif ($xmls->doesExist('/feed')){ // atom 0.3 for ($i=1;$link=$xmls->getValue("/feed/entry[$i]/id");$i++){ $item['enclosures']=array(); for ($j=1;$rel=$xmls->getAttribute("/feed/entry[$i]/link[$j]",'rel');$j++){ if ($rel=='alternate'){ $link=$xmls->getAttribute("/feed/entry[$i]/link[$j]",'href'); } else if($rel=='enclosure' || $rel=='image') { $result = $xmls->getAttributes("/feed/entry[$i]/link[$j]",array('href','type')); if($result) { array_push($item['enclosures'],array('url'=>$result[0],'type'=>$result[1])); } } } $item=array('permalink'=>rawurldecode($link),'enclosures'=>$item['enclosures']); $item['author']=$xmls->getValue("/feed/entry[$i]/author/name"); $item['title']=$xmls->getValue("/feed/entry[$i]/title"); if (!$item['description']=htmlspecialchars_decode($xmls->getValue("/feed/entry[$i]/content"))) $item['description']=htmlspecialchars_decode($xmls->getValue("/feed/entry[$i]/summary")); $item['tags']=array(); for ($j=1;$tag=$xmls->getValue("/feed/entry[$i]/dc:subject[$j]");$j++) { if (!empty($tag)) array_push($item['tags'],trim($tag)); } for ($j=1;$tag=$xmls->getAttribute("/feed/entry[$i]/category[$j]", 'term');$j++) { if (!empty($tag)) array_push($item['tags'],trim($tag)); } if (!$item['written']= $xmls->getValue("/feed/entry[$i]/issued")) { if (!$item['written'] = $xmls->getValue("/feed/entry[$i]/published")) { $item['written'] = $xmls->getValue("/feed/entry[$i]/updated"); } } $item['written'] = Feed::parseDate($item['written']); if (!$item['generator'] = $xmls->getValue("/feed/generator")) $item['generator'] = 'Unknown'; array_push($items, $item); } } elseif ($xmls->getAttribute('/rdf:RDF','xmlns')){ // rss 1.0, rdf for ($i=1;$link=$xmls->getValue("/rdf:RDF/item[$i]/link");$i++){ $item=array('permalink'=>rawurldecode($link)); if (!$item['author']=$xmls->getValue("/rdf:RDF/item[$i]/dc:creator")) $item['author']=$xmls->getValue("/rdf:RDF/item[$i]/author"); // for NaverBlog rss 1.0 $item['title']=$xmls->getValue("/rdf:RDF/item[$i]/title"); if (!$item['description']=$xmls->getValue("/rdf:RDF/item[$i]/content:encoded")) $item['description']=htmlspecialchars_decode($xmls->getValue("/rdf:RDF/item[$i]/description")); $item['tags']=array(); $item['enclosures']=array(); $item['written']=Feed::parseDate($xmls->getValue("/rdf:RDF/item[$i]/dc:date")); array_push($items, $item); } } else return false; return $items; }
include ROOT. '/lib/piece/adminHeader.php'; $exports = array(); $xmls = new XMLStruct; $exportXmls = new XMLStruct; $dir = dir(ROOT . '/exports/'); while (($file = $dir->read()) !== false) { if (!preg_match('/^[A-Za-z0-9 _-]+$/', $file)) continue; if (!is_dir(ROOT . '/exports/' . $file)) continue; if (!file_exists(ROOT . '/exports/'.$file.'/index.xml')) continue; if (!$xmls->openFile(ROOT . '/exports/'.$file.'/index.xml')) continue; $export = array(); $export['name'] = $file; $export['title'] = $xmls->getValue('/export/information/name[lang()]'); $export['description'] = $xmls->getValue('/export/information/description[lang()]'); $exportAuthor = $xmls->selectNode('/export/information/author[lang()]'); $export['author'] = array('name'=>$exportAuthor['.value'], 'link'=>$exportAuthor['.attributes']['link'], 'email'=>$exportAuthor['.attributes']['email']); if ($exportConf = $xmls->selectNode('/export/config[lang()]')) { $export['config'] = 'y'; $export['window'] = $exportConf['window'][0]['.attributes']; } else { $export['config'] = 'n'; } if(!isset($export['window']['height']) || $export['window']['height']=='auto') { $export['window']['height'] = 0; }
function selectSkin($blogid, $skinName) { $context = Model_Context::getInstance(); importlib('blogskin'); $blogid = getBlogId(); if (empty($skinName)) { return _t('실패했습니다.'); } if (strncmp($skinName, 'customize/', 10) == 0) { if (strcmp($skinName, "customize/{$blogid}") != 0) { return _t('실패 했습니다'); } } else { $skinName = Path::getBaseName($skinName); if ($skinName === '.' || $skinName === '..') { return _t('실패 했습니다'); } } if (file_exists(getSkinPath($skinName) . "/index.xml")) { $xml = file_get_contents(getSkinPath($skinName) . "/index.xml"); $xmls = new XMLStruct(); if (!$xmls->open($xml, $context->getProperty('service.encoding'))) { return _t('실패했습니다.'); } $assignments = array('skin' => $skinName); $value = $xmls->getValue('/skin/default/recentEntries'); if (!empty($value) || is_numeric($value)) { $assignments['entriesOnRecent'] = $value; } $value = $xmls->getValue('/skin/default/recentComments'); if (!empty($value) || is_numeric($value)) { $assignments['commentsOnRecent'] = $value; } $value = $xmls->getValue('/skin/default/itemsOnGuestbook'); if (!empty($value) || is_numeric($value)) { $assignments['commentsOnGuestbook'] = $value; } $value = $xmls->getValue('/skin/default/tagsInCloud'); if (!empty($value) || is_numeric($value)) { $assignments['tagsOnTagbox'] = $value; } $value = $xmls->getValue('/skin/default/sortInCloud'); if (!empty($value) || is_numeric($value)) { $assignments['tagboxAlign'] = $value; } $value = $xmls->getValue('/skin/default/recentTrackbacks'); if (!empty($value) || is_numeric($value)) { $assignments['trackbacksOnRecent'] = $value; } $value = $xmls->getValue('/skin/default/expandComment'); if (isset($value)) { $assignments['expandComment'] = $value ? '1' : '0'; } $value = $xmls->getValue('/skin/default/expandTrackback'); if (isset($value)) { $assignments['expandTrackback'] = $value ? '1' : '0'; } $value = $xmls->getValue('/skin/default/lengthOfRecentNotice'); if (!empty($value) || is_numeric($value)) { $assignments['recentNoticeLength'] = $value; } $value = $xmls->getValue('/skin/default/lengthOfRecentPage'); if (!empty($value) || is_numeric($value)) { $assignments['recentPageLength'] = $value; } $value = $xmls->getValue('/skin/default/lengthOfRecentEntry'); if (!empty($value) || is_numeric($value)) { $assignments['recentEntryLength'] = $value; } $value = $xmls->getValue('/skin/default/lengthOfRecentComment'); if (!empty($value) || is_numeric($value)) { $assignments['recentCommentLength'] = $value; } $value = $xmls->getValue('/skin/default/lengthOfRecentTrackback'); if (!empty($value) || is_numeric($value)) { $assignments['recentTrackbackLength'] = $value; } $value = $xmls->getValue('/skin/default/lengthOfLink'); if (!empty($value) || is_numeric($value)) { $assignments['linkLength'] = $value; } $value = $xmls->getValue('/skin/default/contentWidth'); if (!empty($value) || is_numeric($value)) { $assignments['contentWidth'] = $value; } $value = $xmls->getValue('/skin/default/showListOnCategory'); if (isset($value)) { $assignments['showListOnCategory'] = $value; } $value = $xmls->getValue('/skin/default/showListOnArchive'); if (isset($value)) { $assignments['showListOnArchive'] = $value; } $value = $xmls->getValue('/skin/default/showListOnTag'); if (isset($value)) { $assignments['showListOnTag'] = $value; } $value = $xmls->getValue('/skin/default/showListOnSearch'); if (isset($value)) { $assignments['showListOnSearch'] = $value; } $value = $xmls->getValue('/skin/default/showListOnAuthor'); if (isset($value)) { $assignments['showListOnAuthor'] = $value; } $value = $xmls->getValue('/skin/default/tree/color'); if (isset($value)) { $assignments['colorOnTree'] = $value; } $value = $xmls->getValue('/skin/default/tree/bgColor'); if (isset($value)) { $assignments['bgcolorOnTree'] = $value; } $value = $xmls->getValue('/skin/default/tree/activeColor'); if (isset($value)) { $assignments['activecolorOnTree'] = $value; } $value = $xmls->getValue('/skin/default/tree/activeBgColor'); if (isset($value)) { $assignments['activebgcolorOnTree'] = $value; } $value = $xmls->getValue('/skin/default/tree/labelLength'); if (!empty($value) || is_numeric($value)) { $assignments['labelLengthOnTree'] = $value; } $value = $xmls->getValue('/skin/default/tree/showValue'); if (isset($value)) { $assignments['showValueOnTree'] = $value ? '1' : '0'; } foreach ($assignments as $name => $value) { Setting::setSkinSetting($name, $value, $blogid); } if ($xmls->doesExist('/skin/support')) { foreach ($xmls->selectNodes('/skin/support') as $support) { if (!empty($support['.attributes']['mobile']) && $support['.attributes']['mobile'] == "yes") { /// Main skin supports mobile, too. Setting::setBlogSetting('useiPhoneUI', 0, true); } else { Setting::setBlogSetting('useiPhoneUI', 1, true); } } } else { Setting::setBlogSetting('useiPhoneUI', 1, true); } // none/single/multiple $value = $xmls->getValue('/skin/default/commentMessage/none'); if (is_null($value)) { Setting::setBlogSetting('noneCommentMessage', NULL, true); } else { Setting::setBlogSetting('noneCommentMessage', $value, true); } $value = $xmls->getValue('/skin/default/commentMessage/single'); if (is_null($value)) { Setting::setBlogSetting('singleCommentMessage', NULL, true); } else { Setting::setBlogSetting('singleCommentMessage', $value, true); } $value = $xmls->getValue('/skin/default/trackbackMessage/none'); if (is_null($value)) { Setting::setBlogSetting('noneTrackbackMessage', NULL, true); } else { Setting::setBlogSetting('noneTrackbackMessage', $value, true); } $value = $xmls->getValue('/skin/default/trackbackMessage/single'); if (is_null($value)) { Setting::setBlogSetting('singleTrackbackMessage', NULL, true); } else { Setting::setBlogSetting('singleTrackbackMessage', $value, true); } } else { Setting::setBlogSetting('noneCommentMessage', NULL, true); Setting::setBlogSetting('singleCommentMessage', NULL, true); Setting::setBlogSetting('noneTrackbackMessage', NULL, true); Setting::setBlogSetting('singleTrackbackMessage', NULL, true); Setting::setSkinSetting('skin', $skinName, $blogid); } Setting::removeBlogSetting("sidebarOrder", true); CacheControl::flushAll(); CacheControl::flushSkin(); Path::removeFiles(getSkinPath('customize/' . getBlogId()) . "/"); Setting::getSkinSettings($blogid, true); // refresh skin cache return true; }
function getDefaultCenterPanel($mapping) { $ctx = Model_Context::getInstance(); $blogid = $ctx->getProperty('blog.id'); ?> <div id="<?php echo $mapping['plugin']; ?> " class="section"> <h3 class="caption<?php echo isset($_REQUEST['edit']) ? ' visible' : ' invisible'; ?> "> <span><?php echo _t('알림판'); if (isset($_REQUEST['edit'])) { ?> <a id="<?php echo $mapping['plugin']; ?> widgetup" href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/center/dashboard?edit&pos=<?php echo $positionCounter; ?> &rel=-1&edit"><?php echo _t('위로'); ?> </a> <a id="<?php echo $mapping['plugin']; ?> widgetdown" href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/center/dashboard?edit&pos=<?php echo $positionCounter; ?> &rel=1&edit"><?php echo _t('아래로'); ?> </a> <?php } ?> </span> </h3> <?php if (isset($_REQUEST['edit'])) { ?> </div> <?php return true; } else { // Get default data $stats = Statistics::getStatistics($blogid); $latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0); $comments = getRecentComments($blogid, 10); $guestbooks = getRecentGuestbook($blogid, 10); list($commentNotifies, $paging) = getCommentsNotifiedWithPagingForOwner($blogid, 0, null, null, null, 1, 10); $trackbacks = getRecentTrackbacks($blogid, 10); $recents = array(); // title, date, link, category foreach ($comments as $comment) { array_push($recents, array('title' => $comment['comment'], 'date' => $comment['written'], 'link' => $ctx->getProperty('uri.blog') . "/" . $comment['entry'] . "#comment" . $comment['id'], 'category' => 'comment')); } foreach ($commentNotifies as $comment) { array_push($recents, array('title' => $comment['comment'], 'date' => $comment['written'], 'link' => $ctx->getProperty('uri.blog') . "/owner/communication/notify", 'category' => 'commentNotify')); } foreach ($guestbooks as $guestbook) { array_push($recents, array('title' => $guestbook['comment'], 'date' => $guestbook['written'], 'link' => $ctx->getProperty('uri.blog') . "/guestbook/" . $guestbook['id'] . "#guestbook" . $guestbook['id'], 'category' => 'guestbook')); } foreach ($trackbacks as $trackback) { array_push($recents, array('title' => $trackback['subject'], 'date' => $trackback['written'], 'link' => $ctx->getProperty('uri.blog') . "/" . $trackback['entry'] . "#trackback" . $trackback['id'], 'category' => 'trackback')); } $sort_array = array(); foreach ($recents as $uniqid => $row) { // Sorting. foreach ($row as $key => $value) { if (!array_key_exists($key, $sort_array)) { $sort_array[$key] = array(); } $sort_array[$key][$uniqid] = $value; } } if (!empty($sort_array)) { array_multisort($sort_array['date'], SORT_DESC, $recents); } $recents = array_slice($recents, 0, 14); ?> <div id="shortcut-collection"> <h4 class="caption"><span><?php echo _t('바로가기'); ?> </span></h4> <ul> <li class="newPost"><a class="newPost" href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/entry/post"><span><?php echo _t('새 글 쓰기'); ?> </span></a></li> <?php if ($latestEntryId !== 0) { $latestEntry = getEntry($blogid, $latestEntryId); if (!is_null($latestEntry)) { ?> <li class="modifyPost"><a href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/entry/edit/<?php echo $latestEntry['id']; ?> "><?php echo _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10))); ?> </a></li> <?php } } if ($ctx->getProperty('service.reader') == true) { ?> <li class="rssReader"><a href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/network/reader"><?php echo _t('RSS로 등록한 이웃 글 보기'); ?> </a></li> <?php } if (Acl::check("group.administrators")) { ?> <li class="deleteCache"><a href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/center/dashboard/cleanup" onclick="cleanupCache();return false;"><?php echo _t('캐시 지우기'); ?> </a></li> <?php if (Acl::check("group.creators")) { ?> <li class="optimizeStorage"><a href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/data" onclick="optimizeData();return false;"><?php echo _t('저장소 최적화'); ?> </a></li> <?php } } ?> <li class="clear"></li> </ul> </div> <div id="total-information"> <h4 class="caption"><span><?php echo _t('요약'); ?> </span></h4> <table class="posts-line"> <caption><?php echo _t('글'); ?> </caption> <thead> <th>type</th> <th>sum</th> </thead> <tbody> <tr> <td class="type"><?php echo _t('글'); ?> </td> <td class="sum"><?php echo number_format(getEntriesTotalCount($blogid)); ?> </td> </tr> <tr> <td class="type"><?php echo _t('댓글'); ?> </td> <td class="sum"><?php echo number_format(getCommentCount($blogid)); ?> </td> </tr> <tr> <td class="type"><?php echo _t('방명록'); ?> </td> <td class="sum"><?php echo number_format(getGuestbookCount($blogid)); ?> </td> </tr> <tr> <td class="type"><?php echo _t('걸린 글'); ?> </td> <td class="sum"><?php echo number_format(getTrackbackCount($blogid)); ?> </td> </tr> </tbody> </table> <table class="visitors-line"> <caption><?php echo _t('방문자'); ?> </caption> <thead> <th>type</th> <th>sum</th> </thead> <tbody> <tr> <td class="type"><?php echo _t('오늘'); ?> </td> <td class="sum"><?php echo number_format($stats['today']); ?> </td> </tr> <tr> <td class="type"><?php echo _t('어제'); ?> </td> <td class="sum"><?php echo number_format($stats['yesterday']); ?> </td> </tr> <tr> <td class="type"><?php echo _t('7일 평균'); ?> </td> <td class="sum"><?php $weekly = Statistics::getWeeklyStatistics(); $weeklycount = 0; foreach ($weekly as $day) { $weeklycount += $day['visits']; } echo number_format($weeklycount / 7); unset($weekly); unset($weeklycount); ?> </td> </tr> <tr> <td class="type"><?php echo _t('총방문자'); ?> </td> <td class="sum"><?php echo number_format($stats['total']); ?> </td> </tr> </tbody> </table> </div> <div id="myBlogInfo"> <h4 class="caption"><span><a href="<?php echo $ctx->getProperty('uri.blog') . '/owner/communication/comment'; ?> "><?php echo _t('알림판'); ?> </a></span></h4> <table class="recent"> <caption>asdasd</caption> <thead> <tr> <th scope="col" class="date"><?php echo _t('날짜'); ?> </th> <th scope="col" class="category"><?php echo _t('종류'); ?> </th> <th scope="col"><?php echo _t('내용'); ?> </th> </tr> </thead> <tbody> <?php foreach ($recents as $item) { ?> <tr class="<?php echo $item['category']; ?> "> <td class="date"><?php echo Timestamp::format('%m/%d', $item['date']); ?> </td> <td class="category"> <?php switch ($item['category']) { case 'trackback': echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/trackback?status=received">' . _t('걸린글') . '</a>'; break; case 'comment': echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/comment?status=comment">' . _t('댓글') . '</a>'; break; case 'commentNotify': echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/notify">' . _t('알리미') . '</a>'; break; case 'guestbook': echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/comment?status=guestbook">' . _t('방명록') . '</a>'; break; } ?> </td> <td class="title"><a href="<?php echo $item['link']; ?> "><?php echo htmlspecialchars(Utils_Unicode::lessenAsEm($item['title'], 20)); ?> </a></td> </tr> <?php } ?> </tbody> </table> </div> <?php $noticeURL = TEXTCUBE_NOTICE_URL; $noticeURLRSS = $noticeURL . ($ctx->getProperty('blog.language') ? $ctx->getProperty('blog.language') : "ko") . "/rss"; $noticeEntries = array(); if (!is_null(Setting::getServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language')))) { $noticeEntries = unserialize(Setting::getServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language'))); } else { list($result, $feed, $xml) = getRemoteFeed($noticeURLRSS); if ($result == 0) { $xmls = new XMLStruct(); $xmls->setXPathBaseIndex(1); $noticeEntries = array(); if ($xmls->open($xml, $ctx->getProperty('service.encoding'))) { if ($xmls->getAttribute('/rss', 'version')) { for ($i = 1; $link = $xmls->getValue("/rss/channel/item[{$i}]/link"); $i++) { $item = array('permalink' => rawurldecode($link)); $item['title'] = $xmls->getValue("/rss/channel/item[{$i}]/title"); if ($xmls->getValue("/rss/channel/item[{$i}]/pubDate")) { $item['written'] = parseDate($xmls->getValue("/rss/channel/item[{$i}]/pubDate")); } else { if ($xmls->getValue("/rss/channel/item[{$i}]/dc:date")) { $item['written'] = parseDate($xmls->getValue("/rss/channel/item[{$i}]/dc:date")); } else { $item['written'] = 0; } } array_push($noticeEntries, $item); } } } Setting::setServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language'), serialize($noticeEntries)); } } ?> <div id="textcube-notice"> <h4 class="caption"><span><a href="<?php echo $noticeURL . ($ctx->getProperty('blog.language') ? $ctx->getProperty('blog.language') : "ko"); ?> "><?php echo _t('공지사항'); ?> </a></span></h4> <?php if (count($noticeEntries) > 0) { array_splice($noticeEntries, 3, count($noticeEntries) - 3); ?> <table> <tbody> <?php foreach ($noticeEntries as $item) { ?> <tr> <td class="date"><?php echo Timestamp::format2($item['written']); ?> </td> <td class="title"><a href="<?php echo $item['permalink']; ?> " onclick="return openLinkInNewWindow(this);" ><?php echo htmlspecialchars(Utils_Unicode::lessenAsEm($item['title'], 35)); ?> </a></td> </tr> <?php } ?> </tbody> </table> <?php } else { ?> <div id="fail-notice"> <?php echo _t('공지사항을 가져올 수 없습니다. 잠시 후 다시 시도해 주십시오.'); ?> </div> <?php } ?> </div> <?php } ?> </div> <?php }
function checkResponseXML($responseText) { global $service; $xmls = new XMLStruct(); if (!$xmls->open(trim($responseText), $service['encoding'])) { return false; } if (($error = $xmls->getValue('/response/error')) !== null) { return intval($error); } else { return false; } }
} if (!file_exists(ROOT .'/exports/'.$programName.'/index.xml')) { func::alert(_t('프로그램 정보를 찾을 수 없습니다'), 'dialog'); } requireComponent('LZ.PHP.XMLStruct'); $xmls = new XMLStruct; if (!$xmls->openFile(ROOT . '/exports/'.$programName.'/index.xml')) { func::alert(_t('프로그램 정보를 읽을 수 없습니다'), 'dialog'); } $exportInfo = array(); $exportInfo['domain'] = $domainName; $exportInfo['program'] = $programName; $exportInfo['title'] = $xmls->getValue('/export/information/name[lang()]'); $exportInfo['config'] = $xmls->selectNode('/export/config[lang()]'); $exportInfo['description'] = func::filterJavascript($xmls->getValue('/export/information/description[lang()]')); $exportInfo['license'] = func::filterJavascript($xmls->getValue('/export/information/license[lang()]')); $exportInfo['version'] = func::filterJavascript($xmls->getValue('/export/information/version')); $exportInfo['author'] = func::filterJavascript($xmls->getValue('/export/information/author[lang()]')); $exportInfo['email'] = func::filterJavascript($xmls->getAttribute('/export/information/author[lang()]', 'email')); $exportInfo['homepage'] = func::filterJavascript($xmls->getAttribute('/export/information/author[lang()]', 'link')); $exportInfo['status'] = Validator::getBool($db->queryCell("SELECT status FROM {$database['prefix']}Exports WHERE domain='{$domainName}'")); $exportInfo['tags'] = array(); $sNode = $xmls->selectNode('/export/binding'); if(isset($sNode['tag'])) { foreach($sNode['tag'] as $tag) { array_push($exportInfo['tags'], '[##_'.$tag['.attributes']['name'].'_##]'); }
<h3><?php echo _t("스킨설정");?></h3> </div> <div class="wrap skin_setting_wrap"> <div class="now_skin"> <div class="listbox"> <div class="title"> <a href="<?php echo $service['path'];?>/admin/design/meta/"><?php echo _t('사용중인 스킨');?></a> </div> <div class="data"> <div class="thumbnail"> <img src="<?php echo $n_skinpath;?>/preview.gif" alt="<?php echo _t('미리보기 이미지');?>" /> </div> <div class="desc"> <?php echo $xmls->getValue('/skin/information/name[lang()]');?> <span class="version"><?php echo $xmls->getValue('/skin/information/version');?></span> <span class="name">(<?php echo $n_skinname;?>)</span> </div> <div class="clear"></div> </div> </div> <div class="shadow"></div> <div class="borderbox"> <a href="<?php echo $service['path'];?>/admin/design/meta/"><?php echo _t('스킨을 변경하시려면 이곳을 클릭하세요.');?></a> </div> </div> <div class="skin_setting"> <h4><?php echo _t('출력설정 수정');?></h4> <h5><?php echo _t('현재 사용중인 스킨의 출력설정을 수정합니다.');?></h5>
include ROOT. '/lib/piece/adminHeader.php'; $plugins = array(); $xmls = new XMLStruct; $pluginXmls = new XMLStruct; $dir = dir(ROOT . '/plugins/'); while (($file = $dir->read()) !== false) { if (!preg_match('/^[A-Za-z0-9 _-]+$/', $file)) continue; if (!is_dir(ROOT . '/plugins/' . $file)) continue; if (!file_exists(ROOT . '/plugins/'.$file.'/index.xml')) continue; if (!$xmls->openFile(ROOT . '/plugins/'.$file.'/index.xml')) continue; $plugin = array(); $plugin['name'] = $file; $plugin['title'] = $xmls->getValue('/plugin/information/name[lang()]'); $plugin['description'] = $xmls->getValue('/plugin/information/description[lang()]'); $pluginAuthor = $xmls->selectNode('/plugin/information/author[lang()]'); $plugin['author'] = array('name'=>$pluginAuthor['.value'], 'link'=>$pluginAuthor['.attributes']['link'], 'email'=>$pluginAuthor['.attributes']['email']); $pluginTings = $xmls->selectNode('/plugin/ting[lang()]'); $plugin['ting'] = array(); if(isset($pluginTings['pop'])) { foreach ($pluginTings['pop'] as $pop) { $event = $pop['.attributes']['event']; $type = $pop['.attributes']['type']; $text = $pop['.value']; array_push($plugin['ting'], array('event'=>$event, 'type'=>$type, 'text'=>trim($text))); } }
?> /* ToDo : CSS 속성제어용 자바스크립트 에디터 window.addEventListener("load", execLoadFunction, false); function execLoadFunction() { var CSSeditor = new SkinEditor(); CSSeditor.initialize('style'); }*/ //]]> </script> <?php if (file_exists(getSkinPath($skinSetting['skin']) . "/index.xml")) { $xml = file_get_contents(getSkinPath($skinSetting['skin']) . "/index.xml"); $xmls = new XMLStruct(); $xmls->open($xml, $service['encoding']); $skinName = $xmls->getValue('/skin/information/name') . ($skinSetting['skin'] == "customize/{$blogid}" ? _t('(수정한 스킨)') : NULL); } else { $skinName = $skinSetting['skin']; } ?> <div id="part-skin-edit" class="part"> <h2 class="caption"><span class="main-text"><?php echo _f('스킨을 편집합니다 : "%1"', $skinName); ?> </span></h2> <div class="data-inbox"> <div class="main-explain-box"> <p class="explain"><?php echo _t('이 곳에서 스킨을 편집할 수 있습니다. 편집이 끝난 스킨은 저장하기를 눌러 반영할 수 있습니다. 수정 중 원래 스킨으로 되돌리고 싶을 때는 되돌리기 버튼을 눌러 원래대로 되돌릴 수 있습니다.') . '<br />' . _t('수정한 파일은 내려받기 링크를 통해 다운로드 할 수 있습니다. 가장 최근에 수정한 파일을 내려 받기 위해서는 다운로드 전에 꼭 저장을 먼저 해 주시기 바랍니다. 스킨 파일은 하나의 html 파일로 되어 있기 때문에 다양한 웹 에디터를 사용해서 편집하셔도 문제가 없습니다. 내려받은 파일을 웹 에디터로 편집하신 후에 스킨 편집창에 붙여넣는 식으로 스킨을 수정하셔도 됩니다.'); ?>
" /> <?php } } ?> </div> <div class="information"> <?php if (file_exists(getSkinPath($skinSetting['skin']) . "/index.xml")) { ?> <div id="currentInfo"> <?php $xml = file_get_contents(getSkinPath($skinSetting['skin']) . "/index.xml"); $xmls = new XMLStruct(); $xmls->open($xml, $service['encoding']); writeValue('<span class="skin-name">' . $xmls->getValue('/skin/information/name') . '</span> <span class="version">ver.' . $xmls->getValue('/skin/information/version') . ($skinSetting['skin'] == "customize/{$blogid}" ? _t('(사용자 수정본)') : NULL) . '</span>', _t('제목'), "title"); writeValue($xmls->getValue('/skin/information/license'), _t('저작권'), "license"); writeValue($xmls->getValue('/skin/author/name'), _t('만든이'), "maker"); writeValue($xmls->getValue('/skin/author/homepage'), _t('홈페이지'), "homepage"); writeValue($xmls->getValue('/skin/author/email'), _t('e-mail'), "email"); writeValue($xmls->getValue('/skin/information/description'), _t('설명'), "explain"); ?> </div> <div class="button-box"> <a class="edit-button button" href="<?php echo $context->getProperty('uri.blog'); ?> /owner/skin/edit"><span class="text"><?php echo _t('편집하기'); ?> </span></a>