當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。