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


PHP osc_comments_per_page函数代码示例

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


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

示例1: osc_comments_pagination

/**
 * Gets the pagination links of comments pagination
 *
 * @return string pagination links
 */
function osc_comments_pagination()
{
    if (osc_comments_per_page() == 0 || osc_item_comments_page() === 'all') {
        return '';
    } else {
        $params = array('total' => ceil(osc_item_total_comments() / osc_comments_per_page()), 'selected' => osc_item_comments_page(), 'url' => osc_item_comments_url('{PAGE}'));
        $pagination = new Pagination($params);
        return $pagination->doPagination();
    }
}
开发者ID:acharei,项目名称:OSClass,代码行数:15,代码来源:hPagination.php

示例2: findByItemID

 public function findByItemID($id, $page = null, $comments_per_page = null)
 {
     if ($page == null) {
         $page = osc_item_comments_page();
     }
     if ($page == '') {
         $page = 0;
     }
     if ($comments_per_page == null) {
         $comments_per_page = osc_comments_per_page();
     }
     if ($page === 'all' || $comments_per_page == 0) {
         return $this->conn->osc_dbFetchResults("SELECT c.* FROM %st_item_comment c WHERE fk_i_item_id = %d AND b_active = 1 AND b_enabled = 1", DB_TABLE_PREFIX, $id);
     } else {
         return $this->conn->osc_dbFetchResults("SELECT c.* FROM %st_item_comment c WHERE fk_i_item_id = %d AND b_active = 1 AND b_enabled = 1 LIMIT %d, %d", DB_TABLE_PREFIX, $id, $page * $comments_per_page, $comments_per_page);
     }
 }
开发者ID:nsswaga,项目名称:OSClass,代码行数:17,代码来源:ItemComment.php

示例3: osc_has_premium_comments

/**
 * Gets next comment of current premium comments
 *
 * @return array
 */
function osc_has_premium_comments()
{
    if (!View::newInstance()->_exists('comments')) {
        View::newInstance()->_exportVariableToView('comments', ItemComment::newInstance()->findBypremiumID(osc_premium_id(), osc_premium_comments_page(), osc_comments_per_page()));
    }
    return View::newInstance()->_next('comments');
}
开发者ID:acharei,项目名称:OSClass,代码行数:12,代码来源:hPremium.php

示例4: _e

?>
                            <div class="help-box"><?php 
_e('If the value is zero, an administrator must always approve comments');
?>
</div>
                        </div>
                    </div>
                </div>
                <div class="form-row">
                    <div class="form-label"><?php 
_e('Other comment settings');
?>
</div>
                    <div class="form-controls">
                        <?php 
printf(__('Break comments into pages with %s comments per page'), '<input type="text" class="input-small" name="comments_per_page" value="' . osc_esc_html(osc_comments_per_page()) . '" />');
?>
                        <div class="help-box"><?php 
_e('If the value is zero all comments are shown');
?>
</div>
                    </div>
                </div>

                <h2 class="render-title"><?php 
_e('Notifications');
?>
</h2>

                <div class="form-row">
                    <div class="form-label"><?php 
开发者ID:oanav,项目名称:closetshare,代码行数:31,代码来源:comments.php

示例5: twitter_comments_item_pagination

/**
 * Helper to use twitter pagination in item comments
 */
function twitter_comments_item_pagination()
{
    $params = array('total' => ceil(osc_item_total_comments() / osc_comments_per_page()), 'selected' => osc_item_comments_page(), 'class_first' => '', 'class_last' => '', 'class_prev' => 'prev', 'class_next' => 'next', 'delimiter' => '', 'text_prev' => sprintf(__('%s Previous', 'twitter'), '&larr;'), 'text_next' => sprintf(__('Next %s', 'twitter'), '&rarr;'), 'class_selected' => 'active', 'class_non_selected' => '', 'force_limits' => false, 'url' => osc_item_comments_url('{PAGE}'));
    $pagination = new TwitterPagination($params);
    return $pagination->doPagination();
}
开发者ID:ricktaylord,项目名称:osclass-themes,代码行数:9,代码来源:functions.php

示例6: findByItemID

 /**
  * Searches for comments information, given an item id, page and comments per page.
  * 
  * @access public
  * @since unknown
  * @param integer $id
  * @param integer $page
  * @param integer $comments_per_page
  * @return array
  */
 function findByItemID($id, $page = null, $commentsPerPage = null)
 {
     $result = array();
     if ($page == null) {
         $page = osc_item_comments_page();
     }
     if ($page == '') {
         $page = 0;
     }
     if ($commentsPerPage == null) {
         $commentsPerPage = osc_comments_per_page();
     }
     $this->dao->select();
     $this->dao->from($this->getTableName());
     $conditions = array('fk_i_item_id' => $id, 'b_active' => 1, 'b_enabled' => 1);
     $this->dao->where($conditions);
     if ($page !== 'all' || $commentsPerPage > 0) {
         $this->dao->limit($page * $commentsPerPage, $commentsPerPage);
     }
     $result = $this->dao->get();
     if ($result == false) {
         return false;
     } else {
         return $result->result();
     }
 }
开发者ID:randomecho,项目名称:OSClass,代码行数:36,代码来源:ItemComment.php

示例7: _e

                _e('Delete your comment', 'twitter_bootstrap');
                ?>
"><?php 
                _e('Delete', 'twitter_bootstrap');
                ?>
</a>
                                </p>
                                <?php 
            }
            ?>
                            </div>
                        <?php 
        }
        ?>
                        <?php 
        if (!(osc_comments_per_page() == 0) || osc_item_comments_page() === 'all') {
            ?>
                        <div class="pagination">
                            <ul>
                                <?php 
            echo twitter_comments_item_pagination();
            ?>
                            </ul>
                        </div>
                        <?php 
        }
        ?>
                    </div>
                    <!-- list comments end -->
                    <?php 
    }
开发者ID:nsswaga,项目名称:OSClass,代码行数:31,代码来源:item.php

示例8: _e

                                        &nbsp;<label><?php 
_e('Number of comments from same author that should be validated before skipping validation (0 for always moderation)');
?>
</label>
                                        <input type="text" name="num_moderate_comments" id="num_moderate_comments" value="<?php 
echo osc_moderate_comments() == -1 ? '' : osc_moderate_comments();
?>
" />
                                    </div>
                                    <br/>
                                    <label><?php 
_e('Number of comments per page. You could limit the number of comments shown at a time at the item\'s detail page. Other comments will be available through a pagination system. (0 for show all comments at the same time)');
?>
</label>
                                    <input type="text" name="comments_per_page" id="comments_per_page" value="<?php 
echo osc_comments_per_page();
?>
" />
                                    <br/>
                                    <input style="height: 20px; padding-left: 4px;padding-top: 4px;" type="checkbox" <?php 
echo osc_reg_user_post_comments() ? 'checked="true"' : '';
?>
 name="reg_user_post_comments" id="reg_user_post_comments" value="1" />
                                    <label for="reg_user_post_comments"><?php 
_e('Only allow registered users to post comments');
?>
</label>
                                </fieldset>
                            </div>
                            
                            <div style="float: left; width: 50%;">
开发者ID:nsswaga,项目名称:OSClass,代码行数:31,代码来源:comments.php

示例9: _e

                _e('Delete your comment', 'twitter');
                ?>
"><?php 
                _e('Delete', 'twitter');
                ?>
</a>
                                </p>
                                <?php 
            }
            ?>
                            </div>
                        <?php 
        }
        ?>
                        <?php 
        if ((!(osc_comments_per_page() == 0) || osc_item_comments_page() === 'all') && osc_item_total_comments() >= osc_comments_per_page()) {
            ?>
                        <div class="pagination">
                            <ul>
                                <?php 
            echo twitter_comments_item_pagination();
            ?>
                            </ul>
                        </div>
                        <?php 
        }
        ?>
                    </div>
                    <!-- list comments end -->
                    <?php 
    }
开发者ID:ricktaylord,项目名称:osclass-themes,代码行数:31,代码来源:item.php


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