示例#1
0
function getBlogTags($blogid)
{
    if ($tags = Setting::getBlogSettingGlobal('blogTags')) {
        return $tags;
    }
    return null;
}
示例#2
0
文件: index.php 项目: ragi79/Textcube
function CT_Start_Default($target)
{
    requireModel("blog.attachment");
    requireComponent("Eolin.PHP.Core");
    requireComponent("Textcube.Function.misc");
    global $blogid, $blogURL, $database, $service;
    $target .= '<ul>';
    $target .= '<li><a href="' . $blogURL . '/owner/entry/post">' . _t('새 글을 씁니다') . '</a></li>' . CRLF;
    $latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0);
    if ($latestEntryId !== 0) {
        $latestEntry = CT_Start_Default_getEntry($blogid, $latestEntryId);
        if ($latestEntry != false) {
            $target .= '<li><a href="' . $blogURL . '/owner/entry/edit/' . $latestEntry['id'] . '">' . _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10))) . '</a></li>';
        }
    }
    if (Acl::check('group.administrators')) {
        $target .= '<li><a href="' . $blogURL . '/owner/skin">' . _t('스킨을 변경합니다') . '</a></li>' . CRLF;
        $target .= '<li><a href="' . $blogURL . '/owner/skin/sidebar">' . _t('사이드바 구성을 변경합니다') . '</a></li>' . CRLF;
        $target .= '<li><a href="' . $blogURL . '/owner/skin/setting">' . _t('블로그에 표시되는 값들을 변경합니다') . '</a></li>' . CRLF;
        $target .= '<li><a href="' . $blogURL . '/owner/entry/category">' . _t('카테고리를 변경합니다') . '</a></li>' . CRLF;
        $target .= '<li><a href="' . $blogURL . '/owner/plugin">' . _t('플러그인을 켜거나 끕니다') . '</a></li>' . CRLF;
    }
    if ($service['reader'] != false) {
        $target .= '<li><a href="' . $blogURL . '/owner/network/reader">' . _t('RSS 리더를 봅니다') . '</a></li>' . CRLF;
    }
    $target .= '</ul>';
    return $target;
}
示例#3
0
function CT_Start_Default($target)
{
    importlib("model.blog.attachment");
    $context = Model_Context::getInstance();
    $blogURL = $context->getProperty('uri.blog');
    $blogid = $context->getProperty('blog.id');
    $target .= '<ul>';
    $target .= '<li><a href="' . $blogURL . '/owner/entry/post">' . _t('새 글을 씁니다') . '</a></li>' . CRLF;
    $latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0);
    if ($latestEntryId !== 0) {
        $latestEntry = CT_Start_Default_getEntry($blogid, $latestEntryId);
        if ($latestEntry != false) {
            $target .= '<li><a href="' . $blogURL . '/owner/entry/edit/' . $latestEntry['id'] . '">' . _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10))) . '</a></li>';
        }
    }
    if (Acl::check('group.administrators')) {
        $target .= '<li><a href="' . $blogURL . '/owner/skin">' . _t('스킨을 변경합니다') . '</a></li>' . CRLF;
        $target .= '<li><a href="' . $blogURL . '/owner/skin/sidebar">' . _t('사이드바 구성을 변경합니다') . '</a></li>' . CRLF;
        $target .= '<li><a href="' . $blogURL . '/owner/skin/setting">' . _t('블로그에 표시되는 값들을 변경합니다') . '</a></li>' . CRLF;
        $target .= '<li><a href="' . $blogURL . '/owner/entry/category">' . _t('카테고리를 변경합니다') . '</a></li>' . CRLF;
        $target .= '<li><a href="' . $blogURL . '/owner/plugin">' . _t('플러그인을 켜거나 끕니다') . '</a></li>' . CRLF;
    }
    if ($context->getProperty('service.reader', false) != false) {
        $target .= '<li><a href="' . $blogURL . '/owner/network/reader">' . _t('RSS 리더를 봅니다') . '</a></li>' . CRLF;
    }
    $target .= '</ul>';
    return $target;
}
示例#4
0
文件: module.php 项目: ni5am/Textcube
function getDefaultFormatter()
{
    $context = Model_Context::getInstance();
    $formatterMappings = $context->getProperty('plugin.formatterMappings');
    reset($formatterMappings);
    return Setting::getBlogSettingGlobal('defaultFormatter', key($formatterMappings));
}
示例#5
0
function getSidebarModuleOrderData($sidebarCount)
{
    if (!is_null($tempValue = Setting::getBlogSettingGlobal("sidebarOrder", NULL))) {
        $emptyArray = unserialize($tempValue);
    } else {
        $emptyArray = false;
    }
    if ($emptyArray === false) {
        return null;
    }
    return $emptyArray;
}
示例#6
0
function getCoverpageModuleOrderData()
{
    if (!is_null($tempValue = Setting::getBlogSettingGlobal("coverpageOrder", NULL))) {
        $emptyArray = unserialize($tempValue);
    } else {
        $emptyArray = false;
    }
    if ($emptyArray === false) {
        return null;
    }
    return $emptyArray;
}
示例#7
0
function FM_Modern_editorinit($editor)
{
    global $entry;
    $context = Model_Context::getInstance();
    $blogid = getBlogId();
    if (is_null($context->getProperty('plugin.config', null))) {
        $config = array('paragraphdelim' => 'BR', 'defaultmode' => 'WYSIWYG');
    } else {
        $config = $context->getProperty('plugin.config');
    }
    if (in_array(Setting::getBlogSettingGlobal('defaultFormatter', 'html'), array('markdown', 'textile')) || in_array($entry['contentformatter'], array('markdown', 'textile'))) {
        $config['defaultmode'] = 'TEXTAREA';
    } else {
        if (!isset($config['defaultmode'])) {
            $config['defaultmode'] = 'WYSIWYG';
        }
    }
    ob_start();
    ?>
			if (typeof(document.execCommand) == "undefined" || !(STD.isIE || STD.isFirefox || (STD.isWebkit && STD.engineVersion >= 419.3))) return null;
			var editor = new TTModernEditor();
			editor.fixPosition = <?php 
    echo Setting::getBlogSettingGlobal('editorPropertyPositionFix', 0);
    ?>
;
			editor.hasGD = <?php 
    echo extension_loaded('gd') ? 'true' : 'false';
    ?>
;
			editor.propertyFilePath = "<?php 
    echo $context->getProperty('service.path');
    ?>
/attach/<?php 
    echo $blogid;
    ?>
/";
			editor.editMode = "<?php 
    echo $config['defaultmode'];
    ?>
";
			editor.newLineToParagraph = <?php 
    echo isset($config['paragraphdelim']) && $config['paragraphdelim'] == 'P' ? 'true' : 'false';
    ?>
;
			return editor;
<?php 
    $result = ob_get_contents();
    ob_end_clean();
    return $result;
}
示例#8
0
文件: index.php 项目: ragi79/Textcube
function Xquared_editorinit($editor)
{
    global $configVal, $entry, $pluginURL;
    $blogid = getBlogId();
    if (is_null($configVal) || empty($configVal)) {
        $config = array('paragraphdelim' => 'BR', 'defaultmode' => 'WYSIWYG');
    } else {
        $config = Setting::fetchConfigVal($configVal);
    }
    if (in_array(Setting::getBlogSettingGlobal('defaultFormatter', 'html'), array('markdown', 'textile')) || in_array($entry['contentformatter'], array('markdown', 'textile'))) {
        $config['defaultmode'] = 'TEXTAREA';
    } else {
        if (!isset($config['defaultmode'])) {
            $config['defaultmode'] = 'WYSIWYG';
        }
    }
    ob_start();
    ?>
			var editor = new xq.Editor("editWindow");
			editor.config.contentCssList = ["<?php 
    echo $pluginURL;
    ?>
/stylesheets/xq_contents.css"];
			editor.config.imagePathForDefaultToolbar = '<?php 
    echo $pluginURL;
    ?>
/images/toolbar/';
			editor.setEditMode('wysiwyg');
			editor.origInitialize = editor.initialize;
			editor.origFinalize = editor.finalize;
			editor.initialize = function() {
				this.origInitialize();
			}
			editor.finalize = function() {
				this.origFinalize();
			}
			editor.syncTextarea = function(){
				var oForm = document.getElementById('editor-form');
				oForm.content.value = this.getCurrentContent();
			}

			return editor;
<?php 
    $result = ob_get_contents();
    ob_end_clean();
    return $result;
}
示例#9
0
function openid_ViewCommenter($name, $comment)
{
    $context = Model_Context::getInstance();
    if ($comment['secret']) {
        return $name;
    }
    if (empty($comment['openid'])) {
        return $name;
    }
    $openidlogodisplay = Setting::getBlogSettingGlobal("OpenIDLogoDisplay", 0);
    if ($openidlogodisplay) {
        $name = "<a href=\"" . $comment['openid'] . "\" class=\"openid\"><img src=\"" . $context->getProperty('service.path') . "/resources/image/icon_openid.gif\" alt=\"OpenID Logo\" title=\"" . _textf("오픈아이디(%1)로 작성하였습니다", $comment['openid']) . "\" /></a>" . $name;
    } else {
        preg_match_all('@<a(.*)>(.*)</a>@Usi', $name, $temp);
        for ($i = 0; $i < count($temp[0]); $i++) {
            if (strip_tags($temp[2][$i]) == $comment['name']) {
                $name = str_replace($temp[0][$i], "<a{$temp[1][$i]} title='" . _textf("오픈아이디(%1)로 작성하였습니다", $comment['openid']) . "'>" . $temp[2][$i] . "</a>", $name);
            }
        }
        $name .= "<a href=\"" . $comment['openid'] . "\" class=\"openid\">&nbsp;</a>";
    }
    return $name;
}
示例#10
0
文件: index.php 项目: ragi79/Textcube
    ?>
</h3>
		</div>
		<div class="content"><?php 
    printMobileEntryContentView($blogid, $entry, null);
    ?>
</div>
<?php 
    $entryTags = getTags($entry['blogid'], $entry['id']);
    if (sizeof($entryTags) > 0) {
        ?>
		<div class="entry_tags" data-role="content" data-theme="c">
		<h3 class="tags_title">Tags</h3>
<?php 
        $tags = array();
        $relTag = Setting::getBlogSettingGlobal('useMicroformat', 3) > 1 && (count($entries) == 1 || !empty($skin->hentryExisted));
        foreach ($entryTags as $entryTag) {
            $tags[$entryTag['name']] = '<a href="' . $context->getProperty('uri.blog') . '/tag/' . $entryTag['id'] . '">' . htmlspecialchars($entryTag['name']) . '</a>';
        }
        echo implode(",\r\n", array_values($tags));
        ?>
		</div>
	</div>
<?php 
    }
    if (doesHaveOwnership() || $entry['visibility'] >= 2 || isset($_COOKIE['GUEST_PASSWORD']) && trim($_COOKIE['GUEST_PASSWORD']) == trim($entry['password'])) {
        printMobileNavigation($entry, true, true, $paging);
    } else {
        printMobileNavigation($entry, false, false, $paging);
    }
    if (!empty($entryPrint)) {
示例#11
0
文件: tag.php 项目: ragi79/Textcube
         $listCache = $cache;
         //preserve for ordering
     }
 }
 if ($skinSetting['showListOnTag'] != 2) {
     list($entries, $paging) = getEntriesWithPagingByTag($blogid, $tag, $suri['page'], $blog['entriesOnList'], $skinSetting['showListOnTag'] == 3 ? $blog['entriesOnPage'] : $blog['entriesOnList']);
     if ($skinSetting['showListOnTag'] == 1) {
         $skinSetting['showListWithTotalEntries'] = true;
     }
     $preservedEntries = $entries;
     unset($entries);
 }
 // Now, print starts.
 require ROOT . '/interface/common/blog/begin.php';
 $cache->reset();
 if (Setting::getBlogSettingGlobal('useKeywordAsTag', true) == true) {
     $cache->name = 'keyword-' . $tag . '-';
     if ($cache->load()) {
         require ROOT . '/interface/common/blog/entries.php';
     } else {
         $entries[0] = getKeylogByTitle(getBlogId(), $suri['value']);
         if (!empty($entries[0])) {
             require ROOT . '/interface/common/blog/entries.php';
             unset($entries);
         }
     }
 }
 if ($skinSetting['showListOnTag'] != 0) {
     $cache = $listCache;
     require ROOT . '/interface/common/blog/list.php';
 }
示例#12
0
function getBlogSetting($name, $default = null, $blogid = null)
{
    return Setting::getBlogSettingGlobal($name, $default);
}
示例#13
0
 static function changeBlog()
 {
     global $database, $blogURL, $blog, $service;
     $blogid = getBlogId();
     $blogList = User::getBlogs();
     if (count($blogList) == 0) {
         return;
     }
     $changeBlogView = str_repeat(TAB, 6) . "<select id=\"blog-list\" onchange=\"location.href='{$blogURL}/owner/network/teamblog/changeBlog/?blogid='+this.value\">" . CRLF;
     foreach ($blogList as $info) {
         $title = Utils_Unicode::lessen(Setting::getBlogSettingGlobal("title", null, $info, true), 30);
         $title = $title ? $title : _f('%1 님의 블로그', User::getBlogOwnerName($info));
         $changeBlogView .= str_repeat(TAB, 7) . '<option value="' . $info . '"';
         if ($info == $blogid) {
             $changeBlogView .= ' selected="selected"';
         }
         $changeBlogView .= '>' . $title . '</option>' . CRLF;
     }
     $changeBlogView .= str_repeat(TAB, 6) . '</select>' . CRLF;
     return $changeBlogView;
 }
示例#14
0
 function applyMF2Entry($type, $content)
 {
     /* This function contains heavy regular expressions, but this function is called once and stored in cache by skin setup logic */
     $bareContent = $this->getTopLevelContent($content);
     $content = preg_replace("/<((br|hr|img)[^>]*)>/sm", "{{{\\1}}}", $content);
     /* hAtom:entry-title */
     $content = addAttributeCore($content, '@(.*?)(<(a|span|textarea|td|h1|h2|h3|strong|cite|font)[^>]*>[^<>]*?\\[##_article_rep_title_##\\].*?</\\3>)(.*)@sm', array('class' => 'entry-title'), array(1, 2, 4), 1);
     if (preg_match('@<(a|span|textarea|td|h1|h2|h3|strong|cite|font)[^>]*?class=[\'"][^\'"]*entry-title[^\'"]*[\'"][^>]*>@sm', $content)) {
         array_push($this->microformatDebug, _text('Microformat-info: 제목에 hAtom용 title을 추가합니다.'));
     } else {
         array_push($this->microformatDebug, _text('Microformat-warn: 제목에 hAtom용 title을 추가하지 못했습니다.'));
     }
     /* hAtom:entry-content */
     $content = addAttributeCore($content, '@(.*?)(<(div|td|span|p)[^>]*>[^<>]*?\\[##_article_rep_desc_##\\].*?</\\3>)(.*)@sm', array('class' => 'entry-content'), array(1, 2, 4), 1);
     if (strstr($bareContent, '[##_article_rep_desc_##]') !== false) {
         $content = str_replace("[##_article_rep_desc_##]", "<div class=\"entry-content\">[##_article_rep_desc_##]</div>", $content);
         array_push($this->microformatDebug, _text('Microformat-info: 본문을 감싸고 있는 태그가 없어 div를 삽입한 뒤 hAtom용 entry-content를 추가합니다.'));
     } else {
         if (preg_match('@<(div|td|span|p)[^>]*?class=[\'"][^\'"]*entry-content[^\'"]*[\'"][^>]*>@sm', $content)) {
             array_push($this->microformatDebug, _text('Microformat-info: hAtom용 content를 추가합니다.'));
         } else {
             array_push($this->microformatDebug, _text('Microformat-warn: hAtom용 content를 추가하지 못했습니다.'));
         }
     }
     /* hAtom:updated, published */
     if (Setting::getBlogSettingGlobal('useMicroformat', 3) > 2) {
         /* Adding published, updated date */
         $content = preg_replace('@(<(div|td|span|p)[^>]*>[^<>]*?\\[##_article_rep_desc_##\\].*?</\\2>)@sm', "\\1\n\t\t\t\t\t<div style=\"display:none\">\n\t\t\t\t\t<abbr class=\"updated\" title=\"[##_article_rep_microformat_updated_##]\">[##_article_rep_date_##]</abbr>\n\t\t\t\t\t<abbr class=\"published\" title=\"[##_article_rep_microformat_published_##]\">[##_article_rep_date_##]</abbr>\n\t\t\t\t\t</div>", $content);
         if (preg_match('@<abbr[^>]*?class=[\'"][^\'"]*\\bupdated\\b[^\'"]*[\'"][^>]*>@sm', $content)) {
             array_push($this->microformatDebug, _text('Microformat-info: hAtom용 발행일(published,updated)을 보이지 않게 추가하였습니다.'));
         } else {
             array_push($this->microformatDebug, _text('Microformat-warn: hAtom용 발행일을 추가하지 못하였습니다.'));
         }
     } else {
         array_push($this->microformatDebug, _text('Microformat-info: 의미상 어긋나는 사용인 hAtom용 발행일(published,updated)을 추가하지 않았습니다.'));
     }
     /* hAtom:author should be a complete inner text(without other text such as 'By', 'From') of span,cite,label,li. */
     if (!preg_match('@<(\\w+)\\b[^>]*?class=[\'"][^\'"]*author[^\'"]*[\'"][^>]*>@sm', $content)) {
         if (preg_match('@<(span|cite|label|li)[^>]*>([^<>]*)\\[##_article_rep_author_##\\]([^<>]*)</\\1>@sm', $content, $match)) {
             /* If there are garbage texts around author's name..., embrace author's name with a span */
             if (!preg_match('/^\\s*$/', $match[2]) || !preg_match('/^\\s*$/', $match[3])) {
                 $content = str_replace("[##_article_rep_author_##]", "<span>[##_article_rep_author_##]</span>", $content);
                 array_push($this->microformatDebug, _text('Microformat-info: 작성자 주위로 공백외의 문자가 있어 <span>으로 한번 더 감쌉니다.'));
             }
         } else {
             array_push($this->microformatDebug, _text('Microformat-info: 작성자가 출력되지 않는 스킨입니다. 작성자를 보이지 않게 추가하였습니다.'));
             $content = preg_replace('@(<(div|td|span|p)[^>]*>[^<>]*?\\[##_article_rep_desc_##\\].*?</\\2>)@sm', "\\1\n\t\t\t\t\t<span style=\"display:none\">[##_article_rep_author_##]</span>", $content);
         }
         $content = addAttributeCore($content, '@(.*?)(<(span|cite|label|li|div)[^>]*>\\s*\\[##_article_rep_author_##\\]\\s*</\\3>)(.*)@sm', array('class' => 'author'), array(1, 2, 4), 1);
         if (preg_match('@<(span|cite|label|li|div)[^>]*?class=[\'"][^\'"]*\\bauthor\\b[^\'"]*[\'"][^>]*>@sm', $content)) {
             array_push($this->microformatDebug, _text('Microformat-info: 작성자에 hAtom용 class="author"를 추가합니다'));
         } else {
             array_push($this->microformatDebug, _text('Microformat-warn: 작성자에 hAtom용 class="author"를 추가하지 못하였습니다'));
         }
     } else {
         array_push($this->microformatDebug, _text('Microformat-info: class="author"를 사용한 스킨입니다. hAtom용 author는 삽입하지 않았습니다. 주의: 스킨에 사용된 author의 용도가 마이크로포맷과 다를 수 있습니다.'));
     }
     /* hAtom:hEntry is a unique division in a blog entry*/
     if (!preg_match('/<(p|div)[^>]*class=[\'"][^\'"]*\\bhentry\\b[^\'"]*[\'"][^>]*>/sm', $content)) {
         $content = "<div class=\"hentry\">\r\n{$content}\r\n</div>";
         array_push($this->microformatDebug, _text('Microformat-info: 블로그 글영역 전체를 hAtom용 entry로 간주합니다. 적절한 class="hentry" 삽입이 필요할 수 있습니다.'));
     } else {
         array_push($this->microformatDebug, _text('Microformat-info: 스킨에 class="hentry"가 있으므로, hAtom용 entry는 삽입하지 않았습니다.'));
     }
     /* bookmark to A link */
     addAttribute($content, 'a', 'href', '##_article_rep_link_##', array('rel' => 'bookmark', 'title' => "[##_article_rep_title_##]"));
     if (preg_match('@<a\\b[^>]*?rel=[\'"][^\'"]*bookmark[^\'"]*[\'"][^>]*>@sm', $content)) {
         array_push($this->microformatDebug, _text('Microformat-info: 제목에 bookmark를 추가합니다'));
     } else {
         if (Setting::getBlogSettingGlobal('useMicroformat', 3) > 2) {
             $content = str_replace("[##_article_rep_desc_##]", "<a style=\"display:none\" href=\"[##_article_rep_link_##]\" rel=\"bookmark\" class=\"entry-title\" title=\"[##_article_rep_title_##]\">[##_article_rep_title_##]</a>\r\n[##_article_rep_desc_##]", $content);
         }
         array_push($this->microformatDebug, _text('Microformat-info: 링크가 걸린 제목이 없어 보이지 않는 링크를 추가한 뒤 rel="bookmark"와 hAtom용 title을 추가하였습니다'));
     }
     $this->hentryExisted = true;
     $content = preg_replace("/{{{([^}]+)}}}/sm", '<\\1>', $content);
     return $content;
 }
示例#15
0
/// Copyright (c) 2004-2016, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
define('__TEXTCUBE_ADMINPANEL__', true);
require ROOT . '/library/preprocessor.php';
importlib('model.blog.comment');
$IV = array('POST' => array('name' => array('string', 'default' => ''), 'comment' => array('string', 'default' => ''), 'mode' => array(array('commit'), 'default' => ''), 'homepage' => array('string', 'default' => ''), 'password' => array('string', 'default' => ''), 'secret' => array(array('on'), 'default' => null)));
$context = Model_Context::getInstance();
$customIV = fireEvent('ManipulateIVRules', $IV, $context->getProperty('uri.interfaceRoute'));
Validator::addRule($customIV);
if (!Validator::isValid()) {
    Respond::PrintResult(array('error' => 1, 'description' => 'Illegal parameters'));
}
requireStrictRoute();
if (!Setting::getBlogSettingGlobal('acceptComments', 0) && !doesHaveOwnership()) {
    Respond::PrintResult(array('error' => 0, 'commentBlock' => '', 'recentCommentBlock' => ''));
    exit;
}
$pool = DBModel::getInstance();
if ((doesHaveMembership() || !empty($_POST['name'])) && !empty($_POST['comment']) && !empty($_POST['mode']) && $_POST['mode'] == 'commit') {
    if (!empty($_POST['name'])) {
        setcookie('guestName', $_POST['name'], time() + 2592000, $context->getProperty('uri.blog') . "/");
    }
    if (!empty($_POST['homepage']) && $_POST['homepage'] != 'http://') {
        if (strpos($_POST['homepage'], 'http://') === 0) {
            setcookie('guestHomepage', $_POST['homepage'], time() + 2592000, $context->getProperty('uri.blog') . "/");
        } else {
            setcookie('guestHomepage', 'http://' . $_POST['homepage'], time() + 2592000, $context->getProperty('uri.blog') . "/");
        }
    }
示例#16
0
function publishEntries()
{
    global $database;
    $blogid = getBlogId();
    $closestReservedTime = Setting::getBlogSettingGlobal('closestReservedPostTime', INT_MAX);
    if ($closestReservedTime < Timestamp::getUNIXtime()) {
        $entries = POD::queryAll("SELECT id, visibility, category\n\t\t\tFROM {$database['prefix']}Entries \n\t\t\tWHERE blogid = {$blogid} AND draft = 0 AND visibility < 0 AND published < UNIX_TIMESTAMP()");
        if (count($entries) == 0) {
            return;
        }
        foreach ($entries as $entry) {
            $result = POD::query("UPDATE {$database['prefix']}Entries \n\t\t\t\tSET visibility = 0 \n\t\t\t\tWHERE blogid = {$blogid} AND id = {$entry['id']} AND draft = 0");
            if ($entry['visibility'] == -3) {
                if ($result && setEntryVisibility($entry['id'], 2)) {
                    $updatedEntry = getEntry($blogid, $entry['id']);
                    if (!is_null($updatedEntry)) {
                        fireEvent('UpdatePost', $entry['id'], $updatedEntry);
                        setEntryVisibility($entry['id'], 3);
                    }
                }
            } else {
                if ($result) {
                    setEntryVisibility($entry['id'], abs($entry['visibility']));
                    $updatedEntry = getEntry($blogid, $entry['id']);
                    if (!is_null($updatedEntry)) {
                        fireEvent('UpdatePost', $entry['id'], $updatedEntry);
                    }
                }
            }
        }
        $newClosestTime = POD::queryCell("SELECT min(published)\n\t\t\tFROM {$database['prefix']}Entries\n\t\t\tWHERE blogid = {$blogid} AND draft = 0 AND visibility < 0 AND published > UNIX_TIMESTAMP()");
        if (!empty($newClosestTime)) {
            Setting::setBlogSettingGlobal('closestReservedPostTime', $newClosestTime);
        } else {
            Setting::setBlogSettingGlobal('closestReservedPostTime', INT_MAX);
        }
    }
}
示例#17
0
function getTrackbackFeedTotal($blogid, $rawMode = false, $mode = 'rss')
{
    global $database, $serviceURL, $defaultURL, $blogURL, $blog, $service;
    if (empty($blogid)) {
        $blogid = getBlogId();
    }
    $channel = initializeRSSchannel($blogid);
    $channel['title'] = RSSMessage($blog['title'] . ': ' . _text('최근 트랙백 목록'));
    $result = getRecentTrackbacks($blogid, Setting::getBlogSettingGlobal('commentsOnRSS', 20), true);
    if (!$result) {
        $result = array();
    }
    $channel['items'] = array();
    foreach ($result as $row) {
        $trackbackURL = $defaultURL . "/" . $row['entry'] . "#trackback";
        $content = htmlspecialchars($row['excerpt']);
        $item = array('id' => $row['id'], 'title' => RSSMessage($row['subject']), 'link' => $trackbackURL . $row['id'], 'categories' => array(), 'description' => RSSMessage($content), 'author' => RSSMessage(htmlspecialchars($row['site'])), 'pubDate' => $row['written'], 'comments' => $trackbackURL, 'guid' => $trackbackURL . $row['id']);
        array_push($channel['items'], $item);
    }
    if ($rawMode == true) {
        return $channel['items'];
    }
    $rss = array('channel' => $channel);
    if ($mode == 'rss') {
        return publishRSS($blogid, $rss);
    } else {
        if ($mode == 'atom') {
            return publishATOM($blogid, $rss);
        }
    }
    return false;
}
示例#18
0
 function statCallback($total, $totalsize)
 {
     $this->log("* " . sprintf(_t("총 %d개의 메시지"), $total));
     $lastStat = Setting::getBlogSettingGlobal('MmsPop3stat', '');
     $stat = "{$total} {$totalsize}";
     if ($stat == $lastStat) {
         $this->log("* " . _t("새로운 메시지가 없습니다"));
         return false;
     }
     setBlogSetting('MmsPop3stat', $stat);
     return true;
 }
示例#19
0
</span></th>
											<th class="content"><span class="text"><?php 
echo _t('내용');
?>
</span></th>
											<th class="delete"><span class="text"><?php 
echo _t('삭제');
?>
</span></th>
										</tr>
									</thead>
									<tbody>
<?php 
$more = false;
$mergedComments = array();
$lastVisitNotifiedPage = Setting::getBlogSettingGlobal('lastVisitNotifiedPage', null);
setBlogSetting('lastVisitNotifiedPage', time());
for ($i = 0; $i < count($comments); $i++) {
    array_push($mergedComments, $comments[$i]);
    $result = getCommentCommentsNotified($comments[$i]['id']);
    for ($j = 0; $j < count($result); $j++) {
        array_push($mergedComments, $result[$j]);
    }
}
$nameNumber = array();
for ($i = 0; $i < sizeof($mergedComments); $i++) {
    $comment = $mergedComments[$i];
    if (Filter::isFiltered('name', $comment['name'])) {
        $isNameFiltered = true;
    } else {
        $isNameFiltered = false;
示例#20
0
文件: index.php 项目: ragi79/Textcube
if (isset($_GET['search'])) {
    $_POST['search'] = $_GET['search'];
}
if (isset($_GET['trashType'])) {
    $_POST['trashType'] = $_GET['trashType'];
}
$IV = array('GET' => array('page' => array('int', 1, 'default' => 1)), 'POST' => array('category' => array('int', 'default' => 0), 'site' => array('string', 'default' => ''), 'url' => array('url', 'default' => ''), 'ip' => array('ip', 'default' => ''), 'withSearch' => array(array('on'), 'mandatory' => false), 'search' => array('string', 'default' => ''), 'perPage' => array('int', 10, 30, 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
requireModel("blog.response.remote");
requireModel("blog.trash");
$categoryId = empty($_POST['category']) ? 0 : $_POST['category'];
$site = empty($_POST['site']) ? '' : $_POST['site'];
$url = empty($_POST['url']) ? '' : $_POST['url'];
$ip = empty($_POST['ip']) ? '' : $_POST['ip'];
$search = empty($_POST['withSearch']) || empty($_POST['search']) ? '' : trim($_POST['search']);
$perPage = Setting::getBlogSettingGlobal('rowsPerPage', 10);
if (isset($_POST['perPage']) && is_numeric($_POST['perPage'])) {
    $perPage = $_POST['perPage'];
    Setting::setBlogSettingGlobal('rowsPerPage', $_POST['perPage']);
}
$tabsClass = array();
$tabsClass['postfix'] = null;
$tabsClass['postfix'] .= isset($_POST['category']) ? '&amp;category=' . $_POST['category'] : '';
$tabsClass['postfix'] .= isset($_POST['site']) ? '&amp;site=' . $_POST['site'] : '';
$tabsClass['postfix'] .= isset($_POST['ip']) ? '&amp;ip=' . $_POST['ip'] : '';
$tabsClass['postfix'] .= isset($_POST['search']) ? '&amp;search=' . $_POST['search'] : '';
$tabsClass['trash'] = true;
list($trackbacks, $paging) = getTrashTrackbackWithPagingForOwner($blogid, $categoryId, $site, $url, $ip, $search, $suri['page'], $perPage);
require ROOT . '/interface/common/owner/header.php';
?>
						<script type="text/javascript">
示例#21
0
<?php

/// Copyright (c) 2004-2016, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('viewtype' => array(array('listview', 'iconview'), 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
$backupListView = Setting::getBlogSettingGlobal('skinViewType');
// 하나라도 저장에 실패하면 롤백.
if (!Setting::setBlogSettingGlobal("skinViewType", $_POST['viewtype'])) {
    Setting::setBlogSettingGlobal("skinViewType", $backupListView);
    Respond::ResultPage(1);
} else {
    Respond::ResultPage(0);
}
示例#22
0
function getThumbnailPaddingColor()
{
    return Setting::getBlogSettingGlobal("thumbnailPaddingColor", "FFFFFF");
}
示例#23
0
文件: page.php 项目: ragi79/Textcube
<?php

/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
require ROOT . '/library/preprocessor.php';
define('__TEXTCUBE_PAGE__', true);
if (isset($suri['id']) || isset($suri['value']) && strlen($suri['value']) > 0) {
    if (!isset($suri['id']) || Setting::getBlogSettingGlobal('useSloganOnPost', 1) == 1) {
        list($entries, $paging) = getEntryWithPagingBySlogan($blogid, $suri['value'], true);
    } else {
        list($entries, $paging) = getEntryWithPaging($blogid, $suri['id'], true);
    }
    if (count($entries) === 1) {
        unset($paging);
    }
    fireEvent('OBStart');
    require ROOT . '/interface/common/blog/begin.php';
    if (empty($entries)) {
        header('HTTP/1.1 404 Not Found');
        if (empty($skin->pageError)) {
            dress('article_rep', fireEvent('ViewErrorPage', '<div class="TCwarning">' . _text('존재하지 않는 페이지입니다.') . '</div>'), $view);
        } else {
            dress('article_rep', NULL, $view);
            dress('page_error', fireEvent('ViewErrorPage', $skin->pageError), $view);
        }
        unset($paging);
    } else {
        require ROOT . '/interface/common/blog/entries.php';
    }
    require ROOT . '/interface/common/blog/end.php';
 function getBlogSetting($name, $default = null, $global = null)
 {
     if (is_null($global)) {
         $name = 'plugin_' . $name;
     }
     return Setting::getBlogSettingGlobal($name, $default, getBlogId(), false);
 }
示例#25
0
function myPlurk_AddPlurkIcon($target, $mother)
{
    global $blogid, $service, $database, $suri, $blogURL, $pluginURL, $configVal;
    requireComponent('Textcube.Function.misc');
    $data = misc::fetchConfigVal($configVal);
    $attachResponses = isset($data['attachResponses']) && $data['attachResponses'] == 1 ? true : false;
    $plurklang = Setting::getBlogSettingGlobal('blogLanguage', '');
    $plurkIcon = "";
    $responsePlurks = "";
    if ($suri['directive'] != "/rss" && $suri['directive'] != "/m" && $suri['directive'] != "/i/entry" && $suri['directive'] != "/atom" && $suri['directive'] != "/sync" && POD::queryCount("SELECT id FROM {$database['prefix']}PlurkEntries WHERE blogid={$blogid} AND id={$mother}") > 0) {
        $plurk_id = intval(POD::queryCell("SELECT plurkid FROM {$database['prefix']}PlurkEntries WHERE blogid={$blogid} AND id={$mother}"));
        $plurkLink = "http://www.plurk.com/p/" . base_convert($plurk_id, 10, 36);
        if (!empty($plurkLink)) {
            $plurkIcon = '<div id="plurkthis"><img src="' . $pluginURL . '/images/plurkicon.png" border="0" width="16" height="16" alt="Plurk This!" />&nbsp;PLURK: <a href="' . $plurkLink . '" target="_blank">' . $plurkLink . '</a></div><br />';
        }
        if (!$attachResponses) {
            return $plurkIcon . $target;
        }
        $cache = new PageCache();
        $cache->name = 'HC_TCPlurkCache';
        if ($cache->load()) {
            $cache->contents = unserialize($cache->contents);
            if (array_key_exists($mother, $cache->contents) && Timestamp::getUNIXtime() - $cache->dbContents < 600) {
                return $plurkIcon . $target . $cache->contents[$mother];
            }
        }
        require_once "libs/plurk_api.php";
        $plurk = new plurk_api();
        $plurkNickname = isset($data['plurknickname']) ? $data['plurknickname'] : "";
        $plurkPassword = isset($data['plurkpassword']) ? $data['plurkpassword'] : "";
        $plurk_api = 'iMCH3JDDda7c4bs0qiOchZcxAx7t8PA7';
        if (!$plurk->login($plurk_api, $plurkNickname, $plurkPassword)) {
            return $plurkIcon . $target;
        }
        $responsePlurks = "";
        $response = $plurk->get_responses($plurk_id);
        if ($response->responses_seen > 0) {
            $qualifiers = array("loves", "likes", "shares", "gives", "hates", "wants", "wishes", "needs", "will", "hopes", "asks", "has", "was", "wonders", "feels", "thinks", "says", "is");
            $qualifiers_locale = array('en' => $qualifiers, 'zh-TW' => array("愛", "喜歡", "推", "給", "討厭", "想要", "希望", "需要", "打算", "希望", "問", "已經", "曾經", "好奇", "覺得", "想", "說", "正在"), 'zh-CN' => array("爱", "喜欢", "推", "给", "讨厌", "想要", "希望", "需要", "打算", "希望", "问", "已经", "曾经", "好奇", "觉得", "想", "说", "正在"));
            $lang = "en";
            switch ($plurklang) {
                case "zh-TW":
                case "zh-CN":
                    $lang = $plurklang;
                    break;
                default:
                    $lang = "en";
            }
            $friends = array();
            $nick2displayname = array('nickname' => array(), 'displayname' => array());
            foreach ($response->friends as $friend) {
                $friends[$friend->uid]['display_name'] = $friend->display_name;
                $friends[$friend->uid]['nick_name'] = $friend->nick_name;
                $friends[$friend->uid]['has_profile_image'] = $friend->has_profile_image == 1 ? true : false;
                $friends[$friend->uid]['avatar'] = $friend->avatar == null ? "" : $friend->avatar;
                if (!in_array($friend->nick_name, $nick2displayname['nickname'])) {
                    array_push($nick2displayname['nickname'], $friend->nick_name);
                    array_push($nick2displayname['displayname'], $friend->display_name);
                }
            }
            ob_start();
            echo "<div class=\"plurkResponse\" id=\"plurkResponse_{$mother}\">\n";
            echo "<h3>" . _f("%1 Responses to this Plurk", $response->responses_seen) . "</h3>\n";
            echo "<div class=\"plurkResponseLists\">\n<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\">\n";
            foreach ($response->responses as $commentObj) {
                $comment = (array) $commentObj;
                $userIcon = $friends[$comment['user_id']]['has_profile_image'] ? "http://avatars.plurk.com/{$comment['user_id']}-medium{$friends[$comment['user_id']]['avatar']}.gif" : "";
                $display_name = $friends[$comment['user_id']]['display_name'];
                $nick_name = $friends[$comment['user_id']]['nick_name'];
                $qualifier = in_array($comment['qualifier'], $qualifiers) ? $comment['qualifier'] : "";
                $qualifierKey = array_keys($qualifiers, $comment['qualifier']);
                $qualifier_trans = isset($qualifiers_locale[$lang][$qualifierKey[0]]) ? $qualifiers_locale[$lang][$qualifierKey[0]] : '';
                if (preg_match_all('/<a href="http:\\/\\/www.plurk.com\\/(.*?)" class="ex_link">(.*?)<\\/a>/ms', $comment['content'], $matches)) {
                    $mlen = count($matches[1]);
                    for ($i = $mlen - 1; $i >= 0; $i--) {
                        if (in_array($matches[1][$i], $nick2displayname['nickname'])) {
                            $replydisplayname = $nick2displayname['displayname'][array_search($matches[1][$i], $nick2displayname['nickname'])];
                            $comment['content'] = str_replace('<a href="http://www.plurk.com/' . $matches[1][$i] . '" class="ex_link">' . $matches[2][$i] . '</a>', '<a href="http://www.plurk.com/' . $matches[1][$i] . '" class="ex_link">' . $replydisplayname . '</a>', $comment['content']);
                        }
                    }
                }
                echo "<tr><td class=\"user_icon\"><a href=\"http://www.plurk.com/{$nick_name}\" target=\"_blank\"><img src=\"{$userIcon}\" border=\"0\" width=\"45\" height=\"45\" alt=\"{$display_name}\" title=\"{$display_name}\" onerror=\"this.src='{$pluginURL}/images/nonusericon.gif'\" /></a></td>\n";
                echo "<td class=\"plurkcontent\"><a href=\"http://www.plurk.com/{$nick_name}\" target=\"_blank\">{$display_name}</a>&nbsp;\n";
                echo "<span class=\"qualifier_{$qualifier}\">{$qualifier_trans}</span>&nbsp;<span class=\"plurkcomment\">{$comment['content']}</span></td></tr>\n";
            }
            echo "</table>\n</div>\n<p style=\"text-align:right;line-height:1em;\" class=\"plurkResponseMoreButton\">" . _t('MorePlurk...') . "</p>\n";
            echo "</div>\n\n";
            $responsePlurks = ob_get_contents();
            ob_end_clean();
        } else {
            // no response
        }
        $cache->contents[$mother] = $responsePlurks;
        $cache->contents = serialize($cache->contents);
        $cache->dbContents = Timestamp::getUNIXtime();
        $cache->update();
        unset($cache);
    }
    return $plurkIcon . $target . $responsePlurks;
}
示例#26
0
function printIphoneHtmlHeader($title = '')
{
    $context = Model_Context::getInstance();
    $title = htmlspecialchars($context->getProperty('blog.title') . ' :: ' . $title);
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko">
<head>
	<title><?php 
    echo $title;
    ?>
</title>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
	<link rel="stylesheet" type="text/css" href="<?php 
    echo $context->getProperty('service.path');
    ?>
/resources/style/iphone/iphone.css" />
<?php 
    if (Setting::getBlogSettingGlobal('useBlogIconAsIphoneShortcut', true) && file_exists(ROOT . "/attach/" . $context->getProperty('blog.id') . "/index.gif")) {
        ?>
	<link rel="apple-touch-icon" href="<?php 
        echo $context->getProperty('uri.default') . "/index.gif";
        ?>
" />
<?php 
    }
    ?>
	<script type="application/x-javascript" src="<?php 
    echo $context->getProperty('service.path');
    ?>
/resources/script/iphone/iphone.js"></script>
</head>
<body>
	<div class="toolbar">
		<h1 id="pageTitle"><?php 
    echo htmlspecialchars($context->getProperty('blog.title'));
    ?>
</h1>
		<a id="backButton" class="button" href="#"></a>
		<a class="button" href="#searchForm" id="searchButton" onclick="searchAction(true);"><?php 
    echo _text('검색');
    ?>
</a>
	</div>
	<div class="toolbar shortcut">
	<ul>
		<li><a href="<?php 
    echo $context->getProperty('uri.blog');
    ?>
" onclick="window.location.href='<?php 
    echo $context->getProperty('uri.blog');
    ?>
'"><?php 
    echo _text('글목록');
    ?>
</a></li>
		<li><a href="<?php 
    echo $context->getProperty('uri.blog');
    ?>
/comment"><?php 
    echo _text('댓글');
    ?>
</a></li>
		<li><a href="<?php 
    echo $context->getProperty('uri.blog');
    ?>
/trackback"><?php 
    echo _text('트랙백');
    ?>
</a></li>
		<li><a href="<?php 
    echo $context->getProperty('uri.blog');
    ?>
/guestbook"><?php 
    echo _text('방명록');
    ?>
</a></li>
	</ul>
	</div>

<?php 
}
示例#27
0
 function getBlogSettingRowsPerPage($default = null)
 {
     return Setting::getBlogSettingGlobal('rowsPerPage', $default);
 }
示例#28
0
$teamblog_users = null;
if (Acl::check('group.administrators')) {
    $teamblog_users = POD::queryAll("SELECT u.*, p.acl FROM {$database['prefix']}Users AS u INNER JOIN {$database['prefix']}Privileges AS p ON u.userid = p.userid AND p.blogid = {$blogid} ORDER BY p.acl DESC, name ASC");
}
require ROOT . '/interface/common/owner/header.php';
?>
						<script type="text/javascript">
							//<![CDATA[
<?php 
printScriptCheckTextcubeVersion();
?>
								function setEntryVisibility(entry, visibility) {
									if ((visibility < 0) || (visibility > 3))
										return false;
<?php 
if (Setting::getBlogSettingGlobal('visibility', 2) < 2) {
    ?>
									if(visibility == 3) {
										alert('<?php 
    echo _t('블로그가 공개되지 않은 상태이기 때문에 발행할 수 없습니다.');
    ?>
');
										return false;
									}
<?php 
}
?>
									if (visibility == 3 && document.getElementById("syndicatedIcon_" + entry).style.backgroundPosition == 'left bottom') {
										visibility = 2;
									}
示例#29
0
 function authenticate($blogid, $loginid, $password, $blogapi = false)
 {
     $session = array();
     Acl::clearAcl();
     $pool = DBModel::getInstance();
     $blogApiPassword = Setting::getBlogSettingGlobal("blogApiPassword", "");
     $pool->reset("Users");
     if (strlen($password) == 32 && preg_match('/[0-9a-f]{32}/i', $password)) {
         // Traditional md5 Raw login. ( with/without auth token)
         $userid = User::getUserIdByEmail($loginid);
         if (!empty($userid) && !is_null($userid)) {
             $pool->reset('UserSettings');
             $pool->setQualifier('userid', 'equals', intval($userid));
             $pool->setQualifier('name', 'equals', 'AuthToken', true);
             $authtoken = $query->getCell('value');
             $pool->reset("Users");
             if (!empty($authtoken) && $authtoken === $password) {
                 // If user requested auth token, use it to confirm.
                 $session['userid'] = $userid;
             } else {
                 // login with md5 hash
                 $pool->setQualifier("password", "eq", md5($password), true);
             }
         } else {
             return false;
         }
     } else {
         if ($blogapi && !empty($blogApiPassword)) {
             // BlogAPI login
             $pool->setQualifierSet(array("password", "eq", md5($password), true), "OR", array($password, "eq", $blogApiPassword, true));
         } else {
             // Normal login
             $pool->setQualifier("password", "eq", md5($password), true);
         }
     }
     if (empty($session)) {
         $pool->setQualifier("loginid", "eq", $loginid, true);
         $session = $pool->getRow("userid, loginid");
     }
     if (empty($session)) {
         /* You should compare return value with '=== false' which checks with variable types*/
         return false;
     }
     $userid = $session['userid'];
     Acl::authorize('textcube', $userid);
     $pool->reset("Users");
     $pool->setAttribute("lastlogin", Timestamp::getUNIXtime());
     $pool->setQualifier("loginid", "eq", $loginid, true);
     $pool->update();
     //		POD::execute("DELETE FROM {$database['prefix']}UserSettings WHERE userid = '$userid' AND name = 'AuthToken' LIMIT 1");
     return $userid;
 }
示例#30
0
<?php

/// Copyright (c) 2004-2016, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
define('__TEXTCUBE_LOGIN__', true);
require ROOT . '/library/preprocessor.php';
importlib("model.blog.api");
/*--------- API main ---------------*/
if (Setting::getBlogSettingGlobal('useBlogAPI', 0) != 1) {
    Respond::NotFoundPage();
    exit;
}
function SendRSD()
{
    $context = Model_Context::getInstance();
    $blogid = $context->getProperty('blog.id');
    $homeurl = $context->getProperty('uri.host') . $context->getProperty('uri.blog');
    $apiurl = $homeurl . "/api";
    header("Content-type: text/xml", true);
    print '<?xml version="1.0" encoding="utf-8" ?>
<rsd xmlns="http://archipelago.phrasewise.com/rsd" version="1.0">
    <service xmlns="">
        <engineName>Textcube</engineName>
        <engineLink>http://www.textcube.org/</engineLink>
        <homePageLink>' . $homeurl . '/</homePageLink>
        <apis>
        		<api name="MovableType" preferred="true" apiLink="' . $apiurl . '" blogID="' . $blogid . '" />
                <api name="MetaWeblog" preferred="false" apiLink="' . $apiurl . '" blogID="' . $blogid . '" />
                <api name="Blogger" preferred="false" apiLink="' . $apiurl . '" blogID="' . $blogid . '" />
        </apis>