예제 #1
0
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";
}
예제 #2
0
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";
}
예제 #3
0
function index()
{
    global $db, $lang, $prefix;
    include "header.php";
    $result = $db->query("SELECT *\tFROM  " . $prefix . "_fares WHERE  fare_special=1 AND fare_active=1 ORDER BY fare_id");
    $tpl = new Template();
    $tpl->modTemplate("special");
    $num_record = $db->row_count($result);
    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=special", $page, $pages);
    } else {
        $page_link = "";
    }
    // Fix the problem
    $result = $db->query("SELECT *\tFROM  " . $prefix . "_fares WHERE  fare_special=1 AND fare_active=1  ORDER BY fare_id DESC\n\n\tLIMIT {$start},{$perpage}");
    $found = $db->row_count($result);
    $tpl->assign("found", $found);
    $tpl->assign("lang", $lang);
    $tpl->assign("pagelink", $page_link);
    $tpl->assign("start", $starting_no);
    $tpl->assign("end", $end_count);
    $tpl->assign("found", $found);
    $tpl->assign("currentpage", $currentpage);
    while ($row = $db->fetch_array($result)) {
        $special[] = $row;
        $tpl->assign("date", "" . todate($row[fare_purchaseby]) . "");
        $q = $db->query("SELECT * from travel_airline WHERE airline_id={$row['fare_airline']}");
        $airline = $db->fetch_array($q);
        $tpl->assign("airline", $airline);
        $tpl->assign("special", $special);
    }
    $tpl->display("specialindex.tpl");
    include "footer.php";
}
예제 #4
0
파일: news.php 프로젝트: ECP-Black/ECP
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);
    }
}
예제 #5
0
     $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)) {
예제 #6
0
파일: gallery.php 프로젝트: Blaz3r/webSPELL
    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);
    }
예제 #7
0
 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;
예제 #8
0
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>';
    }
    if ($dt['closed']) {
        $closed = $_language->module['closed_image'];
    } else {
        $closed = '';
    }
    $posttype = 'topic';
    $kathname = getcategoryname($db['category']);
    eval("\$forum_topics_title = \"" . gettemplate("forum_topics_title") . "\";");
    echo $forum_topics_title;
    eval("\$forum_topics_actions = \"" . gettemplate("forum_topics_actions") . "\";");
    echo $forum_topics_actions;
    if ($dt['closed']) {
        echo '<br /><br />' . $_language->module['closed_image'] . '<br /><br />';
    }
    if ($edit && !$dt['closed']) {
        $id = $_GET['id'];
        $dr = mysql_fetch_array(safe_query("SELECT * FROM " . PREFIX . "forum_posts WHERE postID='" . $id . "'"));
        $topic = $_GET['topic'];
        $bg1 = BG_1;
        $_sticky = $dt['sticky'] == '1' ? 'checked="checked"' : '';
        $anz = mysql_num_rows(safe_query("SELECT * FROM " . PREFIX . "forum_posts WHERE topicID='" . $dt['topicID'] . "' AND postID='" . $id . "' AND poster='" . $userID . "' ORDER BY date ASC LIMIT 0,1"));
        if ($anz or isforumadmin($userID) or ismoderator($userID, $dt['boardID'])) {
            if (istopicpost($dt['topicID'], $id)) {
                $bg1 = BG_1;
                // topicmessage
                $message = getinput($dr['message']);
                $post = $id;
                $board = $dt['boardID'];
                // notification check
                $notifyqry = safe_query("SELECT * FROM " . PREFIX . "forum_notify WHERE topicID='" . $topic . "' AND userID='" . $userID . "'");
                if (mysql_num_rows($notifyqry)) {
                    $notify = '<input class="input" type="checkbox" name="notify" value="1" checked="checked" /> ' . $_language->module['notify_reply'] . '<br />';
                } else {
                    $notify = '<input class="input" type="checkbox" name="notify" value="1" /> ' . $_language->module['notify_reply'] . '<br />';
                }
                //STICKY
                if (isforumadmin($userID) || ismoderator($userID, $board)) {
                    $chk_sticky = '<br />' . "\n" . ' <input class="input" type="checkbox" name="sticky" value="1" ' . $_sticky . ' /> ' . $_language->module['make_sticky'];
                } else {
                    $chk_sticky = '';
                }
                // topic icon list
                $iconlist = '<tr bgcolor="' . $bg1 . '">
          <td><input type="radio" class="input" name="icon" value="ausrufezeichen.gif" />
          <img src="images/icons/topicicons/ausrufezeichen.gif" width="15" height="15" alt="" /></td>
          <td><input type="radio" class="input" name="icon" value="biggrin.gif" />
          <img src="images/icons/topicicons/biggrin.gif" width="15" height="15" alt="" /></td>
          <td><input type="radio" class="input" name="icon" value="boese.gif" />
          <img src="images/icons/topicicons/boese.gif" width="15" height="15" alt="" /></td>
          <td><input type="radio" class="input" name="icon" value="bored.gif" />
          <img src="images/icons/topicicons/bored.gif" width="15" height="15" alt="" /></td>
          <td><input type="radio" class="input" name="icon" value="cool.gif" />
          <img src="images/icons/topicicons/cool.gif" width="15" height="15" alt="" /></td>
          <td><input type="radio" class="input" name="icon" value="eek.gif" />
          <img src="images/icons/topicicons/eek.gif" width="15" height="15" alt="" /></td>
          <td><input type="radio" class="input" name="icon" value="frage.gif" />
          <img src="images/icons/topicicons/frage.gif" width="15" height="15" alt="" /></td>
          <td><input type="radio" class="input" name="icon" value="frown.gif" />
          <img src="images/icons/topicicons/frown.gif" width="15" height="15" alt="" /></td>
        </tr>
        <tr bgcolor="' . $bg1 . '">
          <td><input type="radio" class="input" name="icon" value="lampe.gif" />
          <img src="images/icons/topicicons/lampe.gif" width="15" height="15" alt="" /></td>
          <td><input type="radio" class="input" name="icon" value="mad.gif" />
          <img src="images/icons/topicicons/mad.gif" width="15" height="15" alt="" /></td>
          <td><input type="radio" class="input" name="icon" value="pfeil.gif" />
          <img src="images/icons/topicicons/pfeil.gif" width="15" height="15" alt="" /></td>
          <td><input type="radio" class="input" name="icon" value="smile.gif" />
          <img src="images/icons/topicicons/smile.gif" width="15" height="15" alt="" /></td>
          <td><input type="radio" class="input" name="icon" value="text.gif" />
          <img src="images/icons/topicicons/text.gif" width="15" height="15" alt="" /></td>
          <td><input type="radio" class="input" name="icon" value="thumb_down.gif" />
          <img src="images/icons/topicicons/thumb_down.gif" width="15" height="15" alt="" /></td>
          <td><input type="radio" class="input" name="icon" value="thumb_up.gif" />
          <img src="images/icons/topicicons/thumb_up.gif" width="15" height="15" alt="" /></td>
          <td><input type="radio" class="input" name="icon" value="wink.gif" />
          <img src="images/icons/topicicons/wink.gif" width="15" height="15" alt="" /></td>
        </tr>
        <tr bgcolor="' . $bg1 . '">
            <td colspan="4"><input type="radio" class="input" name="icon" value="0" /> ' . $_language->module['no_icon'] . '</td>
          </tr>';
                if ($dt['icon']) {
                    $iconlist = str_replace('value="' . $dt['icon'] . '"', 'value="' . $dt['icon'] . '" checked="checked"', $iconlist);
                } else {
                    $iconlist = str_replace('value="0"', 'value="0" checked="checked"', $iconlist);
                }
                eval("\$addbbcode = \"" . gettemplate("addbbcode") . "\";");
                eval("\$forum_edittopic = \"" . gettemplate("forum_edittopic") . "\";");
                echo $forum_edittopic;
            } else {
                // notification check
                $notifyqry = safe_query("SELECT * FROM " . PREFIX . "forum_notify WHERE topicID='" . $topic . "' AND userID='" . $userID . "'");
                if (mysql_num_rows($notifyqry)) {
                    $notify = '<input class="input" type="checkbox" name="notify" value="1" checked="checked" /> ' . $_language->module['notify_reply'];
                } else {
                    $notify = '<input class="input" type="checkbox" name="notify" value="1" /> ' . $_language->module['notify_reply'];
                }
                //STICKY
                if (isforumadmin($userID) || ismoderator($userID, $board)) {
                    $chk_sticky = '<br />' . "\n" . ' <input class="input" type="checkbox" name="sticky" value="1" ' . $_sticky . ' /> ' . $_language->module['make_sticky'];
                } else {
                    $chk_sticky = '';
                }
                $dr['message'] = getinput($dr['message']);
                eval("\$addbbcode = \"" . gettemplate("addbbcode") . "\";");
                eval("\$forum_editpost = \"" . gettemplate("forum_editpost") . "\";");
                echo $forum_editpost;
            }
        } else {
            echo $_language->module['permission_denied'] . '<br /><br />';
        }
        $replys = safe_query("SELECT * FROM " . PREFIX . "forum_posts WHERE topicID='{$topic}' ORDER BY date DESC LIMIT {$start}, {$max}");
    } elseif ($addreply && !$dt['closed']) {
        if ($loggedin and $writer) {
            if (isset($_POST['preview'])) {
                $bg1 = BG_1;
                $bg2 = BG_2;
                $time = date("H:i", time());
                $date = $_language->module['today'];
                $message_preview = getforminput($_POST['message']);
                $postID = 0;
                $message = cleartext(getforminput($_POST['message']));
                $message = toggle($message, 'xx');
                $username = '******' . $userID . '"><b>' . getnickname($userID) . '</b></a>';
                if (isclanmember($userID)) {
                    $member = ' <img src="images/icons/member.gif" alt="' . $_language->module['clanmember'] . '" />';
                } else {
                    $member = '';
                }
                if ($getavatar = getavatar($userID)) {
                    $avatar = '<img src="images/avatars/' . $getavatar . '" alt="" />';
                } else {
                    $avatar = '';
                }
                if ($getsignatur = getsignatur($userID)) {
                    $signatur = cleartext($getsignatur);
                } else {
                    $signatur = '';
                }
                if ($getemail = getemail($userID) and !getemailhide($userID)) {
                    $email = '<a href="mailto:' . mail_protect($getemail) . '"><img src="images/icons/email.gif" border="0" alt="email" /></a>';
                } else {
                    $email = '';
                }
                if (isset($_POST['notify'])) {
                    $notify = 'checked="checked"';
                } else {
                    $notify = '';
                }
                $pm = '';
                $buddy = '';
                $statuspic = '<img src="images/icons/online.gif" alt="online" />';
                if (!validate_url(gethomepage($userID))) {
                    $hp = '';
                } else {
                    $hp = '<a href="' . gethomepage($userID) . '" target="_blank"><img src="images/icons/hp.gif" border="0" alt="' . $_language->module['homepage'] . '" /></a>';
                }
                $registered = getregistered($userID);
                $posts = getuserforumposts($userID);
                if (isset($_POST['sticky'])) {
                    $post_sticky = $_POST['sticky'];
                } else {
                    $post_sticky = null;
                }
                $_sticky = $dt['sticky'] == '1' || $post_sticky == '1' ? 'checked="checked"' : '';
                if (isforumadmin($userID)) {
                    $usertype = $_language->module['admin'];
                    $rang = '<img src="images/icons/ranks/admin.gif" alt="" />';
                } elseif (isanymoderator($userID)) {
                    $usertype = $_language->module['moderator'];
                    $rang = '<img src="images/icons/ranks/moderator.gif" alt="" />';
                } else {
                    $ergebnis = safe_query("SELECT * FROM " . PREFIX . "forum_ranks WHERE {$posts} >= postmin AND {$posts} <= postmax AND postmax >0");
                    $ds = mysql_fetch_array($ergebnis);
                    $usertype = $ds['rank'];
                    $rang = '<img src="images/icons/ranks/' . $ds['pic'] . '" alt="" />';
                }
                if (isforumadmin($userID)) {
                    $chk_sticky = '<br />' . "\n" . ' <input class="input" type="checkbox" name="sticky" value="1" ' . $_sticky . ' /> ' . $_language->module['make_sticky'];
                } elseif (isanymoderator($userID)) {
                    $chk_sticky = '<br />' . "\n" . ' <input class="input" type="checkbox" name="sticky" value="1" ' . $_sticky . ' /> ' . $_language->module['make_sticky'];
                } else {
                    $chk_sticky = '';
                }
                $quote = "";
                $actions = "";
                echo '<table width="100%" cellspacing="1" cellpadding="2" bgcolor="' . BORDER . '">
          <tr bgcolor="' . BGHEAD . '">
            <td colspan="2" class="title" align="center">' . $_language->module['preview'] . '</td>
          </tr>
          <tr bgcolor="' . PAGEBG . '"><td colspan="2"></td></tr>';
                eval("\$forum_topic_content = \"" . gettemplate("forum_topic_content") . "\";");
                echo $forum_topic_content;
                echo '</table>';
                $message = $message_preview;
            } else {
                if ($quoteID) {
                    $ergebnis = safe_query("SELECT poster,message FROM " . PREFIX . "forum_posts WHERE postID='{$quoteID}'");
                    $ds = mysql_fetch_array($ergebnis);
                    $message = '[quote=' . getnickname($ds['poster']) . ']' . getinput($ds['message']) . '[/quote]';
                }
            }
            if (isset($_POST['sticky'])) {
                $post_sticky = $_POST['sticky'];
            } else {
                $post_sticky = null;
            }
            $_sticky = $dt['sticky'] == '1' || $post_sticky == '1' ? 'checked="checked"' : '';
            if (isforumadmin($userID) || ismoderator($userID, $dt['boardID'])) {
                $chk_sticky = '<br />' . "\n" . ' <input class="input" type="checkbox" name="sticky" value="1" ' . $_sticky . ' /> ' . $_language->module['make_sticky'];
            } else {
                $chk_sticky = '';
            }
            if (isset($_POST['notify'])) {
                $post_notify = $_POST['notify'];
            } else {
                $post_notify = null;
            }
            $mysql_notify = mysql_num_rows(safe_query("SELECT notifyID FROM " . PREFIX . "forum_notify WHERE userID='" . $userID . "' AND topicID='" . $topic . "'"));
            $notify = $mysql_notify || $post_notify == '1' ? 'checked="checked"' : '';
            $bg1 = BG_1;
            $board = $dt['boardID'];
            eval("\$addbbcode = \"" . gettemplate("addbbcode") . "\";");
            eval("\$forum_newreply = \"" . gettemplate("forum_newreply") . "\";");
            echo $forum_newreply;
        } elseif ($loggedin) {
            echo '<br /><br />' . $_language->module['no_access_write'] . '<br /><br />';
        } else {
            echo $_language->module['not_logged_msg'];
        }
        $replys = safe_query("SELECT * FROM " . PREFIX . "forum_posts WHERE topicID='{$topic}' ORDER BY date DESC LIMIT 0, " . $max . "");
    } else {
        $replys = safe_query("SELECT * FROM " . PREFIX . "forum_posts WHERE topicID='{$topic}' ORDER BY date {$type} LIMIT " . $start . ", " . $max . "");
    }
    eval("\$forum_topic_head = \"" . gettemplate("forum_topic_head") . "\";");
    echo $forum_topic_head;
    $i = 1;
    while ($dr = mysql_fetch_array($replys)) {
        if ($i % 2) {
            $bg1 = BG_1;
            $bg2 = BG_2;
        } else {
            $bg1 = BG_3;
            $bg2 = BG_4;
        }
        $date = date("d.m.Y", $dr['date']);
        $time = date("H:i", $dr['date']);
        $today = date("d.m.Y", time());
        $yesterday = date("d.m.Y", time() - 3600 * 24);
        if ($date == $today) {
            $date = $_language->module['today'];
        } elseif ($date == $yesterday && $date < $today) {
            $date = $_language->module['yesterday'];
        } else {
            $date = $date;
        }
        $message = cleartext($dr['message']);
        $message = toggle($message, $dr['postID']);
        $postID = $dr['postID'];
        $username = '******' . $dr['poster'] . '"><b>' . stripslashes(getnickname($dr['poster'])) . '</b></a>';
        if (isclanmember($dr['poster'])) {
            $member = ' <img src="images/icons/member.gif" alt="' . $_language->module['clanmember'] . '" />';
        } else {
            $member = '';
        }
        if ($getavatar = getavatar($dr['poster'])) {
            $avatar = '<img src="images/avatars/' . $getavatar . '" alt="" />';
        } else {
            $avatar = '';
        }
        if ($getsignatur = getsignatur($dr['poster'])) {
            $signatur = cleartext($getsignatur);
        } else {
            $signatur = '';
        }
        if ($getemail = getemail($dr['poster']) and !getemailhide($dr['poster'])) {
            $email = '<a href="mailto:' . mail_protect($getemail) . '"><img src="images/icons/email.gif" border="0" alt="email" /></a>';
        } else {
            $email = '';
        }
        $pm = '';
        $buddy = '';
        if ($loggedin && $dr['poster'] != $userID) {
            $pm = '<a href="index.php?site=messenger&amp;action=touser&amp;touser='******'poster'] . '"><img src="images/icons/pm.gif" border="0" width="12" height="13" alt="' . $_language->module['messenger'] . '" /></a>';
            if (isignored($userID, $dr['poster'])) {
                $buddy = '<a href="buddys.php?action=readd&amp;id=' . $dr['poster'] . '&amp;userID=' . $userID . '"><img src="images/icons/buddy_readd.gif" border="0" alt="' . $_language->module['back_buddy'] . '" /></a>';
            } elseif (isbuddy($userID, $dr['poster'])) {
                $buddy = '<a href="buddys.php?action=ignore&amp;id=' . $dr['poster'] . '&amp;userID=' . $userID . '"><img src="images/icons/buddy_ignore.gif" border="0" alt="' . $_language->module['ignore'] . '" /></a>';
            } else {
                $buddy = '<a href="buddys.php?action=add&amp;id=' . $dr['poster'] . '&amp;userID=' . $userID . '"><img src="images/icons/buddy_add.gif" border="0" alt="' . $_language->module['add_buddy'] . '" /></a>';
            }
        }
        if (isonline($dr['poster']) == "offline") {
            $statuspic = '<img src="images/icons/offline.gif" alt="offline" />';
        } else {
            $statuspic = '<img src="images/icons/online.gif" alt="online" />';
        }
        if (!validate_url(gethomepage($dr['poster']))) {
            $hp = '';
        } else {
            $hp = '<a href="' . gethomepage($dr['poster']) . '" target="_blank"><img src="images/icons/hp.gif" border="0" alt="' . $_language->module['homepage'] . '" /></a>';
        }
        if (!$dt['closed']) {
            $quote = '<a href="index.php?site=forum_topic&amp;addreply=true&amp;board=' . $dt['boardID'] . '&amp;topic=' . $topic . '&amp;quoteID=' . $dr['postID'] . '&amp;page=' . $page . '&amp;type=' . $type . '"><img src="images/icons/quote.gif" border="0" alt="' . $_language->module['quote'] . '" /></a>';
        } else {
            $quote = "";
        }
        $registered = getregistered($dr['poster']);
        $posts = getuserforumposts($dr['poster']);
        if (isforumadmin($dr['poster'])) {
            $usertype = $_language->module['admin'];
            $rang = '<img src="images/icons/ranks/admin.gif" alt="" />';
        } elseif (isanymoderator($dr['poster'])) {
            $usertype = $_language->module['moderator'];
            $rang = '<img src="images/icons/ranks/moderator.gif" alt="" />';
        } else {
            $ergebnis = safe_query("SELECT * FROM " . PREFIX . "forum_ranks WHERE {$posts} >= postmin AND {$posts} <= postmax AND postmax >0");
            $ds = mysql_fetch_array($ergebnis);
            $usertype = $ds['rank'];
            $rang = '<img src="images/icons/ranks/' . $ds['pic'] . '" alt="" />';
        }
        $actions = '';
        if (($userID == $dr['poster'] or isforumadmin($userID) or ismoderator($userID, $dt['boardID'])) && !$dt['closed']) {
            $actions = ' <a href="index.php?site=forum_topic&amp;topic=' . $topic . '&amp;edit=true&amp;id=' . $dr['postID'] . '&amp;page=' . $page . '"><img src="images/icons/edit.gif" border="0" alt="' . $_language->module['edit'] . '" /></a> ';
        }
        if (isforumadmin($userID) or ismoderator($userID, $dt['boardID'])) {
            $actions .= '<input class="input" type="checkbox" name="postID[]" value="' . $dr['postID'] . '" />';
        }
        eval("\$forum_topic_content = \"" . gettemplate("forum_topic_content") . "\";");
        echo $forum_topic_content;
        unset($actions);
        $i++;
    }
    $adminactions = "";
    if (isforumadmin($userID) or ismoderator($userID, $dt['boardID'])) {
        if ($dt['closed']) {
            $close = '<option value="opentopic">- ' . $_language->module['reopen_topic'] . '</option>';
        } else {
            $close = '<option value="closetopic">- ' . $_language->module['close_topic'] . '</option>';
        }
        $adminactions = '<input class="input" type="checkbox" name="ALL" value="ALL" onclick="SelectAll(this.form);" /> ' . $_language->module['select_all'] . '
		<select name="admaction">
      <option value="0">' . $_language->module['admin_actions'] . ':</option>
      <option value="delposts">- ' . $_language->module['delete_posts'] . '</option>
      <option value="stickytopic">- ' . $_language->module['make_topic_sticky'] . '</option>
      <option value="unstickytopic">- ' . $_language->module['make_topic_unsticky'] . '</option>
      <option value="movetopic">- ' . $_language->module['move_topic'] . '</option>
      ' . $close . '
      <option value="deletetopic">- ' . $_language->module['delete_topic'] . '</option>
    </select>
    <input type="hidden" name="topicID" value="' . $topic . '" />
    <input type="hidden" name="board" value="' . $dt['boardID'] . '" />
    <input type="submit" name="submit" value="' . $_language->module['go'] . '" />';
    }
    eval("\$forum_topic_foot = \"" . gettemplate("forum_topic_foot") . "\";");
    echo $forum_topic_foot;
    eval("\$forum_topics_actions = \"" . gettemplate("forum_topics_actions") . "\";");
    echo $forum_topics_actions;
    echo '<div align="right">' . $adminactions . '</div></form>';
    if ($dt['closed']) {
        echo $_language->module['closed_image'];
    } else {
        if (!$loggedin && !$edit) {
            echo $_language->module['not_logged_msg'];
        }
    }
}
예제 #9
0
    $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;
예제 #10
0
파일: gallery.php 프로젝트: ECP-Black/ECP
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);
    }
}
예제 #11
0
 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;
예제 #12
0
파일: search.php 프로젝트: Blaz3r/webSPELL
             $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;
예제 #13
0
 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;
예제 #14
0
 }
 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;
예제 #15
0
파일: forum.php 프로젝트: Blaz3r/webSPELL
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
    $topics = safe_query("SELECT * FROM " . PREFIX . "forum_topics WHERE boardID='{$board}' ORDER BY sticky DESC, lastdate DESC LIMIT {$start},{$max}");
    $anztopics = mysql_num_rows(safe_query("SELECT boardID FROM " . PREFIX . "forum_topics WHERE boardID='{$board}'"));
    $i = 1;
    unset($link);
    if ($anztopics) {
        eval("\$forum_topics_head = \"" . gettemplate("forum_topics_head") . "\";");
        echo $forum_topics_head;
        while ($dt = mysql_fetch_array($topics)) {
            if ($i % 2) {
                $bg1 = BG_1;
                $bg2 = BG_2;
            } else {
                $bg1 = BG_3;
                $bg2 = BG_4;
            }
            if ($dt['moveID']) {
                $gesamt = 0;
            } else {
                $gesamt = $dt['replys'] + 1;
            }
            $topicpages = 1;
            $topicpages = ceil($gesamt / $maxposts);
            $topicpage_link = '';
            if ($topicpages > 1) {
                $topicpage_link = makepagelink("index.php?site=forum_topic&amp;topic=" . $dt['topicID'], 1, $topicpages);
            }
            if ($dt['icon']) {
                $icon = '<img src="images/icons/topicicons/' . $dt['icon'] . '" alt="" />';
            } else {
                $icon = '';
            }
            // viewed topics
            if ($dt['sticky']) {
                $onicon = '<img src="images/icons/foldericons/newsticky.gif" alt="' . $_language->module['sticky'] . '" />';
                $officon = '<img src="images/icons/foldericons/sticky.gif" alt="' . $_language->module['sticky'] . '" />';
                $onhoticon = '<img src="images/icons/foldericons/newsticky.gif" alt="' . $_language->module['sticky'] . '" />';
                $offhoticon = '<img src="images/icons/foldericons/sticky.gif" alt="' . $_language->module['sticky'] . '" />';
            } else {
                $onicon = '<img src="images/icons/foldericons/newfolder.gif" alt="' . $_language->module['new_posts'] . '" />';
                $officon = '<img src="images/icons/foldericons/folder.gif" alt="no ' . $_language->module['new_posts'] . '" />';
                $onhoticon = '<img src="images/icons/foldericons/newhotfolder.gif" alt="' . $_language->module['new_posts'] . ' [' . $_language->module['popular'] . ']" />';
                $offhoticon = '<img src="images/icons/foldericons/hotfolder.gif" alt="no ' . $_language->module['new_posts'] . ' [' . $_language->module['popular'] . ']" />';
            }
            if ($dt['closed']) {
                $folder = '<img src="images/icons/foldericons/lockfolder.gif" alt="' . $_language->module['closed'] . '" />';
            } elseif ($dt['moveID']) {
                $folder = '<img src="images/icons/topicicons/pfeil.gif" alt="' . $_language->module['moved'] . '" />';
            } elseif ($userID) {
                $is_unread = mysql_num_rows(safe_query("SELECT userID FROM " . PREFIX . "user WHERE topics LIKE '%|" . $dt['topicID'] . "|%' AND userID='" . $userID . "'"));
                if ($is_unread) {
                    if ($dt['replys'] > 15 || $dt['views'] > 150) {
                        $folder = $onhoticon;
                    } else {
                        $folder = $onicon;
                    }
                } else {
                    if ($dt['replys'] > 15 || $dt['views'] > 150) {
                        $folder = $offhoticon;
                    } else {
                        $folder = $officon;
                    }
                }
            } else {
                if ($gesamt > 15) {
                    $folder = $offhoticon;
                } else {
                    $folder = $officon;
                }
            }
            // end viewed topics
            $topictitle = getinput($dt['topic']);
            $topictitle = str_break($topictitle, 40);
            $poster = '<a href="index.php?site=profile&amp;id=' . $dt['userID'] . '">' . getnickname($dt['userID']) . '</a>';
            if (isset($posterID) and isclanmember($posterID)) {
                $member1 = ' <img src="images/icons/member.gif" alt="' . $_language->module['clanmember'] . '" />';
            } else {
                $member1 = '';
            }
            $replys = '0';
            $views = '0';
            if ($dt['moveID']) {
                // MOVED TOPIC
                $move = safe_query("SELECT * FROM " . PREFIX . "forum_topics WHERE topicID='" . $dt['moveID'] . "'");
                $dm = mysql_fetch_array($move);
                if ($dm['replys']) {
                    $replys = $dm['replys'];
                }
                if ($dm['views']) {
                    $views = $dm['views'];
                }
                $date = date("d.m.y", $dm['lastdate']);
                $time = date("H:i", $dm['lastdate']);
                $today = date("d.m.y", time());
                $yesterday = date("d.m.y", time() - 3600 * 24);
                if ($date == $today) {
                    $date = $_language->module['today'] . ", " . $time;
                } elseif ($date == $yesterday && $date < $today) {
                    $date = $_language->module['yesterday'] . ", " . $time;
                } else {
                    $date = $date . ", " . $time;
                }
                $lastposter = '<a href="index.php?site=profile&amp;id=' . $dm['lastposter'] . '">' . getnickname($dm['lastposter']) . '</a>';
                if (isclanmember($dm['lastposter'])) {
                    $member = ' <img src="images/icons/member.gif" alt="' . $_language->module['clanmember'] . '" />';
                } else {
                    $member = '';
                }
                $link = '<a href="index.php?site=forum_topic&amp;topic=' . $dt['moveID'] . '"><b>' . $_language->module['moved'] . ': ' . $topictitle . '</b></a>';
            } else {
                // NO MOVED TOPIC
                if ($dt['replys']) {
                    $replys = $dt['replys'];
                }
                if ($dt['views']) {
                    $views = $dt['views'];
                }
                $date = date("d.m.y", $dt['lastdate']);
                $time = date("H:i", $dt['lastdate']);
                $today = date("d.m.y", time());
                $yesterday = date("d.m.y", time() - 3600 * 24);
                if ($date == $today) {
                    $date = $_language->module['today'] . ", " . $time;
                } elseif ($date == $yesterday && $date < $today) {
                    $date = $_language->module['yesterday'] . ", " . $time;
                } else {
                    $date = $date . ", " . $time;
                }
                $lastposter = '<a href="index.php?site=profile&amp;id=' . $dt['lastposter'] . '">' . getnickname($dt['lastposter']) . '</a>';
                if (isclanmember($dt['lastposter'])) {
                    $member = ' <img src="images/icons/member.gif" alt="' . $_language->module['clanmember'] . '" />';
                } else {
                    $member = '';
                }
                $link = '<a href="index.php?site=forum_topic&amp;topic=' . $dt['topicID'] . '"><b>' . $topictitle . '</b></a>';
            }
            eval("\$forum_topics_content = \"" . gettemplate("forum_topics_content") . "\";");
            echo $forum_topics_content;
            $i++;
            unset($topicpage_link);
            unset($lastposter);
            unset($member);
            unset($member1);
            unset($date);
            unset($time);
            unset($link);
        }
        eval("\$forum_topics_foot = \"" . gettemplate("forum_topics_foot") . "\";");
        echo $forum_topics_foot;
    }
    eval("\$forum_actions = \"" . gettemplate("forum_actions") . "\";");
    echo $forum_actions;
    if ($loggedin) {
        eval("\$forum_topics_legend = \"" . gettemplate("forum_topics_legend") . "\";");
        echo $forum_topics_legend;
    }
    if (!$loggedin) {
        echo $_language->module['not_logged_msg'];
    }
    unset($page_link);
}
예제 #16
0
 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;
     $unpublished = mysqli_num_rows($unpublished);
     if ($unpublished) {
         $publish = '<a href="index.php?site=news&amp;action=unpublished" class="btn btn-danger">' . $unpublished . ' ' . $_language->module['unpublished_news'] . '</a>';
     }
 }
 echo $post . ' ' . $publish . '<a href="index.php?site=news&amp;action=archive" class="btn btn-primary">' . $_language->module['news_archive'] . '</a><hr>';
 if (isset($_GET['show'])) {
     $result = safe_query("SELECT\n                rubricID\n            FROM\n                " . PREFIX . "news_rubrics\n            WHERE\n                rubric='" . $_GET['show'] . "'\n            LIMIT 0,1");
     $dv = mysqli_fetch_array($result);
     $showonly = "AND rubric='" . $dv['rubricID'] . "'";
 } else {
     $showonly = '';
 }
 /*news pages switch*/
 if ($pages > 1) {
     $page_link = makepagelink("index.php?site=news", $page, $pages);
 } else {
     $page_link = '';
 }
 if ($page == "1") {
     /*news pages switch ende*/
     $result = safe_query("SELECT\n\t\t * \n\tFROM \n\t\t" . PREFIX . "news\n\tWHERE\n\t\tpublished='1' AND\n\t\tintern<=" . (int) isclanmember($userID) . " " . $showonly . "\n\tORDER BY \n\t\tdate DESC \n\tLIMIT 0," . $maxshownnews);
     $n = $gesamt;
 } else {
     $start = $page * $max - $max;
     $result = safe_query("SELECT\n\t\t\t *\n\t\tFROM \n\t\t\t" . PREFIX . "news \n\t\tWHERE \n\t\t\tpublished='1' AND\n\t\t\tintern<=" . (int) isclanmember($userID) . " \n\t\tORDER BY \n\t\t\tdate DESC\n\t\tLIMIT " . $start . "," . $maxshownnews);
     $n = $gesamt - $page * $max + $max;
 }
 $i = 1;
 while ($ds = mysqli_fetch_array($result)) {
     if ($i % 2) {
예제 #18
0
 if (isset($_GET['sorttype']) and strtoupper($_GET['sorttype'] == "DESC")) {
     $sorttype = 'DESC';
 } else {
     $sorttype = 'ASC';
 }
 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}", $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;
예제 #19
0
파일: profile.php 프로젝트: Blaz3r/webSPELL
 if (isset($_GET['type'])) {
     if ($_GET['type'] == 'ASC' || $_GET['type'] == 'DESC') {
         $type = $_GET['type'];
     }
 }
 $pages = 1;
 if (!isset($page)) {
     $page = 1;
 }
 if (!isset($type)) {
     $type = "DESC";
 }
 $max = $maxguestbook;
 $pages = ceil($gesamt / $max);
 if ($pages > 1) {
     $page_link = makepagelink("index.php?site=profile&amp;id=" . $id . "&amp;action=guestbook&amp;type=" . $type, $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;
예제 #20
0
    eval("\$shoutbox_all_foot = \"" . gettemplate("shoutbox_all_foot") . "\";");
    echo $shoutbox_all_foot;
    if (isfeedbackadmin($userID)) {
        $submit = '<input class="input" type="checkbox" name="ALL" value="ALL" onclick="SelectAll(this.form);" /> ' . $_language->module['select_all'] . '
											  <input type="submit" value="' . $_language->module['delete_selected'] . '" />';
    } else {
        $submit = '';
    }
    echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
   		<td>' . $page_link . '</td>
   		<td align="right">' . $submit . '</td>
		</tr>
		</table></form>';
    if ($pages > 1) {
        $page_link = makepagelink("index.php?site=shoutbox_content&amp;action=showall", $page, $pages);
    }
} elseif (basename($_SERVER['PHP_SELF']) != "shoutbox_content.php") {
    redirect('index.php?site=shoutbox_content&action=showall', 'shoutbox', 0);
} else {
    include "_mysql.php";
    include "_settings.php";
    include "_functions.php";
    $pagebg = PAGEBG;
    $border = BORDER;
    $bghead = BGHEAD;
    $bgcat = BGCAT;
    $bg1 = BG_1;
    $ergebnis = safe_query("SELECT * FROM " . PREFIX . "shoutbox ORDER BY date DESC LIMIT 0," . $maxshoutbox);
    while ($ds = mysql_fetch_array($ergebnis)) {
        $date = date("H:i", $ds['date']);
예제 #21
0
 echo $title_guestbook;
 $gesamt = mysql_num_rows(safe_query("SELECT gbID FROM " . PREFIX . "guestbook"));
 if (isset($_GET['page'])) {
     $page = (int) $_GET['page'];
 } else {
     $page = 1;
 }
 $type = "DESC";
 if (isset($_GET['type'])) {
     if ($_GET['type'] == 'ASC' || $_GET['type'] == 'DESC') {
         $type = $_GET['type'];
     }
 }
 $pages = ceil($gesamt / $maxguestbook);
 if ($pages > 1) {
     $page_link = makepagelink("index.php?site=guestbook&amp;type={$type}", $page, $pages);
 } else {
     $page_link = '';
 }
 if ($page == "1") {
     $ergebnis = safe_query("SELECT * FROM " . PREFIX . "guestbook ORDER BY date {$type} LIMIT 0,{$maxguestbook}");
     if ($type == "DESC") {
         $n = $gesamt;
     } else {
         $n = 1;
     }
 } else {
     $start = $page * $maxguestbook - $maxguestbook;
     $ergebnis = safe_query("SELECT * FROM " . PREFIX . "guestbook ORDER BY date {$type} LIMIT {$start},{$maxguestbook}");
     if ($type == "DESC") {
         $n = $gesamt - ($page - 1) * $maxguestbook;
예제 #22
0
 }
 $sort = 'date';
 $type = 'DESC';
 if (isset($_GET['type'])) {
     if ($_GET['type'] == 'ASC') {
         $type = 'ASC';
     }
 }
 if (isset($entries) and $entries > 0) {
     $max = (int) $entries;
 } else {
     $max = $maxmessages;
 }
 $pages = ceil($gesamt / $max);
 if ($pages > 1) {
     $page_link = makepagelink("index.php?site=messenger&amp;action=outgoing&amp;entries={$max}", $page, $pages);
 } else {
     $page_link = '';
 }
 if ($page == "1") {
     $ergebnis = safe_query("SELECT * FROM " . PREFIX . "messenger WHERE fromuser='******' AND userID='{$userID}' 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 . "messenger WHERE fromuser='******' AND userID='{$userID}' ORDER BY {$sort} {$type} LIMIT {$start},{$max}");
     if ($type == "DESC") {
         $n = $gesamt - $page * $max + $max;
예제 #23
0
파일: index.php 프로젝트: ECP-Black/ECP
function news_archiv($topicID = 0)
{
    global $db;
    $topics = array();
    $db->query('SELECT tID, topicname FROM ' . DB_PRE . 'ecp_topics ORDER BY topicname ASC');
    while ($row = $db->fetch_assoc()) {
        $topics[] = $row;
    }
    if ($topicID) {
        $anzahl = $db->result(DB_PRE . 'ecp_news', 'COUNT(newsID)', '(lang = "" OR lang LIKE ",%' . LANGUAGE . '%,") AND topicID = ' . $topicID . ' AND ' . DB_PRE . 'ecp_news.datum < ' . time() . ' AND (access = "" OR ' . $_SESSION['access_search'] . ')');
        $seiten = get_sql_limit($anzahl, 30);
        $sql = 'SELECT `newsID`, `' . DB_PRE . 'ecp_news`.`userID`, `topicID`, `' . DB_PRE . 'ecp_news`.`datum`, `headline`, `bodytext`, `extendtext`, `links`, `hits`,
							  `username`, `topicname`, `topicbild`, `beschreibung`, COUNT(comID) AS comments 
						FROM ' . DB_PRE . 'ecp_news 
						LEFT JOIN ' . DB_PRE . 'ecp_user ON (' . DB_PRE . 'ecp_news.userID = ID)  
						LEFT JOIN ' . DB_PRE . 'ecp_topics ON (topicID = tID) 
						LEFT JOIN ' . DB_PRE . 'ecp_comments ON (subID = newsID AND bereich = "news")
						WHERE (lang = "" OR lang LIKE ",%' . LANGUAGE . '%,") AND topicID = ' . $topicID . ' AND ' . DB_PRE . 'ecp_news.datum < ' . time() . ' AND (access = "" OR ' . $_SESSION['access_search'] . ') GROUP BY newsID ORDER BY sticky DESC, datum DESC';
    } else {
        $anzahl = $db->result(DB_PRE . 'ecp_news', 'COUNT(newsID)', '(lang = "" OR lang LIKE ",%' . LANGUAGE . '%,") AND ' . DB_PRE . 'ecp_news.datum < ' . time() . ' AND (access = "" OR ' . $_SESSION['access_search'] . ')');
        $seiten = get_sql_limit($anzahl, 30);
        $sql = 'SELECT `newsID`, `' . DB_PRE . 'ecp_news`.`userID`, `topicID`, `' . DB_PRE . 'ecp_news`.`datum`, `headline`, `bodytext`, `extendtext`, `links`, `hits`,
							  `username`, `topicname`, `topicbild`, `beschreibung`, COUNT(comID) AS comments 
						FROM ' . DB_PRE . 'ecp_news 
						LEFT JOIN ' . DB_PRE . 'ecp_user ON (' . DB_PRE . 'ecp_news.userID = ID)  
						LEFT JOIN ' . DB_PRE . 'ecp_topics ON (topicID = tID) 
						LEFT JOIN ' . DB_PRE . 'ecp_comments ON (subID = newsID AND bereich = "news")
						WHERE (lang = "" OR lang LIKE ",%' . LANGUAGE . '%,") AND ' . DB_PRE . 'ecp_news.datum < ' . time() . ' AND (access = "" OR ' . $_SESSION['access_search'] . ') GROUP BY newsID ORDER BY sticky DESC, datum DESC';
    }
    if ($anzahl) {
        if (!isset($_GET['page'])) {
            $_GET['page'] = 1;
        }
        $db->query($sql . ' LIMIT ' . $seiten[1] . ', 30');
        $news = array();
        while ($row = $db->fetch_assoc()) {
            $row['datum'] = date(LONG_DATE, $row['datum']);
            $row['comments'] = format_nr($row['comments']);
            $row['hits'] = format_nr($row['hits']);
            $news[] = $row;
        }
        $tpl = new smarty();
        $tpl->assign('topics', $topics);
        $tpl->assign('news', $news);
        ob_start();
        $tpl->display(DESIGN . '/tpl/news/news_archiv.html');
        $content = ob_get_contents();
        ob_end_clean();
        main_content(NEWS_ARCHIV, $content, '', 1);
        if ($seiten[0] > 1) {
            table(PAGES, '<div style="text-align:center">' . NEWS . ': ' . $anzahl . ' | ' . PAGES . ': ' . makepagelink('?section=news&action=archiv&tid=' . $topicID, $_GET['page'], $seiten[0]) . '</div>');
        }
    } else {
        table(INFO, NO_ENTRIES);
    }
}
예제 #24
0
    eval("\$awards_info = \"" . gettemplate("awards_info") . "\";");
    echo $awards_info;
} else {
    $page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
    $sort = isset($_GET['sort']) && $_GET['sort'] == 'squadID' ? "squadID" : "date";
    $type = isset($_GET['type']) && $_GET['type'] == 'ASC' ? "ASC" : "DESC";
    if (isclanwaradmin($userID) || isnewsadmin($userID)) {
        echo '<input style="float:right;" type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=awards&amp;action=new\');return document.MM_returnValue" value="Add Award" />';
    }
    $alle = safe_query("SELECT awardID FROM " . PREFIX . "awards");
    $gesamt = mysql_num_rows($alle);
    $pages = 1;
    $max = $maxawards;
    $pages = ceil($gesamt / $max);
    if ($pages > 1) {
        $page_link = makepagelink("awards/", $page, $pages);
    } else {
        $page_link = '';
    }
    if ($page == "1") {
        $ergebnis = safe_query("SELECT * FROM " . PREFIX . "awards 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 . "awards ORDER BY {$sort} {$type} LIMIT {$start},{$max}");
        if ($type == "DESC") {
            $n = $gesamt - $page * $max + $max;
예제 #25
0
function searchnormal()
{
    global $db, $lang, $prefix;
    include "header.php";
    $pagla = new Template();
    $origin = addslashes($_REQUEST["origin"]);
    $destination = addslashes($_REQUEST["destination"]);
    if (empty($origin) && empty($destination)) {
        header("location:index.php?m=search");
    }
    //query
    $qorigin = $db->query("SELECT origin_name  FROM " . $prefix . "_origin WHERE origin_name LIKE '%{$origin}%'");
    list($originName) = $db->fetch_row($qorigin);
    $qd = $db->query("SELECT destination_name FROM " . $prefix . "_destination WHERE destination_name LIKE '%{$destination}%'");
    list($destinationName) = $db->fetch_row($qd);
    $query = "SELECT * FROM " . $prefix . "_fares," . $prefix . "_fares_origin," . $prefix . "_origin," . $prefix . "_destination\r\n\t WHERE fare_active=1\r\n\tAND fare_id= fares_fare AND fares_origin =origin_id\r\n\tAND fare_destination=destination_id";
    if (!empty($origin)) {
        $query .= " AND origin_name LIKE'%{$origin}%'";
    }
    if (!empty($destination)) {
        $query .= " AND destination_name LIKE '%{$destination}%'";
    }
    $qsearch = $db->query($query);
    $num_record = $db->row_count($qsearch);
    if ($num_record < 1) {
        $pagla->assign("norecord", "norecord");
        $pagla->assign("lang", $lang);
        $pagla->display("search/search_result.tpl");
        include "footer.php";
        exit;
    }
    if (isset($_GET['page'])) {
        $page = intval($_GET['page']);
    } else {
        $page = 1;
    }
    $currentpage = $page;
    $perpage = 15;
    $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=search&op=searchnormal&origin={$origin}&destination={$destination}", $page, $pages);
    } else {
        $page_link = "";
    }
    $result = $db->query("{$query}  ORDER BY   fare_adultfare ASC limit {$start},{$perpage}");
    while ($row = $db->fetch_array($result)) {
        $indexx = $row[fare_id];
        $info[$indexx] = $row;
        $info[$indexx]["airline"] = getrow("airline_name", "travel_airline", "airline_id", "{$row['fare_airline']}");
    }
    #$originName=getrow("origin_name","".$prefix."_origin","origin_id","$origin");
    #$destinationName=getrow("destination_name","".$prefix."_destination","destination_id","$destination");
    $pagla->assign("lang", $lang);
    $pagla->assign("fareinfo", $info);
    $pagla->assign("found", $num_record);
    $pagla->assign("destinationName", $destination);
    $pagla->assign("originName", $origin);
    $pagla->assign("page_link", $page_link);
    $pagla->assign("end_count", $end_count);
    $pagla->assign("starting_no", $starting_no);
    $pagla->assign("currentpage", "{$currentpage}/{$pages}");
    $pagla->display("search/search_result.tpl");
    include "footer.php";
}
예제 #26
0
            if (isset($_POST['groups'])) {
                $grps = $_POST['groups'];
            } else {
                $grps = array(1);
            }
            $sql = safe_query("SELECT * FROM " . PREFIX . "forum_groups");
            while ($ds = mysql_fetch_array($sql)) {
                if (in_array($ds['fgrID'], $grps)) {
                    $groups[] = array('fgrID' => $ds['fgrID'], 'name' => getinput($ds['name']));
                }
            }
            $groups_anz = count($groups);
            $anz_users = count($users);
            $pages = ceil($anz_users / $anz_users_page);
            if ($pages > 1) {
                echo makepagelink("admincenter.php?site=group-users&amp;action=show&amp;users=" . implode("-", $_POST['users']) . "&amp;groups=" . implode("-", $_POST['groups']) . "&amp;addfield=" . $_POST['addfield'], $page, $pages);
            }
            echo '<h1>&curren; <a href="admincenter.php?site=group-users" class="white">' . $_language->module['group_users'] . '</a> &raquo; ' . $_language->module['edit_group_users'] . '</h1>';
            echo '<script type="text/javascript">
    function setUser(userID,group,status){
    	fetch("group-users.php?ajax=true&action=usergroups&user="******"&group="+group+"&state="+status,"","return","event");
    }
    function SelectAllEval() {
	for(var x=0;x<document.form.elements.length;x++) {
		var y=document.form.elements[x];
		if(y.name!=\'ALL\'){
			y.checked=document.form.ALL.checked;
			parts = y.value.split(\' => \');
			if(parts.length == 2){
				setUser(parts[0],parts[1],y.checked);
			}
예제 #27
0
         $ergebnis = safe_query("SELECT u.* FROM " . PREFIX . "user u WHERE userID='{$search}' ORDER BY {$sort} {$type} LIMIT {$start},{$max}");
     } else {
         $ergebnis = safe_query("SELECT u.* FROM " . PREFIX . "user u ORDER BY {$sort} {$type} LIMIT {$start},{$max}");
     }
     if ($type == "DESC") {
         $n = $gesamt - $page * $max + $max;
     } else {
         $n = $gesamt + 1 - $page * $max + $max;
     }
 }
 $page_link = '';
 if ($pages > 1) {
     if ($status == true) {
         $sort = "status";
     }
     $page_link = makepagelink("admincenter.php?site=users&amp;sort={$sort}&amp;type={$type}&amp;search={$search}", $page, $pages);
     $page_link = str_replace('images/', '../images/', $page_link);
 }
 $anz = mysql_num_rows($ergebnis);
 if ($anz) {
     $CAPCLASS = new Captcha();
     $CAPCLASS->create_transaction();
     $hash = $CAPCLASS->get_hash();
     if (!isset($_GET['sort'])) {
         $_GET['sort'] = '';
     }
     if ($status == true) {
         $sort = "status";
     } elseif ($_GET['sort'] == 'nickname' || $_GET['sort'] == 'registerdate') {
         $sort = $_GET['sort'];
     }
예제 #28
0
파일: news.php 프로젝트: Blaz3r/webSPELL
 if (isnewsadmin($userID)) {
     $post = '<input type="button" onclick="MM_openBrWindow(\'news.php?action=new\',\'News\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\')" value="' . $_language->module['post_news'] . '" />';
     $unpublished = safe_query("SELECT newsID FROM " . PREFIX . "news WHERE published='0' AND saved='1'");
     $unpublished = mysql_num_rows($unpublished);
     if ($unpublished) {
         $publish = '<input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=news&amp;action=unpublished\');return document.MM_returnValue" value="' . $unpublished . ' ' . $_language->module['unpublished_news'] . '" /> ';
     }
 }
 echo $post . ' ' . $publish . ' <input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=news\');return document.MM_returnValue" value="' . $_language->module['show_news'] . '" /><hr />';
 $all = safe_query("SELECT newsID FROM " . PREFIX . "news WHERE published='1' AND intern<=" . isclanmember($userID));
 $gesamt = mysql_num_rows($all);
 $pages = 1;
 $max = empty($maxnewsarchiv) ? 20 : $maxnewsarchiv;
 $pages = ceil($gesamt / $max);
 if ($pages > 1) {
     $page_link = makepagelink("index.php?site=news&amp;action=archive&amp;sort=" . $sort . "&amp;type=" . $type, $page, $pages);
 } else {
     $page_link = '';
 }
 if ($page == "1") {
     $ergebnis = safe_query("SELECT * FROM " . PREFIX . "news WHERE published='1' AND intern<=" . isclanmember($userID) . " 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) . " ORDER BY " . $sort . " " . $type . " LIMIT " . $start . "," . $max);
     if ($type == "DESC") {
         $n = $gesamt - $page * $max + $max;
예제 #29
0
 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("index.php?site=clanwars&amp;sort={$sort}&amp;type={$type}", $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;
예제 #30
0
파일: index.php 프로젝트: ECP-Black/ECP
function forum_search_results($id)
{
    global $db;
    if ($id) {
        $search = $db->fetch_assoc('SELECT * FROM ' . DB_PRE . 'ecp_forum_search WHERE (SID = \'' . session_id() . '\' OR userID = ' . (int) @$_SESSION['userID'] . ') AND searchID = ' . $id);
        if (isset($search['searchID'])) {
            if ($search['stichwort'] != '') {
                if ($search['viewas'] == 'comments') {
                    $db->query($search['sqlquery'] . ' ORDER BY ' . $search['sortart'] . ' ' . $search['sortorder']);
                    $anzahl = $db->num_rows();
                    $limits = get_sql_limit($anzahl, LIMIT_FORUM_COMMENTS);
                    $result = $db->query($search['sqlquery'] . ' ORDER BY ' . $search['sortart'] . ' ' . $search['sortorder'] . ' LIMIT ' . $limits[1] . ', ' . LIMIT_FORUM_COMMENTS);
                    $comments = array();
                    while ($row = mysql_fetch_assoc($result)) {
                        $row['adatum'] = forum_make_date($row['adatum']);
                        $row['nr'] = ++$limits[1];
                        $row['countryname'] = @$countries[$row['country']];
                        $row['sex'] == 'male' ? $row['sextext'] = MALE : ($row['sextext'] = FEMALE);
                        if ($row['edits']) {
                            $row['edit'] = str_replace(array('{anzahl}', '{von}', '{last}'), array($row['edits'], '<a href="?section=user&id=' . $row['edituserID'] . '">' . $row['editfrom'] . '</a>', date(LONG_DATE, $row['editdatum'])), COMMENT_EDIT_TXT);
                        }
                        if ($row['attachs']) {
                            $anhaenge = array();
                            $db->query('SELECT `attachID`, `name`, `size`, `downloads` FROM `' . DB_PRE . 'ecp_forum_attachments` WHERE `bID` = ' . $row['bID'] . ' AND `tID` = ' . $row['tID'] . ' AND `mID` = ' . $row['comID']);
                            while ($sub = $db->fetch_assoc()) {
                                $sub['size'] = goodsize($sub['size']);
                                $anhaenge[] = $sub;
                            }
                            $row['attchs'] = $anhaenge;
                        }
                        $comments[] = $row;
                    }
                    $tpl = new smarty();
                    $tpl->assign('comments', $comments);
                    $tpl->assign('words', str_replace(array('AND', 'OR'), array('<strong>AND</strong>', '<strong>OR</strong>'), $search['stichwort']));
                    if ($limits[0] != 1) {
                        $tpl->assign('seiten', '<span class="klammer">[</span> ' . PAGES . ': ' . $anzahl . ' <span class="klammer">|</span> ' . makepagelink('?section=forum&action=searchresults&id=' . $id, (int) @$_GET['page'] == 0 ? 1 : (int) @$_GET['page'], $limits[0]) . ' <span class="klammer">]</span>');
                    }
                    $tpl->assign('path', '<a href="?section=forum">' . FORUM . '</a> <img src="templates/' . DESIGN . '/images/pfeil_o.gif" alt="" /> ' . SEARCH);
                    ob_start();
                    $tpl->display(DESIGN . '/tpl/forum/board_head.html');
                    $tpl->display(DESIGN . '/tpl/forum/search_results_comments.html');
                    echo '</div>';
                    $content = ob_get_contents();
                    ob_end_clean();
                    main_content(FORUM_SEARCH_RESULTS, $content, '', 1);
                } else {
                    if ($search['sortart'] == 'adatum') {
                        $search['sortart'] = 'lastreplay';
                    }
                    $db->query($search['sqlquery']);
                    $anzahl = $db->num_rows();
                    $limits = get_sql_limit($anzahl, LIMIT_THREADS);
                    $result = $db->query($search['sqlquery'] . ' ORDER BY ' . $search['sortart'] . ' ' . $search['sortorder'] . ' LIMIT ' . $limits[1] . ', ' . LIMIT_THREADS);
                    $threads = array();
                    while ($row = mysql_fetch_assoc($result)) {
                        $row['lastreplay'] = forum_make_date($row['lastreplay']);
                        $row['datum'] = forum_make_date($row['datum']);
                        $row['bewertung'] = $row['ratingvotes'] != 0 ? str_replace(array('{anzahl}', '{avg}'), array(format_nr($row['ratingvotes']), format_nr($row['rating'], 2)), FORUM_RATING_VAL) : FORUM_NO_RATINGS;
                        $row['bewertungbild'] = 'rating_' . str_replace('.', '_', get_forum_rating($row['rating']));
                        $threads[] = $row;
                    }
                    $tpl = new smarty();
                    $tpl->assign('threads', $threads);
                    $tpl->assign('words', str_replace(array('AND', 'OR'), array('<strong>AND</strong>', '<strong>OR</strong>'), $search['stichwort']));
                    if ($limits[0] != 1) {
                        $tpl->assign('seiten', '<span class="klammer">[</span> ' . PAGES . ': ' . $anzahl . ' <span class="klammer">|</span> ' . makepagelink('?section=forum&action=searchresults&id=' . $id, (int) @$_GET['page'] == 0 ? 1 : (int) @$_GET['page'], $limits[0]) . ' <span class="klammer">]</span>');
                    }
                    $tpl->assign('path', '<a href="?section=forum">' . FORUM . '</a> <img src="templates/' . DESIGN . '/images/pfeil_o.gif" alt="" /> ' . SEARCH);
                    ob_start();
                    $tpl->display(DESIGN . '/tpl/forum/board_head.html');
                    $tpl->display(DESIGN . '/tpl/forum/search_results_boards.html');
                    echo '</div>';
                    $content = ob_get_contents();
                    ob_end_clean();
                    main_content(FORUM_SEARCH_RESULTS, $content, '', 1);
                }
            } else {
                if ($search['usersuchart'] == 1) {
                    if ($search['sortart'] == 'adatum') {
                        $search['sortart'] == 'datum';
                    }
                    $db->query($search['sqlquery'] . ' ORDER BY ' . $search['sortart'] . ' ' . $search['sortorder']);
                    $anzahl = $db->num_rows();
                    $limits = get_sql_limit($anzahl, LIMIT_FORUM_COMMENTS);
                    $result = $db->query($search['sqlquery'] . ' ORDER BY ' . $search['sortart'] . ' ' . $search['sortorder'] . ' LIMIT ' . $limits[1] . ', ' . LIMIT_FORUM_COMMENTS);
                    $comments = array();
                    while ($row = mysql_fetch_assoc($result)) {
                        $row['adatum'] = forum_make_date($row['adatum']);
                        $row['nr'] = ++$limits[1];
                        $row['countryname'] = @$countries[$row['country']];
                        $row['sex'] == 'male' ? $row['sextext'] = MALE : ($row['sextext'] = FEMALE);
                        if ($row['edits']) {
                            $row['edit'] = str_replace(array('{anzahl}', '{von}', '{last}'), array($row['edits'], '<a href="?section=user&id=' . $row['edituserID'] . '">' . $row['editfrom'] . '</a>', date(LONG_DATE, $row['editdatum'])), COMMENT_EDIT_TXT);
                        }
                        if ($row['attachs']) {
                            $anhaenge = array();
                            $db->query('SELECT `attachID`, `name`, `size`, `downloads` FROM `' . DB_PRE . 'ecp_forum_attachments` WHERE `bID` = ' . $row['bID'] . ' AND `tID` = ' . $row['tID'] . ' AND `mID` = ' . $row['comID']);
                            while ($sub = $db->fetch_assoc()) {
                                $sub['size'] = goodsize($sub['size']);
                                $anhaenge[] = $sub;
                            }
                            $row['attchs'] = $anhaenge;
                        }
                        $comments[] = $row;
                    }
                    $tpl = new smarty();
                    $tpl->assign('search', 'username');
                    $tpl->assign('username', $search['fromusername']);
                    $tpl->assign('comments', $comments);
                    if ($limits[0] != 1) {
                        $tpl->assign('seiten', '<span class="klammer">[</span> ' . PAGES . ': ' . $anzahl . ' <span class="klammer">|</span> ' . makepagelink('?section=forum&action=searchresults&id=' . $id, (int) @$_GET['page'] == 0 ? 1 : (int) @$_GET['page'], $limits[0]) . ' <span class="klammer">]</span>');
                    }
                    $tpl->assign('path', '<a href="?section=forum">' . FORUM . '</a> <img src="templates/' . DESIGN . '/images/pfeil_o.gif" alt="" /> ' . SEARCH);
                    ob_start();
                    $tpl->display(DESIGN . '/tpl/forum/board_head.html');
                    $tpl->display(DESIGN . '/tpl/forum/search_results_comments.html');
                    echo '</div>';
                    $content = ob_get_contents();
                    ob_end_clean();
                    main_content(FORUM_SEARCH_RESULTS, $content, '', 1);
                } else {
                    if ($search['sortart'] == 'adatum') {
                        $search['sortart'] = 'lastreplay';
                    }
                    $db->query($search['sqlquery']);
                    $anzahl = $db->num_rows();
                    $limits = get_sql_limit($anzahl, LIMIT_THREADS);
                    $result = $db->query($search['sqlquery'] . ' ORDER BY ' . $search['sortart'] . ' ' . $search['sortorder'] . ' LIMIT ' . $limits[1] . ', ' . LIMIT_THREADS);
                    $threads = array();
                    while ($row = mysql_fetch_assoc($result)) {
                        $row['lastreplay'] = forum_make_date($row['lastreplay']);
                        $row['datum'] = forum_make_date($row['datum']);
                        $row['bewertung'] = $row['ratingvotes'] != 0 ? str_replace(array('{anzahl}', '{avg}'), array(format_nr($row['ratingvotes']), format_nr($row['rating'], 2)), FORUM_RATING_VAL) : FORUM_NO_RATINGS;
                        $row['bewertungbild'] = 'rating_' . str_replace('.', '_', get_forum_rating($row['rating']));
                        $threads[] = $row;
                    }
                    $tpl = new smarty();
                    $tpl->assign('search', 'username');
                    $tpl->assign('username', $search['fromusername']);
                    $tpl->assign('threads', $threads);
                    if ($limits[0] != 1) {
                        $tpl->assign('seiten', '<span class="klammer">[</span> ' . PAGES . ': ' . $anzahl . ' <span class="klammer">|</span> ' . makepagelink('?section=forum&action=searchresults&id=' . $id, (int) @$_GET['page'] == 0 ? 1 : (int) @$_GET['page'], $limits[0]) . ' <span class="klammer">]</span>');
                    }
                    $tpl->assign('path', '<a href="?section=forum">' . FORUM . '</a> <img src="templates/' . DESIGN . '/images/pfeil_o.gif" alt="" /> ' . SEARCH);
                    ob_start();
                    $tpl->display(DESIGN . '/tpl/forum/board_head.html');
                    $tpl->display(DESIGN . '/tpl/forum/search_results_boards.html');
                    echo '</div>';
                    $content = ob_get_contents();
                    ob_end_clean();
                    main_content(FORUM_SEARCH_RESULTS, $content, '', 1);
                }
            }
        } else {
            table(ERROR, FORUM_SEARCH_NOT_YOURS);
        }
    }
}