Example #1
0
function usertable($res, $frame_caption)
{
    global $CURUSER;
    begin_frame($frame_caption, true);
    begin_table();
    ?>
<tr>
<td class=colhead>Место</td>
<td class=colhead align=left>Пользователь</td>
<td class=colhead>Раздач</td>
<td class=colhead align=left>Скорость раздачи</td>
<td class=colhead>Закачал</td>
<td class=colhead align=left>Скорость закачки</td>
<td class=colhead align=right>Рейтинг</td>
<td class=colhead align=left>Зарегистрирован</td>

</tr>
<?php 
    $num = 0;
    while ($a = mysql_fetch_assoc($res)) {
        ++$num;
        $highlight = $CURUSER["id"] == $a["userid"] ? " bgcolor=#BBAF9B" : "";
        if ($a["downloaded"]) {
            $ratio = $a["uploaded"] / $a["downloaded"];
            $color = get_ratio_color($ratio);
            $ratio = number_format($ratio, 2);
            if ($color) {
                $ratio = "<font color={$color}>{$ratio}</font>";
            }
        } else {
            $ratio = "Inf.";
        }
        print "<tr{$highlight}><td align=center>{$num}</td><td align=left{$highlight}><a href=userdetails.php?id=" . $a["userid"] . "><b>" . $a["username"] . "</b>" . "</td><td align=right{$highlight}>" . mksize($a["uploaded"]) . "</td><td align=right{$highlight}>" . mksize($a["upspeed"]) . "/s" . "</td><td align=right{$highlight}>" . mksize($a["downloaded"]) . "</td><td align=right{$highlight}>" . mksize($a["downspeed"]) . "/s" . "</td><td align=right{$highlight}>" . $ratio . "</td><td align=left>" . date("Y-m-d", strtotime($a["added"])) . " (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($a["added"])) . " назад)</td></tr>";
    }
    end_table();
    end_frame();
}
Example #2
0
}
if ($n_tor == 0) {
    stdmsg("Sorry...", "No categories defined!");
} else {
    if ($catorder == "lastul") {
        $orderby = "last DESC, c.name";
    } elseif ($catorder == "torrents") {
        $orderby = "n_t DESC, c.name";
    } elseif ($catorder == "peers") {
        $orderby = "n_p DESC, name";
    } else {
        $orderby = "c.name";
    }
    $res = mysql_query("SELECT c.name, MAX(t.added) AS last, COUNT(DISTINCT t.id) AS n_t, COUNT(p.id) AS n_p\r\n\tFROM categories as c LEFT JOIN torrents as t ON t.category = c.id LEFT JOIN peers as p\r\n\tON t.id = p.torrent GROUP BY c.id ORDER BY {$orderby}") or sqlerr(__FILE__, __LINE__);
    begin_frame("Category Activity", true);
    begin_table();
    print "<tr><td class=colhead><a href=\"" . $_SERVER['PHP_SELF'] . "?uporder={$uporder}&amp;catorder=category\" class=colheadlink>Category</a></td>\r\n\t<td class=colhead><a href=\"" . $_SERVER['PHP_SELF'] . "?uporder={$uporder}&amp;catorder=lastul\" class=colheadlink>Last Upload</a></td>\r\n\t<td class=colhead><a href=\"" . $_SERVER['PHP_SELF'] . "?uporder={$uporder}&amp;catorder=torrents\" class=colheadlink>Torrents</a></td>\r\n\t<td class=colhead>Perc.</td>\r\n\t<td class=colhead><a href=\"" . $_SERVER['PHP_SELF'] . "?uporder={$uporder}&amp;catorder=peers\" class=colheadlink>Peers</a></td>\r\n\t<td class=colhead>Perc.</td></tr>\n";
    while ($cat = mysql_fetch_assoc($res)) {
        print "<tr><td class=rowhead>" . $cat['name'] . "</b></a></td>";
        print "<td " . ($cat['last'] ? ">" . $cat['last'] . " (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($cat['last'])) . " ago)" : "align = center>---") . "</td>";
        print "<td align=right>" . $cat['n_t'] . "</td>";
        print "<td align=right>" . number_format(100 * $cat['n_t'] / $n_tor, 1) . "%</td>";
        print "<td align=right>" . $cat['n_p'] . "</td>";
        print "<td align=right>" . ($n_peers > 0 ? number_format(100 * $cat['n_p'] / $n_peers, 1) . "%" : "---") . "</td>\n";
    }
    end_table();
    end_frame();
}
end_main_frame();
stdfoot();
die;
print "<td align='center' class='header'>" . UPLOADED . "</td>\n";
print "<td align='center' class='header'>" . RATIO . "</td>\n";
print "<td align='center' class='header'>" . FINISHED . "</td></tr>\n";
while ($row = $res->fetch_array(MYSQLI_BOTH)) {
    print "<tr><td align='center' class='lista'>" . "<a href='userdetails.php?id=" . (int) $row["uid"] . "'>" . security::html_safe(unesc($row["username"])) . "</a></td>" . "<td align='center' class='lista'><a href='usercp.php?do=pm&action=edit&uid=" . user::$current['uid'] . "&what=new&to=" . urlencode(unesc($row["username"])) . "'>" . image_or_link($STYLEPATH . "/pm.png", "", "PM") . "</a></td>";
    if ($row["flagpic"] != "") {
        print "<td align='center' class='lista'><img src='images/flag/" . $row["flagpic"] . "' alt='" . security::html_safe($row["country"]) . "' /></td>";
    } else {
        print "<td align='center' class='lista'><img src='images/flag/unknown.gif' alt='" . UNKNOWN . "' /></td>";
    }
    print "<td align='center' class='lista'>" . $row["active"] . "</td>";
    print "<td align='center' class='lista'>" . security::html_safe($row["agent"]) . "</td>";
    $dled = misc::makesize((int) $row["downloaded"]);
    $upld = misc::makesize((int) $row["uploaded"]);
    print "<td align='center' class='lista'>" . $dled . "</td>";
    print "<td align='center' class='lista'>" . $upld . "</td>";
    if (intval($row["downloaded"]) > 0) {
        $ratio = number_format((int) $row["uploaded"] / (int) $row["downloaded"], 2);
    } else {
        $ratio = "&infin;";
    }
    print "<td align='center' class='lista'>" . $ratio . "</td>";
    print "<td align='center' class='lista'>" . get_elapsed_time($row["date"]) . " ago</td></tr>";
}
if ($res->num_rows == 0) {
    print "<tr><td align='center' colspan='9' class='lista'>No history to display</td></tr>";
}
print "</table>";
print "</div><br /><br /><center><a href='javascript: history.go(-1);'>" . BACK . "</a>";
block_end();
stdfoot();
Example #4
0
     // $res2 = do_sqlquery("SELECT * FROM {$TABLE_PREFIX}files WHERE info_hash='".$data["hash"]."'");
     // $added = mysql_fetch_array($res2);
     $vz = $data['added'];
     //sql_timestamp_to_unix_timestamp($data["data"]);
     $timer = floor((time() - $vz) / 3600);
     if ($ratio < 1.0 && $CURUSER['uid'] != $data["uploader"]) {
         $wait = $CURUSER["WT"];
     }
     $wait -= $timer;
     if ($wait <= 0) {
         $wait = 0;
     }
     echo "\n\t<td align=\"center\" width=\"20\" class=\"lista\" style=\"text-align: center;\">" . $wait . " h</td>";
 }
 //end waitingtime
 echo "\n\t<td nowrap=\"nowrap\" class=\"lista\" align=\"center\" width=\"85\" style=\"text-align: center;\">" . get_elapsed_time($data["added"]) . " ago</td>";
 echo "\n\t<td nowrap=\"nowrap\" class=\"lista\" align=\"center\" width=\"60\" style=\"text-align: center;\">" . makesize($data["size"]) . "</td>";
 if ($data["external"] == "no") {
     if ($GLOBALS["usepopup"]) {
         echo "\n\t<td align=\"center\" class=\"lista\"" . linkcolor($data["seeds"]) . "\" style=\"text-align: center;\"><a class=\"lasttor\" href=\"javascript:poppeer('index.php?page=peers&amp;id=" . $data["hash"] . "');\" title=\"" . $language["PEERS_DETAILS"] . "\">" . $data["seeds"] . "</a></td>\n";
         echo "\n\t<td align=\"center\" class=\"lista\"" . linkcolor($data["leechers"]) . "\" style=\"text-align: center;\"><a class=\"lasttor\" href=\"javascript:poppeer('index.php?page=peers&amp;id=" . $data["hash"] . "');\" title=\"" . $language["PEERS_DETAILS"] . "\">" . $data["leechers"] . "</a></td>\n";
         if ($data["finished"] > 0) {
             echo "\n\t<td align=\"center\" class=\"lista\" style=\"text-align: center;\"><a class=\"lasttor\" href=\"javascript:poppeer('index.php?page=torrent_history&amp;id=" . $data["hash"] . "');\" title=\"History - " . $data["filename"] . "\">" . $data["finished"] . "</a></td>";
         } else {
             echo "\n\t<td align=\"center\" class=\"lista\" style=\"text-align: center;\">---</td>";
         }
     } else {
         echo "\n\t<td align=\"center\" class=\"lista\"" . linkcolor($data["seeds"]) . "\" style=\"text-align: center;\"><a class=\"lasttor\" href=\"index.php?page=peers&amp;id=" . $data["hash"] . "\" title=\"" . $language["PEERS_DETAILS"] . "\">" . $data["seeds"] . "</a></td>\n";
         echo "\n\t<td align=\"center\" class=\"lista\"" . linkcolor($data["leechers"]) . "\" style=\"text-align: center;\"><a class=\"lasttor\" href=\"index.php?page=peers&amp;id=" . $data["hash"] . "\" title=\"" . $language["PEERS_DETAILS"] . "\">" . $data["leechers"] . "</a></td>\n";
         if ($data["finished"] > 0) {
             echo "\n\t<td align=\"center\" class=\"lista\" style=\"text-align: center;\"><a class=\"lasttor\" href=\"index.php?page=torrent_history&amp;id=" . $data["hash"] . "\" title=\"History - " . $data["filename"] . "\">" . $data["finished"] . "</a></td>";
    $topicname = $arr["subject"];
    $forumid = $arr["f_id"];
    $forumname = $arr["name"];
    $newposts = $arr["lastpostread"] < $arr["lastpost"] && $CURUSER["id"] == $userid;
    $order_is = "p.id DESC";
    $from_is = "posts AS p LEFT JOIN topics as t ON p.topicid = t.id LEFT JOIN forums AS f ON t.forumid = f.id";
    $select_is = "t.id, p.*";
    $where_is = "t.id = {$topicid} AND f.minclassread <= " . $CURUSER['class'];
    $queryposts = "SELECT {$select_is} FROM {$from_is} WHERE {$where_is} ORDER BY {$order_is} {$limit}";
    $res2 = sql_query($queryposts) or sqlerr(__FILE__, __LINE__);
    $arr2 = mysql_fetch_assoc($res2);
    $postid = $arr2["id"];
    $posterid = $arr2["userid"];
    $queryuser = sql_query("SELECT username FROM users WHERE id={$arr2['userid']}");
    $res3 = mysql_fetch_assoc($queryuser);
    $added = $arr2["added"] . " GMT (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($arr2["added"])) . " ago)";
    ?>
<STYLE TYPE="text/css" MEDIA=screen>
td.clearalt6 {
background: #777777;
padding: 5px;
border: 0px;
border: hidden;
}
td.clearalt7 {
padding: 5px;
background: #555555;
border: 0px;
border: hidden;
}
</STYLE>
Example #6
0
            } else {
                $star = "";
            }
            // get warned
            if ($warned == "yes") {
                $klicaj = "<img src=pic/warned8.gif>";
            } else {
                $klicaj = "";
            }
            $counter = $i + 1;
            echo "<tr>";
            echo "<td align=center>{$counter}.</td>";
            echo "<td><a href=/userdetails.php?id={$id}>{$username}</a> {$star} {$klicaj}</td>";
            echo "<td>{$uploaded} / {$downloaded}</td>";
            echo "<td>{$ratio}</td>";
            echo "<td>{$numtorrents} torrents</td>";
            if ($numtorrents > 0) {
                $lastadded = mysql_result($upperresult, $numtorrents - 1, "added");
                echo "<td>" . get_elapsed_time(sql_timestamp_to_unix_timestamp($lastadded)) . " ago (" . gmdate("d. M Y", strtotime($lastadded)) . ")</td>";
            } else {
                echo "<td>---</td>";
            }
            echo "<td align=center><a href=sendmessage.php?receiver={$id}><img src=pic/pm.gif></a></td>";
            echo "</tr>";
        }
        echo "</table>";
    }
} else {
    echo "Not permitted.";
}
stdfoot();
Example #7
0
            $id = intval($_GET["id"]);
            if ($what == "inbox") {
                $res = do_sqlquery("select m.*, IF(m.sender=0,'System',u.username) as sendername FROM {$TABLE_PREFIX}messages m LEFT JOIN {$TABLE_PREFIX}users u on u.id=m.sender WHERE receiver={$uid} AND m.id={$id}", true);
            } elseif ($what == "outbox") {
                $res = do_sqlquery("select m.*, IF(m.receiver=0,'System',u.username) as sendername FROM {$TABLE_PREFIX}messages m LEFT JOIN {$TABLE_PREFIX}users u on u.id=m.receiver WHERE sender={$uid} AND m.id={$id}", true);
            }
            if (mysql_num_rows($res) == "0") {
                err_msg($language["ERROR"], $language["BAD_ID"]);
                stdfoot();
                exit;
            } else {
                $result = mysql_fetch_array($res);
                $pmreadtpl = array();
                $pmreadtpl["sender_link"] = "index.php?page=userdetails&amp;id=" . $result["sender"] . "";
                $pmreadtpl["sender_name"] = unesc($result["sendername"]);
                $pmreadtpl["added"] = get_date_time($result["added"]);
                $pmreadtpl["elapsed"] = get_elapsed_time($result["added"]);
                $pmreadtpl["comment"] = format_comment(unesc($result["subject"]));
                $pmreadtpl["body"] = format_comment(unesc($result["msg"]));
                if ($what == "inbox") {
                    $usercptpl->set("MSG_MENU", true, true);
                    $pmreadtpl["quote_link"] = "location.href='index.php?page=usercp&amp;do=pm&amp;action=edit&amp;what=quote&amp;uid=" . $uid . "&amp;id=" . $id . "'";
                    $pmreadtpl["answer_link"] = "location.href='index.php?page=usercp&amp;do=pm&amp;action=edit&amp;uid=" . $uid . "&amp;id=" . $id . "'";
                    $pmreadtpl["delete_link"] = "location.href='index.php?page=usercp&amp;do=pm&amp;action=delete&amp;uid=" . $uid . "&amp;id=" . $id . "'";
                    do_sqlquery("UPDATE {$TABLE_PREFIX}messages SET readed='yes' WHERE id={$id}", true);
                }
                $usercptpl->set("pmread", $pmreadtpl);
            }
        }
        break;
}
Example #8
0
//echo $pagertop;
if (mysql_num_rows($res) == 0) {
    $votesviewtpl->set("vv2", "<p align=center><b>Nothing Found</b></p>\n");
} else {
    $votesviewtpl->set("vv3", "<center><table width=99% class=lista align=center cellpadding=3>\n");
    $votesviewtpl->set("vv4", "<tr><td class=header>Username</td><td class=header>Uploaded</td><td class=header>Downloaded</td>" . "<td class=header>Ratio</td>\n");
    while ($arr = mysql_fetch_assoc($res)) {
        if ($arr["downloaded"] > 0) {
            $ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
            //$ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
        } else {
            if ($arr["uploaded"] > 0) {
                $ratio = "Inf.";
            } else {
                $ratio = "---";
            }
        }
        $uploaded = makesize($arr["uploaded"]);
        $joindate = "{$arr['added']} (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["added"])) . " ago)";
        $downloaded = makesize($arr["downloaded"]);
        if ($arr["enabled"] == 'no') {
            $enabled = "<font color = red>No</font>";
        } else {
            $enabled = "<font color = green>Yes</font>";
        }
        $req[$i]["vv5"] = "<tr><td class=lista><center><a href=index.php?page=userdetails&id={$arr['userid']}><b>{$arr['username']}</b></a></td><td align=left class=lista><center>{$uploaded}</td><td align=left class=lista><center>{$downloaded}</td><td align=left class=lista><center>{$ratio}</td></tr>\n";
        $i++;
    }
    $votesviewtpl->set("req", $req);
    $votesviewtpl->set("vv6", "</table></center><BR><BR>\n");
}
Example #9
0
$template->set_filenames(array('tail' => 'footer.tpl'));
trigger_notify('loc_begin_page_tail');
$template->assign(array('VERSION' => $conf['show_version'] ? PHPWG_VERSION : '', 'PHPWG_URL' => defined('PHPWG_URL') ? PHPWG_URL : ''));
//--------------------------------------------------------------------- contact
if (!is_a_guest()) {
    $template->assign('CONTACT_MAIL', get_webmaster_mail_address());
}
//------------------------------------------------------------- generation time
$debug_vars = array();
if ($conf['show_queries']) {
    $debug_vars = array_merge($debug_vars, array('QUERIES_LIST' => $debug));
}
if ($conf['show_gt']) {
    if (!isset($page['count_queries'])) {
        $page['count_queries'] = 0;
        $page['queries_time'] = 0;
    }
    $time = get_elapsed_time($t2, get_moment());
    $debug_vars = array_merge($debug_vars, array('TIME' => $time, 'NB_QUERIES' => $page['count_queries'], 'SQL_TIME' => number_format($page['queries_time'], 3, '.', ' ') . ' s'));
}
$template->assign('debug', $debug_vars);
//------------------------------------------------------------- mobile version
if (!empty($conf['mobile_theme']) && (get_device() != 'desktop' || mobile_theme())) {
    $template->assign('TOGGLE_MOBILE_THEME_URL', add_url_params(htmlspecialchars($_SERVER['REQUEST_URI']), array('mobile' => mobile_theme() ? 'false' : 'true')));
}
trigger_notify('loc_end_page_tail');
//
// Generate the page
//
$template->parse('tail');
$template->p();
Example #10
0
</a><?php 
                                                                            } else {
                                                                                ?>
<b>unknown[<?php 
                                                                                echo $posterid;
                                                                                ?>
]</b><?php 
                                                                            }
                                                                            ?>
</td><?php 
                                                                            ?>
<td  nowrap="nowrap"><?php 
                                                                            echo $getdaily['added'];
                                                                            ?>
<br /><?php 
                                                                            echo get_elapsed_time(strtotime($getdaily['added']));
                                                                            ?>
</td><?php 
                                                                            ?>
</tr><?php 
                                                                        }
                                                                        mysql_free_result($res);
                                                                        end_table();
                                                                        echo "<p>{$pagerbottom}</p>";
                                                                        end_main_frame();
                                                                        stdfoot();
                                                                    } else {
                                                                        if ($action == "search") {
                                                                            $maxresults = 50;
                                                                            $cats = genreforumlist();
                                                                            stdhead("Forum Search");
Example #11
0
         print "<td align=\"left\" class=\"rowfollow\">" . $lang_userdetails['text_until'] . $warneduntil;
         print "<br />(" . mkprettytime(strtotime($warneduntil) - strtotime(date("Y-m-d H:i:s"))) . $lang_userdetails['text_to_go'] . ")</td>\n";
     }
     print "</tr>";
 } else {
     print "<td align=\"left\" class=\"rowfollow\">" . $lang_userdetails['text_warn_for'] . "<select name=\"warnlength\">\n";
     print "<option value=\"0\">------</option>\n";
     print "<option value=\"1\">1 " . $lang_userdetails['text_week'] . "</option>\n";
     print "<option value=\"2\">2 " . $lang_userdetails['text_weeks'] . "</option>\n";
     print "<option value=\"4\">4 " . $lang_userdetails['text_weeks'] . "</option>\n";
     print "<option value=\"8\">8 " . $lang_userdetails['text_weeks'] . "</option>\n";
     print "<option value=\"255\">" . $lang_userdetails['text_unlimited'] . "</option>\n";
     print "</select></td></tr>\n";
     print "<tr><td align=\"left\" class=\"rowfollow\">" . $lang_userdetails['text_reason_of_warning'] . "</td><td align=\"left\" class=\"rowfollow\"><input type=\"text\" size=\"60\" name=\"warnpm\" /></td></tr>";
 }
 $elapsedlw = get_elapsed_time(strtotime($user["lastwarned"]));
 print "<tr><td align=\"left\" class=\"rowfollow\">" . $lang_userdetails['text_times_warned'] . "</td><td align=\"left\" class=\"rowfollow\">" . $user[timeswarned] . "</td></tr>\n";
 if ($user["timeswarned"] == 0) {
     print "<tr><td align=\"left\" class=\"rowfollow\">" . $lang_userdetails['text_last_warning'] . "</td><td align=\"left\" class=\"rowfollow\">" . $lang_userdetails['text_not_warned_note'] . "</td></tr>\n";
 } else {
     if ($user["warnedby"] != "System") {
         $res = sql_query("SELECT id, username, warnedby FROM users WHERE id = " . $user['warnedby'] . "") or sqlerr(__FILE__, __LINE__);
         $arr = mysql_fetch_assoc($res);
         $warnedby = "<br />[" . $lang_userdetails['text_by'] . "<u>" . get_username($arr['id']) . "</u></a>]";
     } else {
         $warnedby = "<br />[" . $lang_userdetails['text_by_system'] . "]";
         print "<tr><td class=\"rowfollow\">" . $lang_userdetails['text_last_warning'] . "</td><td align=\"left\" class=\"rowfollow\"> {$user['lastwarned']} .(" . $lang_userdetails['text_until'] . "{$elapsedlw})   {$warnedby}</td></tr>\n";
     }
     print "<tr><td class=\"rowfollow\">" . $lang_userdetails['text_last_warning'] . "</td><td align=\"left\" class=\"rowfollow\"> {$user['lastwarned']} ({$elapsedlw}" . $lang_userdetails['text_ago'] . ")   " . $warnedby . "</td></tr>\n";
 }
 $leechwarn = $user["leechwarn"] == "yes";
Example #12
0
 print "<a name='top' />\n";
 //------ Print table
 begin_frame();
 $pc = $res->num_rows;
 $pn = 0;
 $r = $db->query("SELECT lastpostread FROM readposts WHERE userid = " . user::$current["uid"] . " AND topicid = " . $topicid) or sqlerr(__FILE__, __LINE__);
 $a = $r->fetch_row();
 $lpr = (int) $a[0];
 if (!$lpr) {
     $db->query("INSERT INTO readposts (userid, topicid) VALUES(" . $userid . ", " . $topicid . ")") or sqlerr(__FILE__, __LINE__);
 }
 while ($arr = $res->fetch_assoc()) {
     ++$pn;
     $postid = (int) $arr["id"];
     $posterid = (int) $arr["userid"];
     $added = get_date_time($arr["added"]) . "<br />(" . get_elapsed_time($arr["added"]) . " ago)";
     //---- Get poster details
     $arr2 = MCached::get('forum::poster::details::' . $posterid);
     if ($arr2 === MCached::NO_RESULT) {
         $res2 = $db->query("SELECT username, level, avatar, uploaded, downloaded, name, flagpic FROM users INNER JOIN users_level ON users.id_level = users_level.id LEFT JOIN countries ON users.flag = countries.id WHERE users.id = " . $posterid) or sqlerr(__FILE__, __LINE__);
         $arr2 = $res2->fetch_assoc();
         MCached::add('forum::poster::details::' . $posterid, $arr2, 1800);
     }
     $postername = security::html_safe($arr2["username"]);
     if ($postername == "") {
         $by = "Guest";
         $avatar = "";
     } else {
         $avatar = $arr2["avatar"] && $arr2["avatar"] != "" ? security::html_safe($arr2["avatar"]) : "";
         $title = security::html_safe($arr2["level"]);
         $flag = security::html_safe($arr2['name']);
Example #13
0
 /**
  * Same as flush() but with optional debugging.
  * @see Template::flush()
  */
 function p()
 {
     $this->flush();
     if ($this->smarty->debugging) {
         global $t2;
         $this->smarty->assign(array('AAAA_DEBUG_TOTAL_TIME__' => get_elapsed_time($t2, get_moment())));
         Smarty_Internal_Debug::display_debug($this->smarty);
     }
 }
Example #14
0
echo '<pre>';
for ($upgrade_id = 140; $upgrade_id <= 144; $upgrade_id++) {
    if (!file_exists(UPGRADES_PATH . '/' . $upgrade_id . '-database.php')) {
        continue;
    }
    // maybe the upgrade task has already been applied in a previous and
    // incomplete upgrade
    if (in_array($upgrade_id, $applied)) {
        continue;
    }
    unset($upgrade_description);
    echo "\n\n";
    echo '=== upgrade ' . $upgrade_id . "\n";
    // include & execute upgrade script. Each upgrade script must contain
    // $upgrade_description variable which describe briefly what the upgrade
    // script does.
    $up_start = get_moment();
    include UPGRADES_PATH . '/' . $upgrade_id . '-database.php';
    // notify upgrade (TODO change on each release)
    $query = '
INSERT INTO `' . PREFIX_TABLE . 'upgrade`
  (id, applied, description)
  VALUES
  (\'' . $upgrade_id . '\', NOW(), \'[migration from 2.6.0 to ' . PHPWG_VERSION . ', ' . get_elapsed_time($up_start, get_moment()) . '] ' . $upgrade_description . '\')
;';
    pwg_query($query);
}
echo '</pre>';
ob_end_clean();
// now we upgrade from 2.7.0
// include_once(PHPWG_ROOT_PATH.'install/upgrade_2.7.0.php');
Example #15
0
 $uid = mysqli_result($result, $i, "uid");
 $res2 = do_sqlquery("SELECT username,id_level from {$TABLE_PREFIX}users WHERE id={$uid}");
 $result2 = mysqli_fetch_array($res2);
 $reputt = do_sqlquery("SELECT * FROM {$TABLE_PREFIX}users_level WHERE id_level =" . $result2['id_level']);
 $setrept = mysqli_fetch_array($reputt);
 $name = stripslashes($setrept[prefixcolor]) . $result2[username] . stripslashes($setrept[suffixcolor]);
 $date = mysqli_result($result, $i, "date");
 $hash_info = mysqli_result($result, $i, "info_hash");
 $res3 = do_sqlquery("SELECT filename,external from {$TABLE_PREFIX}files WHERE info_hash='" . $hash_info . "'");
 $result3 = mysqli_fetch_array($res3);
 $fname = $result3["filename"];
 if ($result3["external"] == 'yes') {
     $fname = "{$fname} <font color =red>(EXT)</font>";
 }
 $damn = sql_timestamp_to_unix_timestamp($date);
 $pretty1 = get_elapsed_time($damn);
 $pos = strpos($pretty1, ",");
 $pretty = substr($pretty1, 0, $pos);
 $pretty = $pretty1;
 $weeks = "week";
 $rep = "w";
 if (strpos($pretty, "week") == true) {
     $prettynew = str_replace($weeks, $rep, $pretty);
 }
 if (strpos($pretty, "day") == true) {
     $prettynew = str_replace("day", "d", $pretty);
 }
 if (strpos($pretty, "hour") == true) {
     $prettynew = str_replace("hour", "h", $pretty);
 }
 if (strpos($pretty, "min") == true) {
</form>

</div></td></tr></table>
<br>
NOTE: No HTML Code Allowed. (NO HTML)
<?
}
if ($_GET['action'] == ""){
stdhead("Unconnectable Peers Mass PM Log");
$getlog = mysql_query("SELECT * FROM `notconnectablepmlog` LIMIT 10");
print("<h1>Unconnectable Peers Mass PM Log</h1>");
print("<a href=findnotconnectable.php?action=sendpm><h3>Send All not connectable Users A PM</h3></a>");
print("<a href=findnotconnectable.php?action=list><h3>List Unconnectable Users</h3></a>");
print("<br>Please dont use the mass PM too often. we dont want to spam the users, just let them know they are unconnectable.<p>");
print("<br>Every week would be ok.<p>");
print("<table border=1 cellspacing=0 cellpadding=5>\n");
print("<tr><td class=colhead>By User</td><td class=colhead>Date</td><td class=colhead>elapsed</td></tr>");
while($arr2 = mysql_fetch_assoc($getlog)){
$r2 = mysql_query("SELECT username FROM users WHERE id=$arr2[user]") or sqlerr();
$a2 = mysql_fetch_assoc($r2);
$elapsed = get_elapsed_time(sql_timestamp_to_unix_timestamp($arr2[date]));
print("<tr><td class=colhead><a href=userdetails.php?id=$arr2[user]>$a2[username]</a></td><td class=colhead>$arr2[date]</td><td>$elapsed ago</td></tr>");
}
print("</table>");

}

stdfoot();

?>
Example #17
0
		}
		if ($arr["userid"]) {
			$username = get_username($arr["userid"],false,true,true,true,false,false,"",true);
			$arr2 = get_user_row($arr["userid"]);
			if ($_GET["type"] != 'helpbox' && $arr["type"] == 'hb')
				$username .= $lang_shoutbox['text_to_guest'];
			}
		else{
			$school = strpos($arr["ip"],':')?school_ip_location($arr["ip"],false):'';
			$userip = str_replace(':','',$arr['ip']);
			$guestid = substr($userip,strlen($userip) - 8);
			$username = "******".$school."'>游客".$guestid."</b>";
			$arr2["username"] = "******".$guestid;
		}
		if ($CURUSER['timetype'] != 'timealive')
			$time = strftime("%m.%d %H:%M",$arr["date"]);
		else $time = get_elapsed_time($arr["date"]).$lang_shoutbox['text_ago'];
		$messtext = $arr["text"];
		
		$messtext = str_replace("[@".$CURUSER['username']."]","[color=Red][b]@".$CURUSER['username']."[/b][/color]",$messtext);  //将回复给自己的名字染红
		print("<tr><td class=\"shoutrow\"><span class='date'>[".$time."]</span> ".
$del ." <span onclick=\"retuser('".$arr2["username"]."');\" style=\"cursor:pointer;\">[@]</span> ". $username." " . format_comment($messtext,1,true,true,600,true,false)."
</td></tr>\n");
		$i++;
	}
	print("</table>");
}
?>
</body>
</html>
Example #18
0
print "<h1>Previous polls</h1>";
function srt($a, $b)
{
    if ($a[0] > $b[0]) {
        return -1;
    }
    if ($a[0] < $b[0]) {
        return 1;
    }
    return 0;
}
while ($poll = mysql_fetch_assoc($polls)) {
    $o = array($poll["option0"], $poll["option1"], $poll["option2"], $poll["option3"], $poll["option4"], $poll["option5"], $poll["option6"], $poll["option7"], $poll["option8"], $poll["option9"], $poll["option10"], $poll["option11"], $poll["option12"], $poll["option13"], $poll["option14"], $poll["option15"], $poll["option16"], $poll["option17"], $poll["option18"], $poll["option19"]);
    print "<p><table width=750 border=1 cellspacing=0 cellpadding=10><tr><td align=center>\n";
    print "<p class=sub>";
    $added = gmdate("Y-m-d", strtotime($poll['added'])) . " GMT (" . get_elapsed_time(sql_timestamp_to_unix_timestamp($poll["added"])) . " ago)";
    print "{$added}";
    if (get_user_class() >= UC_ADMINISTRATOR) {
        print " - [<a href=makepoll.php?action=edit&pollid={$poll['id']}><b>Edit</b></a>]\n";
        print " - [<a href=?action=delete&pollid={$poll['id']}><b>Delete</b></a>]\n";
    }
    print "<a name={$poll['id']}>";
    print "</p>\n";
    print "<table class=main border=1 cellspacing=0 cellpadding=5><tr><td class=text>\n";
    print "<p align=center><b>" . $poll["question"] . "</b></p>";
    $pollanswers = mysql_query("SELECT selection FROM pollanswers WHERE pollid=" . $poll["id"] . " AND  selection < 20") or sqlerr();
    $tvotes = mysql_num_rows($pollanswers);
    $vs = array();
    // count for each option ([0]..[19])
    $os = array();
    // votes and options: array(array(123, "Option 1"), array(45, "Option 2"))
Example #19
0
/**
 */
function print_time($message)
{
    global $last_time;
    $new_time = get_moment();
    echo '<pre>[' . get_elapsed_time($last_time, $new_time) . ']';
    echo ' ' . $message;
    echo '</pre>';
    flush();
    $last_time = $new_time;
}
Example #20
0
                    foreach (explode(',', $data[$key]) as $tag_name) {
                        $tags_of[$id][] = tag_id_from_tag_name($tag_name);
                    }
                }
            }
        } else {
            $errors[] = array('path' => $element_infos['path'], 'type' => 'PWG-ERROR-NO-FS');
        }
    }
    if (!$simulate) {
        if (count($datas) > 0) {
            mass_updates(IMAGES_TABLE, array('primary' => array('id'), 'update' => array_unique(array_merge(array_diff($site_reader->get_metadata_attributes(), array('keywords', 'tags')), array('date_metadata_update')))), $datas, isset($_POST['meta_empty_overrides']) ? 0 : MASS_UPDATES_SKIP_EMPTY);
        }
        set_tags_of($tags_of);
    }
    $template->append('footer_elements', '<!-- metadata update : ' . get_elapsed_time($start, get_moment()) . ' -->');
    $template->assign('metadata_result', array('NB_ELEMENTS_DONE' => count($datas), 'NB_ELEMENTS_CANDIDATES' => count($files), 'NB_ERRORS' => count($errors)));
}
// +-----------------------------------------------------------------------+
// |                        template initialization                        |
// +-----------------------------------------------------------------------+
$template->set_filenames(array('update' => 'site_update.tpl'));
$result_title = '';
if (isset($simulate) and $simulate) {
    $result_title .= '[' . l10n('Simulation') . '] ';
}
// used_metadata string is displayed to inform admin which metadata will be
// used from files for synchronization
$used_metadata = implode(', ', $site_reader->get_metadata_attributes());
if ($site_is_remote and !isset($_POST['submit'])) {
    $used_metadata .= ' + ...';
Example #21
0
	<td class="colhead"><nobr>Last access</td>
	<td class="colhead"><nobr>Class</td>
	<td class="colhead">Downloaded</td>
	<td class="colhead">UpLoaded</td>
	<td class="colhead">Ratio</td>
	<td class="colhead">Status</td>
	<td class="colhead"><nobr>Enabled</td>
	</tr><?php 
    while ($arr = mysql_fetch_assoc($res)) {
        if ($arr["downloaded"] > 0) {
            $ratio = "<font color=" . get_ratio_color(number_format($arr["uploaded"] / $arr["downloaded"], 3)) . ">{$ratio}</font>";
        } elseif ($arr["uploaded"] > 0) {
            $ratio = 'Inf.';
        } else {
            $ratio = "---";
        }
        $uploaded = prefixed($arr["uploaded"]);
        $downloaded = prefixed($arr["downloaded"]);
        $added = $arr['added'] != '0000-00-00 00:00:00' ? substr($arr['added'], 0, 10) : '-';
        $last_access = $arr['last_access'] != '0000-00-00 00:00:00' ? substr($arr['last_access'], 0, 10) : '-';
        $class = get_user_class_name($arr["class"]);
        echo "<tr align='center'><td><input type=\"checkbox\" name=\"ids[]\" value=\"{$arr['id']}\"></td><td><a href=/userdetails.php?id={$arr['id']}><b>{$arr['username']}</b></a>" . ($arr["donor"] == "yes" ? "<img src=pic/star.gif border=0 alt='Donor'>" : "") . ($arr["warned"] == "yes" ? "<img src=pic/warned.gif border=0 alt='Warned'>" : "") . "</td>\n\t\t<td><nobr>{$added}<br />(<font class='small'>" . get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["added"])) . " ago</font>)</td>\n\t\t<td><nobr>{$last_access}<br />(<font class='small'>" . get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["last_access"])) . " ago</font>)</td>\n\t\t<td>{$class}</td>\n\t\t<td>{$downloaded}</td>\n\t\t<td>{$uploaded}</td>\n\t\t<td>{$ratio}</td>\n\t\t<td>" . $arr['status'] . "</td>\n\t\t<td>" . $arr['enabled'] . "</td>\n\t\t</tr>\n";
    }
    echo "<tr><td colspan=10 align='center'><select name='do'><option value='enabled' disabled selected>What to do?</option><option value='enabled'>Enable selected</option><option value='confirm'>Confirm selected</option><option value='delete'>Delete selected</option></select><input type='submit' value='Submit'></td></tr></form>";
    end_table();
    echo $pagerbottom;
} else {
    stdmsg('Sorry', 'Nothing found!');
}
end_main_frame();
stdfoot();
Example #22
0
print("<table width=750 border=1 cellspacing=0 cellpadding=5><tr class=tablea><td>");

$i = 0;

$friendadd = mysql_query("SELECT f.userid AS fuid, u.username AS name, u.id AS uid, u.class, u.avatar, u.title, u.donor, u.warned, u.enabled, u.last_access FROM friends AS f LEFT JOIN users AS u ON f.userid = u.id WHERE friendid = $CURUSER[id] ORDER BY name") or sqlerr(__FILE__, __LINE__);
if(mysql_num_rows($friendadd) == 0)
	$friendsno = "<em>Engir vinir enn þá</em>";
else
	while ($friend = mysql_fetch_array($friendadd))
	{
    $title = $friend["title"];
		if (!$title)
	    $title = get_user_class_name($friend["class"]);
    $body1 = "<a href=userdetails.php?id=" . $friend['fuid'] . "><b>" . $friend['name'] . "</b></a>" .
    	get_user_icons($friend) . " ($title)<br><br>Sást síðast " . $friend['last_access'] .
    	"<br>(" . get_elapsed_time(sql_timestamp_to_unix_timestamp($friend[last_access])) . " síðan)";
		$body2 = "<br><a href=sendmessage.php?receiver=" . $friend['fuid'] . ">Senda einkaskilaboð</a>";
    $avatar = ($CURUSER["avatars"] == "yes" ? htmlspecialchars($friend["avatar"]) : "");
		if (!$avatar)
			$avatar = "/pic/default_avatar.gif";
    if ($i % 2 == 0)
    	print("<table width=100% style='padding: 0px'><tr><td class=bottom style='padding: 5px' width=50% align=center>");
    else
    	print("<td class=bottom style='padding: 5px' width=50% align=center class=tablea>");
    print("<table class=main width=100% height=75px class=tablea>");
    print("<tr valign=top class=tableb><td width=75 align=center style='padding: 0px'>" .
			($avatar ? "<div style='width:75px;height:75px;overflow: hidden'><img width=75px src=\"$avatar\"></div>" : ""). "</td><td>\n");
    print("<table class=main>");
    print("<tr bgcolor=#BECDD8><td class=embedded style='padding: 5px' width=80%>$body1</td>\n");
    print("<td class=embedded style='padding: 5px' width=20%>$body2</td></tr>\n");
    print("</table>");
Example #23
0
				</td>
                <td>
					<a href="/userdetails.php?id=<?php 
                echo (int) $arr['added_by'];
                ?>
"><?php 
                echo $arr['username'];
                ?>
</a>
                </td>
                <td nowrap="nowrap">
                	<?php 
                echo function_exists('display_date_time') ? display_date_time(get_date_time($arr['added'])) : get_date_time($arr['added']);
                ?>
<br /><font class="small"><?php 
                echo get_elapsed_time($arr['added']);
                ?>
 ago</font>
                </td>
                <?php 
                if ($staff_classes[$CURUSER['class']]['edit'] || $staff_classes[$CURUSER['class']]['delete']) {
                    ?>
					<td nowrap="nowrap">
                    	<?php 
                    if ($staff_classes[$CURUSER['class']]['edit']) {
                        ?>
<b>[</b><a href="<?php 
                        echo $_SERVER['PHP_SELF'];
                        ?>
?action=edit&amp;id=<?php 
                        echo (int) $arr['id'];
Example #24
0
    $comments = array();
    $count = 0;
    foreach ($subres as $subrow) {
        $level = get_result("SELECT level FROM {$TABLE_PREFIX}users_level WHERE id_level='{$subrow['id_level']}'", true, $btit_settings['cache_duration']);
        $lvl = $level[0];
        if (!$subrow[uid]) {
            $title = "orphaned";
        } elseif (!"{$subrow['custom_title']}") {
            $title = "" . $lvl['level'] . "";
        } else {
            $title = unesc($subrow["custom_title"]);
        }
        $comments[$count]["user"] = "******"index.php?page=userdetails&amp;id=" . $subrow["uid"] . "\">" . unesc($subrow["user"]) . warn($row) . "</a>";
        $comments[$count]["user"] .= "</a><br/> " . $title;
        $comments[$count]["date"] = date("d/m/Y H.i.s", $subrow["data"] - $offset);
        $comments[$count]["elapsed"] = "(" . get_elapsed_time($subrow["data"]) . " ago)";
        $comments[$count]["avatar"] = "<img onload=\"resize_avatar(this);\" src=\"" . ($subrow["avatar"] && $subrow["avatar"] != "" ? htmlspecialchars($subrow["avatar"]) : "{$STYLEURL}/images/default_avatar.gif") . "\" alt=\"\" />";
        $comments[$count]["ratio"] = "<img src=\"images/arany.png\">&nbsp;" . (intval($subrow['downloaded']) > 0 ? number_format($subrow['uploaded'] / $subrow['downloaded'], 2) : "---");
        $comments[$count]["uploaded"] = "<img src=\"images/speed_up.png\">&nbsp;" . makesize($subrow["uploaded"]);
        $comments[$count]["downloaded"] = "<img src=\"images/speed_down.png\">&nbsp;" . makesize($subrow["downloaded"]);
        // only users able to delete torrents can delete comments...
        if ($CURUSER["delete_torrents"] == "yes") {
            $comments[$count]["delete"] = "<a onclick=\"return confirm('" . str_replace("'", "\\'", $language["DELETE_CONFIRM"]) . "')\" href=\"index.php?page=comment&amp;id=" . $row["info_hash"] . "&amp;cid=" . $subrow["id"] . "&amp;action=delete\">" . image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]) . "</a>";
        }
        $comments[$count]["comment"] = format_comment($subrow["text"]);
        $count++;
    }
    unset($subrow);
    unset($subres);
}
$torrenttpl->set("current_username", $CURUSER["username"]);
Example #25
0
print "<h2 align=left><a name=\"friends\">" . $user['username'] . " has " . $fcount . " Friend " . ($fcount > 1 ? "s" : "") . "</a></h2>\n";
print "<table width=737 border=1 cellspacing=0 cellpadding=5><tr><td>";
$i = 0;
$res = mysql_query("SELECT f.friendid as id, u.username AS name, u.class, u.avatar, u.title, u.donor, u.warned, u.enabled, u.last_access FROM friends AS f LEFT JOIN users as u ON f.friendid = u.id WHERE userid={$userid} AND f.confirmed='yes' ORDER BY name") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) == 0) {
    $friends = "<em>" . $user['username'] . " has no friends.</em>";
} else {
    while ($friend = mysql_fetch_array($res)) {
        $pm_pic = "<img src=" . $pic_base_url . "button_pm.gif alt='Send PM' border=0>";
        $dt = gmtime() - 180;
        $online = $friend["last_access"] >= '' . get_date_time($dt) . '' ? '&nbsp;<img src=' . $pic_base_url . 'user_online.gif border=0 alt=Online>' : '<img src=' . $pic_base_url . 'user_offline.gif border=0 alt=Offline>';
        $title = htmlspecialchars($friend["title"]);
        if (!$title) {
            $title = get_user_class_name($friend["class"]);
        }
        $body1 = "<a href=userdetails.php?id=" . $friend['id'] . "><b>" . $friend['name'] . "</b></a>" . get_user_icons($friend) . " ({$title}) {$online}<br /><br />last seen on " . $friend['last_access'] . "<br />(" . get_elapsed_time(sql_timestamp_to_unix_timestamp($friend['last_access'])) . " ago)";
        $body2 = $id == $CURUSER['id'] ? "" : "<br /><a href=friends.php?id={$CURUSER['id']}&action=add&type=friend&targetid=" . $friend['id'] . ">Add Friend</a>" . "<br /><br /><a href=sendmessage.php?receiver=" . $friend['id'] . ">" . $pm_pic . "</a>";
        $avatar = $CURUSER["avatars"] == "yes" ? htmlspecialchars($friend["avatar"]) : "";
        // if (!$avatar)
        // $avatar = "".$pic_base_url."default_avatar.gif";
        if ($i % 2 == 0) {
            print "<table width=737 style='padding: 0px'><tr><td class=bottom style='padding: 5px' width=50% align=center>";
        } else {
            print "<td class=bottom style='padding: 5px' width=50% align=center>";
        }
        print "<table class=main width=737 height=75px>";
        print "<tr valign=top><td width=75 align=center style='padding: 0px'>" . ($avatar ? "<div style='width:75px;height:75px;overflow: hidden'><img width=75px src=\"{$avatar}\"></div>" : "") . "</td><td>\n";
        print "<table class=main>";
        print "<tr><td class=embedded style='padding: 5px' width=737>{$body1}</td>\n";
        print "<td class=embedded style='padding: 5px' width=20%>{$body2}</td></tr>\n";
        print "</table>";
function latestforumposts()
{
    global $pic_base_url, $CURUSER, $config, $php_file, $page_find, $lang_off, $language;
    // / FIRST WE MAKE THE HEADER (NON-LOOPED) ///
    ?>
<table align="center" width="760" cellspacing=0 cellpadding=8><tr><td align="left" class=colhead><b><?php 
    echo $language['topic'];
    ?>
</b></td><!--<td align="center" class=colhead><b>Author</b></td><td align="center" class=colhead><b>Replies</b></td>--><td align="center" class=colhead><b><?php 
    echo $language['view'];
    ?>
</b></td><td align="center" class=colhead><b><?php 
    echo $language['post'];
    ?>
</b></td><!--<td align="center" class=colhead><b>Posted At</b></td>-->
</tr>
<?php 
    $page = 1;
    $num = 0;
    // / HERE GOES THE QUERY TO RETRIEVE DATA FROM THE DATABASE AND WE START LOOPING ///
    $topicres = sql_query("SELECT t.id, t.userid, t.subject, t.locked, t.forumid, t.pollid, t.lastpost, t.sticky, t.views, t.forumid, f.minclassread, f.name " . ", (SELECT COUNT(id) FROM posts WHERE topicid=t.id) AS p_count " . ", p.userid AS puserid, p.added " . ", u.id AS uid, u.username " . ", u2.username AS u2_username " . "FROM topics AS t " . "LEFT JOIN forums AS f ON f.id = t.forumid " . "LEFT JOIN posts AS p ON p.id=(SELECT MAX(id) FROM posts WHERE topicid = t.id) " . "LEFT JOIN users AS u ON u.id=p.userid " . "LEFT JOIN users AS u2 ON u2.id=t.userid " . "WHERE t.locked = 'no' AND f.minclassread <= " . $CURUSER['class'] . " " . "ORDER BY t.lastpost DESC LIMIT 11") or sqlerr(__FILE__, __LINE__);
    while ($topicarr = mysql_fetch_assoc($topicres)) {
        $topicid = $topicarr["id"];
        $topic_userid = $topicarr["userid"];
        $perpage = $CURUSER["postsperpage"];
        if (!$perpage) {
            $perpage = 24;
        }
        $posts = $topicarr["p_count"];
        $replies = max(0, $posts - 1);
        $first = $page * $perpage - $perpage + 1;
        $last = $first + $perpage - 1;
        if ($last > $num) {
            $last = $num;
        }
        $pages = ceil($posts / $perpage);
        // $menu = "\n";
        $menu = "";
        for ($i = 1; $i <= $pages; $i++) {
            if ($i == 1 && $i != $pages) {
                $menu .= "[ ";
            }
            if ($pages > 1) {
                $menu .= "<a href=/forums.php?action=viewtopic&amp;topicid={$topicid}&amp;page={$i}>{$i}</a>\n";
            }
            if ($i < $pages) {
                $menu .= "|\n";
            }
            if ($i == $pages && $i > 1) {
                $menu .= "]";
            }
        }
        $added = $topicarr["added"] . '<br /><font class=small>(' . get_elapsed_time(sql_timestamp_to_unix_timestamp($topicarr["added"])) . ' ago)</font>';
        $username = is_valid_id($topicarr['uid']) ? "<a href=/userdetails.php?id=" . $topicarr["puserid"] . "><b>" . $topicarr['username'] . "</b></a>" : "<i>Unknown[{$topic_userid}]</i>";
        $author = !empty($topicarr['u2_username']) ? "<a href=/userdetails.php?id={$topic_userid}><b>" . $topicarr['u2_username'] . "</b></a>" : "<i>Unknown[{$topic_userid}]</i>";
        $staffimg = $topicarr["minclassread"] > 0 ? "<img src=" . $pic_base_url . "staff.png border=0 />" : "";
        $lockimg = $topicarr["locked"] == 'yes' ? "<img src=" . $pic_base_url . "lockednew.gif border=0 />" : "";
        $pollimg = is_valid_id($topicarr["pollid"]) ? "<img src=\"" . $pic_base_url . "poll.gif\" alt=\"Poll:\" width=\"12\" height=\"14\" />&nbsp;&nbsp;&nbsp;" : "";
        $stickyimg = $topicarr["sticky"] == 'yes' ? "<img src=\"" . $pic_base_url . "sticky.gif\" alt=\"Sticky:\" width=\"12px\" height=\"14px\" />&nbsp;&nbsp;&nbsp;" : "";
        $subject = $pollimg . $stickyimg . "<a href=\"forums.php?action=viewtopic&amp;topicid={$topicid}&amp;page=last#" . $topicarr["lastpost"] . "\"><b>" . encodehtml($topicarr["subject"]) . "</b></a>{$lockimg}&nbsp;&nbsp;&nbsp;{$staffimg}&nbsp;&nbsp;&nbsp;{$menu}<br /><font class=small> in <i><a href=\"/forums.php?action=viewforum&amp;forumid=" . $topicarr['forumid'] . "\">" . $topicarr['name'] . "</a></i> by " . $author . "&nbsp;&nbsp;" . get_elapsed_time(sql_timestamp_to_unix_timestamp($topicarr["added"])) . " ago </font>";
        ?>
<tr><td><?php 
        echo $subject;
        ?>
</td><td align="center"><?php 
        echo number_format($topicarr["views"]);
        ?>
</td><td align="center"><?php 
        echo $username;
        ?>
</td></tr><?php 
    }
    ?>
</table>
<?php 
}
Example #27
0
}
// End -->
</script>
<?php 
    print "<h2>" . safeChar($count) . " accounts inactive for longer than " . safeChar($days) . " days.</h2>";
    print "<form action=\"inactive.php\" method=\"post\">";
    print "<table class=main border=1 cellspacing=0 cellpadding=5><tr>\n";
    print "<td class=colhead>Username</td>";
    print "<td class=colhead>Class</td>";
    print "<td class=colhead>Mail</td>";
    print "<td class=colhead>Ratio</td>";
    print "<td class=colhead>Last Seen</td>";
    print "<td class=colhead align=\"center\">x</td>";
    while ($arr = mysql_fetch_assoc($res)) {
        $ratio = $arr["downloaded"] > 0 ? number_format($arr["uploaded"] / $arr["downloaded"], 3) : ($arr["uploaded"] > 0 ? "Inf." : "---");
        $last_seen = $arr["last_access"] == "0000-00-00 00:00:00" ? "never" : "" . get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["last_access"])) . "&nbsp;ago";
        $class = get_user_class_name($arr["class"]);
        print "<tr>";
        print "<td><a href=\"userdetails.php?id=" . $arr["id"] . "\">" . $arr["username"] . "</a></td>";
        print "<td>" . $class . "</td>";
        print "<td><a href=\"mailto:" . $arr["email"] . "\">" . safeChar($arr["email"]) . "</a></td>";
        print "<td>" . $ratio . "</td>";
        print "<td>" . $last_seen . "</td>";
        print "<td align=\"center\" bgcolor=\"#FF0000\"><input type=\"checkbox\" name=\"userid[]\" value=\"" . $arr["id"] . "\" /></td>";
        print "</tr>";
    }
    print "<tr><td colspan=\"6\" class=\"colhead\" align=\"center\">\n<select name=\"action\">\n<option value=\"mail\">Send mail</option>\n<option value=\"deluser\" " . ($CURUSER["class"] < UC_ADMINISTRATOR ? "disabled" : "") . ">Delete users</option>\n<option value=\"disable\">Disable Accounts</option>\n</select>&nbsp;&nbsp;<input type=\"submit\" name=\"submit\" value=\"Apply Changes\"/>&nbsp;&nbsp;<input type=\"button\" value=\"Check all\" onClick=\"this.value=check(form)\"></td></tr>";
    if ($record_mail) {
        $ress = sql_query("SELECT avps.value_s AS userid, avps.value_i AS last_mail, avps.value_u AS mails, users.username FROM avps LEFT JOIN users ON avps.value_s=users.id WHERE avps.arg='inactivemail' LIMIT 1");
        $date = mysql_fetch_assoc($ress);
        if ($date["last_mail"] > 0) {
Example #28
0
            } else {
                echo '<td align=center>---</td>';
            }
        }
    }
    echo '</table><br>';
    $select = sql_query("SELECT * FROM invite_codes WHERE sender = " . sqlesc($CURUSER['id']) . " AND status = 'Pending'") or sqlerr();
    $num_row = mysql_num_rows($select);
    print "<table border=1 width=750 cellspacing=0 cellpadding=5>" . "<tr class=tabletitle><td colspan=6 class=colhead><b>Created Invite Codes</b></td></tr>";
    if (!$num_row) {
        echo '<tr class=tableb><td colspan=6>You have not created invite codes at the moment!</tr>';
    } else {
        echo '<tr class=tableb><td><b>Invite Code</b></td><td><b>Created Date</b></td><td><b>Delete</b></td><td><b>Status</b></tr>';
        for ($i = 0; $i < $num_row; ++$i) {
            $fetch_assoc = mysql_fetch_assoc($select);
            echo '<tr class=tableb><td>' . $fetch_assoc['code'] . ' <a href="?do=send_email&id=' . (int) $fetch_assoc['id'] . '"><img src="pic/email.gif" border="0" / ></td><td>' . "" . get_elapsed_time(sql_timestamp_to_unix_timestamp($fetch_assoc['invite_added'])) . " ago" . '</td>';
            echo '<td><a href="?do=delete_invite&id=' . (int) $fetch_assoc['id'] . '"><img src=pic/del.png border=0 /></a></td><td>' . $fetch_assoc['status'] . '</td></tr>';
        }
    }
    echo '<tr class=tableb><td colspan=7 align=center><form action="?do=create_invite" method="post"><input type=submit value="Create Invite Code" style=height: 20px></form></td></tr>';
    echo '</table>';
    stdfoot();
} elseif ($do == 'create_invite') {
    if ($CURUSER['invites'] <= 0) {
        stderr('Error', 'No invites!');
    }
    if ($CURUSER["invite_on"] == 'no') {
        stderr("Denied", "Your invite sending privileges has been disabled by the Staff!");
    }
    $res = sql_query("SELECT COUNT(*) FROM users") or sqlerr(__FILE__, __LINE__);
    $arr = mysql_fetch_row($res);
Example #29
0
        $peers[$i]["PROGRESS"] = $stat . "%<br />" . $progress;
        $peers[$i]["STATUS"] = $row["status"];
        if (!$XBTT_USE) {
            $peers[$i]["CLIENT"] = htmlspecialchars(getagent(unesc($row["client"]), unesc($row["peer_id"])));
        }
        $dled = makesize($row["downloaded"]);
        $upld = makesize($row["uploaded"]);
        $peers[$i]["DOWNLOADED"] = $dled;
        $peers[$i]["UPLOADED"] = $upld;
        //Peer Ratio
        if (intval($row["downloaded"]) > 0) {
            $ratio = number_format($row["uploaded"] / $row["downloaded"], 2);
        } else {
            $ratio = '&#8734;';
        }
        $peers[$i]["RATIO"] = $ratio;
        //End Peer Ratio
        $peers[$i]["SEEN"] = get_elapsed_time($row["lastupdate"]) . " ago";
        $i++;
    }
}
if ($GLOBALS["usepopup"]) {
    $peerstpl->set("BACK2", "<br /><br /><center><a href=\"javascript:window.close()\"><tag:language.CLOSE /></a></center>");
} else {
    $peerstpl->set("BACK2", "<br /><br /><center><a href=\"javascript: history.go(-1);\"><tag:language.BACK /></a></center>");
}
$peerstpl->set("XBTT", $XBTT_USE, TRUE);
$peerstpl->set("XBTT2", $XBTT_USE, TRUE);
$peerstpl->set("XBTT3", $XBTT_USE, TRUE);
$peerstpl->set("XBTT4", $XBTT_USE, TRUE);
$peerstpl->set("peers", $peers);
Example #30
0
        }
        echo "</table>\n";
        echo "<p align=right><input type=submit value=Delete></p>";
        echo "</form>";
        echo $pagerbottom;
        echo "</td></tr></table>\n";
    }
    stdfoot();
}
// View application
if ($action == "viewapp") {
    $id = $_GET["id"];
    $res = sql_query("SELECT uploadapp.*, users.id AS uid, users.username, users.class, users.added, users.uploaded, users.downloaded FROM uploadapp INNER JOIN users on uploadapp.userid = users.id WHERE uploadapp.id={$id}") or sqlerr(__FILE__, __LINE__);
    $arr = mysql_fetch_assoc($res);
    $membertime = get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["added"]));
    $elapsed = get_elapsed_time(sql_timestamp_to_unix_timestamp($arr["applied"]));
    stdhead("Uploader applications");
    echo "<h1 align=center>Uploader application</h1>";
    echo "<table width=750 border=1 cellspacing=0 cellpadding=5>";
    echo "<tr><td class=rowhead width=25%>My username is</td><td><a href=userdetails.php?id={$arr['uid']}>{$arr['username']}</a></td></tr>";
    echo "<tr><td class=rowhead>I have joined at</td><td>{$arr['added']} ({$membertime} ago)</td></tr>";
    echo "<tr><td class=rowhead>My upload amount is</td><td>" . prefixed($arr["uploaded"]) . "</td></tr>";
    echo "<tr><td class=rowhead>My download amount is</td><td>" . prefixed($arr["downloaded"]) . "</td></tr>";
    echo "<tr><td class=rowhead>My ratio is </td><td>" . number_format($arr["uploaded"] / $arr["downloaded"], 3) . "</td></tr>";
    echo "<tr><td class=rowhead>I am connectable</td><td>{$arr['connectable']}</td></tr>";
    echo "<tr><td class=rowhead>My current userclass is</td><td>" . get_user_class_name($arr["class"]) . "</td></tr>";
    echo "<tr><td class=rowhead>I have applied at</td><td>{$arr['applied']} ({$elapsed} ago)</td></tr>";
    echo "<tr><td class=rowhead>My upload speed is</td><td>" . htmlspecialchars($arr["speed"]) . "</td></tr>";
    echo "<tr><td class=rowhead>What I have to offer</td><td>" . htmlspecialchars($arr["offer"]) . "</td></tr>";
    echo "<tr><td class=rowhead>Why I should be promoted</td><td>" . htmlspecialchars($arr["reason"]) . "</td></tr>";
    echo "<tr><td class=rowhead>I am uploader at other sites</td><td>{$arr['sites']}</td></tr>";