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


PHP makepagelink函数代码示例

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


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

示例1: index

function index()
{
    global $site_path, $db, $prefix, $site_host, $config, $lang;
    include "header.php";
    $id = intval($_GET["id"]);
    $tpl = new Template();
    $tpl->modTemplate("package");
    $result = $db->query("SELECT * FROM travel_package WHERE package_id={$id} AND package_active=1");
    $row = $db->fetch_array($result);
    $content = explode("<break>", "{$row['package_desc']}");
    $num_record = count($content);
    if (isset($_GET['page'])) {
        $page = intval($_GET['page']);
    } else {
        $page = 1;
    }
    $currentpage = $page;
    $perpage = 1;
    $start = ($page - 1) * $perpage;
    $pages = ceil($num_record / $perpage);
    $starting_no = $start + 1;
    if ($num_record - $start < $perpage) {
        $end_count = $num_record;
    } elseif ($num_record - $start >= $perpage) {
        $end_count = $start + $perpage;
    }
    if ($pages > 1) {
        $page_link = makepagelink("index.php?m=package&file=packagedetails&id={$id}", $page, $pages);
    } else {
        $page_link = "";
    }
    $arrayelement = (int) $page;
    $arrayelement--;
    if (is_admin()) {
        $link = "<a href=index.php?file=admin&op=editpackage&id={$row['package_id']}>Edit</a>";
    } else {
        $link = "";
    }
    $contentx = nl2br($content[$arrayelement]);
    $q = $_SERVER["QUERY_STRING"];
    $url = "{$config['site_url']}/index.php?{$q}";
    $tpl->assign("phone", $config[site_phone]);
    $tpl->assign("lang", $lang);
    $tpl->assign("id", $id);
    $tpl->assign("link", $url);
    $tpl->assign("pagelink", $page_link);
    $tpl->assign("start", $starting_no);
    $tpl->assign("end", $end_count);
    $tpl->assign("found", $num_record);
    $tpl->assign("currentpage", $currentpage);
    $tpl->assign("package", $row);
    $tpl->assign("content", $contentx);
    $tpl->display("package_details.tpl");
    include "footer.php";
}
开发者ID:bogiesoft,项目名称:TravelAgentv2,代码行数:55,代码来源:packagedetails.php

示例2: index

function index()
{
    include "header.php";
    global $db, $lang, $prefix;
    $tpl = new Template();
    $tpl->modTemplate("package");
    $continent = intval($_GET["continent"]);
    if (!empty($continent)) {
        $cond = " AND package_continent={$continent}";
    }
    $result = $db->query("SELECT *  FROM " . $prefix . "_package  WHERE  package_active=1 {$cond}");
    $num_record = $db->row_count($result);
    if ($num_record < 1) {
        $tpl->display("no_package.tpl");
        include "footer.php";
        exit;
    }
    if (isset($_GET['page'])) {
        $page = intval($_GET['page']);
    } else {
        $page = 1;
    }
    $currentpage = $page;
    $perpage = 20;
    $start = ($page - 1) * $perpage;
    $pages = ceil($num_record / $perpage);
    $starting_no = $start + 1;
    if ($num_record - $start < $perpage) {
        $end_count = $num_record;
    } elseif ($num_record - $start >= $perpage) {
        $end_count = $start + $perpage;
    }
    if ($pages > 1) {
        $page_link = makepagelink("index.php?m=package", $page, $pages);
    } else {
        $page_link = "";
    }
    $result2 = $db->query("SELECT * FROM " . $prefix . "_package  WHERE package_active=1 {$cond} ORDER BY package_id DESC limit {$start},{$perpage}");
    $tpl->assign("pagelink", $page_link);
    $tpl->assign("start", $starting_no);
    $tpl->assign("end", $end_count);
    $tpl->assign("found", $num_record);
    $tpl->assign("currentpage", $currentpage);
    while ($row = $db->fetch_array($result2)) {
        $package[] = $row;
    }
    $tpl->assign("lang", $lang);
    $tpl->assign("package", $package);
    $tpl->display("package.tpl");
    include "footer.php";
}
开发者ID:bogiesoft,项目名称:TravelAgentv2,代码行数:51,代码来源:index.php

示例3: admin_news

function admin_news()
{
    global $db;
    $tpl = new smarty();
    if (@$_GET['func'] == 'pin') {
        ob_end_clean();
        if ($db->result(DB_PRE . 'ecp_news', 'sticky', 'newsID = ' . (int) $_GET['id']) == 0) {
            $db->query('UPDATE ' . DB_PRE . 'ecp_news SET sticky = 1 WHERE newsID = ' . (int) $_GET['id']);
        } else {
            $db->query('UPDATE ' . DB_PRE . 'ecp_news SET sticky = 0 WHERE newsID = ' . (int) $_GET['id']);
        }
        $tpl->assign('ajax', 1);
    }
    $anzahl = $db->result(DB_PRE . 'ecp_news', 'COUNT(newsID)', 'datum > 0', 0);
    if ($anzahl) {
        $limits = get_sql_limit($anzahl, ADMIN_ENTRIES);
        $news = array();
        $db->query('SELECT `newsID`, `topicID`, `datum`, `headline`, `topicname`, sticky FROM `' . DB_PRE . 'ecp_news` LEFT JOIN `' . DB_PRE . 'ecp_topics` ON (`topicID` = `tID`) ORDER BY sticky DESC, `datum` DESC LIMIT ' . $limits[1] . ', ' . ADMIN_ENTRIES);
        while ($row = $db->fetch_assoc()) {
            $row['datum'] = date(LONG_DATE, $row['datum']);
            $news[] = $row;
        }
    }
    $tpl->assign('seiten', makepagelink('?section=admin&site=news', isset($_GET['page']) ? $_GET['page'] : 1, $limits[0]));
    $tpl->assign('news', @$news);
    ob_start();
    $tpl->display(DESIGN . '/tpl/admin/news.html');
    $content = ob_get_contents();
    ob_end_clean();
    if (@$_GET['func'] == 'pin') {
        echo html_ajax_convert($content);
        die;
    } else {
        main_content(ADMIN_NEWS, $content, '', 1);
    }
}
开发者ID:ECP-Black,项目名称:ECP,代码行数:36,代码来源:news.php

示例4: makepagelink

     $page = 1;
 }
 if (!isset($sort)) {
     $sort = "{$sortierung}";
 }
 if (!isset($type)) {
     $type = "DESC";
 }
 for ($n = $max; $n <= $gesamt; $n += $max) {
     if ($gesamt > $n) {
         $pages++;
     }
 }
 /********************** SEITENANZAHL GENERIEREN BEI MEHR ALS EINER SEITE + SORTIERUNG **********************/
 if ($pages > 1) {
     $page_link = makepagelink("index.php?site=videos&sort={$sort}&type={$type}", $page, $pages);
 }
 if ($page == "1") {
     $ergebnis = safe_query("SELECT * FROM " . PREFIX . "videos ORDER BY {$sort} {$type} LIMIT 0,{$max}");
     if (isset($rubric)) {
         $ergebnis = safe_query("SELECT * FROM " . PREFIX . "videos WHERE rubric=" . $rubric . " ORDER BY {$sort} {$type} LIMIT 0,{$max}");
     }
     if ($type == "DESC") {
         $n = $gesamt;
     } else {
         $n = 1;
     }
 } else {
     $start = $page * $max - $max;
     $ergebnis = safe_query("SELECT * FROM " . PREFIX . "videos ORDER BY {$sort} {$type} LIMIT {$start},{$max}");
     if (isset($rubric)) {
开发者ID:hellagent75,项目名称:ign_live,代码行数:31,代码来源:videos.php

示例5: eval

    eval("\$gallery = \"" . gettemplate("gallery_gallery_foot") . "\";");
    echo $gallery;
} elseif (isset($_GET['groupID'])) {
    $_language->read_module('gallery');
    $galclass = new Gallery();
    eval("\$gallery = \"" . gettemplate("title_gallery") . "\";");
    echo $gallery;
    $galleries = mysql_num_rows(safe_query("SELECT galleryID FROM " . PREFIX . "gallery WHERE groupID='" . $_GET['groupID'] . "'"));
    $pages = ceil($galleries / $gallerypictures);
    if (!isset($_GET['page'])) {
        $page = 1;
    } else {
        $page = $_GET['page'];
    }
    if ($pages > 1) {
        $pagelink = makepagelink("index.php?site=gallery&amp;groupID=" . $_GET['groupID'], $page, $pages);
    } else {
        $pagelink = '<img src="images/icons/multipage.gif" width="10" height="12" alt="" /> <small>' . $_language->module['pg_1_1'] . '</small>';
    }
    $group = $galclass->getgroupname($_GET['groupID']);
    if ($_GET['groupID'] == 0) {
        $group = $_language->module['usergalleries'];
    }
    eval("\$gallery = \"" . gettemplate("gallery_group_head") . "\";");
    echo $gallery;
    if ($page == "1") {
        $ergebnis = safe_query("SELECT * FROM " . PREFIX . "gallery WHERE groupID='" . $_GET['groupID'] . "' ORDER BY galleryID DESC LIMIT 0, " . $gallerypictures);
    } else {
        $start = $page * $gallerypictures - $gallerypictures;
        $ergebnis = safe_query("SELECT * FROM " . PREFIX . "gallery WHERE groupID='" . $_GET['groupID'] . "' ORDER BY galleryID DESC LIMIT " . $start . ", " . $gallerypictures);
    }
开发者ID:Blaz3r,项目名称:webSPELL,代码行数:31,代码来源:gallery.php

示例6: mb_substr

 if (isset($_GET['sorttype']) and strtoupper($_GET['sorttype'] == "ASC")) {
     $sorttype = 'ASC';
 } else {
     $sorttype = 'DESC';
 }
 if (!isset($parentID) and isset($_GET['parentID'])) {
     $parentID = (int) $_GET['parentID'];
 }
 if (!isset($type) and isset($_GET['type'])) {
     $type = mb_substr($_GET['type'], 0, 2);
 }
 $alle = safe_query("SELECT commentID FROM " . PREFIX . "comments WHERE parentID='{$parentID}' AND type='{$type}'");
 $gesamt = mysql_num_rows($alle);
 $commentspages = ceil($gesamt / $maxfeedback);
 if ($commentspages > 1) {
     $page_link = makepagelink("{$referer}&amp;sorttype={$sorttype}", $commentspage, $commentspages, 'comments');
 } else {
     $page_link = '';
 }
 if ($commentspage == "1") {
     $ergebnis = safe_query("SELECT * FROM " . PREFIX . "comments WHERE parentID='{$parentID}' AND type='{$type}' ORDER BY date {$sorttype} LIMIT 0,{$maxfeedback}");
     if ($sorttype == "DESC") {
         $n = $gesamt;
     } else {
         $n = 1;
     }
 } else {
     $start = ($commentspage - 1) * $maxfeedback;
     $ergebnis = safe_query("SELECT * FROM " . PREFIX . "comments WHERE parentID='{$parentID}' AND type='{$type}' ORDER BY date {$sorttype} LIMIT {$start},{$maxfeedback}");
     if ($sorttype == "DESC") {
         $n = $gesamt - ($commentspage - 1) * $maxfeedback;
开发者ID:Blaz3r,项目名称:webSPELL,代码行数:31,代码来源:comments.php

示例7: showtopic

function showtopic($topic, $edit, $addreply, $quoteID, $type)
{
    global $userID;
    global $loggedin;
    global $page;
    global $maxposts;
    global $preview;
    global $message;
    global $picsize_l;
    global $_language;
    $_language->read_module('forum');
    $_language->read_module('bbcode', true);
    $pagebg = PAGEBG;
    $border = BORDER;
    $bghead = BGHEAD;
    $bgcat = BGCAT;
    $thread = safe_query("SELECT * FROM " . PREFIX . "forum_topics WHERE topicID='{$topic}' ");
    $dt = mysql_fetch_array($thread);
    $usergrp = 0;
    $writer = 0;
    $ismod = ismoderator($userID, $dt['boardID']);
    if ($dt['writegrps'] != "" and !$ismod) {
        $writegrps = explode(";", $dt['writegrps']);
        foreach ($writegrps as $value) {
            if (isinusergrp($value, $userID)) {
                $usergrp = 1;
                $writer = 1;
                break;
            }
        }
    } else {
        $writer = 1;
    }
    if ($dt['readgrps'] != "" and !$usergrp and !$ismod) {
        $readgrps = explode(";", $dt['readgrps']);
        foreach ($readgrps as $value) {
            if (isinusergrp($value, $userID)) {
                $usergrp = 1;
                break;
            }
        }
        if (!$usergrp) {
            echo $_language->module['no_permission'];
            redirect('index.php?site=forum', $_language->module['no_permission'], 2);
            return;
        }
    }
    $gesamt = mysql_num_rows(safe_query("SELECT topicID FROM " . PREFIX . "forum_posts WHERE topicID='{$topic}'"));
    if ($gesamt == 0) {
        die($_language->module['topic_not_found'] . " <a href=\"javascript:history.back()\">back</a>");
    }
    $pages = 1;
    if (!isset($page) || ($site = '')) {
        $page = 1;
    }
    if (isset($type)) {
        if (!($type == 'ASC' || $type == 'DESC')) {
            $type = "ASC";
        }
    } else {
        $type = "ASC";
    }
    $max = $maxposts;
    $pages = ceil($gesamt / $maxposts);
    $page_link = '';
    if ($pages > 1) {
        $page_link = makepagelink("index.php?site=forum_topic&amp;topic={$topic}&amp;type={$type}", $page, $pages);
    }
    if ($type == "ASC") {
        $sorter = '<a href="index.php?site=forum_topic&amp;topic=' . $topic . '&amp;page=' . $page . '&amp;type=DESC">' . $_language->module['sort'] . ':</a> <img src="images/icons/asc.gif" alt="" />';
    } else {
        $sorter = '<a href="index.php?site=forum_topic&amp;topic=' . $topic . '&amp;page=' . $page . '&amp;type=ASC">' . $_language->module['sort'] . ':</a> <img src="images/icons/desc.gif" alt="" />';
    }
    $start = 0;
    if ($page > 1) {
        $start = $page * $max - $max;
    }
    safe_query("UPDATE " . PREFIX . "forum_topics SET views=views+1 WHERE topicID='{$topic}' ");
    // viewed topics
    if (mysql_num_rows(safe_query("SELECT userID FROM " . PREFIX . "user WHERE topics LIKE '%|" . $topic . "|%'"))) {
        $gv = mysql_fetch_array(safe_query("SELECT topics FROM " . PREFIX . "user WHERE userID='{$userID}'"));
        $array = explode("|", $gv['topics']);
        $new = '|';
        foreach ($array as $split) {
            if ($split != "" and $split != $topic) {
                $new = $new . $split . '|';
            }
        }
        safe_query("UPDATE " . PREFIX . "user SET topics='" . $new . "' WHERE userID='{$userID}'");
    }
    // end viewed topics
    $topicname = getinput($dt['topic']);
    $ergebnis = safe_query("SELECT * FROM " . PREFIX . "forum_boards WHERE boardID='" . $dt['boardID'] . "' ");
    $db = mysql_fetch_array($ergebnis);
    $boardname = $db['name'];
    $moderators = getmoderators($dt['boardID']);
    $topicactions = '<a href="printview.php?board=' . $dt['boardID'] . '&amp;topic=' . $topic . '" target="_blank"><img src="images/icons/printview.gif" border="0" alt="printview" /></a> ';
    if ($loggedin and $writer) {
        $topicactions .= '<a href="index.php?site=forum&amp;addtopic=true&amp;action=newtopic&amp;board=' . $dt['boardID'] . '">' . $_language->module['newtopic_image'] . '</a> <a href="index.php?site=forum_topic&amp;topic=' . $topic . '&amp;addreply=true&amp;page=' . $pages . '&amp;type=' . $type . '">' . $_language->module['newreply_image'] . '</a>';
    }
//.........这里部分代码省略.........
开发者ID:Blaz3r,项目名称:webSPELL,代码行数:101,代码来源:forum_topic.php

示例8: makepagelink

    $page = 1;
}
$sort = "nickname";
if (isset($_GET['sort'])) {
    if ($_GET['sort'] == 'country' || $_GET['sort'] == 'nickname' || $_GET['sort'] == 'lastlogin' || $_GET['sort'] == 'registerdate') {
        $sort = $_GET['sort'];
    }
}
$type = "ASC";
if (isset($_GET['type'])) {
    if ($_GET['type'] == 'ASC' || $_GET['type'] == 'DESC') {
        $type = $_GET['type'];
    }
}
if ($pages > 1) {
    $page_link = makepagelink("index.php?site=registered_users&amp;sort={$sort}&amp;type={$type}", $page, $pages);
} else {
    $page_link = '';
}
if ($page == "1") {
    $ergebnis = safe_query("SELECT * FROM " . PREFIX . "user ORDER BY " . $sort . " " . $type . " LIMIT 0," . $maxusers);
    if ($type == "DESC") {
        $n = $gesamt;
    } else {
        $n = 1;
    }
} else {
    $start = $page * $maxusers - $maxusers;
    $ergebnis = safe_query("SELECT * FROM " . PREFIX . "user ORDER BY " . $sort . " " . $type . " LIMIT " . $start . "," . $maxusers);
    if ($type == "DESC") {
        $n = $gesamt - $page * $maxusers + $maxusers;
开发者ID:Blaz3r,项目名称:webSPELL,代码行数:31,代码来源:registered_users.php

示例9: admin_gallery_view

function admin_gallery_view($id)
{
    global $db;
    $gallery = $db->fetch_assoc('SELECT name, folder, images FROM ' . DB_PRE . 'ecp_gallery WHERE galleryID = ' . $id);
    if (isset($gallery['name'])) {
        if ($gallery['images']) {
            $limits = get_sql_limit($gallery['images'], LIMIT_GALLERY_PICS);
            $db->query('SELECT * FROM ' . DB_PRE . 'ecp_gallery_images WHERE gID = ' . $id . ' ORDER BY imageID ASC LIMIT ' . $limits[1] . ',' . LIMIT_GALLERY_PICS);
            $pics = array();
            while ($row = $db->fetch_assoc()) {
                $row['uploaded'] = date(SHORT_DATE, $row['uploaded']);
                $pics[] = $row;
            }
            $tpl = new smarty();
            $tpl->assign('pics', $pics);
            $tpl->assign('seiten', makepagelink('?section=admin&site=gallery&func=viewgallery&id=' . $id, isset($_GET['page']) ? $_GET['page'] : 1, $limits[0]));
            $tpl->assign('folder', $gallery['folder']);
            ob_start();
            $tpl->display(DESIGN . '/tpl/admin/gallery_view_overview.html');
            $content = ob_get_contents();
            ob_end_clean();
        }
        $tpl = new smarty();
        $tpl->assign('sid', session_name() . '=' . session_id());
        $tpl->assign('pics', @$content);
        ob_start();
        $tpl->display(DESIGN . '/tpl/admin/gallery_view' . (UPLOAD_METHOD == 'old' ? '_old' : '') . '.html');
        $content = ob_get_contents();
        ob_end_clean();
        main_content(GALLERY, $content, '', 1);
    } else {
        table(ERROR, NO_ENTRIES_ID);
    }
}
开发者ID:ECP-Black,项目名称:ECP,代码行数:34,代码来源:gallery.php

示例10: ceil

 if (isset($_GET['type'])) {
     if ($_GET['type'] == '' || $_GET['type'] == '') {
         $type = $_GET[''];
     }
 }
 $pages = 1;
 if (!isset($page)) {
     $page = 1;
 }
 if (!isset($type)) {
     $type = "DESC";
 }
 $max = $maxguestbook;
 $pages = ceil($gesamt / $max);
 if ($pages > 1) {
     $page_link = makepagelink("user/" . $profile_username . "/" . $typex, $page, $pages);
 } else {
     $page_link = '';
 }
 if ($page == "1") {
     $ergebnis = safe_query("SELECT * FROM " . PREFIX . "user_gbook WHERE userID='" . $id . "' ORDER BY date " . $type . " LIMIT 0, " . $max);
     if ($type == "DESC") {
         $n = $gesamt;
     } else {
         $n = 1;
     }
 } else {
     $start = $page * $max - $max;
     $ergebnis = safe_query("SELECT * FROM " . PREFIX . "user_gbook WHERE userID='" . $id . "' ORDER BY date " . $type . " LIMIT " . $start . ", " . $max);
     if ($type == "DESC") {
         $n = $gesamt - ($page - 1) * $max;
开发者ID:hellagent75,项目名称:ign_live,代码行数:31,代码来源:profile.php

示例11: clearfromtags

             $newsID = $ds['newsID'];
             $res_title[$i] = $message_array[$showlang]['headline'];
             $res_message[$i] = clearfromtags($message_array[$showlang]['message']);
             $res_link[$i] = '<a href="index.php?site=news_comments&amp;newsID=' . $newsID . '">' . $_language->module['news_link'] . '</a>';
             $res_occurr[$i] = substri_count_array($message_array, stripslashes($text));
             $res_date[$i] = $ds['date'];
             $res_type[$i] = $_language->module['news'];
             $i++;
         }
     }
 }
 $count_results = $i;
 echo "<center><b>" . $count_results . "</b> " . $_language->module['results_found'] . "</center><br /><br />";
 $pages = ceil($count_results / $results);
 if ($pages > 1) {
     echo makepagelink("index.php?site=search&amp;action=search&amp;articles=" . $_GET['articles'] . "&amp;faq=" . $_GET['faq'] . "&amp;forum=" . $_GET['forum'] . "&amp;news=" . $_GET['news'] . "&amp;r=" . $_GET['r'] . "&amp;text=" . $_GET['text'] . "&amp;am=" . $_GET['am'] . "&amp;ad=" . $_GET['ad'] . "&amp;ay=" . $_GET['ay'] . "&amp;bm=" . $_GET['bm'] . "&amp;bd=" . $_GET['bd'] . "&amp;by=" . $_GET['by'] . "&amp;order=" . $_GET['order'], $page, $pages);
 }
 // sort results
 if ($_GET['order'] == '2') {
     asort($res_occurr);
 } else {
     arsort($res_occurr);
 }
 $i = 0;
 foreach ($res_occurr as $key => $val) {
     if ($page > 1 and $i < $results * ($page - 1)) {
         $i++;
         continue;
     }
     if ($i >= $results * $page) {
         break;
开发者ID:Blaz3r,项目名称:webSPELL,代码行数:31,代码来源:search.php

示例12: mysql_num_rows

 echo $title_clanwars;
 $gesamt = mysql_num_rows(safe_query("SELECT cwID FROM " . PREFIX . "clanwars"));
 $pages = 1;
 if (!isset($page)) {
     $page = 1;
 }
 if (!isset($sort)) {
     $sort = "date";
 }
 if (!isset($type)) {
     $type = "DESC";
 }
 $max = $maxclanwars;
 $pages = ceil($gesamt / $max);
 if ($pages > 1) {
     $page_link = makepagelink("results/", $page, $pages);
 } else {
     $page_link = "";
 }
 if ($page == "1") {
     $ergebnis = safe_query("SELECT c.*, s.name AS squadname FROM " . PREFIX . "clanwars c LEFT JOIN " . PREFIX . "squads s ON s.squadID=c.squad ORDER BY c.{$sort} {$type} LIMIT 0,{$max}");
     if ($type == "DESC") {
         $n = $gesamt;
     } else {
         $n = 1;
     }
 } else {
     $start = $page * $max - $max;
     $ergebnis = safe_query("SELECT c.*, s.name AS squadname FROM " . PREFIX . "clanwars c LEFT JOIN " . PREFIX . "squads s ON s.squadID=c.squad ORDER BY {$sort} {$type} LIMIT {$start},{$max}");
     if ($type == "DESC") {
         $n = $gesamt - $page * $max + $max;
开发者ID:hellagent75,项目名称:ign_live,代码行数:31,代码来源:clanwars.php

示例13: safe_query

 }
 if (isset($_GET['game'])) {
     $showonly = "AND game='" . $_GET['game'] . "'";
     $show = '&game=' . $_GET['game'];
 }
 if (isset($_GET['rubric']) && isset($_GET['category']) && isset($_GET['game']) || isset($_GET['category']) && isset($_GET['game']) || isset($_GET['rubric']) && isset($_GET['category']) || isset($_GET['rubric']) && isset($_GET['game'])) {
     $showonly = '';
     $show = '';
 }
 $all = safe_query("SELECT newsID FROM " . PREFIX . "news WHERE published='1' AND intern<=" . isclanmember($userID) . " " . $showonly . "");
 $gesamt = mysql_num_rows($all);
 $pages = 1;
 $max = empty($maxnewsarchiv) ? 20 : $maxnewsarchiv;
 $pages = ceil($gesamt / $max);
 if ($pages > 1) {
     $page_link = makepagelink("" . $_GET['category'] . "/archive/" . $typexx, $page, $pages);
 } else {
     $page_link = '';
 }
 if ($page == "1") {
     $ergebnis = safe_query("SELECT * FROM " . PREFIX . "news WHERE published='1' AND intern<=" . isclanmember($userID) . " " . $showonly . " ORDER BY " . $sort . " " . $type . " LIMIT 0," . $max);
     if ($type == "DESC") {
         $n = $gesamt;
     } else {
         $n = 1;
     }
 } else {
     $start = $page * $max - $max;
     $ergebnis = safe_query("SELECT * FROM " . PREFIX . "news WHERE published='1' AND intern<=" . isclanmember($userID) . " " . $showonly . " ORDER BY " . $sort . " " . $type . " LIMIT " . $start . "," . $max);
     if ($type == "DESC") {
         $n = $gesamt - $page * $max + $max;
开发者ID:hellagent75,项目名称:ign_live,代码行数:31,代码来源:news.php

示例14: showboard

function showboard($board)
{
    global $userID;
    global $loggedin;
    global $maxtopics;
    global $maxposts;
    global $page;
    global $action;
    global $_language;
    $_language->read_module('forum');
    $pagebg = PAGEBG;
    $border = BORDER;
    $bghead = BGHEAD;
    $bgcat = BGCAT;
    eval("\$title_messageboard = \"" . gettemplate("title_messageboard") . "\";");
    echo $title_messageboard;
    $alle = safe_query("SELECT topicID FROM " . PREFIX . "forum_topics WHERE boardID='{$board}'");
    $gesamt = mysql_num_rows($alle);
    if ($action == "markall" and $userID) {
        $gv = mysql_fetch_array(safe_query("SELECT topics FROM " . PREFIX . "user WHERE userID='{$userID}'"));
        $board_topics = array();
        while ($ds = mysql_fetch_array($alle)) {
            $board_topics[] = $ds['topicID'];
        }
        $array = explode("|", $gv['topics']);
        $new = '|';
        foreach ($array as $split) {
            if ($split != "" and !in_array($split, $board_topics)) {
                $new .= $split . '|';
            }
        }
        safe_query("UPDATE " . PREFIX . "user SET topics='" . $new . "' WHERE userID='{$userID}'");
    }
    if (!isset($page) || $page == '') {
        $page = 1;
    }
    $max = $maxtopics;
    $pages = ceil($gesamt / $max);
    $page_link = '';
    if ($pages > 1) {
        $page_link = makepagelink("index.php?site=forum&amp;board={$board}", $page, $pages);
    }
    if ($page == 1) {
        $start = 0;
    }
    if ($page > 1) {
        $start = $page * $max - $max;
    }
    $db = mysql_fetch_array(safe_query("SELECT * FROM " . PREFIX . "forum_boards WHERE boardID='" . $board . "' "));
    $boardname = $db['name'];
    $usergrp = 0;
    $writer = 0;
    $ismod = false;
    if (ismoderator($userID, $board) or isforumadmin($userID)) {
        $ismod = true;
    }
    if ($db['writegrps'] != "" and !$ismod) {
        $writegrps = explode(";", $db['writegrps']);
        foreach ($writegrps as $value) {
            if (isinusergrp($value, $userID)) {
                $usergrp = 1;
                $writer = 1;
                break;
            }
        }
    } else {
        $writer = 1;
    }
    if ($db['readgrps'] != "" and !$usergrp and !$ismod) {
        $readgrps = explode(";", $db['readgrps']);
        foreach ($readgrps as $value) {
            if (isinusergrp($value, $userID)) {
                $usergrp = 1;
                break;
            }
        }
        if (!$usergrp) {
            echo $_language->module['no_permission'];
            redirect('index.php?site=forum', '', 2);
            return;
        }
    }
    $moderators = getmoderators($board);
    if ($moderators) {
        $moderators = '(' . $_language->module['moderated_by'] . ': ' . $moderators . ')';
    }
    $actions = '<a href="index.php?site=search">' . $_language->module['search_image'] . '</a>';
    if ($loggedin) {
        $mark = '&#8226; <a href="index.php?site=forum&amp;board=' . $board . '&amp;action=markall">' . $_language->module['mark_topics_read'] . '</a>';
        if ($writer) {
            $actions .= ' <a href="index.php?site=forum&amp;addtopic=true&amp;board=' . $board . '">' . $_language->module['newtopic_image'] . '</a>';
        }
    } else {
        $mark = '';
    }
    $cat = $db['category'];
    $kathname = getcategoryname($cat);
    eval("\$forum_head = \"" . gettemplate("forum_head") . "\";");
    echo $forum_head;
    // TOPICS
//.........这里部分代码省略.........
开发者ID:Blaz3r,项目名称:webSPELL,代码行数:101,代码来源:forum.php

示例15: eval

 eval("\$title_articles = \"" . gettemplate("title_articles") . "\";");
 echo $title_articles;
 if (isnewsadmin($userID)) {
     echo '<input type="button" onclick="MM_openBrWindow(\'articles.php?action=new\',\'Articles\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\');" value="' . $_language->module['new_article'] . '" /><br /><br />';
 }
 $alle = safe_query("SELECT articlesID FROM " . PREFIX . "articles WHERE saved='1'");
 $gesamt = mysql_num_rows($alle);
 $pages = 1;
 $max = $maxarticles;
 for ($n = $max; $n <= $gesamt; $n += $max) {
     if ($gesamt > $n) {
         $pages++;
     }
 }
 if ($pages > 1) {
     $page_link = makepagelink("index.php?site=articles&amp;sort=" . $sort . "&amp;type=" . $type, $page, $pages);
 } else {
     $page_link = '';
 }
 if ($page == "1") {
     $ergebnis = safe_query("SELECT * FROM " . PREFIX . "articles WHERE saved='1' ORDER BY {$sort} {$type} LIMIT 0,{$max}");
     if ($type == "DESC") {
         $n = $gesamt;
     } else {
         $n = 1;
     }
 } else {
     $start = $page * $max - $max;
     $ergebnis = safe_query("SELECT * FROM " . PREFIX . "articles WHERE saved='1' ORDER BY {$sort} {$type} LIMIT {$start},{$max}");
     if ($type == "DESC") {
         $n = $gesamt - $page * $max + $max;
开发者ID:Talfagoron,项目名称:webSPELL-1,代码行数:31,代码来源:articles.php


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