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


PHP game::pagenumbers方法代码示例

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


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

示例1: content_build

    /**
     * Sett opp innhold til en enhet i noden
     * @param array $unit
     */
    public static function content_build($unit)
    {
        switch ($unit['ni_type']) {
            case 1:
                // bb
                $content = '
<div class="p">' . game::format_data($unit['nir_content']) . '</div>';
                break;
            case 2:
                // html
            // html
            case 3:
                // htmleditor
                $content = '
' . $unit['nir_content'];
                break;
            case 5:
                // gallery_section
                $content = '
<p>Not implementet.</p>';
                break;
            case 6:
                // gallery_item
                $content = '
<p>Not implementet.</p>';
                break;
            case 7:
                // news
                $params = new params($unit['nir_params']);
                // hvilke tags?
                $tags = new container($params->get("tags"));
                $page_name = "ni_s_{$unit['ni_id']}";
                $pageinfo = new pagei(PAGEI_ACTIVE_GET, $page_name, PAGEI_PER_PAGE, max(1, min(50, $params->get("per_page", 15))));
                // hent nyhetene
                if (count($tags->items) > 0) {
                    $tags_db = array_map(array(ess::$b->db, "quote"), $tags->items);
                    // filter via tags
                    $query = "n_id, n_title, n_content, n_userid, n_time, n_visible, n_type FROM news, news_tags WHERE n_visible > 0 AND n_id = nt_n_id AND nt_tagname IN (" . implode(", ", $tags_db) . ") GROUP BY n_id ORDER BY n_time DESC";
                } else {
                    $query = "n_id, n_title, n_intro, LEFT(n_content, 5) AS n_content, n_userid, n_time, n_visible, n_type FROM news WHERE n_visible > 0 ORDER BY n_time DESC";
                }
                $result = $pageinfo->query($query);
                $content = '';
                if ($result->rowCount() == 0) {
                    $content .= '
<p>Ingen nyheter.</p>';
                } else {
                    while ($row = $result->fetch()) {
                        $content .= '
<h2>' . htmlspecialchars($row['n_title']) . '</h2>
<p class="h_right">' . ess::$b->date->get($row['n_time'])->format() . '</p>
<div class="p">' . game::format_data($row['n_intro']) . '</div>';
                        // mer info?
                        if (mb_strlen($row['n_content']) > 0) {
                            $content .= '
<p><a href="' . game::address(PHP_SELF, $_GET, array(), array("show_n" => $row['n_id'])) . '">Les mer &raquo;</a></p>';
                        }
                    }
                    if (!$params->get("hide_select_page") && $pageinfo->pages > 1) {
                        $content .= '
<p>' . game::pagenumbers(game::address(PHP_SELF, $_GET, array($page_name)), game::address(PHP_SELF, $_GET, array($page_name), array($page_name => true)) . "=", $pageinfo->pages, $pageinfo->active) . '</p>';
                    }
                }
                break;
            case 8:
                // php include
                $content = '
<p>Not implementet.</p>';
                break;
            default:
                // plaintext
                $content = '
<p>' . htmlspecialchars($unit['nir_content']) . '</p>';
        }
        return $content;
    }
开发者ID:Kuzat,项目名称:kofradia,代码行数:80,代码来源:class.nodes.php


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