コード例 #1
0
function commenttable_new($rows)
{
    global $CURUSER, $HTTP_SERVER_VARS;
    begin_main_frame();
    begin_frame();
    $count = 0;
    foreach ($rows as $row) {
        $subres = mysql_query("SELECT name from torrents where id=" . unsafeChar($row["torrent"])) or sqlerr(__FILE__, __LINE__);
        $subrow = mysql_fetch_array($subres);
        print "<br /><a href=\"details.php?id=" . safeChar($row["torrent"]) . "\">" . safeChar($subrow["name"]) . "</a><br />\n";
        print "<p class=sub>#" . $row["id"] . " by ";
        if (isset($row["username"])) {
            print "<a name=comm" . $row["id"] . " href=userdetails.php?id=" . safeChar($row["user"]) . "><b>" . safechar($row["username"]) . "</b></a>" . ($row["warned"] == "yes" ? "<img src=" . "pic/warned.gif alt=\"Warned\">" : "");
        } else {
            print "<a name=\"comm" . safeChar($row["id"]) . "\"><i>(orphaned)</i></a>\n";
        }
        print " at " . safeChar($row["added"]) . " GMT" . "- [<a href=comment.php?action=edit&cid={$row['id']}>Edit</a>]" . "- [<a href=deletecomment.php?id={$row['id']}>Delete</a>]</p>\n";
        $avatar = $CURUSER["avatars"] == "yes" ? safechar($row["avatar"]) : "";
        if (!$avatar) {
            $avatar = "pic/default_avatar.gif";
        }
        begin_table(true);
        print "<tr valign=top>\n";
        print "<td align=center width=150 style='padding: 0px'><img width=150 src={$avatar}></td>\n";
        print "<td class=text>" . format_comment($row["text"]) . "</td>\n";
        print "</tr>\n";
        end_table();
    }
    end_frame();
    end_main_frame();
}
コード例 #2
0
/**
|--------------------------------------------------------------------------|
|   https://github.com/Bigjoos/                                |
|--------------------------------------------------------------------------|
|   Licence Info: GPL                                              |
|--------------------------------------------------------------------------|
|   Copyright (C) 2010 U-232 V4                        |
|--------------------------------------------------------------------------|
|   A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.   |
|--------------------------------------------------------------------------|
|   Project Leaders: Mindless,putyn.                       |
|--------------------------------------------------------------------------|
_   _   _   _   _     _   _   _   _   _   _     _   _   _   _
/ \ / \ / \ / \ / \   / \ / \ / \ / \ / \ / \   / \ / \ / \ / \
( U | - | 2 | 3 | 2 )-( S | o | u | r | c | e )-( C | o | d | e )
\_/ \_/ \_/ \_/ \_/   \_/ \_/ \_/ \_/ \_/ \_/   \_/ \_/ \_/ \_/
*/
function rsstfreakinfo()
{
    require_once INCL_DIR . 'html_functions.php';
    global $INSTALLER09;
    $html = '';
    $use_limit = true;
    $limit = 5;
    $xml = file_get_contents('http://feed.torrentfreak.com/Torrentfreak/');
    $html = begin_main_frame() . begin_frame('Torrent Freak news');
    $icount = 1;
    $doc = new DOMDocument();
    @$doc->loadXML($xml);
    $items = $doc->getElementsByTagName('item');
    foreach ($items as $item) {
        $html .= '<h3><u>' . $item->getElementsByTagName('title')->item(0)->nodeValue . '</u></h3><font class="small">by ' . str_replace(array('<![CDATA[', ']]>'), '', $item->getElementsByTagName('creator')->item(0)->nodeValue) . ' on ' . $item->getElementsByTagName('pubDate')->item(0)->nodeValue . '</font><br />' . str_replace(array('<![CDATA[', ']]>'), '', $item->getElementsByTagName('description')->item(0)->nodeValue) . '<br /><a href="' . $item->getElementsByTagName('link')->item(0)->nodeValue . '" target="_blank"><font class="small">Read more</font></a>';
        if ($use_limit && $icount == $limit) {
            break;
        }
        $icount++;
    }
    $html = str_replace(array('“', '”'), '"', $html);
    $html = str_replace(array("’", "‘", "‘"), "'", $html);
    $html = str_replace("–", "-", $html);
    $html .= end_frame() . end_main_frame();
    return $html;
}
コード例 #3
0
ファイル: bjstats.php プロジェクト: ZenoX2012/CyBerFuN-CoDeX
function bjtable($res, $frame_caption)
{
    begin_frame($frame_caption, true);
    begin_table();
    ?>
<tr>
<td class="colhead">Rank</td>
<td align="left" class="colhead">User</td>
<td align="right" class="colhead">Wins</td>
<td align="right" class="colhead">Losses</td>
<td align="right" class="colhead">Games</td>
<td align="right" class="colhead">Percentage</td>
<td align="right" class="colhead">Win/Loss</td>
</tr>
<?php 
    $num = 0;
    while ($a = mysql_fetch_assoc($res)) {
        ++$num;
        //Calculate Win %
        $win_perc = number_format($a[wins] / $a[games] * 100, 1);
        // Add a user's +/- statistic
        $plus_minus = $a[wins] - $a[losses];
        if ($plus_minus >= 0) {
            $plus_minus = mksize(($a[wins] - $a[losses]) * 100 * 1024 * 1024);
        } else {
            $plus_minus = "-";
            $plus_minus .= mksize(($a[losses] - $a[wins]) * 100 * 1024 * 1024);
        }
        print "<tr><td>{$num}</td><td align=left><table border=0 class=main cellspacing=0 cellpadding=0><tr><td class=embedded>" . "<b><a href=userdetails.php?id=" . $a[id] . ">" . $a[username] . "</a></b></td>" . "</tr></table></td><td align=right>" . number_format($a[wins], 0) . "</td>" . "</td><td align=right>" . number_format($a[losses], 0) . "</td>" . "</td><td align=right>" . number_format($a[games], 0) . "</td>" . "</td><td align=right>{$win_perc}</td>" . "</td><td align=right>{$plus_minus}</td>" . "</tr>\n";
    }
    end_table();
    end_frame();
}
コード例 #4
0
ファイル: bjstats.php プロジェクト: CharlieHD/U-232-V3
function bjtable($res, $frame_caption)
{
    $htmlout = '';
    $htmlout .= begin_frame($frame_caption, true);
    $htmlout .= begin_table();
    $htmlout .= "<tr>\r\n\t<td class='colhead'>Rank</td>\r\n\t<td class='colhead' align='left'>User</td>\r\n\t<td class='colhead' align='right'>Wins</td>\r\n\t<td class='colhead' align='right'>Losses</td>\r\n\t<td class='colhead' align='right'>Games</td>\r\n\t<td class='colhead' align='right'>Percentage</td>\r\n\t<td class='colhead' align='right'>Win/Loss</td>\r\n\t</tr>";
    $num = 0;
    while ($a = mysqli_fetch_assoc($res)) {
        ++$num;
        //==Calculate Win %
        $win_perc = number_format($a['wins'] / $a['games'] * 100, 1);
        //==Add a user's +/- statistic
        $plus_minus = $a['wins'] - $a['losses'];
        if ($plus_minus >= 0) {
            $plus_minus = mksize(($a['wins'] - $a['losses']) * 100 * 1024 * 1024);
        } else {
            $plus_minus = "-";
            $plus_minus .= mksize(($a['losses'] - $a['wins']) * 100 * 1024 * 1024);
        }
        $htmlout .= "<tr><td>{$num}</td><td align='left'>" . "<b><a href='userdetails.php?id=" . $a['id'] . "'>" . $a['username'] . "</a></b></td>" . "<td align='right'>" . number_format($a['wins'], 0) . "</td>" . "<td align='right'>" . number_format($a['losses'], 0) . "</td>" . "<td align='right'>" . number_format($a['games'], 0) . "</td>" . "<td align='right'>{$win_perc}</td>" . "<td align='right'>{$plus_minus}</td>" . "</tr>\n";
    }
    $htmlout .= end_table();
    $htmlout .= end_frame();
    return $htmlout;
}
コード例 #5
0
ファイル: forums.php プロジェクト: Arkhana/TorrentTrader2.08
function showerror($heading = "Error", $text, $sort = "Error")
{
    stdhead("{$sort}: {$heading}");
    begin_frame("<font class='error'>{$sort}: {$heading}</font>");
    echo $text;
    end_frame();
    stdfoot();
    die;
}
コード例 #6
0
ファイル: template.php プロジェクト: klldll/tbdev
function insert_smilies_frame()
{
    global $smilies, $DEFAULTBASEURL;
    begin_frame("Смайлы", true);
    begin_table(false, 5);
    print "<tr><td class=\"colhead\">Написание</td><td class=\"colhead\">Смайл</td></tr>\n";
    while (list($code, $url) = each($smilies)) {
        print "<tr><td>{$code}</td><td><img src=\"{$DEFAULTBASEURL}/pic/smilies/{$url}\"></td>\n";
    }
    end_table();
    end_frame();
}
コード例 #7
0
ファイル: template.php プロジェクト: ZenoX2012/CyBerFuN-CoDeX
function insert_smilies_frame()
{
    global $smilies, $BASEURL;
    begin_frame("Smilies", true);
    begin_table(false, 5);
    print "<tr><td class=colhead>Type...</td><td class=colhead>To make a...</td></tr>\n";
    while (list($code, $url) = each($smilies)) {
        print "<tr><td>{$code}</td><td><img src={$BASEURL}/pic/smilies/{$url}></td>\n";
    }
    end_table();
    end_frame();
}
コード例 #8
0
function insert_smilies_frame()
{
    global $smilies, $BASEURL, $pic_base_url;
    begin_frame("Smilies", true);
    begin_table(false, 5);
    print "<tr><td class='colhead'>Type...</td><td class='colhead'>To make a...</td></tr>\n";
    while (list($code, $url) = each($smilies)) {
        print "<tr><td>{$code}</td><td><img src=\"{$pic_base_url}smilies/{$url}\" alt='' /></td></tr>\n";
    }
    end_table();
    end_frame();
}
コード例 #9
0
ファイル: html_functions.php プロジェクト: CharlieHD/U-232-V3
function insert_smilies_frame()
{
    global $smilies, $INSTALLER09;
    $htmlout = '';
    $htmlout .= begin_frame("Smilies", true);
    $htmlout .= begin_table(false, 5);
    $htmlout .= "<tr><td class='colhead'>Type...</td><td class='colhead'>To make a...</td></tr>\n";
    foreach ($smilies as $code => $url) {
        $htmlout .= "<tr><td>{$code}</td><td><img src=\"{$INSTALLER09['pic_base_url']}smilies/{$url}\" alt='' /></td></tr>\n";
    }
    $htmlout .= end_table();
    $htmlout .= end_frame();
    return $htmlout;
}
コード例 #10
0
ファイル: reqdetails.php プロジェクト: herrag33k/TomTorrent
function reqcommenttable($rows)
{
	global $CURUSER, $HTTP_SERVER_VARS;
	begin_main_frame();
	begin_frame();
	$count = 0;

	foreach ($rows as $row) {
		print("<p class=sub>#" . $row["id"] . " bY: ");
		if (isset($row["username"])) {
			$username = $row["username"];
			$ratres = mysql_query("SELECT uploaded, downloaded FROM users WHERE username='******'");
			$rat = mysql_fetch_array($ratres);
			if ($rat["downloaded"] > 0) {
				$ratio = $rat['uploaded'] / $rat['downloaded'];
				$ratio = number_format($ratio, 3);
				$color = get_ratio_color($ratio);
				if ($color)
					$ratio = "<font color=$color>$ratio</font>";
			} else
				if ($rat["uploaded"] > 0)
					$ratio = "Inf.";
				else
					$ratio = "---";

			$title = $row["title"];
			if ($title == "")
				$title = get_user_class_name($row["class"]);
			else
				$title = htmlspecialchars($title);
			print("<a name=comm".$row["id"]." href=userdetails.php?id=".$row["user"]."><b>".htmlspecialchars($row["username"])."</b></a>".($row["donor"] == "yes" ? "<img src=pic/star.gif alt='Donor'>" : "").($row["warned"] == "yes" ? "<img src="."/pic/warned.gif alt=\"Warned\">" : "")." ($title) (Ratio: $ratio)\n");
		} else
			print("<a name=\"comm" . $row["id"] . "\"><i>(orphaned)</i></a>\n");
		print(" at " . $row["added"] . " GMT" .($row["user"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? "- [<a href=reqcomment.php?action=edit&amp;cid=$row[id]>Edit</a>]" : "") .(get_user_class() >= UC_MODERATOR ? "- [<a href=reqcomment.php?action=delete&amp;cid=$row[id]>Delete</a>]" : "") . "</p>\n");$avatar = ($CURUSER["avatars"] == "yes" ? htmlspecialchars($row["avatar"]) : "");
		if (!$avatar)
			$avatar = "/pic/default_avatar.gif";
		$text = format_comment($row["text"]);
		begin_table(true);
		print("<tr valign=top>\n");
		print("<td align=center width=150 style='padding: 0px'><img width=150 src=$avatar></td>\n");
		print("<td class=text>$text</td>\n");
		print("</tr>\n");
		end_table();
	}
	end_frame();
	end_main_frame();
}
コード例 #11
0
ファイル: tfreak.php プロジェクト: CharlieHD/U-232-V2
/**
 *   https://09source.kicks-ass.net:8443/svn/installer09/
 *   Licence Info: GPL
 *   Copyright (C) 2010 Installer09 v.2
 *   A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon.
 *   Project Leaders: Mindless,putyn,kidvision.
 **/
function rsstfreakinfo()
{
    require_once INCL_DIR . 'html_functions.php';
    global $TBDEV;
    $html = '';
    $use_limit = true;
    $limit = 5;
    $xml = file_get_contents('http://feed.torrentfreak.com/Torrentfreak/');
    preg_match_all('/\\<(title|pubDate|dc:creator|link|description)\\>(.+?)\\<\\/\\1\\>/i', $xml, $out, PREG_PATTERN_ORDER);
    $feeds = $out[2];
    $c = count($feeds);
    $html = begin_main_frame() . begin_frame('Torrent Freak news');
    for ($i = 5; $i < $c; $i += 5) {
        $html .= '<h3><u>' . $feeds[$i] . '</u></h3><font class="small">by ' . $feeds[$i + 3] . ' on ' . $feeds[$i + 2] . '</font><br /><p>' . str_replace(array('<![CDATA[', ']]>'), '', $feeds[$i + 4]) . '</p><br /><a href="' . $feeds[$i + 1] . '" target="_blank"><font class="small">Read more</font></a>';
        if ($use_limit && $i >= $limit * 5) {
            break;
        }
    }
    $html .= end_frame() . end_main_frame();
    return $html;
}
コード例 #12
0
function usercommenttable($rows)
{
    $htmlout = '';
    global $CURUSER, $INSTALLER09, $userid, $lang;
    $htmlout .= "<table class='main' width='750' border='0' cellspacing='0' cellpadding='0'>" . "<tr><td class='embedded'>";
    $htmlout .= begin_frame();
    $count = 0;
    foreach ($rows as $row) {
        $htmlout .= "<p class='sub'>#" . (int) $row["id"] . " by ";
        if (isset($row["username"])) {
            $title = $row["title"];
            if ($title == "") {
                $title = get_user_class_name($row["class"]);
            } else {
                $title = htmlsafechars($title);
            }
            $htmlout .= "<a name='comm" . (int) $row['id'] . "' href='userdetails.php?id=" . (int) $row['user'] . "'><b>" . htmlsafechars($row['username']) . "</b></a>" . ($row["donor"] == "yes" ? "<img src=\"{$INSTALLER09['pic_base_url']}star.gif\" alt='{$lang['userdetails_donor']}' />" : "") . ($row["warned"] >= "1" ? "<img src=" . "\"{$INSTALLER09['pic_base_url']}warned.gif\" alt=\"{$lang['userdetails_warned']}\" />" : "") . " ({$title})\n";
        } else {
            $htmlout .= "<a name=\"comm" . (int) $row["id"] . "\"><i>{$lang['userdetails_orphaned']}</i></a>\n";
        }
        $htmlout .= " " . get_date($row["added"], 'DATE', 0, 1) . "" . ($userid == $CURUSER["id"] || $row["user"] == $CURUSER["id"] || $CURUSER['class'] >= UC_STAFF ? " - [<a href='usercomment.php?action=edit&amp;cid=" . (int) $row['id'] . "'>{$lang['userdetails_comm_edit']}</a>]" : "") . ($userid == $CURUSER["id"] || $CURUSER['class'] >= UC_STAFF ? " - [<a href='usercomment.php?action=delete&amp;cid=" . (int) $row['id'] . "'>{$lang['userdetails_comm_delete']}</a>]" : "") . ($row["editedby"] && $CURUSER['class'] >= UC_STAFF ? " - [<a href='usercomment.php?action=vieworiginal&amp;cid=" . (int) $row['id'] . "'>{$lang['userdetails_comm_voriginal']}</a>]" : "") . "</p>\n";
        $avatar = $CURUSER["avatars"] == "yes" ? htmlsafechars($row["avatar"]) : "";
        if (!$avatar) {
            $avatar = "{$INSTALLER09['pic_base_url']}default_avatar.gif";
        }
        $text = format_comment($row["text"]);
        if ($row["editedby"]) {
            $text .= "<font size='1' class='small'><br /><br />{$lang['userdetails_comm_ledited']}<a href='userdetails.php?id=" . (int) $row['editedby'] . "'><b>" . htmlsafechars($row['username']) . "</b></a> " . get_date($row['editedat'], 'DATE', 0, 1) . "</font>\n";
        }
        $htmlout .= "<table width='100%' border='1' cellspacing='0' cellpadding='5'>";
        $htmlout .= "<tr valign='top'>\n";
        $htmlout .= "<td align='center' width='150' style='padding:0px'><img width='150' src=\"{$avatar}\" alt=\"Avatar\" /></td>\n";
        $htmlout .= "<td class='text'>{$text}</td>\n";
        $htmlout .= "</tr>\n";
        $htmlout .= "</table>";
    }
    $htmlout .= end_frame();
    $htmlout .= "</td></tr></table>";
    return $htmlout;
}
コード例 #13
0
function usercommenttable($rows)
{
    global $CURUSER, $pic_base_url, $userid;
    begin_main_frame();
    begin_frame();
    $count = 0;
    foreach ($rows as $row) {
        print "<p class=sub>#" . $row["id"] . " by ";
        if (isset($row["username"])) {
            $title = $row["title"];
            if ($title == "") {
                $title = get_user_class_name($row["class"]);
            } else {
                $title = htmlspecialchars($title);
            }
            print "<a name=comm" . $row["id"] . " href=userdetails.php?id=" . $row["user"] . "><b>" . htmlspecialchars($row["username"]) . "</b></a>" . ($row["donor"] == "yes" ? "<img src=\"{$pic_base_url}star.gif\" alt='Donor'>" : "") . ($row["warned"] == "yes" ? "<img src=" . "\"{$pic_base_url}warned.gif\" alt=\"Warned\">" : "") . " ({$title})\n";
        } else {
            print "<a name=\"comm" . $row["id"] . "\"><i>(orphaned)</i></a>\n";
        }
        print " at " . $row["added"] . " GMT" . ($userid == $CURUSER["id"] || $row["user"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? "- [<a href=usercomment.php?action=edit&amp;cid={$row['id']}>Edit</a>]" : "") . ($userid == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? "- [<a href=usercomment.php?action=delete&amp;cid={$row['id']}>Delete</a>]" : "") . ($row["editedby"] && get_user_class() >= UC_MODERATOR ? "- [<a href=usercomment.php?action=vieworiginal&amp;cid={$row['id']}>View original</a>]" : "") . "</p>\n";
        $avatar = $CURUSER["avatars"] == "yes" ? htmlspecialchars($row["avatar"]) : "";
        // if (!$avatar)
        // $avatar = "{$pic_base_url}default_avatar.gif";
        $text = format_comment($row["text"]);
        if ($row["editedby"]) {
            $text .= "<p><font size=1 class=small>Last edited by <a href=userdetails.php?id={$row['editedby']}><b>{$row['username']}</b></a> at {$row['editedat']} GMT</font></p>\n";
        }
        begin_table(true);
        print "<tr valign=top>\n";
        print "<td align=center width=150 style='padding: 0px'><img width=150 src=\"{$avatar}\"></td>\n";
        print "<td class=text>{$text}</td>\n";
        print "</tr>\n";
        end_table();
    }
    end_frame();
    end_main_frame();
}
コード例 #14
0
ファイル: floodlimit.php プロジェクト: CharlieHD/U-232-V3
}
require_once INCL_DIR . 'user_functions.php';
require_once INCL_DIR . 'html_functions.php';
require_once CLASS_DIR . 'class_check.php';
class_check(UC_ADMINISTRATOR);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $limits = isset($_POST['limit']) && is_array($_POST['limit']) ? $_POST['limit'] : 0;
    foreach ($limits as $class => $limit) {
        if ($limit == 0) {
            unset($limits[$class]);
        }
    }
    if (file_put_contents($INSTALLER09['flood_file'], serialize($limits))) {
        header('Refresh: 2; url=/staffpanel.php?tool=floodlimit');
        stderr('Success', 'Limits saved! returning to main page');
    } else {
        stderr('Err', 'Something went wrong make sure ' . $_file . ' exists and it is chmoded 0777');
    }
} else {
    if (!file_exists($INSTALLER09['flood_file']) || !is_array($limit = unserialize(file_get_contents($INSTALLER09['flood_file'])))) {
        $limit = array();
    }
    $out = begin_main_frame() . begin_frame('Edit flood limit');
    $out .= '<form method=\'post\' action=\'\' ><table width=\'60%\' align=\'center\'><tr><td class=\'colhead\'>User class</td><td class=\'colhead\'>Limit</td></tr>';
    for ($i = UC_MIN; $i <= UC_MAX; $i++) {
        $out .= '<tr><td align=\'left\'>' . get_user_class_name($i) . '</td><td><input name=\'limit[' . $i . ']\' type=\'text\' size=\'10\' value=\'' . (isset($limit[$i]) ? $limit[$i] : 0) . '\'/></td></tr>';
    }
    $out .= '<tr><td colspan=\'2\'>Note if you want no limit for the user class set the limit to 0</td></tr><tr><td colspan=\'2\' class=\'colhead\'><input type=\'submit\' value=\'Save\' /></td></tr>';
    $out .= '</table></form>' . end_frame() . end_main_frame();
    echo stdhead('Flood limit') . $out . stdfoot();
}
コード例 #15
0
ファイル: functions.php プロジェクト: skygunner/ekucms
function commenttable($rows, $type, $parent_id, $review = false)
{
    global $lang_functions;
    global $CURUSER, $commanage_class;
    global $Advertisement;
    begin_main_frame();
    begin_frame();
    $count = 0;
    if ($Advertisement->enable_ad()) {
        $commentad = $Advertisement->get_ad('comment');
    }
    foreach ($rows as $row) {
        $userRow = get_user_row($row['user']);
        if ($count >= 1) {
            if ($Advertisement->enable_ad()) {
                if ($commentad[$count - 1]) {
                    echo "<div align=\"center\" style=\"margin-top: 10px\" id=\"ad_comment_" . $count . "\">" . $commentad[$count - 1] . "</div>";
                }
            }
        }
        print "<div style=\"margin-top: 8pt; margin-bottom: 8pt;\"><table id=\"cid" . $row["id"] . "\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr><td class=\"embedded\" width=\"99%\">#" . $row["id"] . "&nbsp;&nbsp;<font color=\"gray\">" . $lang_functions['text_by'] . "</font>";
        print get_username($row["user"], false, true, true, false, false, true);
        print "&nbsp;&nbsp;<font color=\"gray\">" . $lang_functions['text_at'] . "</font>" . gettime($row["added"]) . ($row["editedby"] && get_user_class() >= $commanage_class ? " - [<a href=\"comment.php?action=vieworiginal&amp;cid=" . $row[id] . "&amp;type=" . $type . "\">" . $lang_functions['text_view_original'] . "</a>]" : "") . "</td><td class=\"embedded nowrap\" width=\"1%\"><a href=\"#top\"><img class=\"top\" src=\"pic/trans.gif\" alt=\"Top\" title=\"Top\" /></a>&nbsp;&nbsp;</td></tr></table></div>";
        $avatar = $CURUSER["avatars"] == "yes" ? htmlspecialchars(trim($userRow["avatar"])) : "";
        if (!$avatar) {
            $avatar = "pic/default_avatar.png";
        }
        $text = format_comment($row["text"]);
        $text_editby = "";
        if ($row["editedby"]) {
            $lastedittime = gettime($row['editdate'], true, false);
            $text_editby = "<br /><p><font class=\"small\">" . $lang_functions['text_last_edited_by'] . get_username($row['editedby']) . $lang_functions['text_edited_at'] . $lastedittime . "</font></p>\n";
        }
        print "<table class=\"main\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n";
        $secs = 900;
        $dt = sqlesc(date("Y-m-d H:i:s", TIMENOW - $secs));
        // calculate date.
        print "<tr>\n";
        print "<td class=\"rowfollow\" width=\"150\" valign=\"top\" style=\"padding: 0px;\">" . return_avatar_image($avatar) . "</td>\n";
        print "<td class=\"rowfollow\" valign=\"top\"><br />" . $text . $text_editby . "</td>\n";
        print "</tr>\n";
        $actionbar = "<a href=\"comment.php?action=add&amp;sub=quote&amp;cid=" . $row[id] . "&amp;pid=" . $parent_id . "&amp;type=" . $type . "\"><img class=\"f_quote\" src=\"pic/trans.gif\" alt=\"Quote\" title=\"" . $lang_functions['title_reply_with_quote'] . "\" /></a>" . "<a href=\"comment.php?action=add&amp;pid=" . $parent_id . "&amp;type=" . $type . "\"><img class=\"f_reply\" src=\"pic/trans.gif\" alt=\"Add Reply\" title=\"" . $lang_functions['title_add_reply'] . "\" /></a>" . (get_user_class() >= $commanage_class ? "<a href=\"comment.php?action=delete&amp;cid=" . $row[id] . "&amp;type=" . $type . "\"><img class=\"f_delete\" src=\"pic/trans.gif\" alt=\"Delete\" title=\"" . $lang_functions['title_delete'] . "\" /></a>" : "") . ($row["user"] == $CURUSER["id"] || get_user_class() >= $commanage_class ? "<a href=\"comment.php?action=edit&amp;cid=" . $row[id] . "&amp;type=" . $type . "\"><img class=\"f_edit\" src=\"pic/trans.gif\" alt=\"Edit\" title=\"" . $lang_functions['title_edit'] . "\" />" . "</a>" : "");
        print "<tr><td class=\"toolbox\"> " . ("'" . $userRow['last_access'] . "'" > $dt ? "<img class=\"f_online\" src=\"pic/trans.gif\" alt=\"Online\" title=\"" . $lang_functions['title_online'] . "\" />" : "<img class=\"f_offline\" src=\"pic/trans.gif\" alt=\"Offline\" title=\"" . $lang_functions['title_offline'] . "\" />") . "<a href=\"sendmessage.php?receiver=" . htmlspecialchars(trim($row["user"])) . "\"><img class=\"f_pm\" src=\"pic/trans.gif\" alt=\"PM\" title=\"" . $lang_functions['title_send_message_to'] . htmlspecialchars($userRow["username"]) . "\" /></a><a href=\"report.php?commentid=" . htmlspecialchars(trim($row["id"])) . "\"><img class=\"f_report\" src=\"pic/trans.gif\" alt=\"Report\" title=\"" . $lang_functions['title_report_this_comment'] . "\" /></a></td><td class=\"toolbox\" align=\"right\">" . $actionbar . "</td>";
        print "</tr></table>\n";
        $count++;
    }
    end_frame();
    end_main_frame();
}
コード例 #16
0
ファイル: post_functions.php プロジェクト: Bigjoos/U-232-V5
function insert_compose_frame($id, $newtopic = true, $quote = false, $attachment = false)
{
    global $CURUSER, $INSTALLER09, $Multi_forum;
    $htmlout = '';
    if ($newtopic) {
        $res = sql_query("SELECT name FROM forums WHERE id=" . sqlesc($id)) or sqlerr(__FILE__, __LINE__);
        $arr = mysqli_fetch_assoc($res) or die("Bad forum ID!");
        // $htmlout .="<h3>New topic in <a href='{$INSTALLER09['baseurl']}/forums.php?action=viewforum&amp;forumid=".$id."'>".htmlsafechars($arr["name"])."</a> forum</h3>";
        $htmlout .= "<!--<div class='navigation'>\n\t\t\t\t<a href='index.php'>" . $INSTALLER09["site_name"] . "</a> \n\t\t\t\t&gt;\n\t\t\t\t<a href='forums.php'>Forums</a>\n\t\t\t\t&gt;\n\t\t\t\t<a href='{$INSTALLER09['baseurl']}/forums.php?action=viewforum&amp;forumid=" . $id . "'>" . htmlsafechars($arr["name"]) . "</a>\n\t\t\t\t<br><img src='templates/1/pic/carbon/nav_bit.png' alt=''>\n\t\t\t\t<span class='active'>New Topic</span>\n\t\t\t\t</div><br />-->";
    } else {
        $res = sql_query("SELECT t.forum_id, t.topic_name, t.locked, f.min_class_read, f.name AS forum_name FROM topics AS t LEFT JOIN forums AS f ON f.id = t.forum_id WHERE t.id=" . sqlesc($id)) or sqlerr(__FILE__, __LINE__);
        $arr = mysqli_fetch_assoc($res) or die("Forum error, Topic not found.");
        $forum = htmlsafechars($arr["forum_name"]);
        $forumid = (int) $arr['forum_id'];
        if ($arr['locked'] == 'yes') {
            stderr("Sorry", "The topic is locked.");
            $htmlout .= end_table();
            $htmlout .= end_main_frame();
            echo stdhead("Compose", true, $stdhead) . $htmlout . stdfoot($stdfoot);
            exit;
        }
        if ($CURUSER["class"] < $arr["min_class_read"]) {
            $htmlout .= stdmsg("Sorry", "You are not allowed in here.");
            $htmlout .= end_table();
            $htmlout .= end_main_frame();
            echo stdhead("Compose") . $htmlout . stdfoot();
            exit;
        }
        $htmlout .= "<!--<div class='navigation'>\n\t\t\t\t<a href='index.php'>" . $INSTALLER09["site_name"] . "</a> \n\t\t\t\t&gt;\n\t\t\t\t<a href='forums.php'>Forums</a>\n\t\t\t\t&gt;\n\t\t\t\t<a href='{$INSTALLER09['baseurl']}/forums.php?action=viewforum&amp;forumid=" . $forumid . "'>{$forum}</a>\n\t\t\t\t&gt;\n\t\t\t\t<a href='{$INSTALLER09['baseurl']}/forums.php?action=viewtopic&amp;topicid=" . $id . "'>" . htmlsafechars($arr["topic_name"]) . "</a>\n\t\t\t\t<br><img src='templates/1/pic/carbon/nav_bit.png' alt=''>\n\t\t\t\t<span class='active'>Post Reply</span>\n\t\t\t\t</div><br />-->";
        // $htmlout .="<h3 align='center'>Reply to topic:<a href='{$INSTALLER09['baseurl']}/forums.php?action=viewtopic&amp;topicid=".$id."'>".htmlsafechars($arr["topic_name"])."</a></h3>";
    }
    $htmlout .= "\n    <script type='text/javascript'>\n    /*<![CDATA[*/\n    function Preview()\n    {\n    document.compose.action = './forums/preview.php'\n    document.compose.target = '_blank';\n    document.compose.submit();\n    return true;\n    }\n    /*]]>*/\n    </script>";
    //$htmlout .= begin_frame("Compose", true);
    $htmlout .= "<form method='post' name='compose' action='{$INSTALLER09['baseurl']}/forums.php' enctype='multipart/form-data'>\n\t  <input type='hidden' name='action' value='post' />\n\t  <input type='hidden' name='" . ($newtopic ? 'forumid' : 'topicid') . "' value='" . $id . "' />";
    //$htmlout .= begin_table(true);
    $htmlout .= "<table border='0' cellspacing='0' cellpadding='5' class='tborder'>\n\t<tr>\n<td class='thead' colspan='2'><strong>Compose</strong></td>\n</tr>\n\t";
    if ($newtopic) {
        $htmlout .= "<tr>\n\t\t\t<td class=row width='10%'>Subject</td>\n\t\t\t<td class=row align='left'>\n\t\t\t\t<input type='text' class='form-control col-md-12' size='100' maxlength='{$Multi_forum['configs']['maxsubjectlength']}' name='topic_name'  />\n\t\t\t</td>\n\t\t</tr>";
    }
    if ($quote) {
        $postid = (int) $_GET["postid"];
        if (!is_valid_id($postid)) {
            stderr("Error", "Invalid ID!");
            $htmlout .= end_table();
            $htmlout .= end_main_frame();
            echo stdhead("Compose", true, $stdhead) . $htmlout . stdfoot($stdfoot);
            exit;
        }
        $res = sql_query("SELECT posts.*, users.username FROM posts JOIN users ON posts.user_id = users.id WHERE posts.id =" . sqlesc($postid)) or sqlerr(__FILE__, __LINE__);
        if (mysqli_num_rows($res) == 0) {
            stderr("Error", "No post with this ID");
            $htmlout .= end_table();
            $htmlout .= end_main_frame();
            echo stdhead("Error - No post with this ID", true, $stdhead) . $htmlout . stdfoot($stdfoot);
            exit;
        }
        $arr = mysqli_fetch_assoc($res);
    }
    $htmlout .= "<tr>\n\t\t<td class=row valign='top'>Body</td>\n\t\t<td class=row>";
    $qbody = $quote ? "[quote=" . htmlsafechars($arr["username"]) . "]" . htmlsafechars($arr["body"]) . "[/quote]" : "";
    //if (function_exists('BBcode'))
    //$htmlout .= BBcode($qbody, true);
    if (function_exists('textbbcode')) {
        $htmlout .= ' 
		' . textbbcode('compose', 'body', isset($qbody) ? htmlsafechars($qbody) : '') . ' 
		';
    } else {
        $htmlout .= "<textarea name='body' style='width:99%' rows='7'>{$qbody}</textarea>";
    }
    $htmlout .= "</td></tr>";
    if ($Multi_forum['configs']['use_attachment_mod'] && $attachment) {
        $htmlout .= "<tr>\n\t\t\t\t<td colspan='2'><fieldset class='fieldset'><legend>Add Attachment</legend>\n\t\t\t\t<input type='checkbox' name='uploadattachment' value='yes' />\n\t\t\t\t<input type='file' name='file' size='60' />\n        <div class='error'>Allowed Files: rar, zip<br />Size Limit " . mksize($Multi_forum['configs']['maxfilesize']) . "</div></fieldset>\n\t\t\t\t</td>\n\t\t\t</tr>";
    }
    $htmlout .= "<tr>\n   \t  <td class=row align='center' colspan='2'>" . post_icons() . "</td>\n \t     </tr><tr class=row>\n \t\t  <td colspan='2' align='center'>\n \t     <input class='btn btn-primary dropdown-toggle' type='submit' value='Submit' /><input class='btn btn-primary dropdown-toggle' type='button' value='Preview' name='button2' onclick='return Preview();' />\n";
    if ($newtopic) {
        $htmlout .= "Anonymous Topic<input type='checkbox' name='anonymous' value='yes'/>\n";
    } else {
        $htmlout .= "Anonymous Post<input type='checkbox' name='anonymous' value='yes'/>\n";
    }
    $htmlout .= "</td></tr></form>\n";
    $htmlout .= "<tr>\n\t\t\t\t<td colspan='2' align='right' class='tfoot'>\n\t\t\t\t" . insert_quick_jump_menu() . "\n\t\t\t\t</td>\n\t\t\t</tr>";
    $htmlout .= end_table();
    $htmlout .= "<br />";
    // $htmlout .= end_frame();
    // ------ Get 10 last posts if this is a reply
    if (!$newtopic && $INSTALLER09['show_last_10']) {
        $postres = sql_query("SELECT p.id, p.added, p.body, p.anonymous, u.id AS uid, u.enabled, u.class, u.donor, u.warned, u.chatpost, u.leechwarn, u.pirate, u.king, u.username, u.avatar, u.offensive_avatar " . "FROM posts AS p " . "LEFT JOIN users AS u ON u.id = p.user_id " . "WHERE p.topic_id=" . sqlesc($id) . " " . "ORDER BY p.id DESC LIMIT 10") or sqlerr(__FILE__, __LINE__);
        if (mysqli_num_rows($postres) > 0) {
            $htmlout .= "<br />";
            $htmlout .= begin_frame("10 last posts, in reverse order");
            while ($post = mysqli_fetch_assoc($postres)) {
                //$avatar = ($CURUSER["avatars"] == "all" ? htmlsafechars($post["avatar"]) : ($CURUSER["avatars"] == "some" && $post["offavatar"] == "no" ? htmlsafechars($post["avatar"]) : ""));
                $avatar = $CURUSER["avatars"] == "yes" ? avatar_stuff($post) : "";
                if ($post['anonymous'] == 'yes') {
                    $avatar = $INSTALLER09['pic_base_url'] . $Multi_forum['configs']['forum_pics']['default_avatar'];
                } else {
                    $avatar = $CURUSER["avatars"] == "yes" ? avatar_stuff($post) : '';
                }
                if (empty($avatar)) {
                    $avatar = $INSTALLER09['pic_base_url'] . $Multi_forum['configs']['forum_pics']['default_avatar'];
                }
                $user_stuff = $post;
                $user_stuff['id'] = (int) $post['uid'];
                if ($post["anonymous"] == "yes") {
                    if ($CURUSER['class'] < UC_STAFF && $post["uid"] != $CURUSER["id"]) {
                        $htmlout .= "<p class='sub'>#" . (int) $post["id"] . " by <i>Anonymous</i> at " . get_date($post["added"], 'LONG', 1, 0) . "</p>";
                    } else {
                        $htmlout .= "<p class='sub'>#" . (int) $post["id"] . " by <i>Anonymous</i> [<b>" . format_username($user_stuff, true) . "</b>] at " . get_date($post["added"], 'LONG', 1, 0) . "</p>";
                    }
                } else {
                    $htmlout .= "<p class='sub'>#" . (int) $post["id"] . " by " . (!empty($post["username"]) ? format_username($user_stuff, true) : "unknown[" . (int) $post['uid'] . "]") . " at " . get_date($post["added"], 'LONG', 1, 0) . "</p>";
                }
                $htmlout .= begin_table(true);
                $htmlout .= "<tr>\n\t\t\t\t <td height='100' width='100' align='center' style='padding: 0px' valign='top'><img height='100' width='100' src='" . $avatar . "' alt='User avvy' /></td>\n\t\t\t\t <td class='comment' valign='top'>" . format_comment($post["body"]) . "</td>\n\t\t\t\t </tr>";
                $htmlout .= end_table();
            }
            $htmlout .= end_frame();
        }
    }
    //$htmlout .= insert_quick_jump_menu();
    return $htmlout;
}
コード例 #17
0
ファイル: warn.php プロジェクト: CharlieHD/U-232-V2
    exit;
}
switch ($do) {
    case "disabled":
        $query = "SELECT id,username, class, downloaded, uploaded, IF(downloaded>0, round((uploaded/downloaded),2), '---') as ratio, disable_reason, added, last_access FROM users WHERE enabled='no' ORDER BY last_access DESC ";
        $title = "Disabled users";
        $link = "<a href=\"staffpanel.php?tool=warn&amp;action=warn&amp;?do=warned\">warned users</a>";
        break;
    case "warned":
        $query = "SELECT id, username, class, downloaded, uploaded, IF(downloaded>0, round((uploaded/downloaded),2), '---') as ratio, warn_reason, warned, added, last_access FROM users WHERE warned>='1' ORDER BY last_access DESC, warned DESC ";
        $title = "Warned users";
        $link = "<a href=\"staffpanel.php?tool=warn&amp;action=warn&amp;do=disabled\">disabled users</a>";
        break;
}
$g = sql_query($query) or print mysql_error();
$count = mysql_num_rows($g);
$HTMLOUT .= begin_main_frame();
$HTMLOUT .= begin_frame($title . "&nbsp;[<font class=\"small\">total - " . $count . " user" . ($count > 1 ? "s" : "") . "</font>] - " . $link);
if ($count == 0) {
    $HTMLOUT .= stdmsg("hey", "There is no " . strtolower($title));
} else {
    $HTMLOUT .= "<form action='staffpanel.php?tool=warn&amp;action=warn' method='post'>\r\n\t\t<table width='600' cellpadding='3' cellspacing='2' style='border-collapse:separate;' align='center'>\r\n\t\t<tr>    \t\r\n\t\t\t<td class='colhead' align='left' width='100%' >User</td>\r\n\t\t\t<td class='colhead' align='center' nowrap='nowrap'>Ratio</td>\r\n\t\t\t<td class='colhead' align='center' nowrap='nowrap'>Class</td>\r\n\t\t\t<td class='colhead' align='center' nowrap='nowrap'>Last access</td>\r\n\t\t\t<td class='colhead' align='center' nowrap='nowrap'>Joined</td>\r\n\t\t\t<td class='colhead' align='center' nowrap='nowrap'><input type='checkbox' name='checkall' /></td>\r\n\t\t</tr>";
    while ($a = mysql_fetch_assoc($g)) {
        $tip = $do == "warned" ? "Warned for : " . $a["warn_reason"] . "<br />" . " Warned till " . get_date($a["warned"], 'DATE', 1) . " - " . mkprettytime($a['warned'] - time()) : "Disabled for " . $a["disable_reason"];
        $HTMLOUT .= "<tr>\r\n\t\t\t\t  <td align='left' width='100%'><a href='userdetails.php?id={$a["id"]}' onmouseover=\"Tip('({$tip})')\" onmouseout=\"UnTip()\">{$a["username"]}</a></td>\r\n\t\t\t\t  <td align='left' nowrap='nowrap'>{$a["ratio"]}<br /><font class='small'><b>D: </b>" . mksize($a["downloaded"]) . "&nbsp;<b>U:</b> " . mksize($a["uploaded"]) . "</font></td>\r\n\t\t\t\t  <td align='center' nowrap='nowrap'>" . get_user_class_name($a["class"]) . "</td>\r\n\t\t\t\t  <td align='center' nowrap='nowrap'>" . get_date($a["last_access"], 'LONG', 0, 1) . "</td>\r\n\t\t\t\t  <td align='center' nowrap='nowrap'>" . get_date($a["added"], 'DATE', 1) . "</td>\r\n\t\t\t\t  <td align='center' nowrap='nowrap'><input type='checkbox' name='users[]' value='{$a["id"]}' /></td>\r\n\t\t\t\t</tr>";
    }
    $HTMLOUT .= "<tr>\r\n\t\t\t<td colspan='6' class='colhead' align='center'>\r\n\t\t\t\t<select name='action'>\r\n\t\t\t\t\t<option value='unwarn'>Unwarn</option>\r\n\t\t\t\t\t<option value='disable'>Disable</option>\r\n\t\t\t\t\t<option value='delete'>Delete</option>\r\n\t\t\t\t</select>\r\n\t\t\t\t&raquo;\r\n\t\t\t\t<input type='submit' value='Apply' />\r\n\t\t\t\t<input type='hidden' value='" . htmlspecialchars($_SERVER["REQUEST_URI"]) . "' name='ref' />\r\n\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t</form>";
}
$HTMLOUT .= end_frame();
$HTMLOUT .= end_main_frame();
echo stdhead($title) . $HTMLOUT . stdfoot($stdfoot);
コード例 #18
0
ファイル: forum.php プロジェクト: Q8HMA/BtiTracker-1.5.1
function insert_compose_frame($id, $newtopic = true, $quote = false)
{
    global $maxsubjectlength, $db;
    MCached::connect();
    if ($newtopic) {
        $arr = MCached::get('forums::name::' . $id);
        if ($arr === MCached::NO_RESULT) {
            $res = $db->query("SELECT name FROM forums WHERE id = " . $id) or sqlerr(__FILE__, __LINE__);
            $arr = $res->fetch_assoc() or die(BAD_FORUM_ID);
            MCached::add('forums::name::' . $id, $arr, 9600);
        }
        $forumname = security::html_safe(unesc($arr["name"]));
        block_begin(WORD_NEW . " " . TOPIC . " " . IN . " <a href='?action=viewforum&forumid=" . $id . "'>" . $forumname . "</a> " . FORUM);
    } else {
        $arr = MCached::get('quick::jump::topics::' . $id);
        if ($arr === MCached::NO_RESULT) {
            $res = $db->query("SELECT * FROM topics WHERE id = " . $id) or sqlerr(__FILE__, __LINE__);
            $arr = $res->fetch_assoc() or stderr(ERROR, FORUM_ERROR . TOPIC_NOT_FOUND);
            MCached::add('quick::jump::topics::' . $id, $arr, 9600);
        }
        $subject = security::html_safe(unesc($arr["subject"]));
        block_begin(REPLY . " " . TOPIC . ": <a href='?action=viewtopic&topicid=" . $id . "'>" . $subject . "</a>");
    }
    begin_frame();
    print "<form method='post' name='compose' action='?action=post'>\n";
    if ($newtopic) {
        print "<input type='hidden' name='forumid' value='" . $id . "'>\n";
    } else {
        print "<input type='hidden' name='topicid' value='" . $id . "'>\n";
    }
    begin_table();
    if ($newtopic) {
        print "<tr><td class='header'>" . SUBJECT . "</td>" . "<td class='lista' align='left' style='padding: 0px'><input type='text' size='50' maxlength='" . $maxsubjectlength . "' name='subject' " . "style='border: 0px; height: 19px'></td></tr>\n";
    }
    if ($quote) {
        $postid = 0 + (int) $_GET["postid"];
        if (!is_valid_id($postid)) {
            die;
        }
        $res = $db->query("SELECT posts.*, users.username FROM posts INNER JOIN users ON posts.userid = users.id WHERE posts.id = " . $postid) or sqlerr(__FILE__, __LINE__);
        if ($res->num_rows != 1) {
            stderr(ERROR, ERR_NO_POST_WITH_ID . "" . $postid);
        }
        $arr = $res->fetch_assoc();
    }
    print "<tr><td class='header'>" . BODY . "</td><td class='lista' align='left' style='padding: 0px'>";
    textbbcode("compose", "body", $quote ? "[quote=" . security::html_safe($arr["username"]) . "]" . security::html_safe(unesc($arr["body"])) . "[/quote]" : "");
    print "<tr><td colspan='2' align='center'><input type='submit' class='btn' value='" . FRM_CONFIRM . "'></td></tr>\n";
    print "</td></tr>";
    end_table();
    print "</form>\n";
    end_frame();
    //------ Get 10 last posts if this is a reply
    if (!$newtopic) {
        $postres = $db->query("SELECT * FROM posts WHERE topicid = " . $id . " ORDER BY id DESC LIMIT 10") or sqlerr(__FILE__, __LINE__);
        begin_frame(LAST_10_POSTS, true);
        while ($post = $postres->fetch_assoc()) {
            //-- Get poster details
            $userres = $db->query("SELECT * FROM users WHERE id = " . (int) $post["userid"] . " LIMIT 1") or sqlerr(__FILE__, __LINE__);
            $user = $userres->fetch_assoc();
            $avatar = $user["avatar"] && $user["avatar"] != "" ? security::html_safe($user["avatar"]) : "";
            begin_table(true);
            print "<tr valign='top'><td width='150' align='center' style='padding: 0px'>#" . (int) $post["id"] . " by " . security::html_safe($user["username"]) . "<br />" . get_date_time($post["added"]) . ($avatar != "" ? "<br /><img width='80' src='" . $avatar . "'>" : "") . "</td><td class='lista'>" . format_comment(unesc($post["body"])) . "</td></tr><br>\n";
            end_table();
        }
        end_frame();
    }
    if (!isset($forumid)) {
        $forumid = 0;
    }
    insert_quick_jump_menu($forumid);
    block_end();
}
コード例 #19
0
ファイル: staffbox.php プロジェクト: thefkboss/U-232
            }
        } else {
            stderr($lang['staffbox_err'], $lang['staffbox_odd_err']);
        }
        break;
    default:
        $count_msgs = get_row_count('staffmessages');
        $perpage = 4;
        $pager = pager($perpage, $count_msgs, 'staffbox.php?');
        if (!$count_msgs) {
            stderr($lang['staffbox_err'], $lang['staffbox_no_msgs']);
        } else {
            $HTMLOUT = begin_main_frame() . begin_frame($lang['staffbox_info']);
            $HTMLOUT .= $pager['pagertop'];
            $HTMLOUT .= "<form method='post' name='staffbox' action='" . $_SERVER['PHP_SELF'] . "'>";
            $HTMLOUT .= "<table width='90%' border='1' cellspacing='0' cellpadding='5' align='center'>";
            $HTMLOUT .= "<tr>\r\n                 <td class='colhead' align='center' width='100%'>{$lang['staffbox_subject']}</td>\r\n                 <td class='colhead' align='center'>{$lang['staffbox_sender']}</td>\r\n                 <td class='colhead' align='center'>{$lang['staffbox_added']}</td>\r\n                 <td class='colhead' align='center'>{$lang['staffbox_answered']}</td>\r\n                 <td class='colhead' align='center'><input type='checkbox' name='t' onclick=\"checkbox('staffbox')\" /></td>\r\n                </tr>";
            $r = sql_query('SELECT s.id, s.added, s.subject, s.answered, s.answeredby, s.sender, s.answer, u.username , u2.username as username2 
						FROM staffmessages  as s
						LEFT JOIN users as u ON s.sender = u.id 
						LEFT JOIN users as u2 ON s.answeredby = u2.id 
						ORDER BY id desc ' . $pager['limit']) or sqlerr(__FILE__, __LINE__);
            while ($a = mysql_fetch_assoc($r)) {
                $HTMLOUT .= "<tr>\r\n                   <td align='center'><a href='" . $_SERVER['PHP_SELF'] . "?do=view&amp;id=" . $a['id'] . "'>" . htmlspecialchars($a['subject']) . "</a></td>\r\n                   <td align='center'><b>" . ($a['username'] ? "<a href='userdetails.php?id=" . $a['sender'] . "'>" . $a['username'] . "</a>" : "Unknown[" . $a['sender'] . "]") . "</b></td>\r\n                   <td align='center' nowrap='nowrap'>" . get_date($a['added'], 'DATE', 1) . "<br/><span class='small'>" . get_date($a['added'], 0, 1) . "</span></td>\r\n\t\t\t\t   <td align='center'><b>" . ($a['answeredby'] > 0 ? "by <a href='userdetails.php?id=" . $a['answeredby'] . "'>" . $a['username2'] . "</a>" : "<span style='color:#ff0000'>No</span>") . "</b></td>\r\n                   <td align='center'><input type='checkbox' name='id[]' value='" . $a['id'] . "' /></td>\r\n                  </tr>\n";
            }
            $HTMLOUT .= "<tr><td align='right' colspan='5'>\r\n\t\t\t\t\t<select name='do'>\r\n\t\t\t\t\t\t<option value='delete'>{$lang['staffbox_do_delete']}</option>\r\n\t\t\t\t\t\t<option value='setanswered'>{$lang['staffbox_do_set']}</option>\r\n\t\t\t\t\t</select>\r\n\t\t\t\t\t<input type='submit' value='{$lang['staffbox_confirm']}' /></td></tr>\r\n\t\t\t\t</table></form>";
            $HTMLOUT .= $pager['pagerbottom'];
            $HTMLOUT .= end_frame() . end_main_frame();
        }
        print stdhead($lang['staffbox_head']) . $HTMLOUT . stdfoot($stdfoot);
}
コード例 #20
0
ファイル: admincp.php プロジェクト: lavanoid/TorrentTrader3
function navmenu()
{
    global $site_config;
    //Get Last Cleanup
    $res = SQL_Query_exec("SELECT last_time FROM tasks WHERE task = 'cleanup'");
    $row = mysql_fetch_row($res);
    if (!$row) {
        $lastclean = "never done...";
    } else {
        $row[0] = gmtime() - $row[0];
        $days = intval($row[0] / 86400);
        $row[0] -= $days * 86400;
        $hours = intval($row[0] / 3600);
        $row[0] -= $hours * 3600;
        $mins = intval($row[0] / 60);
        $secs = $row[0] - $mins * 60;
        $lastclean = "{$days} days, {$hours} hrs, {$mins} minutes, {$secs} seconds ago.";
    }
    begin_frame(T_("MENU"));
    print "Last cleanup performed: " . $lastclean . " [<a href='admincp.php?action=forceclean'>" . T_("FORCE_CLEAN") . "</a>]<br /><br />";
    if ($site_config["ttversion"] != "2-svn") {
        $file = @file_get_contents('https://www.torrenttrader.org/tt2version.php');
        if ($site_config['ttversion'] >= $file) {
            echo "<br /><center><b>" . T_("YOU_HAVE_LATEST_VER_INSTALLED") . " v{$site_config['ttversion']}</b></center>";
        } else {
            echo "<br /><center><b><font class='error'>" . T_("NEW_VERSION_OF_TT_NOW_AVAIL") . ": v" . $file . " you have v" . $site_config['ttversion'] . "<br /> Please visit <a href=http://www.torrenttrader.org>TorrentTrader.org</a> to upgrade.</font></b></center>";
        }
    }
    $res = SQL_Query_exec("SELECT VERSION() AS mysql_version");
    $row = mysql_fetch_assoc($res);
    $mysqlver = $row['mysql_version'];
    $pending = get_row_count("users", "WHERE status = 'pending' AND invited_by = '0'");
    echo "<center><b>" . T_("USERS_AWAITING_VALIDATION") . ":</b> <a href='admincp.php?action=confirmreg'>({$pending})</a></center><br />";
    echo "<center>" . T_("VERSION_MYSQL") . ": <b>" . $mysqlver . "</b><br />" . T_("VERSION_PHP") . ": <b>" . phpversion() . "</b></center>";
    ?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
    <td align="center"><a href="admincp.php?action=usersearch"><img src="images/admin/user_search.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("ADVANCED_USER_SEARCH");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=avatars"><img src="images/admin/avatar_log.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("AVATAR_LOG");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=backups"><img src="images/admin/db_backup.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("BACKUPS");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=ipbans"><img src="images/admin/ip_block.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("BANNED_IPS");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=bannedtorrents"><img src="images/admin/banned_torrents.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("BANNED_TORRENTS");
    ?>
</a><br /></td>
</tr>
<tr>
    <td colspan="5">&nbsp;</td>
</tr>
<tr>
    <td align="center"><a href="admincp.php?action=blocks&amp;do=view"><img src="images/admin/blocks.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("BLOCKS");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=cheats"><img src="images/admin/cheats.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("DETECT_POSS_CHEATS");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=emailbans"><img src="images/admin/mail_bans.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("EMAIL_BANS");
    ?>
</a><br /></td>
    <td align="center"><a href="faq-manage.php"><img src="images/admin/faq.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("FAQ");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=freetorrents"><img src="images/admin/free_leech.png" border="0" width="32" height="32" alt="" /><br />Freeleech Torrents<?php 
    /*echo T_("TORRENTS_FREE_LEECH");*/
    ?>
</a><br /></td>
</tr>
<tr>
    <td colspan="5">&nbsp;</td>
</tr>
<tr>
    <td align="center"><a href="admincp.php?action=lastcomm"><img src="images/admin/comments.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("LATEST_COMMENTS");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=masspm"><img src="images/admin/mass_pm.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("MASS_PM");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=messagespy"><img src="images/admin/message_spy.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("MESSAGE_SPY");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=news&amp;do=view"><img src="images/admin/news.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("NEWS");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=peers"><img src="images/admin/peer_list.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("PEERS_LIST");
    ?>
</a><br /></td>
</tr>
<tr>
    <td colspan="5">&nbsp;</td>
</tr>
<tr>
    <td align="center"><a href="admincp.php?action=polls&amp;do=view"><img src="images/admin/polls.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("POLLS");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=reports&amp;do=view"><img src="images/admin/report_system.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("REPORTS");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=rules&amp;do=view"><img src="images/admin/rules.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("RULES");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=sitelog"><img src="images/admin/site_log.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("SITELOG");
    ?>
</a><br /></td>
    <td align="center"><a href="teams-create.php"><img src="images/admin/teams.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("TEAMS");
    ?>
</a><br /></td>
</tr>
<tr> 
    <td colspan="5">&nbsp;</td>
</tr>
<tr>
    <td align="center"><a href="admincp.php?action=style"><img src="images/admin/themes.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("THEME_MANAGEMENT");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=categories&amp;do=view"><img src="images/admin/torrent_cats.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("TORRENT_CAT_VIEW");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=torrentlangs&amp;do=view"><img src="images/admin/torrent_lang.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("TORRENT_LANG");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=torrentmanage"><img src="images/admin/torrents.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("TORRENTS");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=groups&amp;do=view"><img src="images/admin/user_groups.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("USER_GROUPS_VIEW");
    ?>
</a><br /></td>
</tr>
<tr>
    <td colspan="5">&nbsp;</td>
</tr>
<tr>
    <td align="center"><a href="admincp.php?action=warned"><img src="images/admin/warned_user.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("WARNED_USERS");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=whoswhere"><img src="images/admin/whos_where.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("WHOS_WHERE");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=censor"><img src="images/admin/word_censor.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("WORD_CENSOR");
    ?>
</a><br /></td>
    <td align="center"><a href="admincp.php?action=forum"><img src="images/admin/forums.png" border="0" width="32" height="32" alt="" /><br /><?php 
    echo T_("FORUM_MANAGEMENT");
    ?>
<br /></a></td>
    <td align="center"><a href="admincp.php?action=users"><img src="images/admin/simple_user_search.png" border="0" width="32" height="32" alt="" /><br />Simple User Search<br /></a></td>  
</tr>
<tr>
    <td colspan="5">&nbsp;</td>
</tr>
<tr>
    <td align="center"><a href="admincp.php?action=privacylevel"><img src="images/admin/privacy_level.png" border="0" width="32" height="32" alt="" /><br />Privacy Level<br /></a></td>     
    <td align="center"><a href="admincp.php?action=pendinginvite"><img src="images/admin/pending_invited_user.png" border="0" width="32" height="32" alt="" /><br />Pending Invited Users<br /></a></td>    
    <td align="center"><a href="admincp.php?action=invited"><img src="images/admin/invited_user.png" border="0" width="32" height="32" alt="" /><br />Invited Users<br /></a></td>    
    <td align="center"><a href="admincp.php?action=sqlerr"><img src="images/admin/sql_error.png" border="0" width="32" height="32" alt="" /><br />SQL Error<br /></a></td>  
    <td align="center"><a href="admincp.php?action=settings"><img src="images/admin/config.png" border="0" width="32" height="32" alt="" /><br />Configuration<br /></a></td>  
</tr>
</table>

<?php 
    end_frame();
}
コード例 #21
0
        stderr('Success', 'Lottery configuration was saved! Click <a href=\'lottery.php?do=config\'>here to get back</a>');
    } else {
        stderr('Error', 'There was an error while executing the update query. Mysql error: ' . (is_object($GLOBALS["___mysqli_ston"]) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));
    }
    exit;
}
$html = begin_main_frame();
if ($lottery_config['enable']) {
    $classes = join(', ', array_map('get_user_class_name', explode('|', $lottery_config['class_allowed'])));
    $html .= stdmsg('Lottery configuration closed', 'Classes playing in this lottery are : <b>' . $classes . '</b>');
} else {
    $html .= begin_frame('Lottery configuration');
    $html .= "<form action='lottery.php?do=config' method='post'>\n  <table width='100%' border='1' cellpadding='5' cellspacing='0' >\n\t<tr>\n    <td width='50%' class='table' align='left'>Enable The Lottery</td>\n    <td class='table' align='left'>Yes <input class='table' type='radio' name='enable' value='1' " . ($lottery_config['enable'] ? 'checked=\'checked\'' : '') . " /> No <input class='table' type='radio' name='enable' value='0' " . (!$lottery_config['enable'] ? 'checked=\'checked\'' : '') . " />\n    </td>\n  </tr>\n\t<tr>\n    <td width='50%' class='table' align='left'>Use Prize Fund (No, uses default pot of all users)</td><td class='table' align='left'>Yes <input class='table' type='radio' name='use_prize_fund' value='1' " . ($lottery_config['use_prize_fund'] ? 'checked=\'checked\'' : '') . " /> No <input class='table' type='radio' name='use_prize_fund' value='0' " . (!$lottery_config['use_prize_fund'] ? 'checked=\'checked\'' : '') . " /></td>\n  </tr>\n\t<tr>\n   <td width='50%' class='table' align='left'>Prize Fund</td>\n   <td class='table' align='left'><input type='text' name='prize_fund' value='{$lottery_config['prize_fund']}' /></td>\n  </tr>\n\t<tr>\n   <td width='50%' class='table' align='left'>Ticket Amount</td>\n   <td class='table' align='left'><input type='text' name='ticket_amount' value='{$lottery_config['ticket_amount']}' /></td>\n  </tr>\n\t<tr>\n    <td width='50%' class='table' align='left'>Ticket Amount Type</td>\n    <td class='table' align='left'><select name='ticket_amount_type'><option value='seedbonus' selected='selected'>seedbonus</option></select></td>\n  </tr>\n\t<tr><td width='50%' class='table' align='left'>Amount Of Tickets Allowed</td><td class='table' align='left'><input type='text' name='user_tickets' value='{$lottery_config['user_tickets']}' /></td>\n  </tr>\n\t<tr><td width='50%' class='table' align='left' valign='top'>Classes Allowed</td><td class='table' align='left'>";
    for ($i = UC_USER; $i <= UC_SYSOP; $i++) {
        $html .= "<label for='c{$i}'><input type='checkbox' value='{$i}' id='c{$i}' name='class_allowed[]'/> " . get_user_class_name($i) . "</label><br/>";
    }
    $html .= "</td></tr>";
    $html .= "\n   <tr>\n    <td width='50%' class='table' align='left'>Total Winners</td>\n    <td class='table' align='left'><input type='text' name='total_winners' value='{$lottery_config['total_winners']}' /></td>\n  </tr>\n\t<tr>\n    <td width='50%' class='table' align='left'>Start Date</td>\n    <td class='table' align='left'>\n      <select name='start_date'><option value='" . TIME_NOW . "'>Now</option>";
    for ($i = 2; $i <= 24; $i += 2) {
        $html .= "<option value='" . (TIME_NOW + 3600 * $i) . "' >" . $i . " hours</option>";
    }
    $html .= "</select></td>\n    </tr>\n    <tr>\n      <td width='50%' class='table' align='left'>End Date</td><td class='table' align='left'><select name='end_date'>\n        <option value='0'>------</option>";
    for ($i = 1; $i <= 7; $i++) {
        $html .= "<option value='" . (TIME_NOW + 84600 * $i) . "'>{$i} days</option>";
    }
    $html .= "</select></td>\n    </tr>\n    <tr>\n      <td colspan='2' class='table' align='center'><input type='submit' value='Apply changes' /></td>\n    </tr>";
    $html .= "</table></form>";
    $html .= end_frame();
}
$html .= end_main_frame();
echo stdhead('Lottery configuration') . $html . stdfoot();
コード例 #22
0
ファイル: topten.php プロジェクト: thefkboss/U-232
function peerstable($res, $frame_caption)
{
    global $lang;
    $htmlout = '';
    $htmlout .= begin_frame($frame_caption, true);
    $htmlout .= begin_table();
    $htmlout .= "<tr><td class='colhead'>{$lang['common_rank']}</td><td class='colhead'>{$lang['peers_uname']}</td><td class='colhead'>{$lang['peers_ulrate']}</td><td class='colhead'>{$lang['peers_dlrate']}</td></tr>";
    $n = 1;
    while ($arr = mysql_fetch_assoc($res)) {
        $highlight = $CURUSER["id"] == $arr["userid"] ? " bgcolor='#BBAF9B'" : "";
        $htmlout .= "<tr><td{$highlight}>{$n}</td><td{$highlight}><a href='userdetails.php?id=" . $arr["userid"] . "'><b>" . $arr["username"] . "</b></a></td><td{$highlight}>" . mksize($arr["uprate"]) . "/s</td><td{$highlight}>" . mksize($arr["downrate"]) . "/s</td></tr>\n";
        ++$n;
    }
    $htmlout .= end_table();
    $htmlout .= end_frame();
    return $htmlout;
}
コード例 #23
0
function commenttable($rows, $variant = 'torrent')
{
    require_once INCL_DIR . 'html_functions.php';
    global $CURUSER, $TBDEV;
    $lang = load_language('torrenttable_functions');
    $htmlout = '';
    $count = 0;
    $variant_options = array('torrent' => 'details', 'request' => 'viewrequests');
    if (isset($variant_options[$variant])) {
        $locale_link = $variant_options[$variant];
    } else {
        return;
    }
    $extra_link = $variant == 'request' ? '&type=request' : '';
    $htmlout .= begin_main_frame();
    $htmlout .= begin_frame();
    foreach ($rows as $row) {
        $htmlout .= "<p class='sub'>#{$row["id"]} {$lang["commenttable_by"]} ";
        if (isset($row["username"])) {
            if ($row['anonymous'] == 'yes') {
                $htmlout .= ($CURUSER['class'] >= UC_MODERATOR ? 'Anonymous - 
                Posted by: <b>' . htmlspecialchars($row['username']) . '</b> 
                ID: ' . $row['user'] . '' : 'Anonymous') . ' ';
            } else {
                $title = $row["title"];
                if ($title == "") {
                    $title = get_user_class_name($row["class"]);
                } else {
                    $title = htmlspecialchars($title);
                }
                $htmlout .= "<a name='comm{$row["id"]}' href='userdetails.php?id={$row["user"]}'><b>" . htmlspecialchars($row["username"]) . "</b></a>" . ($row["donor"] == "yes" ? "<img src='{$TBDEV['pic_base_url']}star.gif' alt='" . $lang["commenttable_donor_alt"] . "' />" : "") . ($row["warned"] == "yes" ? "<img src=" . "'{$TBDEV['pic_base_url']}warned.gif' alt='" . $lang["commenttable_warned_alt"] . "' />" : "") . " ({$title})\n";
            }
        } else {
            $htmlout .= "<a name='comm{$row["id"]}'><i>(" . $lang["commenttable_orphaned"] . ")</i></a>\n";
        }
        $htmlout .= get_date($row['added'], '');
        $htmlout .= ($row["user"] == $CURUSER["id"] || $CURUSER["class"] >= UC_STAFF ? "- [<a href='comment.php?action=edit&amp;cid=" . $row['id'] . $extra_link . "&amp;tid=" . $row[$variant] . "'>" . $lang["commenttable_edit"] . "</a>]" : "") . ($CURUSER["class"] >= UC_VIP ? " - [<a href='report.php?type=Comment&amp;id=" . $row['id'] . "'>Report this Comment</a>]" : "") . ($CURUSER["class"] >= UC_STAFF ? " - [<a href='comment.php?action=delete&amp;cid=" . $row['id'] . $extra_link . "&amp;tid=" . $row[$variant] . "'>" . $lang["commenttable_delete"] . "</a>]" : "") . ($row["editedby"] && $CURUSER["class"] >= UC_STAFF ? "- [<a href='comment.php?action=vieworiginal&amp;cid=" . $row['id'] . $extra_link . "&amp;tid=" . $row[$variant] . "'>" . $lang["commenttable_view_original"] . "</a>]" : "") . "</p>\n";
        $avatar = $CURUSER["avatars"] == "all" ? htmlspecialchars($row["avatar"]) : ($CURUSER["avatars"] == "some" && $row["offavatar"] == "no" ? htmlspecialchars($row["avatar"]) : "");
        if (!$avatar) {
            $avatar = "{$TBDEV['pic_base_url']}forumicons/default_avatar.gif";
        }
        $text = format_comment($row["text"]);
        if ($row["editedby"]) {
            $text .= "<p><font size='1' class='small'>" . $lang["commenttable_last_edited_by"] . " <a href='userdetails.php?id={$row['editedby']}'><b>{$row['username']}</b></a> " . $lang["commenttable_last_edited_at"] . " " . get_date($row['editedat'], 'DATE') . "</font></p>\n";
        }
        $htmlout .= begin_table(true);
        $htmlout .= "<tr valign='top'>\n";
        $htmlout .= "<td align='center' width='150' style='padding: 0px'><img width='{$row['av_w']}' height='{$row['av_h']}' src='{$avatar}' alt='' /><br />" . get_reputation($row, 'comments') . "</td>\n";
        $htmlout .= "<td class='text'>{$text}</td>\n";
        $htmlout .= "</tr>\n";
        $htmlout .= end_table();
    }
    $htmlout .= end_frame();
    $htmlout .= end_main_frame();
    return $htmlout;
}
コード例 #24
0
ファイル: forums.php プロジェクト: ZenoX2012/CyBerFuN-CoDeX
function insert_compose_frame($id, $newtopic = true, $quote = false, $attachment = false)
{
    global $maxsubjectlength, $CURUSER, $max_torrent_size, $maxfilesize, $pic_base_url, $use_attachment_mod, $forum_pics, $DEFAULTBASEURL;
    if ($newtopic) {
        $res = sql_query("SELECT name FROM forums WHERE id = " . sqlesc($id)) or sqlerr(__FILE__, __LINE__);
        $arr = mysql_fetch_assoc($res) or die("Bad forum ID!");
        ?>
<h3>New topic in <a href='<?php 
        echo $_SERVER['PHP_SELF'];
        ?>
?action=viewforum&amp;forumid=<?php 
        echo $id;
        ?>
'><?php 
        echo safeChar($arr["name"]);
        ?>
</a> forum</h3><?php 
    } else {
        $res = sql_query("SELECT subject, locked FROM topics WHERE id = " . sqlesc($id)) or sqlerr(__FILE__, __LINE__);
        $arr = mysql_fetch_assoc($res) or die("Forum error, Topic not found.");
        if ($arr['locked'] == 'yes') {
            stdmsg("Sorry", "The topic is locked.");
            end_table();
            end_main_frame();
            stdfoot();
            exit;
        }
        ?>
<h3 align="center"><?php 
        echo $language['replyto'];
        ?>
<a href='<?php 
        echo $_SERVER['PHP_SELF'];
        ?>
action=viewtopic&amp;topicid=<?php 
        echo $id;
        ?>
'><?php 
        echo safeChar($arr["subject"]);
        ?>
</a></h3><?php 
    }
    begin_frame("Compose", true);
    ?>
<form method='post' name='compose' action='<?php 
    echo $_SERVER['PHP_SELF'];
    ?>
' enctype='multipart/form-data'>
	<input type="hidden" name="action" value="post" />
	<input type='hidden' name='<?php 
    echo $newtopic ? 'forumid' : 'topicid';
    ?>
' value='<?php 
    echo $id;
    ?>
' /><?php 
    begin_table(true);
    if ($newtopic) {
        ?>
		<tr>
			<td class='rowhead' width="10%">Subject</td>
			<td align='left'>
				<input type='text' size='100' maxlength='<?php 
        echo $maxsubjectlength;
        ?>
' name='subject' style='height: 19px' />
			</td>
		</tr><?php 
    }
    if ($quote) {
        $postid = (int) $_GET["postid"];
        if (!is_valid_id($postid)) {
            stdmsg("Error", "Invalid ID!");
            end_table();
            end_main_frame();
            stdfoot();
            exit;
        }
        $res = sql_query("SELECT posts.*, users.username FROM posts JOIN users ON posts.userid = users.id WHERE posts.id = {$postid}") or sqlerr(__FILE__, __LINE__);
        if (mysql_num_rows($res) == 0) {
            stdmsg("Error", "No post with this ID");
            end_table();
            end_main_frame();
            stdfoot();
            exit;
        }
        $arr = mysql_fetch_assoc($res);
    }
    ?>
<tr>
		<td class='rowhead' width="10%">Body</td>
		<td><?php 
    $qbody = $quote ? "[quote=" . safeChar($arr["username"]) . "]" . safeChar(unesc($arr["body"])) . "[/quote]" : '';
    if (function_exists('textbbcode')) {
        textbbcode("compose", "body", $qbody);
    } else {
        ?>
<textarea name="body" style="width:99%" rows="7"><?php 
        echo $qbody;
        ?>
</textarea><?php 
    }
    if ($use_attachment_mod && $attachment) {
        ?>
<tr>
				<td colspan='2'><fieldset class="fieldset"><legend>Add attachment</legend>
					<input type='checkbox' name='uploadattachment' value='yes' />
					<input type="file" name="file" size="60" />
                    <div class='error'>Allowed files: rar, zip<br />Max file size: <?php 
        echo prefixed($maxfilesize);
        ?>
</div></fieldset>
				</td>
			</tr><?php 
    }
    ?>
		<tr>
		<td align=center colspan=2>
		<?php 
    echo post_icons();
    ?>
		</td>
	</tr>
		<tr>
        	<td colspan='2' align='center'>
            <input type='submit' value='Submit' />
			</td>
		</tr>

		</td>
        </tr><?php 
    end_table();
    ?>
</form><?php 
    end_frame();
    // ------ Get 10 last posts if this is a reply
    if (!$newtopic) {
        $postres = sql_query("SELECT p.id, p.added, p.body, u.id AS uid, u.username, u.avatar " . "FROM posts AS p " . "LEFT JOIN users AS u ON u.id = p.userid " . "WHERE p.topicid = " . sqlesc($id) . " " . "ORDER BY p.id DESC LIMIT 10") or sqlerr(__FILE__, __LINE__);
        if (mysql_num_rows($postres) > 0) {
            ?>
<br /><?php 
            begin_frame("Last 10 post's in reverse order");
            while ($post = mysql_fetch_assoc($postres)) {
                $avatar = $CURUSER["avatars"] == "yes" ? safeChar($post["avatar"]) : '';
                if (empty($avatar)) {
                    $avatar = $pic_base_url . $forum_pics['default_avatar'];
                }
                ?>
<p class=sub>#<?php 
                echo $post["id"];
                ?>
 by <?php 
                echo !empty($post["username"]) ? $post["username"] : "******";
                ?>
 at <?php 
                echo $post["added"];
                ?>
 GMT</p><?php 
                begin_table(true);
                ?>
					<tr>
						<td height='100' width='100' align='center' style='padding: 0px' valign="top"><img height='100' width='100' src="<?php 
                echo $avatar;
                ?>
" /></td>
						<td class='comment' valign='top'><?php 
                echo format_comment($post["body"]);
                ?>
</td>
					</tr><?php 
                end_table();
            }
            end_frame();
        }
    }
    insert_quick_jump_menu();
}
コード例 #25
0
    $tid[] = (int) $ta["id"];
}
if (isset($tids) && count($tids)) {
    $p = sql_query("SELECT p.id,p.torrent as tid,p.seeder, p.finishedat, p.downloadoffset, p.uploadoffset, p.ip, p.port, p.uploaded, p.downloaded, p.started AS started, p.last_action AS last_action, u.id as p_uid , u.username as p_user FROM peers AS p LEFT JOIN users as u on u.id=p.userid WHERE p.torrent IN (" . join(",", $tid) . ") AND p.seeder = 'yes' AND to_go=0 LIMIT 5") or sqlerr(__FILE__, __LINE__);
    while ($pa = mysqli_fetch_assoc($p)) {
        $peers[$pa["tid"]][] = $pa;
    }
}
$htmlout .= "<div align='center' style='width:90%'>\n        <fieldset style='border:2px solid #333333;'>\n            <legend style='padding:5xp 0px 0px 5px;'>{$lang['catol_search']}</legend>\n                <form  action='" . $_SERVER["PHP_SELF"] . "' method='get' style='margin:10px;'>\n                    <input type='text' size='50' name='search' value='" . ($search ? $search : "{$lang['catol_search_for_tor']}") . "' onblur=\"if (this.value == '') this.value='{$lang['catol_search_for_tor']}';\" onfocus=\"if (this.value == '{$lang['catol_search_for_tor']}') this.value='';\" />&nbsp;<input type='submit' value='search!' />\n                </form>";
for ($i = 97; $i < 123; ++$i) {
    $l = chr($i);
    $L = chr($i - 32);
    if ($l == $letter) {
        $htmlout .= "<font class=\"sublink-active\">{$L}</font>\n";
    } else {
        $htmlout .= "<a class=\"sublink\" href=\"" . $_SERVER["PHP_SELF"] . "?letter=" . $l . "\">" . $L . "</a>\n";
    }
}
$htmlout .= "</fieldset></div><br />";
$htmlout .= begin_frame();
if (count($rows) > 0) {
    $htmlout .= "<table width='95%' border='1' cellpadding='5' style='border-collapse:collapse'>\n        <tr><td align='left' colspan='2' class='colhead'>{$lang['catol_std_head']}</td></tr>\n        <tr><td align='left' colspan='2' >{$top}</td></tr>";
    foreach ($rows as $row) {
        $htmlout .= "<tr>\n         <td align='center' valign='top' nowrap='nowrap'>\n            <table align='center' width='160' border='1' cellpadding='2'>\n                <tr><td align='center' class='colhead'>{$lang['catol_upper']} : <a href='userdetails.php?id=" . (int) $row["owner"] . "'>" . ($row["user"] ? htmlsafechars($row["user"]) : "{$lang['catol_unknown']}[" . (int) $row["owner"] . "]") . "</a></td></tr>\n                <tr><td align='center'>" . ($row["poster"] ? "<a href=\"" . htmlsafechars($row["poster"]) . "\"><img src=\"" . htmlsafechars($row["poster"]) . "\" border=\"0\" width=\"150\" height=\"195\" alt=\"{$lang['catol_no_poster']}\" title=\"{$lang['catol_no_poster']}\" /></a>" : "<img src=\"pic/noposter.png\" border=\"0\" width=\"150\" alt=\"{$lang['catol_no_poster']}\" title=\"{$lang['catol_no_poster']}\" />") . "</td></tr>\n            </table>\n\n        </td>\n\n            <td align='center' width='100%' valign='top'>\n            <table width='100%' cellpadding='3' cellspacing='0' border='1' style='border-collapse:collapse;font-weight:bold;'>\n            <tr>\n                <td align='center' width='100%' rowspan='2' ><a href='details.php?id=" . (int) $row["id"] . "&amp;hit=1'><b>" . substr(htmlsafechars($row["name"]), 0, 60) . "</b></a></td>\n                <td align='center' class='colhead'>{$lang['catol_added']}</td>\n                <td align='center' class='colhead'>{$lang['catol_size']}</td>\n                <td align='center' class='colhead'>{$lang['catol_snatched']}</td>\n                <td align='center' class='colhead'>S.</td>\n                <td align='center' class='colhead'>L.</td>\n            </tr>\n            <tr>\n                <td align='center'>" . get_date($row["added"], 'LONG', 0, 1) . "</td>\n                <td align='center' nowrap='nowrap'>" . mksize($row["size"]) . "</td>\n                <td align='center' nowrap='nowrap'>" . ($row["snatched"] > 0 ? $row["snatched"] == 1 ? (int) $row["snatched"] . " time" : (int) $row["snatched"] . " times" : 0) . "</td>\n                <td align='center'>" . (int) $row["seeders"] . "</td>\n                <td align='center'>" . (int) $row["leechers"] . "</td>\n            </tr>\n            <tr><td width='100%' colspan='6' class='colhead' >{$lang['catol_info']}.</td></tr>\n            <tr><td width='100%' colspan='6' style='font-weight:normal;' >" . readMore($row["descr"], 500, "details.php?id=" . (int) $row["id"] . "&amp;hit=1") . "</td></tr>\n            <tr><td width='100%' colspan='6' class='colhead'>{$lang['catol_seeder_info']}</td></tr>\n            <tr><td width='100%' colspan='6' style='font-weight:normal;' >" . (isset($peers[$row["id"]]) ? peer_list($peers[$row["id"]]) : "{$lang['catol_no_info_show']}") . "</td></tr>\n            </table></td></tr>";
    }
    $htmlout .= "<tr><td align='left' colspan='2' >{$bottom}</td></tr>\n        <tr><td align='right' colspan='2' class='colhead'>{$lang['catol_orig_created_by']}</td></tr>\n        </table>";
} else {
    $htmlout .= "<h2>{$lang['catol_nothing_found']}!</h2>";
}
$htmlout .= end_frame();
echo stdhead($lang['catol_std_head']) . $htmlout . stdfoot();
コード例 #26
0
ファイル: tickets.php プロジェクト: CharlieHD/U-232-V3
    $lottery['total_pot'] = $lottery_config['ticket_amount'] * $lottery['total_tickets'];
}
//how much the winner gets
$lottery['per_user'] = round($lottery['total_pot'] / $lottery_config['total_winners'], 2);
//how many tickets could the user buy
$lottery['current_user']['could_buy'] = $lottery['current_user']['can_buy'] = $lottery_config['user_tickets'] - $lottery['current_user']['total_tickets'];
//if he has less bonus points calculate how many tickets can he buy with what he has
if ($CURUSER['seedbonus'] < $lottery['current_user']['could_buy'] * $lottery_config['ticket_amount']) {
    for ($lottery['current_user']['can_buy']; $CURUSER['seedbonus'] < $lottery_config['ticket_amount'] * $lottery['current_user']['can_buy']; --$lottery['current_user']['can_buy']) {
    }
}
//check if the lottery ended if the lottery ended don't allow the user to buy more tickets or if he has already bought the max tickets
if (time() > $lottery_config['end_date'] || $lottery_config['user_tickets'] <= $lottery['current_user']['total_tickets']) {
    $lottery['current_user']['can_buy'] = 0;
}
//print('<pre>'.print_r($lottery,1));
$html = begin_main_frame() . begin_frame('Lottery', true);
$html .= "<ul style='text-align:left;'>\r\n    <li>Tickets are non-refundable</li>\r\n    <li>Each ticket costs <b>" . $lottery_config['ticket_amount'] . "</b> which is taken from your seedbonus amount</li>\r\n    <li>Purchaseable shows how many tickets you can afford</li>\r\n    <li>You can only buy up to your purchaseable amount.</li>\r\n    <li>The competiton will end: <b>" . get_date($lottery_config['end_date'], 'LONG') . "</b></li>\r\n    <li>There will be <b>" . $lottery_config['total_winners'] . "</b> winners who will be picked at random</li>\r\n    <li>Winner(s) will get <b>" . $lottery['per_user'] . "</b> added to their seedbonus amount</li>\r\n    <li>The Winners will be announced once the lottery has closed and posted on the home page.</li>";
if (!$lottery_config['use_prize_fund']) {
    $html .= "<li>The more tickets that are sold the bigger the pot will be !</li>";
}
if (count($lottery['current_user']['tickets'])) {
    $html .= "<li>You own ticket numbers : <b>" . join('</b>, <b>', $lottery['current_user']['tickets']) . "</b></li>";
}
$html .= "</ul><hr/>\r\n   <table width='400' class='main' align='center' border='1' cellspacing='0' cellpadding='5'>\r\n    <tr>\r\n      <td class='table'>Total Pot</td>\r\n      <td class='table' align='right'>" . $lottery['total_pot'] . "</td>\r\n    </tr>\r\n    <tr>\r\n      <td class='table'>Total Tickets Purchased</td>\r\n      <td class='table' align='right'>" . $lottery['total_tickets'] . " Tickets</td>\r\n    </tr>\r\n    <tr>\r\n      <td class='table'>Tickets Purchased by You</td>\r\n      <td class='table' align='right'>" . $lottery['current_user']['total_tickets'] . " Tickets</td>\r\n    </tr>\r\n    <tr>\r\n      <td class='table'>Purchaseable</td>\r\n      <td class='table' align='right'>" . ($lottery['current_user']['could_buy'] > $lottery['current_user']['can_buy'] ? 'you have points for <b>' . $lottery['current_user']['can_buy'] . '</b> ticket(s) but you can buy another <b>' . ($lottery['current_user']['could_buy'] - $lottery['current_user']['can_buy']) . '</b> ticket(s) if you get more bonus points' : $lottery['current_user']['can_buy']) . "</td>\r\n    </tr>";
if ($lottery['current_user']['can_buy'] > 0) {
    $html .= "\r\n      <tr>\r\n        <td class='table' colspan='2' align='center'> \r\n          <form action='lottery.php?do=tickets' method='post'>\r\n              <input type='text' size='5' name='tickets' /><input type='submit' value='Buy tickets' />\r\n          </form>\r\n        </td>\r\n      </tr>";
}
$html .= "</table>";
$html .= end_frame() . end_main_frame();
echo stdhead('Buy tickets for lottery') . $html . stdfoot();
コード例 #27
0
function offcommenttable($rows)
{
    global $CURUSER, $HTTP_SERVER_VARS;
    begin_main_frame();
    begin_frame();
    $count = 0;
    $count2 = '';
    $id = '';
    foreach ($rows as $row) {
        // =======change colors
        if ($count2 == 0) {
            $count2 = $count2 + 1;
            $class = "clearalt6";
        } else {
            $count2 = 0;
            $class = "clearalt7";
        }
        print "<br>";
        begin_table(true);
        print "<tr><td class=colhead colspan=2><p class=sub><a name=comment_" . $row["id"] . ">#" . $row["id"] . "</a> by: ";
        if (isset($row["username"])) {
            $username = $row["username"];
            $ratres = sql_query("SELECT uploaded, downloaded from users where username='******'");
            $rat = mysql_fetch_array($ratres);
            if ($rat["downloaded"] > 0) {
                $ratio = $rat['uploaded'] / $rat['downloaded'];
                $ratio = number_format($ratio, 3);
                $color = get_ratio_color($ratio);
                if ($color) {
                    $ratio = "<font color={$color}>{$ratio}</font>";
                }
            } else {
                if ($rat["uploaded"] > 0) {
                    $ratio = "Inf.";
                } else {
                    $ratio = "---";
                }
            }
            $title = $row["title"];
            if ($title == "") {
                $title = get_user_class_name($row["class"]);
            } else {
                $title = safechar($title);
            }
            print "<a name=comm" . $row["id"] . " href=userdetails.php?id=" . $row["user"] . "><b>" . safechar($row["username"]) . "</b></a>" . ($row["donor"] == "yes" ? "<img src=pic/star.gif alt='Donor'>" : "") . ($row["warned"] == "yes" ? "<img src=" . "pic/warned.gif alt=\"Warned\">" : "") . " ({$title}) (ratio: {$ratio})\n";
        } else {
            print "<a name=\"comm" . $row["id"] . "\"><i>(orphaned)</i></a>\n";
        }
        print " at " . $row["added"] . " GMT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . ($row["user"] == $CURUSER["id"] || get_user_class() >= UC_MODERATOR ? "[ <a href=offcomment.php?action=edit&amp;cid={$row['id']}>Edit</a> ] " : "") . (get_user_class() >= UC_MODERATOR ? "[ <a href=offcomment.php?action=delete&amp;cid={$row['id']}>Delete</a> ]" : "") . ($row["editedby"] && get_user_class() >= UC_MODERATOR ? "" : "") . " [ <a href=userdetails.php?id=" . $row["user"] . ">Profile</a> ] [ <a href=sendmessage.php?receiver=" . $row["user"] . ">PM</a> ] [ <a href=report.php?type=Offer_Comment&id={$row['id']}>Report</a> ]</p>\n";
        $avatar = $CURUSER["avatars"] == "yes" ? safechar($row["avatar"]) : "";
        if (!$avatar) {
            $avatar = "pic/default_avatar.gif";
        }
        $text = format_comment($row["text"]);
        if ($row["editedby"]) {
            $text .= "<p><font size=1 class=small>Edited by <a href=userdetails.php?id={$row['editedby']}><b>{$row['username']}</b></a>  {$row['editedat']} GMT</font></p>\n";
        }
        print "</td></tr><tr valign=top><td align=center width=150 class={$class}><img width=150 src={$avatar}></td><td class={$class}>{$text}</td></tr>\n";
        end_table();
    }
    end_frame();
    end_main_frame();
    // stdfoot();
}
コード例 #28
0
ファイル: topten.php プロジェクト: klldll/tbdev
function peerstable($res, $frame_caption)
{
    begin_frame($frame_caption, true);
    begin_table();
    print "<tr><td class=colhead>Rank</td><td class=colhead>Username</td><td class=colhead>Upload rate</td><td class=colhead>Download rate</td></tr>";
    $n = 1;
    while ($arr = mysql_fetch_assoc($res)) {
        $highlight = $CURUSER["id"] == $arr["userid"] ? " bgcolor=#BBAF9B" : "";
        print "<tr><td{$highlight}>{$n}</td><td{$highlight}><a href=userdetails.php?id=" . $arr["userid"] . "><b>" . $arr["username"] . "</b></td><td{$highlight}>" . mksize($arr["uprate"]) . "/s</td><td{$highlight}>" . mksize($arr["downrate"]) . "/s</td></tr>\n";
        ++$n;
    }
    end_table();
    end_frame();
}
コード例 #29
0
ファイル: shoutbox.php プロジェクト: lavanoid/TorrentTrader3
            echo "<center><table width='100%' border='0' cellpadding='1' cellspacing='1'>";
            echo "<tr class='shoutbox_messageboxback'>";
            echo "<td width='75%' align='center'>";
            echo "<input type='text' name='message' class='shoutbox_msgbox' />";
            echo "</td>";
            echo "<td>";
            echo "<input type='submit' name='submit' value='" . T_("SHOUT") . "' class='shoutbox_shoutbtn' />";
            echo "</td>";
            echo "<td>";
            echo '<a href="javascript:PopMoreSmiles(\'shoutboxform\', \'message\');"><small>' . T_("MORE_SMILIES") . '</small></a>';
            echo ' <small>-</small> <a href="javascript:PopMoreTags();"><small>' . T_("TAGS") . '</small></a>';
            echo "<br />";
            echo "<a href='shoutbox.php'><small>" . T_("REFRESH") . "</small></a>";
            echo " <small>-</small> <a href='" . $site_config['SITEURL'] . "/shoutbox.php?history=1' target='_blank'><small>" . T_("HISTORY") . "</small></a>";
            echo "</td>";
            echo "</tr>";
            echo "</table></center>";
            echo "</form>";
        } else {
            echo "<br /><div class='shoutbox_error'>" . T_("SHOUTBOX_MUST_LOGIN") . "</div>";
        }
    }
    if (!isset($_GET['history'])) {
        echo "</body></html>";
    } else {
        end_frame();
        stdfoot();
    }
} else {
    echo T_("SHOUTBOX_DISABLED");
}
コード例 #30
0
ファイル: inviteadd.php プロジェクト: CharlieHD/U-232-V2
                case 'add':
                    $body = sprintf($lang['inviteadd_body_add'], $a['username'], $invites, $invites > 1 ? 's' : '', $INSTALLER09['site_name']);
                    break;
            }
            $pms[] = "(0," . $a['id'] . "," . sqlesc(time()) . "," . sqlesc($body) . " " . ($use_subject ? ",{$subject}" : "") . ")";
        }
        $mc1->delete_value('inbox_new_' . $a['id']);
        $mc1->delete_value('inbox_new_sb_' . $a['id']);
    }
    if (sizeof($users) > 0) {
        $r = sql_query("INSERT INTO users(id,invites) VALUES " . join(",", $users) . " ON DUPLICATE key UPDATE invites=values(invites) ") or sqlerr(__FILE__, __LINE__);
    }
    if (sizeof($pms) > 0) {
        $r1 = sql_query("INSERT INTO messages (sender, receiver, added, msg " . ($use_subject ? ", subject" : "") . ") VALUES " . join(",", $pms) . " ") or sqlerr(__FILE__, __LINE__);
    }
    if ($r && ($sendpm ? $r1 : true)) {
        header("Refresh: 2; url=\"staffpanel.php?tool=inviteadd\"");
        stderr($lang['inviteadd_success'], $lang['inviteadd_done']);
    } else {
        stderr($lang['inviteadd_error'], $lang['inviteadd_wrong']);
    }
}
$HTMLOUT = '';
$HTMLOUT .= "<form action=\"staffpanel.php?tool=inviteadd&amp;action=inviteadd\" method=\"post\">\r\n\t<table width=\"500\" cellpadding=\"5\" cellspacing=\"0\" border=\"1\" align=\"center\">\r\n\t  <tr>\r\n\t\t<td valign=\"top\" align=\"right\">{$lang['inviteadd_classes']}</td>\r\n\t\t<td width=\"100%\" align=\"left\" colspan=\"3\">";
$HTMLOUT .= "<label for=\"all\"><input type=\"checkbox\" name=\"classes[]\" value=\"255\" id=\"all\" />{$lang['inviteadd_allclasses']}</label><br/>\n";
for ($i = $firstclass; $i < $maxclass + 1; $i++) {
    $HTMLOUT .= "<label for=\"c{$i}\"><input type=\"checkbox\" name=\"classes[]\" value=\"{$i}\" id=\"c{$i}\" />" . get_user_class_name($i) . " </label><br/>\n";
}
$HTMLOUT .= "</td>\r\n\t  </tr>\r\n\t  <tr>\r\n\t\t<td valign=\"top\" align=\"center\" >{$lang['inviteadd_options']}</td>\r\n\t\t<td valign=\"top\">{$lang['inviteadd_action']}\r\n\t\t  <select name=\"do\" >\r\n\t\t\t<option value=\"add\">{$lang['inviteadd_badd']}</option>\r\n\t\t\t<option value=\"remove\">{$lang['inviteadd_bremove']}</option>\r\n\t\t\t<option value=\"remove_all\">{$lang['inviteadd_ball']}</option>\r\n\t\t  </select></td>\r\n\t\t<td>Invites <input type=\"text\" maxlength=\"2\" name=\"invites\" size=\"5\" />\r\n\t\t</td>\r\n\t\t<td >{$lang['inviteadd_sendpm']}<select name=\"pm\" ><option value=\"no\">{$lang['inviteadd_no']}</option><option value=\"yes\">{$lang['inviteadd_yes']}</option></select></td></tr>\r\n\t\t<tr><td colspan=\"4\" align=\"center\"><input type=\"submit\" value=\"{$lang['inviteadd_do']}\" /></td></tr>\r\n\t</table>\r\n\t</form>";
echo stdhead($lang['inviteadd_stdhead']) . begin_frame() . $HTMLOUT . end_frame() . stdfoot();