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


PHP BxDolCmts::getObjectCommentsCount方法代码示例

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


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

示例1: GenSearchResult

    /**
     * Generate a Block of searching result by Tag (GET is tagKey)
     *
     * @return HTML presentation of data
     */
    function GenSearchResult()
    {
        global $site;
        $iCheckedMemberID = $this->aBlogConf['visitorID'];
        $sRestrictRes = $this->CheckRestrictionToView($iCheckedMemberID);
        if ($sRestrictRes != '') {
            return $sRestrictRes;
        }
        $bNoProfileMode = isset($_REQUEST['ownerID']) || isset($_REQUEST['ownerName']) ? false : true;
        $sRetHtml = '';
        $sSearchedTag = process_db_input($_REQUEST['tagKey']);
        $iMemberID = $this->defineUserId();
        $sDateFormatPhp = getParam('php_date_format');
        $sTagsC = _t('_Tags');
        $sNoBlogC = _t('_No blogs available');
        $sBlogPosts = '';
        $sWhereAddon = $iMemberID > 0 ? "AND `BlogCategories`.`OwnerID` = {$iMemberID}" : '';
        $sOwnerAddAp = $iMemberID == $this->aBlogConf['visitorID'] ? '' : "AND `PostStatus`='approval'";
        $sBlogPostsSQL = "\n\t\t\tSELECT `BlogPosts`. * , `BlogCategories`.`CategoryName`, `BlogCategories`.`CategoryUri`, `BlogCategories`.`CategoryID`, `BlogCategories`.`OwnerID` AS 'OwnID'\n\t\t\tFROM `BlogPosts` \n\t\t\tINNER JOIN `BlogCategories` ON `BlogCategories`.`CategoryID` = `BlogPosts`.`CategoryID` \n\t\t\tWHERE 1 \n\t\t\t{$sWhereAddon}\n\t\t\t{$sOwnerAddAp}\n\t\t";
        $vBlogPosts = db_res($sBlogPostsSQL);
        while ($aResSQL = mysql_fetch_assoc($vBlogPosts)) {
            $sDateTime = date($sDateFormatPhp, strtotime($aResSQL['BlogDate']));
            $oCmts = new BxDolCmts('blogposts', $aResSQL['PostID']);
            $iCountBlogComments = $oCmts->getObjectCommentsCount();
            $sTagsCommas = $aResSQL['Tags'];
            $aTags = split(',', $sTagsCommas);
            if (in_array($sSearchedTag, $aTags)) {
                $sProfNickName = getNickName($aResSQL['OwnID']);
                if ($iMemberID > 0) {
                    $aUser = array('Permalink' => $sProfNickName, 'Link' => $aResSQL['OwnID']);
                } else {
                    $aUser = '';
                }
                foreach ($aTags as $sTagKey) {
                    $sTagLink = $this->genBlogLink('search_by_tag', $aUser, '', '', $sTagKey);
                    $sTagsHrefs .= <<<EOF
<a href="{$sTagLink}" >{$sTagKey}</a>&nbsp;
EOF;
                }
                $sActions = '';
                if (($this->aBlogConf['visitorID'] == $aBlogsRes['OwnerID'] || $this->bAdminMode == TRUE) && $iMemberID > 0) {
                    $sLink = $this->genBlogFormUrl();
                    $sActions = <<<EOF
<div class="fr">
\t\t<a href="{$sLink}" onclick="javascript: UpdateField('EditPostID','{$aResSQL['PostID']}');document.forms.command_edit_post.submit();return false;" style="text-transform:none;">{$sEditC}</a>&nbsp;
\t\t<a href="{$sLink}" onclick="javascript: if (confirm('{$sSureC}')) {UpdateField('DeletePostID','{$aResSQL['PostID']}');UpdateField('DOwnerID','{$aBlogsRes['OwnerID']}');document.forms.command_delete_post.submit(); } return false;" style="text-transform:none;">{$sDeleteC}</a>
</div>
EOF;
                }
                $sProfileLink = $iMemberID > 0 ? '' : "<a href=" . getProfileLink($aResSQL['OwnID']) . ">" . $sProfNickName . "</a>";
                $bFriend = is_friends($this->aBlogConf['visitorID'], $aResSQL['OwnID']);
                $bOwner = $this->aBlogConf['visitorID'] == $aResSQL['OwnID'] ? true : false;
                if ('friends' == $aResSQL['PostReadPermission'] && !$bFriend && !$bOwner && !$this->bAdminMode) {
                    $sMsgBox = MsgBox(_t('_this_blog_only_for_friends'));
                    $sBlogPosts .= <<<EOF
<div class="clear_both"></div>
\t<img src="{$site['icons']}lock.gif" alt="" class="marg_icon" style="float:right;position:relative;" />
\t{$sMsgBox}
<div class="clear_both"></div>
EOF;
                } else {
                    $aUser = array('Permalink' => $sProfNickName, 'Link' => $aResSQL['OwnID']);
                    $aPost = array('Permalink' => $aResSQL['PostUri'], 'Link' => $aResSQL['PostID']);
                    $aCat = array('Permalink' => $aResSQL['CategoryUri'], 'Link' => $aResSQL['CategoryID']);
                    $sPostLink = $this->genBlogLink('show_member_post', $aUser, '', $aPost);
                    $sCatLink = $this->genBlogLink('show_member_blog', $aUser, $aCat, $aPost);
                    $sBlogPosts .= <<<EOF
<div class="cls_res_info_p1">
\t<div class="cls_res_thumb">
\t\t<a class="actions" href="{$sPostLink}">
\t\t\t{$aResSQL['PostCaption']} 
\t\t</a>
\t</div>
\t{$sActions}
\t<div class="clear_both"></div>
</div>
<div class="fr_small_gray_centered">
\t{$sProfileLink}
\t<span style="vertical-align:middle;"><img src="{$site['icons']}clock.gif" style="position:static;margin-right:7px;" alt="{$sDateTime}" /></span>{$sDateTime}&nbsp;
\t<span style="vertical-align:middle;"><img src="{$site['icons']}add_comment.gif" alt="{$sAddCommentC}" title="{$sAddCommentC}" style="position:static;margin-right:7px;" /></span>{$iCountBlogComments} comments&nbsp;
\t<span style="vertical-align:middle;"><img src="{$site['icons']}folder_small.png" style="position:static;margin-right:7px;" /></span>
\t<a href="{$sCatLink}">
\t\t{$aResSQL['CategoryName']}
\t</a>
</div>
<div class="cls_res_info_p1">
\t{$aResSQL['PostText']}
</div>
<div class="cls_res_info_p1">
\t<span style="vertical-align:middle;"><img src="{$site['icons']}tag_small.png" style="position:static;margin-right:7px;" alt="" /></span>{$sTagsC}:&nbsp;{$sTagsHrefs}
</div>
<br />
EOF;
                }
            } else {
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:101,代码来源:BxDolBlogs.php


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