コード例 #1
0
ファイル: index.php プロジェクト: Avantians/Textcube
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;
}
コード例 #2
0
ファイル: index.php プロジェクト: Avantians/Textcube
function KeywordUI_bindTag($target, $mother)
{
    $context = Model_Context::getInstance();
    importlib('model.blog.keyword');
    $blogid = getBlogId();
    $blogURL = $context->getProperty("uri.blog");
    $pluginURL = $context->getProperty("plugin.uri");
    if (isset($mother) && isset($target)) {
        $tagsWithKeywords = array();
        $keywordNames = getKeywordNames($blogid);
        foreach ($target as $tag => $tagLink) {
            if (in_array($tag, $keywordNames) == true) {
                $tagsWithKeywords[$tag] = $tagLink . "<a href=\"#\" class=\"key1\" onclick=\"openKeyword('{$blogURL}/keylog/" . URL::encode($tag) . "'); return false\"><img src=\"" . $pluginURL . "/images/flag_green.gif\" alt=\"Keyword " . $tag . "\"/></a>";
            } else {
                $tagsWithKeywords[$tag] = $tagLink;
            }
        }
        $target = $tagsWithKeywords;
    }
    return $target;
}
コード例 #3
0
ファイル: cron.php プロジェクト: Avantians/Textcube
function dumbCronScheduler($checkOnly = true)
{
    $context = Model_Context::getInstance();
    $now = Timestamp::getUNIXtime();
    $dumbCronStamps = Setting::getServiceSetting('dumbCronStamps', serialize(array('1m' => 0, '5m' => 0, '30m' => 0, '1h' => 0, '2h' => 0, '6h' => 0, '12h' => 0, '24h' => 0, 'Daily' => 0)), true);
    $dumbCronStamps = unserialize($dumbCronStamps);
    $schedules = array('1m' => 60, '5m' => 60 * 5, '10m' => 60 * 10, '30m' => 60 * 30, '1h' => 60 * 60, '2h' => 60 * 60 * 2, '6h' => 60 * 60 * 6, '12h' => 60 * 60 * 12, '24h' => 60 * 60 * 24, 'Daily' => 60 * 60 * 24, '1w' => 60 * 60 * 24 * 7);
    /* Events: Cron1m, Cron5m, Cron30m, Cron1h, Cron2h, Cron6h, Cron12h */
    $log_file = __TEXTCUBE_CACHE_DIR__ . '/cronlog.txt';
    $log = fopen($log_file, "a");
    foreach ($schedules as $d => $diff) {
        if (!isset($dumbCronStamps[$d])) {
            $dumbCronStamps[$d] = 0;
        }
        if ($now > $diff + $dumbCronStamps[$d]) {
            if ($checkOnly && eventExists("Cron{$d}")) {
                fclose($log);
                return true;
            }
            fireEvent("Cron{$d}", null, $now);
            if ($d == '6h') {
                importlib('model.blog.trash');
                trashVan();
            }
            fwrite($log, date('Y-m-d H:i:s') . ' ' . $context->getProperty('blog.name') . " Cron{$d} executed ({$_SERVER['REQUEST_URI']})\r\n");
            $dumbCronStamps[$d] = $now;
        }
    }
    fclose($log);
    /* Keep just 1000 lines */
    $logcontent = explode("\r\n", file_get_contents($log_file));
    $logcontent = implode("\r\n", array_slice($logcontent, -1000));
    $log = fopen($log_file, "w");
    fwrite($log, $logcontent);
    fclose($log);
    Setting::setServiceSetting('dumbCronStamps', serialize($dumbCronStamps), true);
    return false;
}
コード例 #4
0
ファイル: index.php プロジェクト: webhacking/Textcube
<?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('title' => array('string', 'default' => '')));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
if (!empty($_POST['title'])) {
    importlib('model.blog.blogSetting');
    if (setBlogTitle(getBlogId(), trim($_POST['title']))) {
        Respond::ResultPage(0);
    }
}
Respond::ResultPage(-1);
コード例 #5
0
ファイル: index.php プロジェクト: webhacking/Textcube
/// 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)
require ROOT . '/library/preprocessor.php';
$tabsClass['cover'] = true;
importlib('blogskin');
importlib("model.blog.sidebar");
importlib("model.blog.coverpage");
importlib("model.blog.entry");
importlib("model.blog.archive");
importlib("model.blog.tag");
importlib("model.blog.notice");
importlib("model.blog.comment");
importlib("model.blog.remoteresponse");
importlib("model.blog.link");
require ROOT . '/interface/common/owner/header.php';
$service['pagecache'] = false;
// For plugin setting update.
$stats = Statistics::getStatistics($blogid);
function correctCoverpageImage($subject)
{
    $pattern_with_src = '/(?:\\ssrc\\s*=\\s*["\']?)([^\\s^"^>^\']+)(?:[\\s">\'])/i';
    $pattern_with_background = '/(?:\\sbackground\\s*=\\s*["\']??)([^\\s^"^>^\']+)(?:[\\s">\'])/i';
    $pattern_with_url_func = '/(?:url\\s*\\(\\s*\'?)([^)]+)(?:\'?\\s*\\))/i';
    $return_val = preg_replace_callback($pattern_with_src, 'correctImagePath', $subject);
    $return_val = preg_replace_callback($pattern_with_background, 'correctImagePath', $return_val);
    $return_val = preg_replace_callback($pattern_with_url_func, 'correctImagePath', $return_val);
    return $return_val;
}
function correctImagePath($match)
コード例 #6
0
ファイル: index.php プロジェクト: webhacking/Textcube
<?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('allowBlogVisibility' => array('bool'), 'requireLogin' => array('bool'), 'encoding' => array('string'), 'faviconDailyTraffic' => array('int'), 'flashClipboardPoter' => array('bool'), 'flashUploader' => array('bool'), 'language' => array('string'), 'serviceurl' => array('string'), 'cookieprefix' => array('string', 'mandatory' => false, 'default' => ''), 'skin' => array('string'), 'timeout' => array('int'), 'autologinTimeout' => array('int'), 'timezone' => array('string'), 'useDebugMode' => array('bool'), 'useEncodedURL' => array('bool'), 'useNumericRSS' => array('bool'), 'usePageCache' => array('bool'), 'useCodeCache' => array('bool'), 'useReader' => array('bool'), 'useRewriteDebugMode' => array('bool'), 'useSessionDebugMode' => array('bool'), 'useSkinCache' => array('bool'), 'useMemcached' => array('bool'), 'useExternalResource' => array('bool'), 'externalResourceURL' => array('string', 'mandatory' => false, 'default' => '')));
require ROOT . '/library/preprocessor.php';
importlib('model.blog.service');
requireStrictRoute();
$matchTable = array('timeout' => 'timeout', 'autologinTimeout' => 'autologinTimeout', 'skin' => 'skin', 'language' => 'language', 'timezone' => 'timezone', 'encoding' => 'encoding', 'serviceurl' => 'serviceURL', 'cookieprefix' => 'cookie_prefix', 'usePageCache' => 'pagecache', 'useCodeCache' => 'codecache', 'useSkinCache' => 'skincache', 'useMemcached' => 'memcached', 'useReader' => 'reader', 'useNumericRSS' => 'useNumericRSS', 'useEncodedURL' => 'useEncodedURL', 'useExternalResource' => 'externalresources', 'externalResourceURL' => 'resourcepath', 'allowBlogVisibility' => 'allowBlogVisibilitySetting', 'requireLogin' => 'requirelogin', 'flashClipboardPoter' => 'flashclipboardpoter', 'flashUploader' => 'flashuploader', 'useDebugMode' => 'debugmode', 'useSessionDebugMode' => 'debug_session_dump', 'useRewriteDebugMode' => 'debug_rewrite_module', 'faviconDailyTraffic' => 'favicon_daily_traffic');
$description = array('server' => 'Database server location. Can be socket or address.', 'database' => 'Database name.', 'username' => 'Database username.', 'password' => 'Database password.', 'dbms' => 'Database engine.', 'prefix' => 'Table prefix in database.', 'type' => 'Service type. [single|path|domain] e.g. [http://www.example.com/blog | http://www.example.com/blog/blog1 | http://blog1.example.com].', 'domain' => 'Service domain. (http://www.example.com)', 'path' => 'Service path. (e.g. /blog)', 'timeout' => 'Session timeout limit (sec.)', 'autologinTimeout' => 'Automatic login timeout (sec.)', 'skin' => 'Default blog skin name.', 'language' => 'Server language', 'timezone' => 'Server timezone', 'encoding' => 'Character encoding', 'serviceURL' => 'Specify the default service URL. Useful if using other web program under the same domain.', 'cookie_prefix' => 'Service cookie prefix. Default cookie prefix is Textcube_[VERSION_NUMBER].', 'pagecache' => 'Use pagecache function.', 'codecache' => 'Use codecache function.', 'skincache' => 'Use skin pre-fetching.', 'memcached' => 'Use memcache to handle session and cache', 'reader' => 'Use Textcube reader. You can set it to false if you do not use Textcube reader, and want to decrease DB load.', 'useNumericRSS' => 'Can force permalink to numeric format on RSS output.', 'useEncodedURL' => 'URL encoding using RFC1738', 'externalresources' => 'Loads resources from external CDN from resourceURL.', 'resourcepath' => 'Specify the full URI of external resource.', 'useSSL' => 'Use SSL connection. Every http:// will be replaced with https://', 'allowBlogVisibilitySetting' => 'Allow service users to change blog visibility.', 'requirelogin' => 'Force log-in process to every blogs. (for private blog service)', 'flashclipboardpoter' => 'Use Flash clipboard copy to support one-click trackback address copy.', 'flashuploader' => 'Use Flash uploader to upload multiple files.', 'debugmode' => 'Textcube debug mode. (for core / plugin debug or optimization)', 'debug_session_dump' => 'session info debuging.', 'debug_rewrite_module' => 'rewrite handling module info debuging.', 'favicon_daily_traffic' => 'Set favicon traffic limitation. default is 10MB.');
/* Exception handling */
$config = array();
foreach ($matchTable as $abs => $real) {
    if ($_POST[$abs] === 1) {
        $config[$real] = true;
    } else {
        if ($_POST[$abs] === 0) {
            $config[$real] = false;
        } else {
            $config[$real] = $_POST[$abs];
        }
    }
}
$result = writeConfigFile($config, $description);
if ($result === true) {
    Respond::PrintResult(array('error' => 0));
} else {
    Respond::PrintResult(array('error' => 1, 'msg' => $result));
}
コード例 #7
0
ファイル: index.php プロジェクト: webhacking/Textcube
<?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('GET' => array('url' => array('url', 'default' => null)));
require ROOT . '/library/preprocessor.php';
importlib("model.blog.remoteresponse");
requireStrictRoute();
Respond::ResultPage(!empty($_GET['url']) && sendTrackback($blogid, $suri['id'], trim($_GET['url'])));
コード例 #8
0
ファイル: index.php プロジェクト: webhacking/Textcube
<?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('names' => array('string', 'default' => null)));
require ROOT . '/library/preprocessor.php';
importlib("model.blog.attachment");
requireStrictRoute();
if (!empty($_POST['names']) && deleteAttachmentMulti($blogid, $suri['id'], $_POST['names'])) {
    Respond::ResultPage(0);
} else {
    Respond::ResultPage(-1);
}
コード例 #9
0
ファイル: setup.php プロジェクト: hoksi/Textcube
    $path = stripPath(substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF']) - 12));
}
$_SERVER['PHP_SELF'] = rtrim($_SERVER['PHP_SELF'], '/');
// Set default table prefix.
if (isset($_POST['dbPrefix']) && $_POST['dbPrefix'] == '') {
    $_POST['dbPrefix'] == 'tc_';
}
$context = Model_Context::getInstance();
$context->setProperty('import.library', array('function.string', 'function.time', 'function.javascript', 'function.html', 'function.xml', 'function.mail'));
if (isset($_POST['dbms'])) {
    $database['dbms'] = $_POST['dbms'];
}
require ROOT . '/library/include.php';
importlib('model.blog.blogSetting');
importlib('model.blog.entry');
importlib('auth');
if (!empty($_GET['test'])) {
    echo getFingerPrint();
    exit;
}
$baseLanguage = 'ko';
if (!empty($_POST['Lang'])) {
    $baseLanguage = $_POST['Lang'];
}
$locale = Locales::getInstance();
$locale->setDomain('setup');
if ($locale->setDirectory(ROOT . '/resources/locale/setup')) {
    $locale->set($baseLanguage, "setup");
}
if (file_exists($root . '/config.php') && filesize($root . '/config.php') > 0) {
    header('HTTP/1.1 503 Service Unavailable');
コード例 #10
0
ファイル: index.php プロジェクト: Avantians/Textcube
<?php

/// Copyright (c) 2004-2015, 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('visibility' => array('int', 0, 3), 'starred' => array('int', 0, 2), 'category' => array('int', 'default' => 0), 'title' => array('string'), 'content' => array('string'), 'contentformatter' => array('string'), 'contenteditor' => array('string'), 'permalink' => array('string', 'default' => ''), 'location' => array('string', 'default' => '/'), 'latitude' => array('number', 'default' => null, 'min' => -90.0, 'max' => 90.0, 'bypass' => true), 'longitude' => array('number', 'default' => null, 'min' => -180.0, 'max' => 180.0, 'bypass' => true), 'tag' => array('string', 'default' => ''), 'acceptcomment' => array(array('0', '1'), 'default' => '0'), 'accepttrackback' => array(array('0', '1'), 'default' => '0'), 'published' => array('int', 0, 'default' => 1)));
require ROOT . '/library/preprocessor.php';
importlib('model.blog.entry');
requireStrictRoute();
if (empty($suri['id'])) {
    $entry = array();
} else {
    $updateDraft = 0;
    $entry = getEntry($blogid, $suri['id']);
    if (is_null($entry)) {
        $entry = getEntry($blogid, $suri['id'], true);
        $updateDraft = 1;
    }
}
if (empty($suri['id']) || !is_null($entry)) {
    $entry['visibility'] = $_POST['visibility'];
    $entry['starred'] = $_POST['starred'];
    $entry['category'] = $_POST['category'];
    $entry['location'] = empty($_POST['location']) ? '/' : $_POST['location'];
    $entry['latitude'] = empty($_POST['latitude']) || $_POST['latitude'] == "null" ? null : $_POST['latitude'];
    $entry['longitude'] = empty($_POST['longitude']) || $_POST['longitude'] == "null" ? null : $_POST['longitude'];
    $entry['tag'] = empty($_POST['tag']) ? '' : $_POST['tag'];
    $entry['title'] = $_POST['title'];
    $entry['content'] = $_POST['content'];
    $entry['contentformatter'] = $_POST['contentformatter'];
    $entry['contenteditor'] = $_POST['contenteditor'];
コード例 #11
0
ファイル: index.php プロジェクト: Avantians/Textcube
 $entry['id'] = $entryId;
 $entry['slogan'] = getSloganById($blogid, $entryId);
 if (!$comment['secret']) {
     $pool = DBModel::getInstance();
     $pool->reset('Entries');
     $pool->setQualifier('blogid', 'equals', $blogid);
     $pool->setQualifier('id', 'equals', $entryId);
     $pool->setQualifier('draft', 'equals', 0);
     $pool->setQualifier('visibility', 'equals', 3);
     $pool->setQualifier('acceptcomment', 'equals', 1);
     $row = $pool->getAll('*');
     if (!empty($row)) {
         sendCommentPing($entryId, $context->getProperty('uri.default') . "/" . ($context->getProperty('blog.useSloganOnPost') ? "entry/{$row['slogan']}" : $entryId), is_null($user) ? $comment['name'] : $user['name'], is_null($user) ? $comment['homepage'] : $user['homepage']);
     }
 }
 importlib('model.blog.skin');
 $skin = new Skin($context->getProperty('skin.skin'));
 if ($entryId > 0) {
     $commentBlock = getCommentView($entry, $skin);
     dress('article_rep_id', $entryId, $commentBlock);
     $commentBlock = escapeCData(revertTempTags(removeAllTags($commentBlock)));
     $recentCommentBlock = escapeCData(revertTempTags(getRecentCommentsView(getRecentComments($blogid), null, $skin->recentCommentItem)));
     $commentCount = getCommentCount($blogid, $entryId);
     $commentCount = $commentCount > 0 ? $commentCount : 0;
     list($tempTag, $commentView) = getCommentCountPart($commentCount, $skin);
 } else {
     $commentView = '';
     $commentBlock = getCommentView($entry, $skin);
     dress('article_rep_id', $entryId, $commentBlock);
     $commentBlock = escapeCData(revertTempTags(removeAllTags($commentBlock)));
     $commentCount = 0;
コード例 #12
0
ファイル: include.php プロジェクト: Avantians/Textcube
/// Copyright (c) 2004-2015, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
/** Pre-define basic components */
/***** Loading code pieces *****/
if (isset($uri)) {
    $codeName = $uri->uri['interfaceType'];
}
if ($context->getProperty('service.codecache', null) == true && file_exists(__TEXTCUBE_CACHE_DIR__ . '/code/' . $codeName)) {
    $codeCacheRead = true;
    require __TEXTCUBE_CACHE_DIR__ . '/code/' . $codeName;
} else {
    $codeCacheRead = false;
    foreach ($context->getProperty('import.library') as $lib) {
        if (strpos($lib, 'DEBUG') === false) {
            importlib($lib);
        } else {
            if (defined('TCDEBUG')) {
                __tcSqlLogPoint($lib);
            }
        }
    }
}
if ($context->getProperty('service.codecache', null) == true && $codeCacheRead == false) {
    $libCode = new CodeCache();
    $libCode->name = $codeName;
    foreach ($context->getProperty('import.library') as $lib) {
        array_push($libCode->sources, '/library/' . str_replace(".", "/", $lib) . '.php');
    }
    $libCode->save();
    unset($libCode);
コード例 #13
0
ファイル: blogSetting.php プロジェクト: webhacking/Textcube
function setDefaultPost($blogid, $userid)
{
    importlib('model.blog.entry');
    $entry = array();
    $entry['category'] = 0;
    $entry['visibility'] = 2;
    $entry['location'] = '/';
    $entry['tag'] = '';
    $entry['title'] = _t('환영합니다!');
    $entry['slogan'] = 'welcome';
    $entry['contentformatter'] = 'ttml';
    $entry['contenteditor'] = 'tinyMCE';
    $entry['starred'] = 0;
    $entry['acceptcomment'] = 1;
    $entry['accepttrackback'] = 1;
    $entry['published'] = null;
    $entry['firstEntry'] = true;
    $entry['content'] = getDefaultPostContent();
    return addEntry($blogid, $entry, $userid);
}
コード例 #14
0
ファイル: index.php プロジェクト: Avantians/Textcube
<?php

/// Copyright (c) 2004-2015, 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('visibility' => array('int', 0, 3, 'mandatory' => false), 'acceptComments' => array('int', 0, 1, 'mandatory' => false), 'acceptTrackbacks' => array('int', 0, 1, 'mandatory' => false), 'useiPhoneUI' => array('int', 0, 1, 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
importlib('model.blog.feed');
requireStrictRoute();
$result = false;
if (isset($_POST['visibility'])) {
    if (Setting::setBlogSettingGlobal('visibility', $_POST['visibility'])) {
        CacheControl::flushCommentRSS();
        CacheControl::flushTrackbackRSS();
        clearFeed();
        $result = true;
    }
}
if (isset($_POST['acceptComments'])) {
    if (Setting::setBlogSettingGlobal('acceptComments', $_POST['acceptComments'])) {
        $result = true;
    }
}
if (isset($_POST['acceptTrackbacks'])) {
    if (Setting::setBlogSettingGlobal('acceptTrackbacks', $_POST['acceptTrackbacks'])) {
        $result = true;
    }
}
if (isset($_POST['useiPhoneUI'])) {
    if ($_POST['useiPhoneUI'] == 1) {
        $useiPhoneUI = true;
コード例 #15
0
 function save()
 {
     global $database;
     importlib('model.common.setting');
     if (isset($this->name)) {
         $this->name = trim($this->name);
         if (!BlogSetting::validateName($this->name)) {
             return $this->_error('name');
         }
         Setting::setBlogSettingGlobal('name', $this->name);
     }
     if (isset($this->secondaryDomain)) {
         $this->secondaryDomain = trim($this->secondaryDomain);
         if (!Validator::domain($this->secondaryDomain)) {
             return $this->_error('secondaryDomain');
         }
         Setting::setBlogSettingGlobal('secondaryDomain', $this->secondaryDomain);
     }
     if (isset($this->defaultDomain)) {
         Setting::setBlogSettingGlobal('defaultDomain', Validator::getBit($this->defaultDomain));
     }
     if (isset($this->title)) {
         $this->title = trim($this->title);
         Setting::setBlogSettingGlobal('title', $this->title);
     }
     if (isset($this->description)) {
         $this->description = trim($this->description);
         Setting::setBlogSettingGlobal('description', $this->description);
     }
     if (isset($this->banner)) {
         if (strlen($this->banner) != 0 && !Validator::filename($this->banner)) {
             return $this->_error('banner');
         }
         Setting::setBlogSettingGlobal('logo', $this->banner);
     }
     if (isset($this->useSloganOnPost)) {
         Setting::setBlogSettingGlobal('useSloganOnPost', Validator::getBit($this->useSloganOnPost));
     }
     if (isset($this->useSloganOnCategory)) {
         Setting::setBlogSettingGlobal('useSloganOnCategory', Validator::getBit($this->useSloganOnCategory));
     }
     if (isset($this->useSloganOnTag)) {
         Setting::setBlogSettingGlobal('useSloganOnTag', Validator::getBit($this->useSloganOnTag));
     }
     if (isset($this->postsOnPage)) {
         if (!Validator::number($this->postsOnPage, 1)) {
             return $this->_error('postsOnPage');
         }
         Setting::setBlogSettingGlobal('entriesOnPage', $this->postsOnPage);
     }
     if (isset($this->postsOnList)) {
         if (!Validator::number($this->postsOnList, 1)) {
             return $this->_error('postsOnList');
         }
         Setting::setBlogSettingGlobal('entriesOnList', $this->postsOnList);
     }
     if (isset($this->postsOnFeed)) {
         if (!Validator::number($this->postsOnFeed, 1)) {
             return $this->_error('postsOnFeed');
         }
         Setting::setBlogSettingGlobal('entriesOnRSS', $this->postsOnFeed);
     }
     if (isset($this->publishWholeOnFeed)) {
         Setting::setBlogSettingGlobal('publishWholeOnRSS', Validator::getBit($this->publishWholeOnFeed));
     }
     if (isset($this->acceptGuestComment)) {
         Setting::setBlogSettingGlobal('allowWriteOnGuestbook', Validator::getBit($this->acceptGuestComment));
     }
     if (isset($this->acceptcommentOnGuestComment)) {
         Setting::setBlogSettingGlobal('allowWriteDblCommentOnGuestbook', Validator::getBit($this->acceptcommentOnGuestComment));
     }
     if (isset($this->language)) {
         if (!Validator::language($this->language)) {
             return $this->_error('language');
         }
         Setting::setBlogSettingGlobal('language', $this->language);
     }
     if (isset($this->timezone)) {
         if (empty($this->timezone)) {
             return $this->_error('timezone');
         }
         Setting::setBlogSettingGlobal('timezone', $this->timezone);
     }
     return true;
 }
コード例 #16
0
ファイル: index.php プロジェクト: webhacking/Textcube
<?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('GET' => array('type' => array('int'), 'ajaxcall' => array('any', 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
importlib("model.blog.trash");
requireStrictRoute();
if ($_GET['type'] == 1) {
    emptyTrash(true);
} else {
    if ($_GET['type'] == 2) {
        emptyTrash(false);
    } else {
        Respond::NotFoundPage();
    }
}
if (array_key_exists('ajaxcall', $_GET)) {
    Respond::ResultPage(0);
} else {
    if ($_GET['type'] == 1) {
        header("Location: " . $context->getProperty('uri.blog') . '/owner/communication/trash/comment');
    } else {
        if ($_GET['type'] == 2) {
            header("Location: " . $context->getProperty('uri.blog') . '/owner/communication/trash/trackback');
        }
    }
}
コード例 #17
0
ファイル: index.php プロジェクト: Avantians/Textcube
 function retrieveCallback($lines, $uid)
 {
     $this->appendUid($uid);
     $mail = $this->pop3->parse($lines);
     if (isset($mail['date_string'])) {
         $slogan = $mail['date_string'];
         $docid = $mail['time_string'];
     } else {
         $slogan = date("Y-m-d");
         $docid = date("H:i:s");
     }
     if (in_array($mail['subject'], array('제목없음'))) {
         $mail['subject'] = '';
     }
     if (!$this->isAllowed($mail)) {
         return false;
     }
     if (false && empty($mail['attachments'])) {
         $this->logMail($mail, "SKIP");
         return false;
     }
     $post = new Post();
     $moblog_begin = "\n<div class=\"moblog-entry\">";
     $moblog_end = "\n</div>\n";
     if ($post->open("slogan = '{$slogan}'")) {
         $post->loadTags();
         $this->log("* 기존 글을 엽니다. (SLOGAN:{$slogan})");
         if (empty($post->tags)) {
             $post->tags = array();
         }
         $tags = $this->extractTags($mail);
         /* mail content will be changed */
         $post->tags = array_merge($post->tags, $tags);
         $post->content .= $moblog_begin . $this->_getDecoratedContent($mail, $docid);
         $post->modified = $mail['date'];
         $post->visibility = $this->visibility;
     } else {
         $this->log("* 새 글을 작성합니다. (SLOGAN:{$slogan})");
         if (isset($mail['date_year'])) {
             $post->title = str_replace(array('%Y', '%M', '%D'), array($mail['date_year'], $mail['date_month'], $mail['date_day']), $this->subject);
         } else {
             $post->title = str_replace(array('%Y', '%M', '%D'), array(date("Y"), date("m"), date("d")), $this->subject);
         }
         $post->userid = $this->userid;
         $post->category = $this->category;
         $post->tags = $this->extractTags($mail);
         /* Go with csv string, Tag class supports both string and array */
         $post->content = $moblog_begin . $this->_getDecoratedContent($mail, $docid);
         $post->contentformatter = getDefaultFormatter();
         $post->contenteditor = getDefaultEditor();
         $post->created = time();
         $post->acceptcomment = true;
         $post->accepttrackback = true;
         $post->visibility = $this->visibility;
         $post->published = time();
         $post->modified = $mail['date'];
         $post->slogan = $slogan;
         if (!$post->add()) {
             $this->logMail($mail, "ERROR");
             $this->log(_t("실패: 글을 추가하지 못하였습니다") . " : " . $post->error);
             return false;
         } else {
             CacheControl::flushCategory($post->category);
         }
     }
     /* 슬로건을 지워야만 문제가 발생하지 않습니다. */
     //unset($post->slogan);
     if (isset($mail['attachments']) && count($mail['attachments'])) {
         importlib("model.blog.api");
         $post->content .= "<div class=\"moblog-attachments\">\n";
         foreach ($mail['attachments'] as $mail_att) {
             $this->log("* " . _t("첨부") . " : {$mail_att['filename']}");
             $att = api_addAttachment(getBlogId(), $post->id, array('name' => $mail_att['filename'], 'content' => $mail_att['decoded_content'], 'size' => $mail_att['length']));
             if (!$att) {
                 $this->logMail($mail, "ERROR");
                 $this->log(_t("실패: 첨부파일을 추가하지 못하였습니다") . " : " . $post->error);
                 return false;
             }
             $alt = htmlentities($mail_att['filename'], ENT_QUOTES, 'utf-8');
             $content = '[##_1C|$FILENAME|width="$WIDTH" height="$HEIGHT" alt="' . $alt . '"|_##]';
             $content = str_replace('$FILENAME', $att['name'], $content);
             $content = str_replace('$WIDTH', $att['width'], $content);
             $content = str_replace('$HEIGHT', $att['height'], $content);
             $post->content .= $content;
         }
         $post->content .= "\n</div>";
     }
     $post->content .= $moblog_end;
     if (!$post->update()) {
         $this->logMail($mail, "ERROR");
         $this->log(_t("실패: 첨부파일을 본문에 연결하지 못하였습니다") . ". : " . $post->error);
         return false;
     }
     $this->logMail($mail, "OK");
     return true;
 }
コード例 #18
0
ファイル: checkup.php プロジェクト: Avantians/Textcube
<?php

/// Copyright (c) 2004-2015, 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';
$codeCache = new CodeCache();
$codeCache->flush();
importlib('blogskin');
importlib('model.blog.skin');
importlib('model.common.setting');
importlib('model.blog.entry');
importlib('model.blog.trash');
importlib('model.blog.version');
$currentVersion = getBlogVersion();
function setSkinSettingForMigration($blogid, $name, $value, $mig = null)
{
    $pool = DBModel::getInstance();
    $name = POD::escapeString($name);
    $value = POD::escapeString($value);
    if ($mig === null) {
        $pool->reset("SkinSettingsMig");
    } else {
        $pool->reset("SkinSettings");
    }
    $pool->setAttribute("blogid", $blogid);
    $pool->setAttribute("name", $name, true);
    $pool->setAttribute("value", $value, true);
    return $pool->replace();
}
コード例 #19
0
ファイル: index.php プロジェクト: Avantians/Textcube
<?php

/// Copyright (c) 2004-2015, 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('targets' => array('list', 'default' => '', 'mandatory' => false), 'ip' => array('ip', 'default' => '', 'mandatory' => false), 'targetIPs' => array('string', 'default' => '', 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
importlib("model.blog.comment");
requireStrictRoute();
$isAjaxRequest = checkAjaxRequest();
if (isset($suri['id'])) {
    if (trashCommentInOwner($blogid, $suri['id']) === true) {
        $isAjaxRequest ? Respond::ResultPage(0) : header("Location: " . $_SERVER['HTTP_REFERER']);
    } else {
        $isAjaxRequest ? Respond::ResultPage(-1) : header("Location: " . $_SERVER['HTTP_REFERER']);
    }
} else {
    if (!empty($_POST['targets'])) {
        foreach (explode(',', $_POST['targets']) as $target) {
            trashCommentInOwner($blogid, $target);
        }
    }
    if (!empty($_POST['targetIPs'])) {
        $targetIPs = array_unique(explode(',', $_POST['targetIPs']));
        foreach ($targetIPs as $target) {
            if (Validator::ip($target)) {
                trashCommentInOwnerByIP($blogid, $target);
            }
        }
    }
    if (!empty($_POST['ip'])) {
コード例 #20
0
ファイル: plugin.php プロジェクト: webhacking/Textcube
function handleCoverpages(&$obj, $previewMode = false)
{
    global $service, $pluginURL, $pluginPath, $pluginName, $configVal, $configMappings;
    $context = Model_Context::getInstance();
    importlib("model.blog.coverpage");
    // [coverpage id][element id](type, id, parameters)
    // type : 3=plug-in
    // id : type1=coverpage i, type2=handler id, type3=plug-in handler name
    // parameters : type1=coverpage j, blah blah~
    $coverpageAllOrders = getCoverpageModuleOrderData();
    if ($previewMode == true) {
        $coverpageAllOrders = null;
    }
    $i = 0;
    $obj->coverpageModule = array();
    if (!is_null($coverpageAllOrders) && array_key_exists($i, $coverpageAllOrders)) {
        $currentCoverpageOrder = $coverpageAllOrders[$i];
        for ($j = 0; $j < count($currentCoverpageOrder); $j++) {
            if ($currentCoverpageOrder[$j]['type'] == 3) {
                // plugin
                $plugin = $currentCoverpageOrder[$j]['id']['plugin'];
                $handler = $currentCoverpageOrder[$j]['id']['handler'];
                include_once ROOT . "/plugins/{$plugin}/index.php";
                if (function_exists($handler)) {
                    $obj->coverpageModule[$j] = "[##_temp_coverpage_element_{$i}_{$j}_##]";
                    $parameters = $currentCoverpageOrder[$j]['parameters'];
                    $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');
                    if (!empty($configMappings[$plugin]['config'])) {
                        $configVal = getCurrentSetting($plugin);
                        $context->setProperty('plugin.config', Setting::fetchConfigVal($configVal));
                    } else {
                        $configVal = '';
                        $context->setProperty('plugin.config', array());
                    }
                    if (function_exists($handler)) {
                        // Loading locale resource
                        $languageDomain = null;
                        if (is_dir($pluginPath . '/locale/')) {
                            $locale = Locales::getInstance();
                            $languageDomain = $locale->domain;
                            if (file_exists($pluginPath . '/locale/' . $locale->defaultLanguage . '.php')) {
                                $locale->setDirectory($pluginPath . '/locale');
                                $locale->set($locale->defaultLanguage, $plugin);
                                $locale->domain = $plugin;
                            }
                        }
                        $obj->coverpageStorage["temp_coverpage_element_{$i}_{$j}"] = call_user_func($handler, $parameters);
                        if (!is_null($languageDomain)) {
                            $locale->domain = $languageDomain;
                        }
                        $pluginURL = $pluginPath = $pluginName = "";
                        $context->unsetProperty('plugin.uri');
                        $context->unsetProperty('plugin.path');
                        $context->unsetProperty('plugin.name');
                        $context->unsetProperty('plugin.config');
                    } else {
                        $obj->coverpageStorage["temp_coverpage_element_{$i}_{$j}"] = "";
                    }
                }
            } else {
                // WHAT?
            }
        }
    }
}
コード例 #21
0
ファイル: index.php プロジェクト: webhacking/Textcube
<?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('fileName' => array('filename'), 'order' => array(array('0', '1'))));
require ROOT . '/library/preprocessor.php';
importlib('model.blog.attachment');
requireStrictRoute();
$result = setEnclosure($_POST['fileName'], $_POST['order']);
Respond::PrintResult(array('error' => $result < 3 ? 0 : 1, 'order' => $result));
コード例 #22
0
ファイル: view.php プロジェクト: Avantians/Textcube
function getEntryContentView($blogid, $id, $content, $formatter, $keywords = array(), $type = 'Post', $useAbsolutePath = true, $bRssMode = false)
{
    $context = Model_Context::getInstance();
    importlib('model.blog.attachment');
    importlib('model.blog.keyword');
    importlib('blogskin');
    $context = Model_Context::getInstance();
    $cacheKey = 'entry-' . $id . '-' . $type . ($bRssMode ? 'format' : 'summarize') . ($useAbsolutePath ? 'absoultePath' : 'relativePath') . $context->getProperty('blog.displaymode', 'desktop');
    $cache = pageCache::getInstance();
    $cache->reset($cacheKey);
    if (!defined('__TEXTCUBE_NO_ENTRY_CACHE__') && $cache->load()) {
        // If cached content exists.
        $view = $cache->contents;
    } else {
        // No cache is found.
        $content = fireEvent('Format' . $type . 'Content', $content, $id);
        $func = $bRssMode ? 'summarizeContent' : 'formatContent';
        $view = $func($blogid, $id, $content, $formatter, $keywords, $useAbsolutePath);
        if ($context->getProperty('blog.displaymode', 'desktop') == 'mobile') {
            $view = stripHTML($view, array('a', 'abbr', 'acronym', 'address', 'b', 'blockquote', 'br', 'caption', 'cite', 'code', 'dd', 'del', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'iframe', 'img', 'ins', 'kbd', 'li', 'ol', 'p', 'pre', 'q', 's', 'samp', 'span', 'strike', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'u', 'ul', 'var'));
        }
        if (!$useAbsolutePath) {
            $view = avoidFlashBorder($view);
        }
        if (!empty($keywords) && is_array($keywords)) {
            $view = bindKeywords($keywords, $view);
        }
        // image resampling
        if (Setting::getBlogSettingGlobal('resamplingDefault') == true) {
            preg_match_all("@<img.+src=['\"](.+)['\"](.*)/?>@Usi", $view, $images, PREG_SET_ORDER);
            $view = preg_replace("@<img.+src=['\"].+['\"].*/?>@Usi", '[#####_#####_#####_image_#####_#####_#####]', $view);
            $contentWidth = Utils_Misc::getContentWidth();
            if (count($images) > 0) {
                for ($i = 0; $i < count($images); $i++) {
                    if (strtolower(Utils_Misc::getFileExtension($images[$i][1])) == 'gif') {
                        $view = preg_replace('@\\[#####_#####_#####_image_#####_#####_#####\\]@', $images[$i][0], $view, 1);
                        continue;
                    }
                    $attributes = preg_match('/(style="cursor: pointer;" onclick="open_img\\((.[^"]+)\\); return false;")/si', $images[$i][2], $matches) ? ' ' . $matches[1] : '';
                    $attributes .= preg_match('/(alt="([^"]*)")/si', $images[$i][2], $matches) ? ' ' . $matches[1] : ' alt="resize"';
                    $attributes .= preg_match('/(title="([^"]*)")/si', $images[$i][2], $matches) ? $title = ' ' . $matches[1] : '';
                    $tempFileName = array_pop(explode('/', $images[$i][1]));
                    if (preg_match('/(.+)\\.w(\\d{1,})\\-h(\\d{1,})\\.(.+)/', $tempFileName, $matches)) {
                        $tempFileName = $matches[1] . '.' . $matches[4];
                    }
                    $newImage = $images[$i][0];
                    if (file_exists(__TEXTCUBE_ATTACH_DIR__ . "/{$blogid}/{$tempFileName}")) {
                        $tempAttributes = Utils_Misc::getAttributesFromString($images[$i][2]);
                        $tempOriginInfo = getimagesize(__TEXTCUBE_ATTACH_DIR__ . "/{$blogid}/{$tempFileName}");
                        if (isset($tempAttributes['width']) && $tempOriginInfo[0] > $tempAttributes['width']) {
                            $image = Utils_Image::getInstance();
                            list($tempImageURL, $tempImageWidth, $tempImageHeight, $tempImageSrc) = $image->getImageResizer($tempFileName, array('width' => $tempAttributes['width']));
                            $newImage = "<img src=\"{$tempImageURL}\" width=\"{$tempImageWidth}\" height=\"{$tempImageHeight}\"{$attributes}/>";
                        }
                    }
                    $view = preg_replace('@\\[#####_#####_#####_image_#####_#####_#####\\]@', $newImage, $view, 1);
                }
            }
        }
        $cache->contents = $view;
        $cache->update();
    }
    $cache->reset();
    $view = fireEvent('View' . $type . 'Content', $view, $id);
    return $view;
}
コード例 #23
0
ファイル: index.php プロジェクト: webhacking/Textcube
<?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('name' => array('directory', 'default' => null)));
require ROOT . '/library/preprocessor.php';
importlib('model.common.plugin');
requireStrictRoute();
if (empty($_POST['name'])) {
    Respond::ResultPage(1);
}
$pluginInfo = getPluginInformation(trim($_POST['name']));
$pluginScope = $pluginInfo['scope'];
if (in_array('editor', $pluginScope) && $editorCount == 1) {
    Respond::ResultPage(2);
}
if (in_array('formatter', $pluginScope) && $formatterCount == 1) {
    Respond::ResultPage(2);
}
if (deactivatePlugin($_POST['name'])) {
    Respond::ResultPage(0);
}
Respond::ResultPage(1);
コード例 #24
0
ファイル: skin.php プロジェクト: ni5am/Textcube
function setSkinSetting($blogid, $setting)
{
    global $skinSetting;
    // Legacy global support. TODO: DELETE THIS LINE AFTER CHECK EVERY REFERENCES IN WHOLE SOURCE
    importlib('blogskin');
    $blogid = getBlogId();
    if (strncmp($context->getProperty('skin.skin'), 'customize/', 10) == 0) {
        if (strcmp($context->getProperty('skin.skin'), "customize/{$blogid}") != 0) {
            return false;
        }
    } else {
        $skinSetting['skin'] = Path::getBaseName($context->getProperty('skin.skin'));
        // Legacy global support. TODO: DELETE THIS LINE AFTER CHECK EVERY REFERENCES IN WHOLE SOURCE
        $context->setProperty('skin.skin', $skinSetting['skin']);
        if ($context->getProperty('skin.skin') === '.' || $context->getProperty('skin.skin') === '..') {
            return _t('실패 했습니다');
        }
    }
    $skinpath = getSkinPath($context->getProperty('skin.skin'));
    if (!is_dir($skinpath)) {
        return _t('실패 했습니다');
    }
    foreach ($setting as $key => $value) {
        Setting::setSkinSetting($key, $value, $blogid);
    }
    Setting::setSkinSetting('skin', $context->getProperty('skin.skin'), $blogid);
    Setting::setBlogSetting('useMicroformat', $setting['useMicroformat'], true);
    Setting::setBlogSetting('useAjaxComment', $setting['useAjaxComment'], true);
    Setting::setBlogSetting('useFOAF', $setting['useFOAF'] == 1 ? 1 : 0, true);
    Setting::setBlogSetting('entriesOnPage', $setting['entriesOnPage'], true);
    Setting::setBlogSetting('entriesOnList', $setting['entriesOnList'], true);
    CacheControl::flushCategory();
    CacheControl::flushTag();
    CacheControl::flushSkin();
    Setting::getSkinSettings($blogid, true);
    // refresh skin cache
    return true;
}
コード例 #25
0
ファイル: index.php プロジェクト: Avantians/Textcube
<?php

/// Copyright (c) 2004-2015, 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('NO_SESSION', true);
define('__TEXTCUBE_LOGIN__', true);
define('__TEXTCUBE_CUSTOM_HEADER__', true);
require ROOT . '/library/preprocessor.php';
importlib("model.blog.feed");
requireStrictBlogURL();
$children = array();
$cache = pageCache::getInstance();
$cache->reset('linesRSS');
if (!$cache->load()) {
    $result = getLinesFeed(getBlogId(), 'public', 'rss');
    if ($result !== false) {
        $cache->reset('linesRSS');
        $cache->contents = $result;
        $cache->update();
    }
}
header('Content-Type: application/rss+xml; charset=utf-8');
fireEvent('FeedOBStart');
echo fireEvent('ViewLinesRSS', $cache->contents);
fireEvent('FeedOBEnd');
コード例 #26
0
ファイル: index.php プロジェクト: webhacking/Textcube
<?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_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') . "/");
        }
コード例 #27
0
ファイル: index.php プロジェクト: webhacking/Textcube
<?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('targets' => array('list', 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
importlib("model.blog.entry");
requireStrictRoute();
$isAjaxRequest = checkAjaxRequest();
if (isset($suri['id'])) {
    if (!Acl::check("group.editors")) {
        if (getUserIdOfEntry(getBlogId(), $suri['id']) != getUserId()) {
            Respond::ResultPage(-1);
            exit;
        }
    }
    if ($isAjaxRequest) {
        if (deleteEntry($blogid, $suri['id']) === true) {
            Respond::ResultPage(0);
        } else {
            Respond::ResultPage(-1);
        }
    } else {
        deleteEntry($blogid, $suri['id']);
        header("Location: " . $_SERVER['HTTP_REFERER']);
    }
} else {
    foreach (explode(',', $_POST['targets']) as $target) {
        // TeamBlog check
        if (!Acl::check('group.writers', 'entry.delete.' . $target)) {
コード例 #28
0
ファイル: index.php プロジェクト: Avantians/Textcube
<?php

/// Copyright (c) 2004-2015, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
if (isset($_POST['page'])) {
    $_GET['page'] = $_POST['page'];
}
$IV = array('GET' => array('category' => array('int', 'mandatory' => false), 'visibility' => array('string', 'mandatory' => false), 'page' => array('int', 1, 'default' => 1), 'tagId' => array('int', 1, 'mandatory' => false), 'search' => array('string', 'mandatory' => false)), 'POST' => array('category' => array('int', 'mandatory' => false), 'visibility' => array('string', 'mandatory' => false), 'categoryAtHome' => array('int', 'mandatory' => false), 'perPage' => array('int', 1, 'mandatory' => false), 'search' => array('string', 'mandatory' => false), 'withSearch' => array(array('on'), 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
importlib("model.blog.trash");
importlib("model.blog.entry");
importlib("model.blog.version");
trashVan();
publishEntries();
// 카테고리 설정.
if (isset($_POST['category'])) {
    $categoryId = $_POST['category'];
} else {
    if (isset($_GET['category'])) {
        $categoryId = $_GET['category'];
    } else {
        if (isset($_POST['categoryAtHome'])) {
            $categoryId = $_POST['categoryAtHome'];
        } else {
            $categoryId = -5;
        }
    }
}
// 공개 / 비공개 설정
if (isset($_GET['visibility'])) {
コード例 #29
0
ファイル: index.php プロジェクト: webhacking/Textcube
<?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('GET' => array('coverpageNumber' => array('int'), 'modulePos' => array('int'), 'viewMode' => array('string', 'default' => '')));
require ROOT . '/library/preprocessor.php';
importlib('blogskin');
importlib("model.blog.sidebar");
importlib("model.blog.coverpage");
$skin = new Skin($skinSetting['skin']);
$coverpageCount = count($skin->coverpageBasicModules);
$coverpageOrder = deleteCoverpageModuleOrderData(getCoverpageModuleOrderData($coverpageCount), $_GET['coverpageNumber'], $_GET['modulePos']);
Setting::setBlogSettingGlobal("coverpageOrder", serialize($coverpageOrder));
//Respond::PrintResult(array('error' => 0));
if ($_GET['viewMode'] != '') {
    $_GET['viewMode'] = '?' . $_GET['viewMode'];
}
header('Location: ' . $context->getProperty('uri.blog') . '/owner/skin/coverpage' . $_GET['viewMode']);
コード例 #30
0
ファイル: api.php プロジェクト: webhacking/Textcube
<?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>