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


PHP doesHaveOwnership函数代码示例

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


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

示例1: getRecentTrackbackTrash

function getRecentTrackbackTrash($blogid)
{
    $trackbacks = array();
    $context = Model_Context::getInstance();
    $pool = DBModel::getInstance();
    $pool->init("RemoteResponses");
    if (doesHaveOwnership()) {
        $pool->setQualifier("blogid", "eq", $blogid);
        $pool->setOrder("written", "desc");
        $pool->setLimit($context->getProperty('skin.trackbacksOnRecent'));
        $result = $pool->getAll();
    } else {
        $pool->setAlias("RemoteResponses", "t");
        $pool->setAlias("Entries", "e");
        $pool->join("Entries", "left", array(array("t.blogid", "eq", "e.blogid"), array("t.entry", "eq", "e.id")));
        $pool->setQualifier("t.blogid", "eq", $blogid);
        $pool->setQualifier("t.responsetype", "eq", 'trackback', true);
        $pool->setQualifier("e.draft", "eq", 0);
        $pool->setQualifier("e.visibility", ">=", 2);
        $pool->setOrder("t.written", "desc");
        $pool->setLimit($context->getProperty('skin.trackbacksOnRecent'));
        $result = $pool->getAll("t.*");
    }
    if ($result && !empty($result)) {
        $trackbacks = $result;
    }
    return $trackbacks;
}
开发者ID:webhacking,项目名称:Textcube,代码行数:28,代码来源:trash.php

示例2: getEntriesByKeyword

function getEntriesByKeyword($blogid, $keyword)
{
    global $database;
    $keyword = POD::escapeString($keyword);
    $visibility = doesHaveOwnership() ? '' : 'AND visibility > 1';
    return POD::queryAll("SELECT id, userid, title, category, comments, published \n\t\t\tFROM {$database['prefix']}Entries \n\t\t\tWHERE blogid = {$blogid} \n\t\t\t\tAND draft = 0 {$visibility} \n\t\t\t\tAND category >= 0 \n\t\t\t\tAND (title LIKE '%{$keyword}%' OR content LIKE '%{$keyword}%')\n\t\t\tORDER BY published DESC");
}
开发者ID:hinablue,项目名称:TextCube,代码行数:7,代码来源:blog.keyword.php

示例3: requireOwnership

function requireOwnership()
{
    if (doesHaveOwnership()) {
        return true;
    }
    requireLogin();
    return false;
}
开发者ID:ni5am,项目名称:Textcube,代码行数:8,代码来源:auth.php

示例4: TestSuite_upgrade_repos_via_user

function TestSuite_upgrade_repos_via_user()
{
    if (doesHaveOwnership()) {
        $result = TestSuite_upgrade_repos(null, null);
        if ($result) {
            Respond::ResultPage(0);
        }
    }
    Respond::Resultpage(-1);
}
开发者ID:Avantians,项目名称:Textcube,代码行数:10,代码来源:index.php

示例5: getDefaultDBModelOnNotice

function getDefaultDBModelOnNotice($blogid)
{
    $query = DBModel::getInstance();
    $query->reset('Entries');
    $query->setQualifier('blogid', 'equals', $blogid);
    $query->setQualifier('draft', 'equals', 0);
    if (!doesHaveOwnership()) {
        $query->setQualifier('visibility', 'bigger', 1);
    }
    $query->setQualifier('category', 'equals', -2);
    $query->setOrder('published', 'DESC');
    return $query;
}
开发者ID:webhacking,项目名称:Textcube,代码行数:13,代码来源:notice.php

示例6: CT_Start_Default_getEntry

function CT_Start_Default_getEntry($blogid, $id)
{
    global $database;
    if ($id == 0) {
        return null;
    }
    $visibility = doesHaveOwnership() ? '' : 'AND visibility > 0';
    $entry = POD::queryRow("SELECT id,title,visibility FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND id = {$id} AND draft = 0 {$visibility}");
    if (!$entry) {
        return false;
    }
    return $entry;
}
开发者ID:ragi79,项目名称:Textcube,代码行数:13,代码来源:index.php

示例7: getEntriesByKeyword

function getEntriesByKeyword($blogid, $keyword)
{
    $pool = DBModel::getInstance();
    $pool->reset('Entries');
    $pool->setQualifier('blogid', 'eq', $blogid);
    $pool->setQualifier('draft', 'eq', 0);
    if (doesHaveOwnership()) {
        $pool->setQualifier('visibility', 'b', 1);
    }
    $pool->setQualifier('category', 'beq', 0);
    $pool->setQualifierSet(array('title', 'like', $keyword, true), 'OR', array('content', 'like', $keyword, true));
    $pool->setOrder('published', 'DESC');
    return $pool->getRow('id,userid,title,category,comments,published');
}
开发者ID:ragi79,项目名称:Textcube,代码行数:14,代码来源:blog.keyword.php

示例8: getEntriesCountByCategory

function getEntriesCountByCategory($blogid, $id)
{
    $context = Model_Context::getInstance();
    if ($context->getProperty('category.raw') === null) {
        getCategories($blogid, 'raw');
    }
    //To cache category information.
    $result = MMCache::queryRow($context->getProperty('category.raw'), 'id', $id);
    if ($id === 0 || $result == '' || $id === null) {
        return 0;
    } else {
        if (doesHaveOwnership() && Acl::check('group.editors')) {
            return $result['entriesinlogin'];
        } else {
            return $result['entries'];
        }
    }
}
开发者ID:ragi79,项目名称:Textcube,代码行数:18,代码来源:blog.category.php

示例9: _getRecentEntries

function _getRecentEntries($blogid)
{
    $query = DBModel::getInstance();
    $query->reset('Entries');
    $query->setQualifier('blogid', 'equals', $blogid);
    $query->setQualifier('draft', 'equals', 0);
    if (doesHaveOwnership()) {
        $query->setQualifier('visibility', 'bigger', 0);
    }
    $query->setQualifier('category', 'bigger or same', 0);
    $query->setLimit(8);
    $query->setOrder('published', 'desc');
    $result = $query->getAll('id,title,comments');
    if (!empty($result)) {
        return $result;
    } else {
        return array();
    }
}
开发者ID:Avantians,项目名称:Textcube,代码行数:19,代码来源:index.php

示例10: CT_Start_Default_getEntry

function CT_Start_Default_getEntry($blogid, $id)
{
    if ($id == 0) {
        return null;
    }
    $visibility = doesHaveOwnership() ? '' : 'AND visibility > 0';
    $pool = DBModel::getInstance();
    $pool->reset("Entries");
    $pool->setQualifier("blogid", "eq", $blogid);
    $pool->setQualifier("id", "eq", $id);
    $pool->setQualifier("draft", "eq", 0);
    if (!doesHaveOwnership()) {
        $pool->setQualifier("visibility", ">", 0);
    }
    $entry = $pool->getRow("id,title,visibility");
    if (!$entry) {
        return false;
    }
    return $entry;
}
开发者ID:Avantians,项目名称:Textcube,代码行数:20,代码来源:index.php

示例11: updateVisitorStatistics

 static function updateVisitorStatistics($blogid)
 {
     global $database, $blogURL;
     if (!fireEvent('UpdatingVisitorStatistics', true)) {
         return;
     }
     if (doesHaveOwnership()) {
         return;
     }
     $id = session_id();
     if (POD::queryCount("SELECT blogid FROM {$database['prefix']}SessionVisits WHERE id = '{$id}' AND address = '{$_SERVER['REMOTE_ADDR']}' AND blogid = {$blogid}") > 0) {
         return;
     }
     if (POD::queryCount("INSERT INTO {$database['prefix']}SessionVisits values('{$id}', '{$_SERVER['REMOTE_ADDR']}', {$blogid})") > 0) {
         if (POD::queryCount("UPDATE {$database['prefix']}BlogStatistics SET visits = visits + 1 WHERE blogid = {$blogid}") < 1) {
             POD::execute("INSERT into {$database['prefix']}BlogStatistics values({$blogid}, 1)");
         }
         $period = Timestamp::getDate();
         if (POD::queryCount("UPDATE {$database['prefix']}DailyStatistics SET visits = visits + 1 WHERE blogid = {$blogid} AND datemark = {$period}") < 1) {
             POD::execute("INSERT INTO {$database['prefix']}DailyStatistics VALUES ({$blogid}, {$period}, 1)");
         }
         if (!empty($_SERVER['HTTP_REFERER'])) {
             $referer = parse_url($_SERVER['HTTP_REFERER']);
             if (!empty($referer['host']) && ($referer['host'] != $_SERVER['HTTP_HOST'] || strncmp($referer['path'], $blogURL, strlen($blogURL)) != 0)) {
                 if (Filter::isFiltered('ip', $_SERVER['REMOTE_ADDR']) || Filter::isFiltered('url', $_SERVER['HTTP_REFERER'])) {
                     return;
                 }
                 if (!fireEvent('AddingRefererLog', true, array('host' => $referer['host'], 'url' => $_SERVER['HTTP_REFERER']))) {
                     return;
                 }
                 $host = POD::escapeString(Utils_Unicode::lessenAsEncoding($referer['host'], 64));
                 $url = POD::escapeString(Utils_Unicode::lessenAsEncoding($_SERVER['HTTP_REFERER'], 255));
                 POD::query("INSERT INTO {$database['prefix']}RefererLogs values({$blogid}, '{$host}', '{$url}', UNIX_TIMESTAMP())");
                 //					POD::query("DELETE FROM {$database['prefix']}RefererLogs WHERE referred < UNIX_TIMESTAMP() - 604800");	// Moved to trashVan
                 if (!POD::queryCount("UPDATE {$database['prefix']}RefererStatistics SET count = count + 1 WHERE blogid = {$blogid} AND host = '{$host}' LIMIT 1")) {
                     POD::execute("INSERT into {$database['prefix']}RefererStatistics values({$blogid}, '{$host}', 1)");
                 }
             }
         }
     }
 }
开发者ID:Avantians,项目名称:Textcube,代码行数:41,代码来源:Textcube.Model.Statistics.php

示例12: getLinkListView

function getLinkListView($links)
{
    $context = Model_Context::getInstance();
    if (rtrim($context->getProperty('suri.url'), '/') == $context->getProperty('uri.path')) {
        $home = true;
    } else {
        $home = false;
    }
    $categoryName = null;
    $buffer = '<ul>' . CRLF;
    $showXfn = Setting::getBlogSettingGlobal('useMicroformat', 3) > 1;
    foreach ($links as $link) {
        if (!doesHaveOwnership() && $link['visibility'] == 0 || !doesHaveMembership() && $link['visibility'] < 2) {
            continue;
        }
        if ($categoryName != $link['categoryName']) {
            if (!empty($categoryName)) {
                $buffer .= '</ul>' . CRLF . '</li>' . CRLF;
            }
            $categoryName = $link['categoryName'];
            $buffer .= '<li><span class="link_ct">' . htmlspecialchars($link['categoryName']) . '</span>' . CRLF . '<ul>' . CRLF;
        }
        if ($showXfn && $home && $link['xfn']) {
            addXfnAttrs(htmlspecialchars($link['url']), htmlspecialchars($link['xfn']), $link['url']);
        }
        $buffer .= '<li><a href="' . htmlspecialchars($link['url']) . '">' . fireEvent('ViewLink', htmlspecialchars(Utils_Unicode::lessenAsEm($link['name'], $context->getProperty('skin.linkLength')))) . '</a></li>' . CRLF;
    }
    if (!empty($categoryName)) {
        $buffer .= '</ul>' . CRLF . '</li>' . CRLF;
    }
    $buffer .= '</ul>' . CRLF;
    return $buffer;
}
开发者ID:Avantians,项目名称:Textcube,代码行数:33,代码来源:view.php

示例13: requireView

require ROOT . '/library/preprocessor.php';
requireView('iphoneView');
list($entryId) = getCommentAttributes($blogid, $suri['id'], 'entry');
printMobileHTMLHeader();
printMobileHTMLMenu('', 'comment');
?>

<div id="comment_<?php 
echo $entryId . "_" . $suri['id'];
?>
" title="Delete <?php 
echo $suri['id'];
?>
" class="panel">
<?php 
if (doesHaveOwnership()) {
    ?>
	<h3 class="title"><?php 
    echo _text('삭제하시겠습니까?');
    ?>
</h3>
	<div class="content">
		<a data-role="button"  data-theme="b" href="<?php 
    echo $blogURL;
    ?>
/comment/delete/action/<?php 
    echo $suri['id'];
    ?>
"><?php 
    echo _text('네');
    ?>
开发者ID:ragi79,项目名称:Textcube,代码行数:31,代码来源:index.php

示例14: getRecentRemoteResponses

function getRecentRemoteResponses($blogid, $count = false, $guestShip = false, $type = null)
{
    global $database, $skinSetting;
    if (!is_null($type)) {
        $typeFilter = " AND t.responsetype = '" . POD::escapeString($type) . "'";
    } else {
        $typeFilter = '';
    }
    $sql = doesHaveOwnership() && !$guestShip ? "SELECT t.*, e.slogan \n\t\tFROM \n\t\t\t{$database['prefix']}RemoteResponses t\n\t\t\tLEFT JOIN {$database['prefix']}Entries e ON t.blogid = e.blogid AND t.entry = e.id AND e.draft = 0\n\t\tWHERE \n\t\t\tt.blogid = {$blogid} AND t.isfiltered = 0 {$typeFilter} \n\t\tORDER BY \n\t\t\tt.written \n\t\tDESC LIMIT " . ($count != false ? $count : $skinSetting['trackbacksOnRecent']) : "SELECT t.*, e.slogan \n\t\tFROM \n\t\t\t{$database['prefix']}RemoteResponses t \n\t\t\tLEFT JOIN {$database['prefix']}Entries e ON t.blogid = e.blogid AND t.entry = e.id\n\t\tWHERE \n\t\t\tt.blogid = {$blogid} \n\t\t\tAND t.isfiltered = 0 \n\t\t\tAND e.draft = 0 \n\t\t\tAND e.visibility >= 2 " . getPrivateCategoryExclusionQuery($blogid) . "\n\t\t\t{$typeFilter}\n\t\tORDER BY \n\t\t\tt.written \n\t\tDESC LIMIT " . ($count != false ? $count : $skinSetting['trackbacksOnRecent']);
    if ($result = POD::queryAllWithDBCache($sql, 'remoteResponse')) {
        return $result;
    } else {
        return array();
    }
}
开发者ID:hinablue,项目名称:TextCube,代码行数:15,代码来源:blog.response.remote.php

示例15: printIphoneCommentFormView

function printIphoneCommentFormView($entryId, $title, $actionURL)
{
    global $blogURL;
    ?>
	
	<form method="GET" action="<?php 
    echo $blogURL;
    ?>
/<?php 
    echo $actionURL;
    ?>
/add/<?php 
    echo $entryId;
    ?>
" class="commentForm">
	<h2><?php 
    echo $title;
    ?>
</h2>
	<fieldset>
		<?php 
    if (!doesHaveOwnership()) {
        ?>
		<input type="hidden" name="id" value="<?php 
        echo $entryId;
        ?>
" />
		<input type="hidden" id="secret_<?php 
        echo $entryId;
        ?>
" name="secret_<?php 
        echo $entryId;
        ?>
" value="0" />
		<div class="row">
			<label><?php 
        echo _text('비밀 댓글');
        ?>
</label>
			<div class="toggle" onclick="secretToggleCheck(this, <?php 
        echo $entryId;
        ?>
);"><span class="thumb"></span><span class="toggleOn">|</span><span class="toggleOff">O</span></div>
		</div>
		<div class="row">
			<label for="name_<?php 
        echo $entryId;
        ?>
"><?php 
        echo _text('이름');
        ?>
</label>
			<input type="text" id="name_<?php 
        echo $entryId;
        ?>
" name="name_<?php 
        echo $entryId;
        ?>
" value="<?php 
        echo isset($_COOKIE['guestName']) ? htmlspecialchars($_COOKIE['guestName']) : '';
        ?>
" />
		</div>
		<div class="row">
			<label for="password_<?php 
        echo $entryId;
        ?>
"><?php 
        echo _text('비밀번호');
        ?>
</label>
			<input type="password" id="password_<?php 
        echo $entryId;
        ?>
" name="password_<?php 
        echo $entryId;
        ?>
" />
		</div>
		<div class="row">
			<label for="homepage_<?php 
        echo $entryId;
        ?>
"><?php 
        echo _text('홈페이지');
        ?>
</label>
			<input type="text" id="homepage_<?php 
        echo $entryId;
        ?>
" name="homepage_<?php 
        echo $entryId;
        ?>
"  value="<?php 
        echo isset($_COOKIE['guestHomepage']) && $_COOKIE['guestHomepage'] != 'http://' ? htmlspecialchars($_COOKIE['guestHomepage']) : 'http://';
        ?>
" />
		</div>
		<?php 
    }
//.........这里部分代码省略.........
开发者ID:hinablue,项目名称:TextCube,代码行数:101,代码来源:iphoneView.php


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