Beispiel #1
0
 function showthumb($picID)
 {
     global $_language;
     $_language->read_module('gallery', true);
     global $thumbwidth, $_language;
     $pic = mysql_fetch_array(safe_query("SELECT * FROM " . PREFIX . "gallery_pictures WHERE picID='" . $picID . "'"));
     if ($pic['picID']) {
         $pic['gallery'] = str_break(stripslashes($this->getgalleryname($picID)), 45);
         if (file_exists('images/gallery/thumb/' . $picID . '.jpg')) {
             $pic['image'] = '<a href="index.php?site=gallery&amp;picID=' . $picID . '"><img src="images/gallery/thumb/' . $picID . '.jpg" border="0" width="' . $thumbwidth . '" alt="" /></a>';
         } else {
             $pic['image'] = '<a href="index.php?site=gallery&amp;picID=' . $picID . '"><img src="images/nopic.gif" border="0" width="' . $thumbwidth . '" alt="' . $_language->module['no_thumb'] . '" /></a>';
         }
         $pic['comments'] = mysql_num_rows(safe_query("SELECT commentID FROM " . PREFIX . "comments WHERE parentID='" . $picID . "' AND type='ga'"));
         $ergebnis = mysql_fetch_array(safe_query("SELECT date FROM " . PREFIX . "gallery as gal, " . PREFIX . "gallery_pictures as pic WHERE gal.galleryID=pic.galleryID AND pic.picID='" . $picID . "'"));
         $pic['date'] = date("d.m.Y", $ergebnis['date']);
         $pic['groupID'] = $this->getgroupid_by_gallery($pic['galleryID']);
         $pic['name'] = stripslashes(clearfromtags($pic['name']));
         eval("\$thumb = \"" . gettemplate("gallery_content_showthumb") . "\";");
     } else {
         $thumb = '<tr><td colspan="2">' . $_language->module['no_picture'] . '</td></tr>';
     }
     return $thumb;
 }
Beispiel #2
0
        eval("\$gallery = \"" . gettemplate("gallery_comments") . "\";");
        echo $gallery;
        //comments
        $comments_allowed = $ds['comments'];
        $parentID = $ds['picID'];
        $type = "ga";
        $referer = "index.php?site=gallery&amp;picID=" . $ds['picID'];
        include "comments.php";
    }
} elseif (isset($_GET['galleryID'])) {
    $_language->read_module('gallery');
    $galclass = new Gallery();
    eval("\$gallery = \"" . gettemplate("title_gallery") . "\";");
    echo $gallery;
    $ds = mysql_fetch_array(safe_query("SELECT name FROM " . PREFIX . "gallery WHERE galleryID='" . $_GET['galleryID'] . "'"));
    $title = str_break(clearfromtags($ds['name']), 45);
    $pics = mysql_num_rows(safe_query("SELECT picID FROM " . PREFIX . "gallery_pictures WHERE galleryID='" . $_GET['galleryID'] . "'"));
    $pages = ceil($pics / $gallerypictures);
    $galleryID = $_GET['galleryID'];
    if ($galclass->getgroupid_by_gallery($_GET['galleryID'])) {
        $group = '<a href="index.php?site=gallery&amp;groupID=' . $galclass->getgroupid_by_gallery($_GET['galleryID']) . '" class="titlelink">' . $galclass->getgroupname($galclass->getgroupid_by_gallery($_GET['galleryID'])) . '</a>';
    } else {
        $group = '<a href="index.php?site=gallery&amp;groupID=0" class="titlelink">' . $_language->module['usergalleries'] . '</a> &gt;&gt; <a href="index.php?site=profile&amp;action=galleries&amp;id=' . $galclass->getgalleryowner($_GET['galleryID']) . '" class="titlelink">' . getnickname($galclass->getgalleryowner($_GET['galleryID'])) . '</a>';
    }
    if (!isset($_GET['page'])) {
        $page = 1;
    } else {
        $page = $_GET['page'];
    }
    if ($pages > 1) {
        $pagelink = makepagelink("index.php?site=gallery&amp;galleryID=" . $_GET['galleryID'], $page, $pages);
Beispiel #3
0
         $posttime = date("d.m.y H:i", $db['date']);
         if (mb_strlen($db['message']) > 100) {
             $message = mb_substr($db['message'], 0, 90 + mb_strpos(mb_substr($db['message'], 90, mb_strlen($db['message'])), " ")) . "...";
         } else {
             $message = $db['message'];
         }
         $postlist .= '<tr bgcolor="' . $bgcolor1 . '">
       <td>
       <table width="100%" cellpadding="2" cellspacing="1">
         <tr>
           <td colspan="3"><a href="index.php?site=forum_topic&amp;topic=' . $db['topicID'] . '">' . $posttime . ' <br /><b>' . str_break(getinput($db['topic']), 34) . '</b></a></td>
         </tr>
         <tr><td></td></tr>
         <tr>
           <td width="1%">&nbsp;</td>
           <td bgcolor="' . $bgcolor2 . '" width="98%"><div style="overflow:hidden;">' . str_break(clearfromtags($message), 34) . '</div></td>
           <td width="1%">&nbsp;</td>
         </tr>
       </table>
       </td>
      </tr>';
         $n++;
     }
 } else {
     $postlist = '<tr>
   <td bgcolor="' . BG_1 . '" valign="top">' . $_language->module['no_new_posts'] . '</td>
 </tr>';
 }
 //clanmember/admin/referer
 if (isclanmember($userID)) {
     $cashboxpic = '<td><a href="index.php?site=cash_box"><img src="images/icons/cashbox.gif" border="0" alt="Cashbox" /></a></td>
Beispiel #4
0
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);
}