Beispiel #1
0
function show_all($min)
{
    global $prefix, $user_prefix, $db, $bgcolor1, $bgcolor2, $user, $cookie, $sitename, $multilingual, $language, $module_name, $userinfo;
    if (!isset($min) || intval($min) <= 0) {
        $min = 0;
    } else {
        $min = intval($min);
    }
    $max = 250;
    include "header.php";
    title("" . _STORIESARCHIVE . "");
    title("{$sitename}: " . _ALLSTORIESARCH . "");
    $r_options = "";
    if (is_user($user)) {
        getusrinfo($user);
        if (isset($userinfo['umode'])) {
            $r_options .= "&amp;mode=" . $userinfo['umode'];
        }
        if (isset($userinfo['uorder'])) {
            $r_options .= "&amp;order=" . $userinfo['uorder'];
        }
        if (isset($userinfo['thold'])) {
            $r_options .= "&amp;thold=" . $userinfo['thold'];
        }
    }
    OpenTable();
    echo "<table border=\"0\" width=\"100%\"><tr>" . "<td bgcolor=\"{$bgcolor2}\" align=\"left\"><b>" . _ARTICLES . "</b></td>" . "<td bgcolor=\"{$bgcolor2}\" align=\"center\"><b>" . _COMMENTS . "</b></td>" . "<td bgcolor=\"{$bgcolor2}\" align=\"center\"><b>" . _READS . "</b></td>" . "<td bgcolor=\"{$bgcolor2}\" align=\"center\"><b>" . _USCORE . "</b></td>" . "<td bgcolor=\"{$bgcolor2}\" align=\"center\"><b>" . _DATE . "</b></td>" . "<td bgcolor=\"{$bgcolor2}\" align=\"center\"><b>" . _ACTIONS . "</b></td></tr>";
    $result = $db->sql_query("SELECT sid, catid, title, time, comments, counter, topic, alanguage, score, ratings from " . $prefix . "_stories order by sid DESC limit {$min},{$max}");
    $numrows = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_stories"));
    while ($row = $db->sql_fetchrow($result)) {
        $sid = intval($row['sid']);
        $catid = intval($row['catid']);
        $title = filter($row['title'], "nohtml");
        $time = $row['time'];
        $comments = intval($row['comments']);
        $counter = intval($row['counter']);
        $topic = intval($row['topic']);
        $alanguage = $row['alanguage'];
        $score = intval($row['score']);
        $ratings = intval($row['ratings']);
        $time = explode(" ", $time);
        $actions = "<a href=\"modules.php?name=News&amp;file=print&amp;sid={$sid}\"><img src=\"images/print.gif\" border=0 alt=\"" . _PRINTER . "\" title=\"" . _PRINTER . "\" width=\"15\" height=\"11\"></a>&nbsp;<a href=\"modules.php?name=News&amp;file=friend&amp;op=FriendSend&amp;sid={$sid}\"><img src=\"images/friend.gif\" border=0 alt=\"" . _FRIEND . "\" title=\"" . _FRIEND . "\" width=\"15\" height=\"11\"></a>";
        if ($score != 0) {
            $rated = substr($score / $ratings, 0, 4);
        } else {
            $rated = 0;
        }
        if ($catid == 0) {
            $title = "<a href=\"modules.php?name=News&amp;file=article&amp;sid={$sid}{$r_options}\">{$title}</a>";
        } elseif ($catid != 0) {
            $row_res = $db->sql_fetchrow($db->sql_query("SELECT title from " . $prefix . "_stories_cat where catid='{$catid}'"));
            $cat_title = filter($row_res['title'], "nohtml");
            $title = "<a href=\"modules.php?name=News&amp;file=categories&amp;op=newindex&amp;catid={$catid}\"><i>{$cat_title}</i></a>: <a href=\"modules.php?name=News&amp;file=article&amp;sid={$sid}{$r_options}\">{$title}</a>";
        }
        if ($multilingual == 1) {
            if (empty($alanguage)) {
                $alanguage = $language;
            }
            $alt_language = ucfirst($alanguage);
            $lang_img = "<img src=\"images/language/flag-{$alanguage}.png\" border=\"0\" hspace=\"2\" alt=\"{$alt_language}\" title=\"{$alt_language}\">";
        } else {
            $lang_img = "<strong><big><b>&middot;</b></big></strong>";
        }
        echo "<tr>" . "<td bgcolor=\"{$bgcolor1}\" align=\"left\">{$lang_img} {$title}</td>" . "<td bgcolor=\"{$bgcolor1}\" align=\"center\">{$comments}</td>" . "<td bgcolor=\"{$bgcolor1}\" align=\"center\">{$counter}</td>" . "<td bgcolor=\"{$bgcolor1}\" align=\"center\">{$rated}</td>" . "<td bgcolor=\"{$bgcolor1}\" align=\"center\">{$time['0']}</td>" . "<td bgcolor=\"{$bgcolor1}\" align=\"center\">{$actions}</td></tr>";
    }
    echo "</table>" . "<br><br><br>";
    $a = 0;
    if ($numrows > 250 and $min == 0) {
        $min = $min + 250;
        $a++;
        echo "<center>[ <a href=\"modules.php?name={$module_name}&amp;sa=show_all&amp;min={$min}\">" . _NEXTPAGE . "</a> ]</center><br>";
    }
    if ($numrows > 250 and $min >= 250 and $a != 1) {
        $pmin = $min - 250;
        $min = $min + 250;
        $a++;
        echo "<center>[ <a href=\"modules.php?name={$module_name}&amp;sa=show_all&amp;min={$pmin}\">" . _PREVIOUSPAGE . "</a> | <a href=\"modules.php?name={$module_name}&amp;sa=show_all&amp;min={$min}\">" . _NEXTPAGE . "</a> ]</center><br>";
    }
    if ($numrows <= 250 and $a != 1 and $min != 0) {
        $pmin = $min - 250;
        echo "<center>[ <a href=\"modules.php?name={$module_name}&amp;sa=show_all&amp;min={$pmin}\">" . _PREVIOUSPAGE . "</a> ]</center><br>";
    }
    echo "<hr size=\"1\" noshade>" . "<font class=\"content\">" . _SELECTMONTH2VIEW . "</font><br>";
    $result2 = $db->sql_query("SELECT time from " . $prefix . "_stories order by time DESC");
    echo "<ul>";
    $thismonth = "";
    while ($row2 = $db->sql_fetchrow($result2)) {
        $time = $row2['time'];
        ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $getdate);
        if ($getdate[2] == "01") {
            $month = _JANUARY;
        } elseif ($getdate[2] == "02") {
            $month = _FEBRUARY;
        } elseif ($getdate[2] == "03") {
            $month = _MARCH;
        } elseif ($getdate[2] == "04") {
            $month = _APRIL;
        } elseif ($getdate[2] == "05") {
            $month = _MAY;
        } elseif ($getdate[2] == "06") {
            $month = _JUNE;
        } elseif ($getdate[2] == "07") {
            $month = _JULY;
        } elseif ($getdate[2] == "08") {
            $month = _AUGUST;
        } elseif ($getdate[2] == "09") {
            $month = _SEPTEMBER;
        } elseif ($getdate[2] == "10") {
            $month = _OCTOBER;
        } elseif ($getdate[2] == "11") {
            $month = _NOVEMBER;
        } elseif ($getdate[2] == "12") {
            $month = _DECEMBER;
        }
        if ($month != $thismonth) {
            $year = $getdate[1];
            echo "<li><a href=\"modules.php?name={$module_name}&amp;sa=show_month&amp;year={$year}&amp;month={$getdate['2']}&amp;month_l={$month}\">{$month}, {$year}</a>";
            $thismonth = $month;
        }
    }
    echo "</ul><br><br><center>" . "<form action=\"modules.php?name=Search\" method=\"post\">" . "<input type=\"text\" name=\"query\" size=\"30\">&nbsp;" . "<input type=\"submit\" value=\"" . _SEARCH . "\">" . "</form>" . "[ <a href=\"modules.php?name={$module_name}\">" . _ARCHIVESINDEX . "</a> ]</center>";
    CloseTable();
    include "footer.php";
}
Beispiel #2
0
function savejournal($uid, $journal, $datetime)
{
    global $NPDS_Prefix;
    global $user;
    $cookie = cookiedecode($user);
    $result = sql_query("SELECT uid FROM " . $NPDS_Prefix . "users WHERE uname='{$cookie['1']}'");
    list($vuid) = sql_fetch_row($result);
    if ($uid == $vuid) {
        $journal = removeHack(stripslashes(FixQuotes($journal)));
        if ($datetime) {
            $journalentry = $journal;
            $journalentry .= "<br /><br />";
            global $gmt;
            $journalentry .= date(translate("dateinternal"), time() + $gmt * 3600);
            sql_query("UPDATE " . $NPDS_Prefix . "users SET user_journal='{$journalentry}' WHERE uid='{$uid}'");
        } else {
            sql_query("UPDATE " . $NPDS_Prefix . "users SET user_journal='{$journal}' WHERE uid='{$uid}'");
        }
        $userinfo = getusrinfo($user);
        Header("Location: user.php");
    } else {
        Header("Location: index.php");
    }
}
Beispiel #3
0
function defaultDisplay()
{
    global $AllowableHTML, $prefix, $user, $cookie, $anonymous, $currentlang, $multilingual, $db, $module_name, $nuke_editor;
    include "header.php";
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _SUBMITNEWS . "</b></font>";
    CloseTable();
    echo "<br>";
    info_box("caution", _SUBMITADVICE);
    //OpenTable();
    //echo "<br><center><img src=\"images/system/caution.gif\" border=\"0\" alt=\"\" title=\"\"><br><br><font class=\"content\"><i>"._SUBMITADVICE."</i></font></center><br>";
    //CloseTable();
    echo "<br>";
    OpenTable();
    if (is_user($user)) {
        getusrinfo($user);
    }
    echo "<table border=\"0\" widht=\"100%\">";
    echo "<tr><td><form action=\"modules.php?name={$module_name}\" method=\"post\">" . "<b>" . _YOURNAME . ":</b></td><td>";
    if (is_user($user)) {
        cookiedecode($user);
        echo "<a href=\"modules.php?name=Your_Account\">{$cookie['1']}</a> <font class=\"content\">[ <a href=\"modules.php?name=Your_Account&amp;op=logout\">" . _LOGOUT . "</a> ]</font>";
    } else {
        echo "{$anonymous} <font class=\"content\">[ <a href=\"modules.php?name=Your_Account\">" . _NEWUSER . "</a> ]</font>";
    }
    echo "</td></tr>" . "<tr><td colspan=\"2\">&nbsp;</td></tr>" . "<tr><td><b>" . _SUBTITLE . ":</b></td><td>" . "<input type=\"text\" name=\"subject\" size=\"50\" maxlength=\"80\"><br>(" . _BEDESCRIPTIVE . ")</td></tr>" . "<tr><td colspan=\"2\">&nbsp;</td></tr>" . "<tr><td><b>" . _TOPIC . ":</b></td><td><select name=\"topic\">";
    $result = $db->sql_query("SELECT topicid, topictext FROM " . $prefix . "_topics ORDER BY topictext");
    echo "<option value=\"\">" . _SELECTTOPIC . "</option>\n";
    while ($row = $db->sql_fetchrow($result)) {
        $topicid = intval($row['topicid']);
        $topics = filter($row['topictext'], "nohtml");
        if ($topicid == $topic) {
            $sel = "selected ";
        }
        echo "<option {$sel} value=\"{$topicid}\">{$topics}</option>\n";
        $sel = "";
    }
    echo "</select></td></tr>";
    if ($multilingual == 1) {
        echo "<tr><td colspan=\"2\">&nbsp;</td></tr>";
        echo "<tr><td><b>" . _LANGUAGE . ":</b></td><td>" . "<select name=\"alanguage\">";
        $handle = opendir('language');
        while ($file = readdir($handle)) {
            if (preg_match("/^lang\\-(.+)\\.php/", $file, $matches)) {
                $langFound = $matches[1];
                $languageslist .= "{$langFound} ";
            }
        }
        closedir($handle);
        $languageslist = explode(" ", $languageslist);
        sort($languageslist);
        for ($i = 0; $i < sizeof($languageslist); $i++) {
            if (!empty($languageslist[$i])) {
                echo "<option value=\"{$languageslist[$i]}\" ";
                if ($languageslist[$i] == $currentlang) {
                    echo "selected";
                }
                echo ">" . ucfirst($languageslist[$i]) . "</option>\n";
            }
        }
        echo "</select></td></tr>";
    } else {
        echo "<input type=\"hidden\" name=\"alanguage\" value=\"{$language}\">";
    }
    echo "<tr><td colspan=\"2\">&nbsp;</td></tr>";
    echo "<tr><td><b>" . _STORYTEXT . ":</b></td><td>" . "<textarea cols=\"70\" rows=\"15\" name=\"story\"></textarea></td></tr>" . "<tr><td colspan=\"2\">&nbsp;</td></tr>" . "<tr><td><b>" . _EXTENDEDTEXT . ":</b></td><td>" . "<textarea cols=\"70\" rows=\"15\" name=\"storyext\"></textarea><br>" . "<font class=\"content\">(" . _AREYOUSURE . ")<br>";
    if ($nuke_editor == 0) {
        echo "<font class=\"content\">" . _ALLOWEDHTML . "<br>";
        while (list($key, ) = each($AllowableHTML)) {
            echo " &lt;" . $key . "&gt;";
        }
        echo "</font>";
    } else {
        echo "" . _HTMLNOTALLOWED . "</font>";
    }
    echo "</td></tr>";
    echo "<tr><td colspan=\"2\">&nbsp;</td></tr>";
    echo "<tr><td>&nbsp;</td><td><hr noshade size=\"1\"></td></tr>";
    echo "<tr><td colspan=\"2\">&nbsp;</td></tr>";
    echo "<tr><td>&nbsp;</td><td><input type=\"submit\" name=\"op\" value=\"" . _PREVIEW . "\"> (" . _SUBPREVIEW . ")</font></form>";
    echo "</td></tr></table>";
    CloseTable();
    include 'footer.php';
}
Beispiel #4
0
function replyPreview($pid, $pollID, $subject, $comment, $xanonpost, $mode, $order, $thold)
{
    include_once "header.php";
    global $userinfo, $user, $cookie, $AllowableHTML, $anonymous, $module_name, $nuke_editor;
    cookiedecode($user);
    getusrinfo($user);
    $subject = filter($subject, "nohtml", 0, preview);
    if (!isset($mode) or empty($mode)) {
        if (isset($userinfo['umode'])) {
            $mode = $userinfo['umode'];
        } else {
            $mode = "thread";
        }
    }
    if (!isset($order) or empty($order)) {
        if (isset($userinfo['uorder'])) {
            $order = $userinfo['uorder'];
        } else {
            $order = 0;
        }
    }
    if (!isset($thold) or empty($thold)) {
        if (isset($userinfo['thold'])) {
            $thold = $userinfo['thold'];
        } else {
            $thold = 0;
        }
    }
    $comment = filter($comment);
    $pid = intval($pid);
    $pollID = intval($pollID);
    if (!isset($pid) || !isset($pollID)) {
        die(_NOTRIGHT);
    }
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _SURVEYCOMPRE . "</b></font></center>";
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<b>{$subject}</b><br>";
    echo "<font class=content>" . _BY . " ";
    if (is_user($user)) {
        echo $cookie[1];
    } else {
        echo $anonymous;
    }
    echo _ONN . "</font><br><br>";
    echo $comment;
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<form action=\"modules.php?name={$module_name}&amp;file=comments\" method=\"post\">" . "<font class=\"content\"><B>" . _YOURNAME . ":</B></FONT> ";
    if (is_user($user)) {
        echo "<font class=\"content\"><a href=\"modules.php?name=Your_Account\">{$cookie['1']}</a> <font class=\"content\">[ <a href=\"modules.php?name=Your_Account&amp;op=logout\">" . _LOGOUT . "</a> ]</font>";
    } else {
        echo "<font class=\"content\">{$anonymous}</font>";
    }
    echo "<br><br><font class=\"content\"><B>" . _SUBJECT . ":</B></FONT><BR>" . "<INPUT TYPE=\"text\" name=\"subject\" size=\"50\" maxlength=\"85\" value=\"{$subject}\"><br><br>" . "<P><font class=\"content\"><B>" . _UCOMMENT . ":</B></FONT><BR>" . "<TEXTAREA wrap=\"virtual\" cols=\"70\" rows=\"15\" name=\"comment\">{$comment}</TEXTAREA><br>";
    if ($nuke_editor == 0) {
        echo "<font class=\"content\">" . _ALLOWEDHTML . "<br>";
        while (list($key, ) = each($AllowableHTML)) {
            echo " &lt;" . $key . "&gt;";
        }
        echo "</font><br><br>";
    } else {
        echo "" . _HTMLNOTALLOWED . "</font><br><br>";
    }
    if ($xanonpost and $anonpost == 1) {
        echo "<INPUT type=\"checkbox\" name=\"xanonpost\" checked> " . _POSTANON . "<br>";
    } elseif (is_user($user) and $anonpost == 1) {
        echo "<INPUT type=\"checkbox\" name=\"xanonpost\"> " . _POSTANON . "<br>";
    }
    echo "<INPUT type=\"hidden\" name=\"pid\" value=\"{$pid}\">" . "<INPUT type=\"hidden\" name=\"pollID\" value=\"{$pollID}\"><INPUT type=\"hidden\" name=\"mode\" value=\"{$mode}\">" . "<INPUT type=\"hidden\" name=\"order\" value=\"{$order}\"><INPUT type=\"hidden\" name=\"thold\" value=\"{$thold}\">" . "<br><INPUT type=submit name=op value=\"" . _PREVIEW . "\"> " . "<INPUT type=submit name=op value=\"" . _OK . "\"></FORM>";
    CloseTable();
    include_once "footer.php";
}
Beispiel #5
0
function broadcast($the_message, $who)
{
    global $prefix, $db, $broadcast_msg, $module_name, $cookie, $user, $userinfo, $user_prefix;
    cookiedecode($user);
    getusrinfo($user);
    $row = $db->sql_fetchrow($db->sql_query("SELECT karma FROM " . $user_prefix . "_users WHERE user_id = '" . intval($cookie[0]) . "'"));
    if ($row['karma'] == 2 or $row['karma'] == 3) {
        Header("Location: modules.php?name=" . $module_name);
        die;
    }
    if (is_user($user) and strtolower($who) == strtolower($cookie[1]) and strtolower($userinfo['username']) == strtolower($cookie[1]) and $userinfo['user_password'] == $cookie[2]) {
        $who = $cookie[1];
        $the_message = filter($the_message, "nohtml", 1);
        if ($broadcast_msg == 1) {
            include "header.php";
            title("" . _BROADCAST . "");
            OpenTable();
            $numrows = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_public_messages WHERE who='{$who}'"));
            if (!empty($the_message) and $numrows == 0) {
                $the_time = time();
                $who = filter($who, "nohtml", 1);
                $db->sql_query("INSERT INTO " . $prefix . "_public_messages VALUES (NULL, '{$the_message}', '{$the_time}', '{$who}')");
                update_points(20);
                echo "<center>" . _BROADCASTSENT . "<br><br>[ <a href=\"modules.php?name={$module_name}\">" . _RETURNPAGE . "</a> ]</center>";
            } else {
                echo "<center>" . _BROADCASTNOTSENT . "<br><br>[ <a href=\"modules.php?name={$module_name}\">" . _RETURNPAGE . "</a> ]</center>";
            }
            CloseTable();
            include "footer.php";
        } else {
            echo "I don't like you...";
        }
    }
}
Beispiel #6
0
function pollResults($pollID)
{
    global $resultTableBgColor, $resultBarFile, $Default_Theme, $user, $cookie, $prefix, $admin, $module_name, $db, $admin_file, $userinfo;
    if (is_user($user)) {
        getusrinfo($user);
        cookiedecode($user);
    }
    if (!isset($pollID)) {
        $pollID = 1;
    }
    $pollID = intval($pollID);
    $result = $db->sql_query("SELECT pollID, pollTitle, timeStamp, artid FROM " . $prefix . "_poll_desc WHERE pollID='{$pollID}'");
    $holdtitle = $db->sql_fetchrow($result);
    echo "<b>{$holdtitle['1']}</b><br><br>";
    $sum = 0;
    for ($i = 0; $i < 12; $i++) {
        $result2 = $db->sql_query("SELECT optionCount FROM " . $prefix . "_poll_data WHERE pollID='{$pollID}' AND voteID='{$i}'");
        $row2 = $db->sql_fetchrow($result2);
        $optionCount = $row2['optionCount'];
        $sum = (int) $sum + $optionCount;
    }
    echo "<table border=\"0\">";
    /* cycle through all options */
    for ($i = 1; $i <= 12; $i++) {
        /* select next vote option */
        $result3 = $db->sql_query("SELECT pollID, optionText, optionCount, voteID FROM " . $prefix . "_poll_data WHERE pollID='{$pollID}' AND voteID='{$i}'");
        $row3 = $db->sql_fetchrow($result3);
        $optionText = $row3['optionText'];
        $optionCount = $row3['optionCount'];
        if (!empty($optionText)) {
            echo "<tr><td>";
            echo "{$optionText}";
            echo "</td>";
            if ($sum) {
                $percent = 100 * $optionCount / $sum;
            } else {
                $percent = 0;
            }
            echo "<td>";
            $percentInt = (int) $percent * 4 * 1;
            $percent2 = (int) $percent;
            $ThemeSel = get_theme();
            if (file_exists("themes/{$ThemeSel}/images/survey_leftbar.gif") and file_exists("themes/{$ThemeSel}/images/survey_mainbar.gif") and file_exists("themes/{$ThemeSel}/images/survey_rightbar.gif")) {
                $l_size = getimagesize("themes/{$ThemeSel}/images/survey_leftbar.gif");
                $m_size = getimagesize("themes/{$ThemeSel}/images/survey_mainbar.gif");
                $r_size = getimagesize("themes/{$ThemeSel}/images/survey_rightbar.gif");
                $leftbar = "survey_leftbar.gif";
                $mainbar = "survey_mainbar.gif";
                $rightbar = "survey_rightbar.gif";
            } else {
                $l_size = getimagesize("themes/{$ThemeSel}/images/leftbar.gif");
                $m_size = getimagesize("themes/{$ThemeSel}/images/mainbar.gif");
                $r_size = getimagesize("themes/{$ThemeSel}/images/rightbar.gif");
                $leftbar = "leftbar.gif";
                $mainbar = "mainbar.gif";
                $rightbar = "rightbar.gif";
            }
            if (file_exists("themes/{$ThemeSel}/images/survey_mainbar_d.gif")) {
                $m1_size = getimagesize("themes/{$ThemeSel}/images/survey_mainbar_d.gif");
                $mainbar_d = "survey_mainbar_d.gif";
                if ($percent2 > 0 and $percent2 <= 23) {
                    $salto = "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"{$percentInt}\">";
                } elseif ($percent2 > 24 and $percent2 < 50) {
                    $a = $percentInt - 100;
                    $salto = "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"70\">" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar_d}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m1_size['1']}\" width=\"30\">" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"{$a}\">";
                } elseif ($percent2 > 49 and $percent2 < 75) {
                    $a = $percentInt - 200;
                    $salto = "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"70\">" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar_d}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m1_size['1']}\" width=\"30\">" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"70\">" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar_d}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m1_size['1']}\" width=\"30\">" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"{$a}\">";
                } elseif ($percent2 > 74 and $percent2 <= 100) {
                    $a = $percentInt - 300;
                    $salto = "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"70\">" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar_d}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m1_size['1']}\" width=\"30\">" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"70\">" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar_d}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m1_size['1']}\" width=\"30\">" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"70\">" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar_d}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m1_size['1']}\" width=\"30\">" . "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" alt=\"{$percent2} %\" title=\"{$percent2} %\" height=\"{$m_size['1']}\" width=\"{$a}\">";
                }
            }
            if ($percent > 0) {
                echo "<img src=\"themes/{$ThemeSel}/images/{$leftbar}\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" alt=\"{$percent2} %\" title=\"{$percent2} %\">";
                if (file_exists("themes/{$ThemeSel}/images/survey_mainbar_d.gif")) {
                    echo "{$salto}";
                } else {
                    echo "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" height=\"{$m_size['1']}\" width=\"{$percentInt}\" alt=\"{$percent2} %\" title=\"{$percent2} %\">";
                }
                echo "<img src=\"themes/{$ThemeSel}/images/{$rightbar}\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" alt=\"{$percent2} %\" title=\"{$percent2} %\">";
            } else {
                echo "<img src=\"themes/{$ThemeSel}/images/{$leftbar}\" height=\"{$l_size['1']}\" width=\"{$l_size['0']}\" alt=\"{$percent2} %\" title=\"{$percent2} %\">";
                if (!file_exists("themes/{$ThemeSel}/images/survey_mainbar_d.gif")) {
                    echo "<img src=\"themes/{$ThemeSel}/images/{$mainbar}\" height=\"{$m_size['1']}\" width=\"{$m_size['0']}\" alt=\"{$percent2} %\" title=\"{$percent2} %\">";
                }
                echo "<img src=\"themes/{$ThemeSel}/images/{$rightbar}\" height=\"{$r_size['1']}\" width=\"{$r_size['0']}\" alt=\"{$percent2} %\" title=\"{$percent2} %\">";
            }
            printf(" %.2f%% (%s)", $percent, $optionCount);
            echo "</td></tr>";
        }
    }
    echo "</table><br>";
    echo "<center><font class=\"content\">";
    echo "<b>" . _TOTALVOTES . " {$sum}</b><br>";
    echo "<br><br>";
    $booth = $pollID;
    $booth = intval($booth);
    if ($holdtitle[3] > 0) {
        $article = "<br><br>" . _GOBACK . "</font></center>";
    } else {
        $article = "</font></center>";
    }
    echo "[ <a href=\"modules.php?name={$module_name}&amp;pollID={$booth}\">" . _VOTING . "</a> | " . "<a href=\"modules.php?name={$module_name}\">" . _OTHERPOLLS . "</a> ] {$article}";
    if (is_admin($admin)) {
        echo "<br><center>[ <a href=\"" . $admin_file . ".php?op=create\">" . _ADD . "</a> | <a href=\"" . $admin_file . ".php?op=polledit&amp;pollID={$pollID}\">" . _EDIT . "</a> ]</center>";
    }
    return 1;
}
function CreateTopic($xanonpost, $subject, $comment, $pid, $pollID, $host_name, $mode, $order, $thold, $posttype)
{
    global $user, $userinfo, $EditedMessage, $cookie, $prefix, $pollcomm, $anonpost, $db, $module_name;
    $author = FixQuotes($author);
    $subject = FixQuotes(filter_text($subject, "nohtml"));
    $comment = format_url($comment);
    if ($posttype == "exttrans") {
        $comment = FixQuotes(nl2br(htmlspecialchars(check_words($comment))));
    } elseif ($posttype == "plaintext") {
        $comment = FixQuotes(nl2br(filter_text($comment)));
    } else {
        $comment = FixQuotes(filter_text($comment));
    }
    if (is_user($user)) {
        getusrinfo($user);
    }
    if (is_user($user) && !$xanonpost) {
        getusrinfo($user);
        $name = $userinfo[username];
        $email = $userinfo[femail];
        $url = $userinfo[user_website];
        $score = 1;
    } else {
        $name = "";
        $email = "";
        $url = "";
        $score = 0;
    }
    $ip = $_SERVER["REMOTE_HOST"];
    if (empty($ip)) {
        $ip = $_SERVER["REMOTE_ADDR"];
    }
    $pollID = intval($pollID);
    $result = $db->sql_query("select count(*) from " . $prefix . "_poll_desc where pollID='{$pollID}'");
    $fake = $db->sql_numrows($result);
    if ($fake == 1) {
        if ($anonpost == 0 and is_user($user) or $anonpost == 1) {
            $db->sql_query("insert into " . $prefix . "_pollcomments values (NULL, '{$pid}', '{$pollID}', now(), '{$name}', '{$email}', '{$url}', '{$ip}', '{$subject}', '{$comment}', '{$score}', '0')");
            update_points(9);
        } else {
            echo "Nice try...";
            die;
        }
    } else {
        include "header.php";
        echo "According to my records, the topic you are trying " . "to reply to does not exist. If you're just trying to be " . "annoying, well then too bad.";
        include "footer.php";
        die;
    }
    if ($pollcomm == 1) {
        if (isset($cookie[4])) {
            $options .= "&mode={$cookie['4']}";
        } else {
            $options .= "&mode=thread";
        }
        if (isset($cookie[5])) {
            $options .= "&order={$cookie['5']}";
        } else {
            $options .= "&order=0";
        }
        if (isset($cookie[6])) {
            $options .= "&thold={$cookie['6']}";
        } else {
            $options .= "&thold=0";
        }
    } else {
        $options = "";
    }
    Header("Location: modules.php?name={$module_name}&op=results&pollID={$pollID}{$options}");
}
Beispiel #8
0
function broadcast($the_message, $who)
{
    global $prefix, $db, $broadcast_msg, $module_name, $cookie, $user, $userinfo;
    cookiedecode($user);
    getusrinfo($user);
    if (is_user($user) and strtolower($who) == strtolower($cookie[1]) and strtolower($userinfo['username']) == strtolower($cookie[1]) and $userinfo['user_password'] == $cookie[2]) {
        $who = $cookie[1];
        $the_message = htmlentities($the_message);
        if ($broadcast_msg == 1) {
            include "header.php";
            title("" . _BROADCAST . "");
            OpenTable();
            $numrows = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_public_messages WHERE who='{$who}'"));
            $the_message = FixQuotes(filter_text($the_message, "nohtml"));
            if ($the_message != "" and $numrows == 0) {
                $the_time = time();
                $who = htmlspecialchars(stripslashes($who));
                $db->sql_query("INSERT INTO " . $prefix . "_public_messages VALUES (NULL, '{$the_message}', '{$the_time}', '{$who}')");
                update_points(20);
                echo "<center>" . _BROADCASTSENT . "<br><br>[ <a href=\"modules.php?name={$module_name}\">" . _RETURNPAGE . "</a> ]</center>";
            } else {
                echo "<center>" . _BROADCASTNOTSENT . "<br><br>[ <a href=\"modules.php?name={$module_name}\">" . _RETURNPAGE . "</a> ]</center>";
            }
            CloseTable();
            include "footer.php";
        } else {
            echo "I don't like you...";
        }
    }
}
Beispiel #9
0
function defaultDisplay()
{
    global $NPDS_Prefix;
    include 'header.php';
    global $user, $anonymous;
    if (isset($user)) {
        $userinfo = getusrinfo($user);
    }
    echo '
   <h2>' . translate("Submit News") . '</h2>
   <form class="" action="submit.php" method="post" name="adminForm">';
    echo '<p class="lead"><strong>' . translate("Your Name") . '</strong> : ';
    if ($user) {
        echo "<a href=\"user.php\">" . $userinfo['name'] . "</a> [ <a href=\"user.php?op=logout\">" . translate("Logout") . "</a> ]</p>";
        echo '<input type="hidden" name="name" value="' . $userinfo['name'] . '" />';
    } else {
        echo "{$anonymous} [ <a href=\"user.php\">" . translate("New User") . "</a> ]</p>";
        echo '<input type="hidden" name="name" value="' . $anonymous . '" />';
    }
    echo '
      <div class="form-group row">
         <label class="form-control-label col-sm-3" for="subject">' . translate("Title") . ' </label>
         <div class="col-sm-9">
            <input type="text" name="subject" class="form-control">
            <p class="help-block">' . translate("Be Descriptive, Clear and Simple") . '! ' . translate("bad titles='Check This Out!' or 'An Article'.") . '</p>
         </div>
      </div>
      <div class="form-group row">
         <label class="form-control-label col-sm-3" for="topic">' . translate("Topic") . '</label>
         <div class="col-sm-9">
            <select class="c-select form-control" name="topic">';
    $toplist = sql_query("SELECT topicid, topictext FROM " . $NPDS_Prefix . "topics ORDER BY topictext");
    echo '
               <option value="">' . translate("Select Topic") . '</option>';
    while (list($topicid, $topics) = sql_fetch_row($toplist)) {
        if ($topicid == $topic) {
            $sel = 'selected="selected" ';
        }
        echo '
               <option ' . $sel . ' value="' . $topicid . '">' . aff_langue($topics) . '</option>';
        $sel = '';
    }
    echo '
            </select>
         </div>
      </div>
      <div class="form-group row">
         <label class="form-control-label col-sm-12" for="story" >' . translate("Intro Text") . '</label>
         <div class="col-sm-12">
            <span class="help-block">' . translate("HTML is fine, but double check those URLs and HTML tags!") . '</span>
            <textarea class="tin form-control" rows="25" name="story"></textarea>
            ' . aff_editeur('story', '') . '
         </div>
      </div>
      <div class="form-group row">
         <label class="form-control-label col-sm-12" for="bodytext">' . translate("Full Text") . '</label>
         <div class="col-sm-12">
            <textarea class="tin form-control" rows="25" name="bodytext"></textarea>
            ' . aff_editeur('bodytext', '') . '
         </div>
      </div>';
    publication(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    echo '
      <hr />
      <div class="form-group row">
         <div class="col-sm-12">
            <span class="help-block">' . translate("You must preview once before you can submit") . '</span>
            <input class="btn btn-primary-outline" type="submit" name="op" value="' . translate("Preview") . '" />
         </div>
      </div>
   </form>';
    include 'footer.php';
}
Beispiel #10
0
function theindex($catid)
{
    global $storyhome, $httpref, $httprefmax, $topicname, $topicimage, $topictext, $datetime, $user, $cookie, $nukeurl, $prefix, $multilingual, $currentlang, $db, $articlecomm, $module_name, $userinfo;
    if (is_user($user)) {
        getusrinfo($user);
    }
    if ($multilingual == 1) {
        $querylang = "AND (alanguage='{$currentlang}' OR alanguage='')";
        /* the OR is needed to display stories who are posted to ALL languages */
    } else {
        $querylang = "";
    }
    include "header.php";
    if (isset($userinfo['storynum'])) {
        $storynum = $userinfo['storynum'];
    } else {
        $storynum = $storyhome;
    }
    $catid = intval($catid);
    $db->sql_query("update " . $prefix . "_stories_cat set counter=counter+1 where catid='{$catid}'");
    $result = $db->sql_query("SELECT sid, aid, title, time, hometext, bodytext, comments, counter, topic, informant, notes, acomm, score, ratings FROM " . $prefix . "_stories where catid='{$catid}' {$querylang} ORDER BY sid DESC limit {$storynum}");
    while ($row = $db->sql_fetchrow($result)) {
        $s_sid = intval($row['sid']);
        $aid = filter($row['aid'], "nohtml");
        $title = filter($row['title'], "nohtml");
        $time = $row['time'];
        $hometext = filter($row['hometext']);
        $bodytext = filter($row['bodytext']);
        $comments = intval($row['comments']);
        $counter = intval($row['counter']);
        $topic = intval($row['topic']);
        $informant = filter($row['informant'], "nohtml");
        $notes = filter($row['notes']);
        $acomm = intval($row['acomm']);
        $score = intval($row['score']);
        $ratings = intval($row['ratings']);
        getTopics($s_sid);
        formatTimestamp($time);
        $subject = filter($subject, "nohtml");
        $introcount = strlen($hometext);
        $fullcount = strlen($bodytext);
        $totalcount = $introcount + $fullcount;
        $c_count = $comments;
        $r_options = "";
        if (isset($userinfo['umode'])) {
            $r_options .= "&amp;mode=" . $userinfo['umode'];
        }
        if (isset($userinfo['uorder'])) {
            $r_options .= "&amp;order=" . $userinfo['uorder'];
        }
        if (isset($userinfo['thold'])) {
            $r_options .= "&amp;thold=" . $userinfo['thold'];
        }
        $story_link = "<a class='readmore' href=\"modules.php?name=News&amp;file=article&amp;sid={$s_sid}{$r_options}\">";
        $morelink = " ";
        if ($fullcount > 0 or $c_count > 0 or $articlecomm == 0 or $acomm == 1) {
            $morelink .= "{$story_link}<b>" . _READMORE . "</b></a> | ";
        } else {
            $morelink .= "";
        }
        if ($fullcount > 0) {
            $morelink .= "{$totalcount} " . _BYTESMORE . " | ";
        }
        if ($articlecomm == 1 and $acomm == 0) {
            if ($c_count == 0) {
                $morelink .= "{$story_link}" . _COMMENTSQ . "</a>";
            } elseif ($c_count == 1) {
                $morelink .= "{$story_link}{$c_count} " . _COMMENT . "</a>";
            } elseif ($c_count > 1) {
                $morelink .= "{$story_link}{$c_count} " . _COMMENTS . "</a>";
            }
        }
        if ($score != 0) {
            $rated = substr($score / $ratings, 0, 4);
        } else {
            $rated = 0;
        }
        $morelink .= " | " . _SCORE . " {$rated}";
        $morelink .= " ";
        $morelink = str_replace(" |  | ", " | ", $morelink);
        $sid = intval($s_sid);
        $row2 = $db->sql_fetchrow($db->sql_query("select title from " . $prefix . "_stories_cat where catid='{$catid}'"));
        $title1 = filter($row2['title'], "nohtml");
        $title = "{$title1}: {$title}";
        themeindex($aid, $informant, $datetime, $title, $counter, $topic, $hometext, $notes, $morelink, $topicname, $topicimage, $topictext);
    }
    if ($httpref == 1) {
        $referer = $_SERVER['HTTP_REFERER'];
        if ($referer == "" or ereg("unknown", $referer) or eregi($nukeurl, $referer)) {
        } else {
            $db->sql_query("insert into " . $prefix . "_referer values (NULL, '{$referer}')");
        }
        $numrows = $db->sql_numrows($db->sql_query("select * from " . $prefix . "_referer"));
        if ($numrows == $httprefmax) {
            $db->sql_query("delete from " . $prefix . "_referer");
        }
    }
    include "footer.php";
}
Beispiel #11
0
function get_theme()
{
    global $user, $userinfo, $Default_Theme, $name, $op;
    if (isset($ThemeSelSave)) {
        return $ThemeSelSave;
    }
    if (is_user($user) && ($name != "Your_Account" or $op != "logout")) {
        getusrinfo($user);
        if (empty($userinfo['theme'])) {
            $userinfo['theme'] = $Default_Theme;
        }
        if (file_exists("themes/" . $userinfo['theme'] . "/theme.php")) {
            $ThemeSel = $userinfo['theme'];
        } else {
            $ThemeSel = $Default_Theme;
        }
    } else {
        $ThemeSel = $Default_Theme;
    }
    static $ThemeSelSave;
    $ThemeSelSave = $ThemeSel;
    return $ThemeSelSave;
}
Beispiel #12
0
function PrintFormImgs()
{
    global $ModPath, $ModStart, $NPDS_Prefix, $ThisFile, $ThisRedo, $user;
    // Récupération de l'utilisateur connecté pour initialisation du champ user_connecte et transmission à AddImgs
    $userinfo = getusrinfo($user);
    $user_connecte = $userinfo["uname"];
    $qnum = sql_num_rows(sql_query("SELECT id FROM " . $NPDS_Prefix . "tdgal_cat"));
    if ($qnum == 0) {
        redirect_url($ThisRedo);
    }
    echo "<h4 class=\"breadcrumb\"><a href=\"" . $ThisFile . "\">" . gal_trans("Accueil") . "</a></h4>";
    echo "<p>" . gal_trans("Proposer des images") . "</p>";
    echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"" . $ThisFile . "\" name=\"FormImgs\">";
    echo "<input type=\"hidden\" name=\"op\" value=\"addimgs\">";
    echo "<input type=\"hidden\" name=\"user_connecte\" value=\"" . $user_connecte . "\">";
    echo '
      <fieldset class="form-group">
      <label for="exampleSelect1">' . gal_trans("Galerie") . '</label>
      <select name="imggal" class="form-control">';
    echo select_arbo("");
    echo '</select>';
    echo '</fieldset>';
    echo '
      <fieldset class="form-group">
      <label for="">' . gal_trans("Image 1") . '</label>
      <input type="file" class="form-control-file" name="newcard1" id="">
      <small class="text-muted">' . gal_trans("Sélectionner votre image") . '</small>
      <input type="text" class="form-control" id=""  name="newdesc1" placeholder="' . gal_trans("Description") . '">
      </fieldset>';
    echo '
   <fieldset class="form-group">
      <label for="">' . gal_trans("Image 2") . '</label>
      <input type="file" class="form-control-file" name="newcard2" id="">
      <small class="text-muted">' . gal_trans("Sélectionner votre image") . '</small>
      <input type="text" class="form-control" id=""  name="newdesc2" placeholder="' . gal_trans("Description") . '">
   </fieldset>';
    echo '
   <fieldset class="form-group">
      <label for="">' . gal_trans("Image 3") . '</label>
      <input type="file" class="form-control-file" name="newcard3" id="">
      <small class="text-muted">' . gal_trans("Sélectionner votre image") . '</small>
      <input type="text" class="form-control" id=""  name="newdesc3" placeholder="' . gal_trans("Description") . '">
   </fieldset>';
    echo '
   <fieldset class="form-group">
      <label for="">' . gal_trans("Image 4") . '</label>
      <input type="file" class="form-control-file" name="newcard4" id="">
      <small class="text-muted">' . gal_trans("Sélectionner votre image") . '</small>
      <input type="text" class="form-control" id=""  name="newdesc4" placeholder="' . gal_trans("Description") . '">
   </fieldset>';
    echo '
   <fieldset class="form-group">
      <label for="">' . gal_trans("Image 5") . '</label>
      <input type="file" class="form-control-file" name="newcard5" id="">
      <small class="text-muted">' . gal_trans("Sélectionner votre image") . '</small>
      <input type="text" class="form-control" id=""  name="newdesc5" placeholder="' . gal_trans("Description") . '">
   </fieldset>';
    echo "<input class=\"btn btn-primary\" type=\"submit\" value=" . gal_trans("Envoyer") . ">";
    echo '</form>';
}
function CreateTopic($xanonpost, $subject, $comment, $pid, $sid, $host_name, $mode, $order, $thold, $posttype)
{
    global $module_name, $user, $userinfo, $EditedMessage, $cookie, $AllowableHTML, $ultramode, $prefix, $anonpost, $articlecomm, $db;
    cookiedecode($user);
    $author = FixQuotes($author);
    $subject = FixQuotes(filter_text($subject, "nohtml"));
    $comment = format_url($comment);
    if ($posttype == "exttrans") {
        $comment = FixQuotes(nl2br(htmlspecialchars(check_words($comment))));
    } elseif ($posttype == "plaintext") {
        $comment = FixQuotes(nl2br(filter_text($comment)));
    } else {
        $comment = FixQuotes(filter_text($comment));
    }
    if (is_user($user)) {
        getusrinfo($user);
    }
    if (is_user($user) && !$xanonpost) {
        getusrinfo($user);
        $name = $userinfo[username];
        $email = $userinfo[femail];
        $url = $userinfo[user_website];
        $score = 1;
    } else {
        $name = "";
        $email = "";
        $url = "";
        $score = 0;
    }
    $ip = $_SERVER["REMOTE_HOST"];
    if (empty($ip)) {
        $ip = $_SERVER["REMOTE_ADDR"];
    }
    $fake = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_stories WHERE sid='{$sid}'"));
    $comment = trim($comment);
    $comment = stripslashes($comment);
    if ($fake == 1 and $articlecomm == 1) {
        if ($anonpost == 0 and is_user($user) or $anonpost == 1) {
            $db->sql_query("INSERT INTO " . $prefix . "_comments VALUES (NULL, '{$pid}', '{$sid}', now(), '{$name}', '{$email}', '{$url}', '{$ip}', '{$subject}', '{$comment}', '{$score}', '0')");
            $db->sql_query("UPDATE " . $prefix . "_stories SET comments=comments+1 WHERE sid='{$sid}'");
            update_points(5);
            if ($ultramode) {
                ultramode();
            }
        } else {
            echo "Nice try...";
            die;
        }
    } else {
        include "header.php";
        echo "According to my records, the topic you are trying " . "to reply to does not exist. If you're just trying to be " . "annoying, well then too bad.";
        include "footer.php";
        die;
    }
    if (isset($cookie[4])) {
        $options .= "&mode={$cookie['4']}";
    } else {
        $options .= "&mode=thread";
    }
    if (isset($cookie[5])) {
        $options .= "&order={$cookie['5']}";
    } else {
        $options .= "&order=0";
    }
    if (isset($cookie[6])) {
        $options .= "&thold={$cookie['6']}";
    } else {
        $options .= "&thold=0";
    }
    Header("Location: modules.php?name={$module_name}&file=article&sid={$sid}{$options}");
}
Beispiel #14
0
function CreateTopic($xanonpost, $subject, $comment, $pid, $sid, $host_name, $mode, $order, $thold)
{
    global $module_name, $user, $userinfo, $EditedMessage, $cookie, $AllowableHTML, $ultramode, $user_prefix, $prefix, $anonpost, $articlecomm, $db, $sitename;
    cookiedecode($user);
    getusrinfo($user);
    $sid = intval($sid);
    $pid = intval($pid);
    $author = filter($author, "nohtml", 1);
    $subject = filter($subject, "nohtml", 1);
    $comment = format_url($comment);
    $comment = filter($comment, "", 1);
    if (empty($subject) or empty($comment)) {
        include "header.php";
        title("{$sitename} - " . _COMMENTSSYSTEM . "");
        OpenTable();
        echo "<center>" . _COMMENTPOSTERROR . "<br><br>" . _GOBACK . "</center>";
        CloseTable();
        include "footer.php";
        fdie();
    }
    //$comment = filter($comment);
    if (is_user($user) and !$xanonpost) {
        $name = $userinfo['username'];
        $email = $userinfo['femail'];
        $url = $userinfo['user_website'];
        $score = 1;
    } else {
        $name = "";
        $email = "";
        $url = "";
        $score = 0;
    }
    if (!isset($ip)) {
        $ip = $_SERVER['REMOTE_ADDR'];
    }
    $fake = $db->sql_numrows($db->sql_query("SELECT * FROM " . $prefix . "_stories WHERE sid='{$sid}'"));
    $comment = trim($comment);
    $comment = filter($comment, "", 1);
    if ($fake == 1 and $articlecomm == 1) {
        if ($anonpost == 0 and is_user($user) or $anonpost == 1) {
            if (is_user($user)) {
                $krow = $db->sql_fetchrow($db->sql_query("SELECT karma FROM " . $user_prefix . "_users WHERE username='******'"));
                $koptions = "";
                $koptions .= "&mode=" . $mode;
                $koptions .= "&order=" . $order;
                $koptions .= "&thold=" . $thold;
                if ($krow['karma'] == 2) {
                    $db->sql_query("INSERT INTO " . $prefix . "_comments_moderated VALUES (NULL, '{$pid}', '{$sid}', now(), '{$name}', '{$email}', '{$url}', '{$ip}', '{$subject}', '{$comment}', '{$score}', '0', '0')");
                    include "header.php";
                    title(_MODERATEDTITLE);
                    OpenTable();
                    echo "<center>" . _COMMENTMODERATED . "";
                    echo "<br><br><a href=\"modules.php?name={$module_name}&file=article&sid={$sid}{$koptions}\">" . _MODERATEDRETURN . "</a>";
                    CloseTable();
                    include "footer.php";
                    fdie();
                } elseif ($krow['karma'] == 3) {
                    Header("Location: modules.php?name={$module_name}&file=article&sid={$sid}{$koptions}");
                    fdie();
                }
            }
            $db->sql_query("INSERT INTO " . $prefix . "_comments VALUES (NULL, '{$pid}', '{$sid}', now(), '{$name}', '{$email}', '{$url}', '{$ip}', '{$subject}', '{$comment}', '{$score}', '0', '0')");
            $db->sql_query("UPDATE " . $prefix . "_stories SET comments=comments+1 WHERE sid='{$sid}'");
            update_points(5);
            if ($ultramode) {
                ultramode();
            }
        } else {
            die("Nice try..");
        }
    } else {
        include "header.php";
        echo "According to my records, the topic you are trying " . "to reply to does not exist. If you're just trying to be " . "annoying, well then too bad.";
        include "footer.php";
        fdie();
    }
    $options = "";
    $options .= "&mode=" . $mode;
    $options .= "&order=" . $order;
    $options .= "&thold=" . $thold;
    Header("Location: modules.php?name={$module_name}&file=article&sid={$sid}{$options}");
}
Beispiel #15
0
function atThemeSet($theme, $douser = 0)
{
    $dbi = $GLOBALS['dbi'];
    $prefix = $GLOBALS['prefix'];
    $userprefix = $GLOBALS['user_prefix'];
    $user = $GLOBALS['user'];
    if (isset($theme) && @file_exists("themes/{$theme}/theme.cfg")) {
        sql_query("UPDATE " . $prefix . "_config SET Default_Theme='{$theme}'", $dbi);
        if (atIsLoggedIn() && $douser) {
            $username = atGetUserName();
            sql_query("UPDATE " . $userprefix . "_users SET theme='{$theme}' WHERE username='******'", $dbi);
            $userinfo = getusrinfo($user);
            docookie($userinfo['user_id'], $userinfo['username'], $userinfo['user_password'], $userinfo['storynum'], $userinfo['umode'], $userinfo['uorder'], $userinfo['thold'], $userinfo['noscore'], $userinfo['ublockon'], $theme, $userinfo['commentmax']);
        }
    }
}
Beispiel #16
0
function rate_complete($sid, $rated = 0, $score)
{
    global $sitename, $user, $cookie, $module_name, $userinfo;
    $r_options = "";
    if (is_user($user)) {
        getusrinfo($user);
        if (isset($userinfo['umode'])) {
            $r_options .= "&amp;mode=" . $userinfo['umode'];
        }
        if (isset($userinfo['uorder'])) {
            $r_options .= "&amp;order=" . $userinfo['uorder'];
        }
        if (isset($userinfo['thold'])) {
            $r_options .= "&amp;thold=" . $userinfo['thold'];
        }
    }
    include "header.php";
    title("{$sitename}: " . _ARTICLERATING . "");
    OpenTable();
    if ($rated == 0) {
        $row = $db->sql_fetchrow($db->sql_query("SELECT title FROM " . $prefix . "_stories WHERE sid='{$sid}'"));
        $row['title'] = filter($row['title'], "nohtml");
        echo "<center><a href=\"modules.php?name={$module_name}&file=article&sid={$sid}{$r_options}\"><b>" . $row['title'] . "</b></a><br>" . _YOURATEDARTICLE . ": <img src=\"images/articles/stars-{$score}.gif\" border=\"0\" alt=\"{$score}/5\" title=\"{$score}/5\"> ({$score}/5)<br><br>";
        echo "<center>" . _THANKSVOTEARTICLE . "<br><br>" . "[ <a href=\"modules.php?name={$module_name}&amp;file=article&amp;sid={$sid}{$r_options}\">" . _BACKTOARTICLEPAGE . "</a> ]</center>";
    } elseif ($rated == 1) {
        echo "<center>" . _ALREADYVOTEDARTICLE . "<br><br>" . "[ <a href=\"modules.php?name={$module_name}&amp;file=article&amp;sid={$sid}{$r_options}\">" . _BACKTOARTICLEPAGE . "</a> ]</center>";
    }
    CloseTable();
    include "footer.php";
}
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2007 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
if (!defined('BLOCK_FILE')) {
    Header("Location: ../index.php");
    die;
}
global $locale, $oldnum, $storynum, $storyhome, $cookie, $categories, $cat, $prefix, $multilingual, $currentlang, $db, $new_topic, $user_news, $userinfo, $user;
getusrinfo($user);
if ($multilingual == 1) {
    if ($categories == 1) {
        $querylang = "where catid='{$cat}' AND (alanguage='{$currentlang}' OR alanguage='')";
    } else {
        $querylang = "where (alanguage='{$currentlang}' OR alanguage='')";
        if ($new_topic != 0) {
            $querylang .= " AND topic='{$new_topic}'";
        }
    }
} else {
    if ($categories == 1) {
        $querylang = "where catid='{$cat}'";
    } else {
        $querylang = "";
        if ($new_topic != 0) {
Beispiel #18
0
function defaultDisplay()
{
    global $AllowableHTML, $prefix, $user, $cookie, $anonymous, $currentlang, $multilingual, $db, $module_name;
    include 'header.php';
    OpenTable();
    echo "<center><font class=\"title\"><b>" . _SUBMITNEWS . "</b></font><br><br>";
    echo "<font class=\"content\"><i>" . _SUBMITADVICE . "</i></font></center><br>";
    CloseTable();
    echo "<br>";
    OpenTable();
    if (is_user($user)) {
        getusrinfo($user);
    }
    echo "<p><form action=\"modules.php?name={$module_name}\" method=\"post\">" . "<b>" . _YOURNAME . ":</b> ";
    if (is_user($user)) {
        cookiedecode($user);
        echo "<a href=\"modules.php?name=Your_Account\">{$cookie['1']}</a> <font class=\"content\">[ <a href=\"modules.php?name=Your_Account&amp;op=logout\">" . _LOGOUT . "</a> ]</font>";
    } else {
        echo "{$anonymous} <font class=\"content\">[ <a href=\"modules.php?name=Your_Account\">" . _NEWUSER . "</a> ]</font>";
    }
    echo "<br><br>" . "<b>" . _SUBTITLE . "</b> " . "(" . _BEDESCRIPTIVE . ")<br>" . "<input type=\"text\" name=\"subject\" size=\"50\" maxlength=\"80\"><br><font class=\"content\">(" . _BADTITLES . ")</font>" . "<br><br>" . "<b>" . _TOPIC . ":</b> <select name=\"topic\">";
    $result = $db->sql_query("SELECT topicid, topictext FROM " . $prefix . "_topics ORDER BY topictext");
    echo "<option value=\"\">" . _SELECTTOPIC . "</option>\n";
    while ($row = $db->sql_fetchrow($result)) {
        $topicid = intval($row['topicid']);
        $topics = stripslashes(check_html($row['topictext'], "nohtml"));
        if ($topicid == $topic) {
            $sel = "selected ";
        }
        echo "<option {$sel} value=\"{$topicid}\">{$topics}</option>\n";
        $sel = "";
    }
    echo "</select>";
    if ($multilingual == 1) {
        echo "<br><br><b>" . _LANGUAGE . ": </b>" . "<select name=\"alanguage\">";
        $handle = opendir('language');
        while ($file = readdir($handle)) {
            if (preg_match("/^lang\\-(.+)\\.php/", $file, $matches)) {
                $langFound = $matches[1];
                $languageslist .= "{$langFound} ";
            }
        }
        closedir($handle);
        $languageslist = explode(" ", $languageslist);
        sort($languageslist);
        for ($i = 0; $i < sizeof($languageslist); $i++) {
            if ($languageslist[$i] != "") {
                echo "<option value=\"{$languageslist[$i]}\" ";
                if ($languageslist[$i] == $currentlang) {
                    echo "selected";
                }
                echo ">" . ucfirst($languageslist[$i]) . "</option>\n";
            }
        }
        echo "</select>";
    } else {
        echo "<input type=\"hidden\" name=\"alanguage\" value=\"{$language}\">";
    }
    echo "<br><br>" . "<b>" . _STORYTEXT . ":</b> (" . _HTMLISFINE . ")<br>" . "<textarea cols=\"50\" rows=\"12\" name=\"story\"></textarea><br>" . "<br><br><b>" . _EXTENDEDTEXT . ":</b><br>" . "<textarea cols=\"50\" rows=\"12\" name=\"storyext\"></textarea><br>" . "(" . _AREYOUSURE . ")</font><br><br>" . "<font class=\"content\">" . _ALLOWEDHTML . "<br>";
    while (list($key, ) = each($AllowableHTML)) {
        echo " &lt;" . $key . "&gt;";
    }
    echo "<br><br><input type=\"submit\" name=\"op\" value=\"" . _PREVIEW . "\">&nbsp;&nbsp;" . "<select name=\"posttype\">\n" . "<option value=\"exttrans\">" . _EXTRANS . "</option>\n" . "<option value=\"html\" >" . _HTMLFORMATED . "</option>\n" . "<option value=\"plaintext\" selected>" . _PLAINTEXT . "</option>\n" . "</select>" . "<br>(" . _SUBPREVIEW . ")</form>";
    CloseTable();
    include 'footer.php';
}