当前位置: 首页>>代码示例>>PHP>>正文


PHP Model_Context类代码示例

本文整理汇总了PHP中Model_Context的典型用法代码示例。如果您正苦于以下问题:PHP Model_Context类的具体用法?PHP Model_Context怎么用?PHP Model_Context使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Model_Context类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CT_Start_Default

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;
}
开发者ID:Avantians,项目名称:Textcube,代码行数:28,代码来源:index.php

示例2: getRecentNotices

function getRecentNotices($blogid)
{
    $context = Model_Context::getInstance();
    $query = getDefaultDBModelOnNotice($blogid);
    $query->setLimit($context->getProperty('skin.noticesOnRecent'));
    return $query->getAll('id, title, slogan, published, userid');
}
开发者ID:webhacking,项目名称:Textcube,代码行数:7,代码来源:notice.php

示例3: __construct

 function __construct()
 {
     $context = Model_Context::getInstance();
     $this->buf = new Utils_OutputWriter();
     $this->skin = new Skin($context->getProperty('skin.skin'));
     $this->view = $this->skin->outter;
 }
开发者ID:Avantians,项目名称:Textcube,代码行数:7,代码来源:Textcube.View.BlogView.php

示例4: addSupport

 public function addSupport($parameters)
 {
     if (!is_array($parameters)) {
         $parameters = array($parameters);
     }
     $context = Model_Context::getInstance();
     foreach ($parameters as $p) {
         switch ($p) {
             case 'URLglobals':
                 global $serviceURL, $pathURL, $defaultURL, $baseURL, $pathURL, $hostURL, $folderURL, $blogURL;
                 $context->useNamespace('uri');
                 $serviceURL = $context->getProperty('service');
                 $pathURL = $context->getProperty('path');
                 $defaultURL = $context->getProperty('default');
                 $baseURL = $context->getProperty('base');
                 $hostURL = $context->getProperty('host');
                 $folderURL = $context->getProperty('folder');
                 $blogURL = $context->getProperty('blog');
                 $context->useNamespace();
                 break;
             case 'globals':
                 global $database, $service, $suri;
                 $database = $context->getAllFromNamespace('database');
                 $service = $context->getAllFromNamespace('service');
                 $suri = $context->getAllFromNamespace('suri');
                 break;
             default:
         }
     }
 }
开发者ID:webhacking,项目名称:Textcube,代码行数:30,代码来源:LegacySupport.php

示例5: getDefinedTableNames

function getDefinedTableNames()
{
    $context = Model_Context::getInstance();
    $prefix = $context->getProperty('database.prefix');
    $definedTables = array("{$prefix}Attachments", "{$prefix}BlogSettings", "{$prefix}BlogStatistics", "{$prefix}Categories", "{$prefix}Comments", "{$prefix}CommentsNotified", "{$prefix}CommentsNotifiedQueue", "{$prefix}CommentsNotifiedSiteInfo", "{$prefix}DailyStatistics", "{$prefix}Entries", "{$prefix}EntriesArchive", "{$prefix}FeedGroupRelations", "{$prefix}FeedGroups", "{$prefix}FeedItems", "{$prefix}FeedReads", "{$prefix}OpenIDUsers", "{$prefix}Feeds", "{$prefix}FeedSettings", "{$prefix}FeedStarred", "{$prefix}Filters", "{$prefix}Lines", "{$prefix}Links", "{$prefix}LinkCategories", "{$prefix}PageCacheLog", "{$prefix}Plugins", "{$prefix}Privileges", "{$prefix}RefererLogs", "{$prefix}RefererStatistics", "{$prefix}ReservedWords", "{$prefix}ServiceSettings", "{$prefix}Sessions", "{$prefix}SessionVisits", "{$prefix}SkinSettings", "{$prefix}TagRelations", "{$prefix}Tags", "{$prefix}TeamEntryRelations", "{$prefix}RemoteResponseLogs", "{$prefix}RemoteResponses", "{$prefix}Users", "{$prefix}UserSettings", "{$prefix}Widgets", "{$prefix}XMLRPCPingSettings");
    return $definedTables;
}
开发者ID:ragi79,项目名称:Textcube,代码行数:7,代码来源:common.setting.php

示例6: open

 function open($filter = '', $fields = '*', $sort = 'datemark DESC')
 {
     $ctx = Model_Context::getInstance();
     if (is_numeric($filter)) {
         $filter = 'AND datemark = ' . $filter;
     } else {
         if (!empty($filter)) {
             $filter = 'AND ' . $filter;
         }
     }
     if (!empty($sort)) {
         $sort = 'ORDER BY ' . $sort;
     }
     $this->close();
     $this->_result = POD::query("SELECT {$fields} FROM " . $ctx->getProperty('database.prefix') . "DailyStatistics WHERE blogid = " . getBlogId() . " {$filter} {$sort}");
     if ($this->_result) {
         if ($this->_count = POD::num_rows($this->_result)) {
             return $this->shift();
         } else {
             POD::free($this->_result);
         }
     }
     unset($this->_result);
     return false;
 }
开发者ID:Avantians,项目名称:Textcube,代码行数:25,代码来源:Textcube.Data.DailyStatistics.php

示例7: __construct

 function __construct($table = null)
 {
     $this->context = Model_Context::getInstance();
     $this->_called = true;
     $this->_buffer = null;
     $this->reset($table);
 }
开发者ID:Avantians,项目名称:Textcube,代码行数:7,代码来源:DBModel.php

示例8: importlib

/** Library binders **/
function importlib()
{
    $context = Model_Context::getInstance();
    $args = func_get_args();
    if (empty($args)) {
        return false;
    }
    foreach ($args as $libPath) {
        $paths = explode(".", $libPath);
        if (end($paths) == "*") {
            array_pop($paths);
            foreach (new DirectoryIterator(ROOT . '/library/' . implode("/", $paths)) as $fileInfo) {
                if ($fileInfo->isFile()) {
                    require_once $fileInfo->getPathname();
                    //$context->setPropertyItem('import.lib', implode(".", $paths).'.'.preg_replace('/\\.[^.\\s]{3,4}$/', '', $fileInfo->getFilename()));
                }
            }
        } else {
            //if (!in_array($libPath, $context->getProperty('import.lib',array()))) {
            require_once ROOT . '/library/' . str_replace(".", "/", $libPath) . ".php";
            //    $context->setPropertyItem('import.lib', $libPath);
            //}
        }
    }
    return true;
}
开发者ID:Avantians,项目名称:Textcube,代码行数:27,代码来源:20-Autoload.php

示例9: initialize

 private static function initialize()
 {
     global $memcache;
     /** After PHP 5.0.5, session write performs after object destruction. */
     self::$mc = $memcache;
     /** To Avoid this, just copy memcache handle into Session object.     */
     self::$context = Model_Context::getInstance();
 }
开发者ID:ragi79,项目名称:Textcube,代码行数:8,代码来源:Textcube.Control.Session.Memcached.php

示例10: CT_RecentPS_Default

function CT_RecentPS_Default($target)
{
    $context = Model_Context::getInstance();
    $target .= '<ol>' . CRLF;
    $target .= _getRecentEntriesView(_getRecentEntries($context->getProperty('blog.id')), '											<li><a class="edit-link" href="[##_rctps_rep_edit_link_##]" style="background-image: url(\'' . $context->getProperty('plugin.uri', '') . '/images/edit.gif\'); background-position: left center; background-repeat: no-repeat; display: block; float: left; height: 12px; margin: 2px 5px 0 0; width: 12px;" title="' . _t('이 포스트를 편집합니다.') . '"><span class="text" style="display: none;">[편집하기]</span></a> <a href="[##_rctps_rep_link_##]" title="' . _t('포스트를 보여줍니다.') . '">[##_rctps_rep_title_##]</a> <span class="cnt">[##_rctps_rep_rp_cnt_##]</span></li>' . CRLF);
    $target .= '										</ol>' . CRLF;
    return $target;
}
开发者ID:Avantians,项目名称:Textcube,代码行数:8,代码来源:index.php

示例11: CT_RecentRP_Default

function CT_RecentRP_Default($target)
{
    $context = Model_Context::getInstance();
    $target .= '<ol>' . CRLF;
    $target .= RecentRP_getRecentCommentsView(RecentRP_getRecentComments($context->getProperty('blog.id')), '											<li><span class="date" style="display: block; font-family: Verdana, 돋움, Dotum, Tahoma, \'Lucida Grande\', sans-serif; font-size: 0.9em;">[##_rctrp_rep_time_##]</span> <a href="[##_rctrp_rep_link_##]">[##_rctrp_rep_desc_##]</a> <span class="name" style="color: #ABABAB;">[##_rctrp_rep_name_##]</span></li>' . CRLF);
    $target .= '										</ol>' . CRLF;
    return revertTempTags($target);
}
开发者ID:ragi79,项目名称:Textcube,代码行数:8,代码来源:index.php

示例12: FM_Textile_summary

function FM_Textile_summary($blogid, $id, $content, $keywords = array(), $useAbsolutePath = true)
{
    $context = Model_Context::getInstance();
    $view = FM_Textile_format($blogid, $id, $content, $keywords, $useAbsolutePath, true);
    if (!$context->getProperty("blog.publishWholeOnRSS")) {
        $view = Utils_Unicode::lessen(removeAllTags(stripHTML($view)), 255);
    }
    return $view;
}
开发者ID:Avantians,项目名称:Textcube,代码行数:9,代码来源:index.php

示例13: TextcubeBirthdayDataSet

function TextcubeBirthdayDataSet($DATA)
{
    $context = Model_Context::getInstance();
    $cfg = $context->getProperty('plugin.config');
    // if( $cfg['month'] != 날짜냐?) return "잘못된 날짜입니다.";
    // 등등등등 여기서 원하는 검증을 하시고 검증 실패시 사용자에게 보여줄 에러메세지를 보내주심 됩니다.
    // 성공하면 그냥 true
    return true;
}
开发者ID:Avantians,项目名称:Textcube,代码行数:9,代码来源:index.php

示例14: EmoticonOnComment_main

function EmoticonOnComment_main($target, $mother)
{
    $context = Model_Context::_getInstance();
    $url = $context->getProperty("plugin.uri");
    $emoticons = array(':)' => '<img src="' . $url . '/emoticon01.gif" alt=":)" />', ';)' => '<img src="' . $url . '/emoticon01.gif" alt=";)" />', ':P' => '<img src="' . $url . '/emoticon02.gif" alt=":P" />', '8D' => '<img src="' . $url . '/emoticon03.gif" alt="8D" />', ':(' => '<img src="' . $url . '/emoticon04.gif" alt=":(" />', '--;' => '<img src="' . $url . '/emoticon05.gif" alt="--;" />');
    foreach ($emoticons as $key => $value) {
        $target = str_replace($key, $value, $target);
    }
    return $target;
}
开发者ID:Avantians,项目名称:Textcube,代码行数:10,代码来源:index.php

示例15: FAS_Call

function FAS_Call($type, $name, $title, $url, $content)
{
    $context = Model_Context::getInstance();
    $pool = DBModel::getInstance();
    $blogstr = $context->getProperty('uri.host') . $context->getProperty('uri.blog');
    $DDosTimeWindowSize = 300;
    $rpc = new XMLRPC();
    $rpc->url = 'http://antispam.textcube.org/RPC/';
    if ($rpc->call('checkSpam', $blogstr, $type, $name, $title, $url, $content, $_SERVER['REMOTE_ADDR']) == false) {
        // call fail
        // Do Local spam check with "Thief-cat algorithm"
        $count = 0;
        if ($type == 2) {
            $storage = "RemoteResponses";
            $pool->reset($storage);
            $pool->setQualifier("url", "eq", $url, true);
            $pool->setQualifier("isfiltered", ">", 0);
            if ($cnt = $pool->getCount("id")) {
                $count += $cnt;
            }
        } else {
            // Comment Case
            $storage = "Comments";
            $pool->reset($storage);
            $pool->setQualifier("comment", "eq", ${$content}, true);
            $pool->setQualifier("name", "eq", $name, true);
            $pool->setQualifier("homepage", "eq", $url, true);
            $pool->setQualifier("isfiltered", ">", 0);
            if ($cnt = $pool->getCount("id")) {
                $count += $cnt;
            }
        }
        // Check IP
        $pool->reset($storage);
        $pool->setQualifier("ip", "eq", $_SERVER['REMOTE_ADDR'], true);
        $pool->setQualifier("written", ">", Timestamp::getUNIXtime() - $DDosTimeWindowSize);
        if ($cnt = $pool->getCount("id")) {
            $count += $cnt;
        }
        if ($count >= 10) {
            return false;
        }
        return true;
    }
    if (!is_null($rpc->fault)) {
        // FAS has some problem
        return true;
    }
    if ($rpc->result['result'] == true) {
        return false;
        // it's spam
    }
    return true;
}
开发者ID:Avantians,项目名称:Textcube,代码行数:54,代码来源:index.php


注:本文中的Model_Context类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。