function reader_g($user_num, $day)
{
    $conect = connect_acc();
    $list = new linked_day();
    if ($result = $conect->query("SELECT * FROM `Event` WHERE `USER_#`='{$user_num}' AND `DAY`='{$day}' ORDER BY 'PRIORTY' ASC")) {
        if ($result->num_rows > 0) {
            while ($row = $result->fetch_assoc()) {
                $time_s = explode(' ', $row['TIME_BEGIN']);
                $time_e = explode(' ', $row['TIME_END']);
                $time_bs = $row['BUFF_BEGIN'];
                $time_be = $row['BUFF_END'];
                if (($buf_time_b = time_diff($time_bs, $time_s[1])) <= $time_s[1]) {
                    $list->add("free time", $buf_time_b, $time_s[1]);
                } else {
                    $list->add("free time", "00:00:00", $time_s[1]);
                }
                $list->add($row['EVENT_NAME'], $time_s[1], $time_e[1]);
                if (($buf_time_a = time_add($time_be, $time_e[1])) >= $time_e[1]) {
                    $list->add("free time", $time_e[1], $buf_time_a);
                } else {
                    $list->add("free time", $time_e[1], "23:59:59");
                }
            }
        }
    }
    disconnect($conect);
    return $list;
}
Example #2
0
/**
 * Generate a table row for a staff member on staff.php
 *
 * @param $Row used for alternating row colors
 * @param $ID the user ID of the staff member
 * @param $Paranoia the user's paranoia
 * @param $Class the user class
 * @param $LastAccess datetime the user last browsed the site
 * @param $Remark the "Staff remark" or FLS' "Support for" text
 * @param $HiddenBy the text that is displayed when a staff member's
 *                  paranoia hides their LastAccess time
 * @return string $Row
 */
function make_staff_row($Row, $ID, $Paranoia, $Class, $LastAccess, $Remark = '', $HiddenBy = 'Hidden by user')
{
    $Row = $Row === 'a' ? 'b' : 'a';
    echo "\t\t\t<tr class=\"row{$Row}\">\n\t\t\t\t<td class=\"nobr\">\n\t\t\t\t\t" . Users::format_username($ID, false, false, false) . "\n\t\t\t\t</td>\n\t\t\t\t<td class=\"nobr\">\n\t\t\t\t\t";
    //used for proper indentation of HTML
    if (check_paranoia('lastseen', $Paranoia, $Class)) {
        echo time_diff($LastAccess);
    } else {
        echo "{$HiddenBy}";
    }
    echo "\n\t\t\t\t</td>\n\t\t\t\t<td class=\"nobr\">" . Text::full_format($Remark) . "</td>\n\t\t\t</tr>\n";
    // the "\n" is needed for pretty HTML
    // the foreach loop that calls this function needs to know the new value of $Row
    return $Row;
}
Example #3
0
<div class="thin">
	<h2><?php 
echo $Subject;
?>
</h2>
	<div class="linkbox">
		<a href="inbox.php">[Back to inbox]</a>
	</div>
<? while(list($SentDate, $SenderID, $Body, $MessageID) = $DB->next_record()) { ?>
	<div class="box vertical_space">
		<div class="head">
			By <strong><?php 
echo $Users[$SenderID]['UserStr'];
?>
</strong> <?php 
echo time_diff($SentDate);
?>
 - <a href="#quickpost" onclick="Quote('<?php 
echo $MessageID;
?>
','<?php 
echo $Users[$SenderID]['Username'];
?>
');">[Quote]</a>	
		</div>
		<div class="body" id="message<?php 
echo $MessageID;
?>
"><?php 
echo $Text->full_format($Body);
?>
Example #4
0
    $DB->query("\n\t\tUPDATE users_info\n\t\tSET LastReadBlog = '" . $Blog[0][0] . "'\n\t\tWHERE UserID = " . $LoggedUser['ID']);
    $LoggedUser['LastReadBlog'] = $Blog[0][0];
}
foreach ($Blog as $BlogItem) {
    list($BlogID, $Author, $AuthorID, $Title, $Body, $BlogTime, $ThreadID) = $BlogItem;
    ?>
	<div id="blog<?php 
    echo $BlogID;
    ?>
" class="box blog_post">
		<div class="head">
			<strong><?php 
    echo $Title;
    ?>
</strong> - posted <?php 
    echo time_diff($BlogTime);
    ?>
 by <a href="user.php?id=<?php 
    echo $AuthorID;
    ?>
"><?php 
    echo $Author;
    ?>
</a>
<?php 
    if (check_perms('admin_manage_blog')) {
        ?>
			- <a href="blog.php?action=editblog&amp;id=<?php 
        echo $BlogID;
        ?>
" class="brackets">Edit</a>
Example #5
0
        ?>
</p>
                                                <p class="article-edit-nav"></p>
                                            </td>
                                            <?php 
        if ($category == 'ing_executives') {
            ?>
                                            <td><p><?php 
            display($members_item->position);
            ?>
</p></td>
                                            <?php 
        }
        ?>
                                            <td><p><?php 
        $time = time_diff($members_item->approved_date, TRUE);
        if ($time == 'just now') {
            display('Just now');
        } elseif (strpos($time, '1 day') !== FALSE) {
            display('Yesterday');
        } elseif (strpos($time, 'second') !== FALSE or strpos($time, 'minute') !== FALSE or strpos($time, 'hour') !== FALSE or strpos($time, 'day') !== FALSE) {
            display($time . ' ago');
        } else {
            display($members_item->approved_date);
        }
        ?>
</p></td>
                                            <td><p><?php 
        display($members_item->approved_by);
        ?>
</p></td>
Example #6
0
    die;
}
Text::$TOC = true;
$UserID = (int) $_GET['userid'];
$UserIDSQL = "";
if (!empty($UserID)) {
    $UserIDSQL = " AND UserID != '{$UserID}' ";
}
G::$DB->query("\n\t\tSELECT UserID, Answer, Date\n\t\tFROM staff_answers\n\t\tWHERE QuestionID = '{$ID}'\n\t\t\t{$UserIDSQL}\n\t\tORDER BY DATE DESC");
$Answers = G::$DB->to_array(false, MYSQLI_ASSOC);
foreach ($Answers as $Answer) {
    ?>
	<div class="box box2">
		<div class="head">
			<span>
				Answer by <?php 
    echo Users::format_username($Answer['UserID']);
    ?>
 - <?php 
    echo time_diff($Answer['Date']);
    ?>
			</span>
		</div>
		<div class="pad">
<?php 
    echo Text::full_format($Answer['Answer']);
    ?>
		</div>
	</div>
<?php 
}
Example #7
0
            echo $LastRead[$TopicID]['Page'];
            ?>
#post<?php 
            echo $LastRead[$TopicID]['PostID'];
            ?>
"></a>
			</span>
<?php 
        }
        ?>
			<span style="float: right;" class="last_poster">
				by <?php 
        echo Users::format_username($LastAuthorID, false, false, false, false, false, $IsDonorForum);
        ?>
 <?php 
        echo time_diff($LastTime, 1);
        ?>
			</span>
		</td>
		<td class="number_column"><?php 
        echo number_format($PostCount - 1);
        ?>
</td>
		<td><?php 
        echo Users::format_username($AuthorID, false, false, false, false, false, $IsDonorForum);
        ?>
</td>
	</tr>
<?php 
    }
}
Example #8
0
    echo $LoggedUser['AuthKey'];
    ?>
" />
		<input type="hidden" name="topicid" value="<?php 
    echo $ThreadID;
    ?>
" />
		<table cellpadding="6" cellspacing="1" border="0" width="100%" class="layout border hidden" id="thread_notes_table">
<?php 
    foreach ($Notes as $Note) {
        ?>
			<tr><td><?php 
        echo Users::format_username($Note['AuthorID']);
        ?>
 (<?php 
        echo time_diff($Note['AddedTime'], 2, true, true);
        ?>
)</td><td><?php 
        echo Text::full_format($Note['Body']);
        ?>
</td></tr>
<?php 
    }
    ?>
			<tr>
				<td colspan="2" class="center">
					<div class="field_div textarea_wrap"><textarea id="topic_notes" name="body" cols="90" rows="3" onkeyup="resize('threadnotes');" style=" margin: 0px; width: 735px;"></textarea></div>
					<input type="submit" value="Save" />
				</td>
			</tr>
		</table>
Example #9
0
?>
	<tr>
		<td><?php 
echo format_username($UserID, $Username, $Donor, $Warned, $Enabled, $PermissionID);
?>
</td>
		<td><?php 
echo PAYPAL_SYMBOL;
?>
 <?php 
echo display_str($Amount);
?>
</td>
		<td><?php 
echo display_str($Email);
?>
</td>
		<td><?php 
echo time_diff($DonationTime);
?>
</td>
	</tr>
<?	} ?>
</table>
<div class="linkbox">
	<?php 
echo $Pages;
?>
</div>
<? show_footer(); ?>
Example #10
0
File: eb.php Project: morilo/ptpimg
    ?>
" size="30" />
			</td>
			<td>
				<input type="text" name="comment" value="<?php 
    echo display_str($Comment);
    ?>
" size="60" />
			</td>
			<td>
				<?php 
    echo format_username($UserID, $Username);
    ?>
<br />
				<?php 
    echo time_diff($Time, 1);
    ?>
</td>
			<td>
				<input type="submit" name="submit" value="Edit" />
				<input type="submit" name="submit" value="Delete" />
			</td>
		</form>
	</tr>
<?php 
}
?>
<tr>
	<td colspan="4" class="colhead">Add To Email Blacklist</td>
</tr>
<tr class="rowa">
Example #11
0
        $Requests = $DB->has_results();
        if ($Requests > 0) {
            while (list($RequestID, $FillerID, $FillerName, $FilledTime) = $DB->next_record()) {
                ?>
						<div style="text-align: right;">
							<strong class="important_text"><a href="user.php?id=<?php 
                echo $FillerID;
                ?>
"><?php 
                echo $FillerName;
                ?>
</a> used this torrent to fill <a href="requests.php?action=viewrequest&amp;id=<?php 
                echo $RequestID;
                ?>
">this request</a> <?php 
                echo time_diff($FilledTime);
                ?>
</strong>
						</div>
<?php 
            }
        }
    }
    ?>
					</td>
				</tr>
<?php 
    // END REPORTED STUFF :|: BEGIN MOD STUFF
    ?>
				<tr>
					<td class="label">
Example #12
0
    ?>
torrent/<?php 
    echo $torrent->fid;
    ?>
"><?php 
    echo $torrent->title;
    ?>
</a><br />

				<span class="info">
					<?php 
    echo pretty_size($torrent->size);
    ?>
;
					added <?php 
    echo time_diff($torrent->ctime);
    ?>
					by
					<?php 
    $this->renderElement('user_byline', array('user' => $torrent->user));
    ?>
					in category <a href="<?php 
    echo WWW_BASE_PATH;
    ?>
browse/<?php 
    echo $torrent->category->slug;
    ?>
"><?php 
    echo $torrent->category->name;
    ?>
</a>
Example #13
0
function gixlg_execsqlrequest($router, $request)
{
    global $gixlg;
    if (!isset($_REQUEST["routerid"])) {
        return;
    } else {
        if (!is_numeric($_REQUEST["routerid"])) {
            printError("RouterID argument is not valid.");
            return;
        } else {
            $routerid = $_REQUEST["routerid"];
        }
    }
    if (!isset($router[$routerid]["address"]) || !ip_valid($router[$routerid]["address"], 4, 0)) {
        printError("Router IP address is not valid. Check your config file.");
        return;
    }
    if (!isset($_REQUEST["requestid"]) || !is_numeric($_REQUEST["requestid"])) {
        printError("RequestID is not valid.");
        return;
    } else {
        $requestid = $_REQUEST["requestid"];
    }
    if (!isset($request[$requestid]["argc"]) || !is_numeric($request[$requestid]["argc"])) {
        printError("Request definition need argc option to be set. Check your config file.");
        return;
    }
    $handler = $request[$requestid]["handler"];
    // check if request is allowed for this router
    if (empty($handler) || strpos($handler, $router[$routerid]["service"]) === false) {
        printError("This request is not permitted for this router by administrator.");
        return;
    }
    if ($request[$requestid]["argc"] > 0) {
        if (trim($_REQUEST["argument"]) == '') {
            $router_defined = isset($router[$routerid]["ignore_argc"]);
            $router_permits = $router[$routerid]["ignore_argc"] == 1;
            $default_defined = isset($router["default"]["ignore_argc"]);
            $default_permits = $router["default"]["ignore_argc"] == 1;
            $final_permits = !$router_defined && $default_defined && $default_permits || $router_defined && $router_permits;
            if (!$final_permits) {
                printError("Argument is required for this command.");
                return;
            }
        } else {
            switch ($requestid) {
                case 20:
                    $argument_tmp = trim($_REQUEST["argument"]);
                    $dot_loc = strpos($argument_tmp, ".");
                    if ($dot_loc === false) {
                        $ipver = 6;
                    } else {
                        $ipver = 4;
                    }
                    $sla_loc = strpos($argument_tmp, "/");
                    if ($sla_loc === false) {
                        $ipnet = 0;
                    } else {
                        $ipnet = 1;
                    }
                    if (ip_valid($argument_tmp, $ipver, $ipnet) != false) {
                        $argument = $argument_tmp;
                    } else {
                        printError("A valid IP address or network is required as an argument.");
                        return;
                    }
                    /*
                         $argument_tmp4 = ip_valid(trim($_REQUEST["argument"]), 4, $request[$requestid]["net"]);
                         $argument_tmp6 = ip_valid(trim($_REQUEST["argument"]), 6, $request[$requestid]["net"]);
                         if ($argument_tmp4!=false) {
                          $argument = $argument_tmp4;
                         } else {
                          if ($argument_tmp6!=false) {
                           $argument = $argument_tmp6;
                          } else {
                           printError("A valid IP address or network is required as an argument.");
                           return;
                          }
                         }
                    */
                    break;
                case 30:
                    if (preg_match('/[^0-9\\* ]/', trim($_REQUEST["argument"]))) {
                        printError("A valid ASN type argument is required.<br>Currently supported types of query: 'ASN', 'ASN ASN', '* ASN', 'ASN *' and '* ASN *' and other combinations of the above.");
                        return;
                    } else {
                        $argument_tmp = trim($_REQUEST["argument"]);
                        if (is_numeric($argument_tmp)) {
                            $argument = $argument_tmp;
                        } else {
                            $argument = str_replace("*", "%", $argument_tmp);
                        }
                    }
                    break;
                default:
                    printError("Argument is not valid.");
                    break;
            }
        }
    }
    $mid = mysqli_connect($gixlg['db_host'], $gixlg['db_user'], $gixlg['db_password'], $gixlg['db_database']);
    if (mysqli_connect_errno()) {
        printError("Could not connect: " . mysqli_connect_error());
        break;
    }
    switch ($requestid) {
        case 10:
            $res = mysqli_query($mid, "SELECT * FROM `members` ORDER BY `type`,(neighbor+0),`neighbor`");
            $nr = mysqli_num_rows($res);
            ?>
<table class="table table-striped table-bordered table-hover table-condensed small">
<thead>
<tr>
<th>Node</th>
<th>Location</th>
<th>Country</th>
<th>RIR</th>
<th>AS name</th>
<th>ASN</th>
<th>Neighbor IP</th>
<th>IPv4/6</th>
<th>State</th>
<th>PfxRcd</th>
<th>Up/Down</th>
<th>Last update</th>
<th>Up since/last</th>
<th>Down since/last</th>
</tr>
</thead>
<tfoot>
<tr><td colspan="14">Total number of neighbors <?php 
            echo $nr;
            ?>
</td></tr>
</tfoot>
<tbody>
<?php 
            while ($d = mysqli_fetch_assoc($res)) {
                $as_info_dns = dns_get_record("AS" . $d['asn'] . ".asn.cymru.com", DNS_TXT);
                list($as_info['as'], $as_info['country'], $as_info['rir'], $as_info['date'], $as_info['desc']) = explode("|", $as_info_dns[0]['txt']);
                $asinfo = explode(" ", $as_info['desc']);
                if ($d['type'] == '4') {
                    $res_node = mysqli_query($mid, "SELECT * FROM `nodes` WHERE `ip4`='" . $d['neighbor'] . "'");
                } else {
                    $res_node = mysqli_query($mid, "SELECT * FROM `nodes` WHERE `ip6`='" . $d['neighbor'] . "'");
                }
                $d_node = mysqli_fetch_assoc($res_node);
                echo "<tr>";
                echo "<td>" . $d_node['vendor'] . " " . $d_node['model'] . "</td>";
                echo "<td>" . $d_node['location'] . "</td>";
                echo "<td>" . $as_info['country'] . "</td>";
                echo "<td>" . strtoupper($as_info['rir']) . "</td>";
                echo "<td>" . $asinfo[1] . "</td>";
                echo "<td>" . $d['asn'] . "</td>";
                echo "<td>" . $d['neighbor'] . "</td>";
                echo "<td>" . $d['type'] . "</td>";
                if ($d['status'] == 1) {
                    echo "<td>up</td>";
                } else {
                    echo "<td>down</td>";
                }
                echo "<td>" . $d['prefixes'] . "</td>";
                echo "<td>" . $d['updown'] . "</td>";
                if ($d['time'] == '0000-00-00 00:00:00') {
                    echo "<td>never</td>";
                } else {
                    echo "<td>" . time_diff($d['time']) . "</td>";
                }
                if ($d['lastup'] == '0000-00-00 00:00:00') {
                    echo "<td>never</td>";
                } else {
                    if ($d['status'] == 0) {
                        echo "<td>" . $d['lastup'] . "</td>";
                    } else {
                        echo "<td>" . time_diff($d['lastup']) . "</td>";
                    }
                }
                if ($d['lastdown'] == '0000-00-00 00:00:00') {
                    echo "<td>never</td>";
                } else {
                    if ($d['status'] == 1) {
                        echo "<td>" . $d['lastdown'] . "</td>";
                    } else {
                        echo "<td>" . time_diff($d['lastdown']) . "</td>";
                    }
                }
                echo "</tr>";
            }
            echo "</tbody>";
            echo "</table>";
            break;
        case 20:
            if ($ipnet == 1) {
                $res = mysqli_query($mid, "SELECT * FROM `prefixes` WHERE (`prefix`='{$argument}') ORDER BY LENGTH(aspath),`neighbor`,(neighbor+0),`neighbor`");
            } else {
                $int_ip = inet_ptoi($argument);
                if ($gixlg['ignore_default_routes']) {
                    $res = mysqli_query($mid, "SELECT * FROM `prefixes` WHERE (MBRCONTAINS(ip_poly, POINTFROMWKB(POINT({$int_ip}, 0))) && (`prefix`!='::/0') and (`prefix`!='0.0.0.0/0')) ORDER BY LENGTH(aspath),`neighbor`,(neighbor+0),`neighbor`");
                } else {
                    $res = mysqli_query($mid, "SELECT * FROM `prefixes` WHERE (MBRCONTAINS(ip_poly, POINTFROMWKB(POINT({$int_ip}, 0)))) ORDER BY LENGTH(aspath),`neighbor`,(neighbor+0),`neighbor`");
                }
            }
            $nr = mysqli_num_rows($res);
            ?>
<table class="table table-striped table-bordered table-hover table-condensed small">
<thead>
<tr>
<th>Node</th>
<th>Location</th>
<th>Type</th>
<th>Network</th>
<th>IPv4/6</th>
<th>Neighbor IP</th>
<?php 
            if ($gixlg['mode'] == 'rc') {
                ?>
<th>Next hop</th>
<th>Dest. node</th>
<th>Dest. type</th>
<th>Dest. loc.</th>
<?php 
            }
            ?>
<th>AS path</th>
<th>Last seen</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="<?php 
            if ($gixlg['mode'] == 'rc') {
                echo "12";
            } else {
                echo "8";
            }
            ?>
">Total number of prefixes <?php 
            echo $nr;
            if ($nr > 0) {
                if ($gixlg['flex_image_size']) {
                    echo "<br/><img src=\"gixlg-map.php?prefix=" . $argument . "\" alt=\"gixlg-map\"/>";
                } else {
                    echo "<br/><img width=\"1200\" src=\"gixlg-map.php?prefix=" . $argument . "\" alt=\"gixlg-map\"/>";
                }
            }
            ?>
</td>
</tr>
</tfoot>
<tbody>
<?php 
            while ($d = mysqli_fetch_assoc($res)) {
                if ($d['type'] == '4') {
                    $res_node = mysqli_query($mid, "SELECT * FROM `nodes` WHERE `ip4`='" . $d['neighbor'] . "'");
                } else {
                    $res_node = mysqli_query($mid, "SELECT * FROM `nodes` WHERE `ip6`='" . $d['neighbor'] . "'");
                }
                $d_node = mysqli_fetch_assoc($res_node);
                $attr1 = "";
                $attr2 = "";
                if ($gixlg['mode'] == 'rc') {
                    $ip_int = inet_ptoi($d['nexthop']);
                    $res_nexthop = mysqli_query($mid, "SELECT * FROM `nexthops` WHERE (({$ip_int}>=`ip4_start` && {$ip_int}<=`ip4_end`) || ({$ip_int}>=`ip6_start` && {$ip_int}<=`ip6_end`))");
                    $d_nexthop = mysqli_fetch_assoc($res_nexthop);
                    $res_member = mysqli_query($mid, "SELECT * FROM `members` WHERE `neighbor`='" . $d['neighbor'] . "'");
                    if (mysqli_num_rows($res_member) == 1) {
                        $d_member = mysqli_fetch_assoc($res_member);
                        if ($d['neighbor'] == $d['nexthop'] && $d_member['asn'] == $d['aspath']) {
                            $attr1 = "<b>";
                            $attr2 = "</b>";
                        }
                    }
                } else {
                    $res_member = mysqli_query($mid, "SELECT * FROM `members` WHERE `neighbor`='" . $d['neighbor'] . "'");
                    if (mysqli_num_rows($res_member) == 1) {
                        $d_member = mysqli_fetch_assoc($res_member);
                        if ($d_member['asn'] == $d['aspath']) {
                            $attr1 = "<b>";
                            $attr2 = "</b>";
                        }
                    }
                }
                echo "<tr onmouseover=\"nhpup.popup('Community: " . $d['community'] . "&lt;br/&gt;Extended community: " . $d['extended_community'] . "&lt;br/&gt;Origin: " . $d['origin'] . "&lt;br/&gt;Nexthop: " . $d['nexthop'] . "', {'class': 'pup', 'width': 700})\">";
                echo "<td>" . $attr1 . $d_node['vendor'] . " " . $d_node['model'] . $attr2 . "</td>";
                echo "<td>" . $attr1 . $d_node['location'] . $attr2 . "</td>";
                echo "<td>" . $attr1 . $d_node['type'] . $attr2 . "</td>";
                echo "<td>" . $attr1 . $d['prefix'] . $attr2 . "</td>";
                echo "<td>" . $attr1 . $d['type'] . $attr2 . "</td>";
                echo "<td>" . $attr1 . $d['neighbor'] . $attr2 . "</td>";
                if ($gixlg['mode'] == 'rc') {
                    echo "<td>" . $attr1 . $d['nexthop'] . $attr2 . "</td>";
                    echo "<td>" . $attr1 . $d_nexthop['node'] . $attr2 . "</td>";
                    echo "<td>" . $attr1 . $d_nexthop['type'] . $attr2 . "</td>";
                    echo "<td>" . $attr1 . $d_nexthop['location'] . $attr2 . "</td>";
                }
                echo "<td>" . $attr1 . $d['aspath'] . $attr2 . "</td>";
                echo "<td>" . $attr1 . $d['time'] . $attr2 . "</td>";
                echo "</tr>";
            }
            echo "</tbody>";
            echo "</table>";
            break;
        case 30:
            $res = mysqli_query($mid, "SELECT * FROM `prefixes` WHERE (`aspath` LIKE '{$argument}') ORDER BY `type`,(prefix+0),prefix,LENGTH(aspath),(nexthop+0),nexthop");
            $nr = mysqli_num_rows($res);
            if ($nr > 2000) {
                printError("Number of prefixes is greater then 2000.");
                return;
            }
            ?>
<table class="table table-striped table-bordered table-hover table-condensed small">
<thead>
<tr>
<th>Node</th>
<th>Type</th>
<th>Location</th>
<th>Network</th>
<th>IPv4/6</th>
<th>Neighbor IP</th>
<?php 
            if ($gixlg['mode'] == 'rc') {
                ?>
<th>Next hop</th>
<th>Dest. node</th>
<th>Dest. type</th>
<th>Dest. loc.</th>
<?php 
            }
            ?>
<th>AS path</th>
<th>Last seen</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="<?php 
            if ($gixlg['mode'] == 'rc') {
                echo "12";
            } else {
                echo "8";
            }
            ?>
">Total number of prefixes <?php 
            echo $nr;
            ?>
</td>
</tr>
</tfoot>
<tbody>
<?php 
            while ($d = mysqli_fetch_assoc($res)) {
                if ($d['type'] == '4') {
                    $res_node = mysqli_query($mid, "SELECT * FROM `nodes` WHERE `ip4`='" . $d['neighbor'] . "'");
                } else {
                    $res_node = mysqli_query($mid, "SELECT * FROM `nodes` WHERE `ip6`='" . $d['neighbor'] . "'");
                }
                $d_node = mysqli_fetch_assoc($res_node);
                $attr1 = "";
                $attr2 = "";
                $d_nexthop = array();
                $d_member = array();
                if ($gixlg['mode'] == 'rc') {
                    $ip_int = inet_ptoi($d['nexthop']);
                    $res_nexthop = mysqli_query($mid, "SELECT * FROM `nexthops` WHERE (({$ip_int}>=`ip4_start` && {$ip_int}<=`ip4_end`) || ({$ip_int}>=`ip6_start` && {$ip_int}<=`ip6_end`))");
                    if (mysqli_num_rows($res_nexthop) == 1) {
                        $d_nexthop = mysqli_fetch_assoc($res_nexthop);
                    }
                    $res_member = mysqli_query($mid, "SELECT * FROM `members` WHERE `neighbor`='" . $d['neighbor'] . "'");
                    if (mysqli_num_rows($res_member) == 1) {
                        $d_member = mysqli_fetch_assoc($res_member);
                        if ($d['neighbor'] == $d['nexthop'] && $d_member['asn'] == $d['aspath']) {
                            $attr1 = "<b>";
                            $attr2 = "</b>";
                        }
                    }
                } else {
                    $res_member = mysqli_query($mid, "SELECT * FROM `members` WHERE `neighbor`='" . $d['neighbor'] . "'");
                    if (mysqli_num_rows($res_member) == 1) {
                        $d_member = mysqli_fetch_assoc($res_member);
                        if ($d_member['asn'] == $d['aspath']) {
                            $attr1 = "<b>";
                            $attr2 = "</b>";
                        }
                    }
                }
                echo "<tr onmouseover=\"nhpup.popup('Community: " . $d['community'] . "&lt;br/&gt;Extended community: " . $d['extended_community'] . "&lt;br/&gt;Origin: " . $d['origin'] . "', {'class': 'pup', 'width': 700})\">";
                echo "<td>" . $attr1 . $d_node['vendor'] . " " . $d_node['model'] . $attr2 . "</td>";
                echo "<td>" . $attr1 . $d_node['type'] . $attr2 . "</td>";
                echo "<td>" . $attr1 . $d_node['location'] . $attr2 . "</td>";
                echo "<td>" . $attr1 . $d['prefix'] . $attr2 . "</td>";
                echo "<td>" . $attr1 . $d['type'] . $attr2 . "</td>";
                echo "<td>" . $attr1 . $d['neighbor'] . $attr2 . "</td>";
                if ($gixlg['mode'] == 'rc') {
                    echo "<td>" . $attr1 . $d['nexthop'] . $attr2 . "</td>";
                    if (isset($d_nexthop['node'])) {
                        echo "<td>" . $attr1 . $d_nexthop['node'] . $attr2 . "</td>";
                    } else {
                        echo "<td></td>";
                    }
                    if (isset($d_nexthop['type'])) {
                        echo "<td>" . $attr1 . $d_nexthop['type'] . $attr2 . "</td>";
                    } else {
                        echo "<td></td>";
                    }
                    if (isset($d_nexthop['location'])) {
                        echo "<td>" . $attr1 . $d_nexthop['location'] . $attr2 . "</td>";
                    } else {
                        echo "<td></td>";
                    }
                }
                echo "<td>" . $attr1 . $d['aspath'] . $attr2 . "</td>";
                echo "<td>" . $attr1 . $d['time'] . $attr2 . "</td>";
                echo "</tr>";
            }
            echo "</tbody>";
            echo "</table>";
            break;
        default:
            printError("Request not supported by router.");
            break;
    }
    mysqli_close($mid);
}
Example #14
0
"><?php 
echo $Username;
?>
</a></h2>
<table width="100%">
	<tr class="colhead">
		<td>Changed</td>
		<td>IP [<a href="/userhistory.php?action=ips&userid=<?php 
echo $UserID;
?>
">H</a>]</td>
	</tr>
<? while(list($ChangeTime, $ChangerIP) = $DB->next_record()){ ?>
	<tr class="rowa">
		<td><?php 
echo time_diff($ChangeTime);
?>
</td>
		<td><?php 
echo display_str($ChangerIP);
?>
 [<a href="/user.php?action=search&ip_history=on&ip=<?php 
echo display_str($ChangerIP);
?>
" title="Search">S</a>]<br /><?php 
echo get_host($ChangerIP);
?>
</td>
	</tr>
<? } ?>
</table>
Example #15
0
            $User = '******' . $User . '</strong>';
        }
    }
    if ($i % 2 == 0 && $i > 0) {
        ?>
	</tr>
	<tr>
<?php 
    }
    ?>
		<td><?php 
    echo $User;
    ?>
</td>
		<td><?php 
    echo time_diff($Timestamp);
    ?>
</td>
<?php 
    $i++;
}
?>
	</tr>
</table>
<?php 
if ($NumResults > 100) {
    ?>
<div class="linkbox"><?php 
    echo js_pages('show_downloads', $_GET['torrentid'], $NumResults, $Page);
    ?>
</div>
Example #16
0
    ?>
			<tr>
				<td><?php 
    echo $Revision;
    ?>
</td>
				<td><?php 
    echo $Title;
    ?>
</td>
				<td><?php 
    echo Users::format_username($AuthorID, false, false, false);
    ?>
</td>
				<td><?php 
    echo time_diff($Date);
    ?>
</td>
				<td><input type="radio" name="old" value="<?php 
    echo $Revision;
    ?>
" /></td>
				<td><input type="radio" name="new" value="<?php 
    echo $Revision;
    ?>
" /></td>
			</tr>
<?php 
}
?>
			<tr>
Example #17
0
			<?php 
echo $DisplayName;
?>
			<br />
			<div class="tags">
				<?php 
echo $TorrentTags;
?>
			</div>
		</td>
		<td><?php 
echo $Data['FileCount'];
?>
</td>
		<td class="nobr"><?php 
echo time_diff($GroupTime, 1);
?>
</td>
		<td class="nobr"><?php 
echo get_size($Data['Size']);
?>
</td>
		<td><?php 
echo number_format($TotalSnatched);
?>
</td>
		<td<?php 
echo $TotalSeeders == 0 ? ' class="r00"' : '';
?>
><?php 
echo number_format($TotalSeeders);
Example #18
0
				<a href="user.php?id=<?php 
            echo $Request['UserID'];
            ?>
"><?php 
            echo Users::format_username($Request['UserID'], false, false, false);
            ?>
</a>
			</td>
			<td class="nobr">
				<?php 
            echo time_diff($Request['TimeAdded'], 1);
            ?>
			</td>
			<td class="nobr">
				<?php 
            echo time_diff($Request['LastVote'], 1);
            ?>
			</td>
		</tr>
<?php 
        }
        // foreach
    }
    // else
}
// if ($BookmarkView && $NumResults < 1)
?>
	</table>
<?php 
if (isset($PageLinks)) {
    ?>
Example #19
0
function build_torrents_table($Cache, $DB, $LoggedUser, $GroupID, $GroupName, $GroupCategoryID, $ReleaseType, $TorrentList, $Types, $Username, $ReportedTimes)
{
    function filelist($Str)
    {
        return "</td>\n<td>" . Format::get_size($Str[1]) . "</td>\n</tr>";
    }
    $LastRemasterYear = '-';
    $LastRemasterTitle = '';
    $LastRemasterRecordLabel = '';
    $LastRemasterCatalogueNumber = '';
    $EditionID = 0;
    foreach ($TorrentList as $Torrent) {
        //t.ID,	t.Media, t.Format, t.Encoding, t.Remastered, t.RemasterYear,
        //t.RemasterTitle, t.RemasterRecordLabel, t.RemasterCatalogueNumber, t.Scene,
        //t.HasLog, t.HasCue, t.LogScore, t.FileCount, t.Size, t.Seeders, t.Leechers,
        //t.Snatched, t.FreeTorrent, t.Time, t.Description, t.FileList,
        //t.FilePath, t.UserID, t.last_action, HEX(t.info_hash), (bad tags), (bad folders), (bad filenames),
        //(cassette approved), (lossy master approved), (lossy web approved), t.LastReseedRequest,
        //LogInDB, (has file), Torrents::torrent_properties()
        list($TorrentID, $Media, $Format, $Encoding, $Remastered, $RemasterYear, $RemasterTitle, $RemasterRecordLabel, $RemasterCatalogueNumber, $Scene, $HasLog, $HasCue, $LogScore, $FileCount, $Size, $Seeders, $Leechers, $Snatched, $FreeTorrent, $TorrentTime, $Description, $FileList, $FilePath, $UserID, $LastActive, $InfoHash, $BadTags, $BadFolders, $BadFiles, $CassetteApproved, $LossymasterApproved, $LossywebApproved, $LastReseedRequest, $LogInDB, $HasFile, $PersonalFL, $IsSnatched) = array_values($Torrent);
        if ($Remastered && !$RemasterYear) {
            $FirstUnknown = !isset($FirstUnknown);
        }
        $Reported = false;
        unset($ReportedTimes);
        $Reports = Torrents::get_reports($TorrentID);
        $NumReports = count($Reports);
        if ($NumReports > 0) {
            $Reported = true;
            include SERVER_ROOT . '/sections/reportsv2/array.php';
            $ReportInfo = '
		<table class="reportinfo_table">
			<tr class="colhead_dark" style="font-weight: bold;">
				<td>This torrent has ' . $NumReports . ' active ' . ($NumReports === 1 ? 'report' : 'reports') . ":</td>\n\t\t\t</tr>";
            foreach ($Reports as $Report) {
                if (check_perms('admin_reports')) {
                    $ReporterID = $Report['ReporterID'];
                    $Reporter = Users::user_info($ReporterID);
                    $ReporterName = $Reporter['Username'];
                    $ReportLinks = "<a href=\"user.php?id={$ReporterID}\">{$ReporterName}</a> <a href=\"reportsv2.php?view=report&amp;id={$Report['ID']}\">reported it</a>";
                } else {
                    $ReportLinks = 'Someone reported it';
                }
                if (isset($Types[$GroupCategoryID][$Report['Type']])) {
                    $ReportType = $Types[$GroupCategoryID][$Report['Type']];
                } elseif (isset($Types['master'][$Report['Type']])) {
                    $ReportType = $Types['master'][$Report['Type']];
                } else {
                    //There was a type but it wasn't an option!
                    $ReportType = $Types['master']['other'];
                }
                $ReportInfo .= "\n\t\t\t<tr>\n\t\t\t\t<td>{$ReportLinks} " . time_diff($Report['ReportedTime'], 2, true, true) . ' for the reason "' . $ReportType['title'] . '":
					<blockquote>' . Text::full_format($Report['UserComment']) . '</blockquote>
				</td>
			</tr>';
            }
            $ReportInfo .= "\n\t\t</table>";
        }
        $CanEdit = check_perms('torrents_edit') || $UserID == $LoggedUser['ID'] && !$LoggedUser['DisableWiki'] && !($Remastered && !$RemasterYear);
        $RegenLink = check_perms('users_mod') ? ' <a href="torrents.php?action=regen_filelist&amp;torrentid=' . $TorrentID . '" class="brackets">Regenerate</a>' : '';
        $FileTable = '
	<table class="filelist_table">
		<tr class="colhead_dark">
			<td>
				<div class="filelist_title" style="float: left;">File Names' . $RegenLink . '</div>
				<div class="filelist_path" style="float: right;">' . ($FilePath ? "/{$FilePath}/" : '') . '</div>
			</td>
			<td>
				<strong>Size</strong>
			</td>
		</tr>';
        if (substr($FileList, -3) == '}}}') {
            // Old style
            $FileListSplit = explode('|||', $FileList);
            foreach ($FileListSplit as $File) {
                $NameEnd = strrpos($File, '{{{');
                $Name = substr($File, 0, $NameEnd);
                if ($Spaces = strspn($Name, ' ')) {
                    $Name = str_replace(' ', '&nbsp;', substr($Name, 0, $Spaces)) . substr($Name, $Spaces);
                }
                $FileSize = substr($File, $NameEnd + 3, -3);
                $FileTable .= sprintf("\n<tr><td>%s</td><td class=\"number_column\">%s</td></tr>", $Name, Format::get_size($FileSize));
            }
        } else {
            $FileListSplit = explode("\n", $FileList);
            foreach ($FileListSplit as $File) {
                $FileInfo = Torrents::filelist_get_file($File);
                $FileTable .= sprintf("\n<tr><td>%s</td><td class=\"number_column\">%s</td></tr>", $FileInfo['name'], Format::get_size($FileInfo['size']));
            }
        }
        $FileTable .= '
	</table>';
        $ExtraInfo = '';
        // String that contains information on the torrent (e.g. format and encoding)
        $AddExtra = '';
        // Separator between torrent properties
        $TorrentUploader = $Username;
        // Save this for "Uploaded by:" below
        // similar to Torrents::torrent_info()
        if ($Format) {
            $ExtraInfo .= display_str($Format);
            $AddExtra = ' / ';
        }
        if ($Encoding) {
            $ExtraInfo .= $AddExtra . display_str($Encoding);
            $AddExtra = ' / ';
        }
        if ($HasLog) {
            $ExtraInfo .= "{$AddExtra}Log";
            $AddExtra = ' / ';
        }
        if ($HasLog && $LogInDB) {
            $ExtraInfo .= ' (' . (int) $LogScore . '%)';
        }
        if ($HasCue) {
            $ExtraInfo .= "{$AddExtra}Cue";
            $AddExtra = ' / ';
        }
        if ($Scene) {
            $ExtraInfo .= "{$AddExtra}Scene";
            $AddExtra = ' / ';
        }
        if (!$ExtraInfo) {
            $ExtraInfo = $GroupName;
            $AddExtra = ' / ';
        }
        if ($IsSnatched) {
            $ExtraInfo .= $AddExtra . Format::torrent_label('Snatched!');
            $AddExtra = ' / ';
        }
        if ($FreeTorrent == '1') {
            $ExtraInfo .= $AddExtra . Format::torrent_label('Freeleech!');
            $AddExtra = ' / ';
        }
        if ($FreeTorrent == '2') {
            $ExtraInfo .= $AddExtra . Format::torrent_label('Neutral Leech!');
            $AddExtra = ' / ';
        }
        if ($PersonalFL) {
            $ExtraInfo .= $AddExtra . Format::torrent_label('Personal Freeleech!');
            $AddExtra = ' / ';
        }
        if ($Reported) {
            $ExtraInfo .= $AddExtra . Format::torrent_label('Reported');
            $AddExtra = ' / ';
        }
        if (!empty($BadTags)) {
            $ExtraInfo .= $AddExtra . Format::torrent_label('Bad Tags');
            $AddExtra = ' / ';
        }
        if (!empty($BadFolders)) {
            $ExtraInfo .= $AddExtra . Format::torrent_label('Bad Folders');
            $AddExtra = ' / ';
        }
        if (!empty($CassetteApproved)) {
            $ExtraInfo .= $AddExtra . Format::torrent_label('Cassette Approved');
            $AddExtra = ' / ';
        }
        if (!empty($LossymasterApproved)) {
            $ExtraInfo .= $AddExtra . Format::torrent_label('Lossy Master Approved');
            $AddExtra = ' / ';
        }
        if (!empty($LossywebApproved)) {
            $ExtraInfo .= $AddExtra . Format::torrent_label('Lossy WEB Approved');
            $AddExtra = ' / ';
        }
        if (!empty($BadFiles)) {
            $ExtraInfo .= $AddExtra . Format::torrent_label('Bad File Names');
            $AddExtra = ' / ';
        }
        if ($GroupCategoryID == 1 && ($RemasterTitle != $LastRemasterTitle || $RemasterYear != $LastRemasterYear || $RemasterRecordLabel != $LastRemasterRecordLabel || $RemasterCatalogueNumber != $LastRemasterCatalogueNumber || $FirstUnknown || $Media != $LastMedia)) {
            $EditionID++;
            ?>
				<tr class="releases_<?php 
            echo $ReleaseType;
            ?>
 groupid_<?php 
            echo $GroupID;
            ?>
 edition group_torrent">
					<td colspan="5" class="edition_info"><strong><a href="#" onclick="toggle_edition(<?php 
            echo $GroupID;
            ?>
, <?php 
            echo $EditionID;
            ?>
, this, event);" class="tooltip" title="Collapse this edition. Hold &quot;Ctrl&quot; while clicking to collapse all editions in this torrent group.">&minus;</a> <?php 
            echo Torrents::edition_string($Torrent, $TorrentDetails);
            ?>
</strong></td>
				</tr>
<?php 
        }
        $LastRemasterTitle = $RemasterTitle;
        $LastRemasterYear = $RemasterYear;
        $LastRemasterRecordLabel = $RemasterRecordLabel;
        $LastRemasterCatalogueNumber = $RemasterCatalogueNumber;
        $LastMedia = $Media;
        ?>
				<tr class="torrent_row releases_<?php 
        echo $ReleaseType;
        ?>
 groupid_<?php 
        echo $GroupID;
        ?>
 edition_<?php 
        echo $EditionID;
        ?>
 group_torrent<?php 
        echo $IsSnatched ? ' snatched_torrent' : '';
        ?>
" style="font-weight: normal;" id="torrent<?php 
        echo $TorrentID;
        ?>
">
					<td>
						<span>[ <a href="torrents.php?action=download&amp;id=<?php 
        echo $TorrentID;
        ?>
&amp;authkey=<?php 
        echo $LoggedUser['AuthKey'];
        ?>
&amp;torrent_pass=<?php 
        echo $LoggedUser['torrent_pass'];
        ?>
" class="tooltip" title="Download"><?php 
        echo $HasFile ? 'DL' : 'Missing';
        ?>
</a>
<?php 
        if (Torrents::can_use_token($Torrent)) {
            ?>
							| <a href="torrents.php?action=download&amp;id=<?php 
            echo $TorrentID;
            ?>
&amp;authkey=<?php 
            echo $LoggedUser['AuthKey'];
            ?>
&amp;torrent_pass=<?php 
            echo $LoggedUser['torrent_pass'];
            ?>
&amp;usetoken=1" class="tooltip" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
<?php 
        }
        ?>
							| <a href="reportsv2.php?action=report&amp;id=<?php 
        echo $TorrentID;
        ?>
" class="tooltip" title="Report">RP</a>
<?php 
        if ($CanEdit) {
            ?>
							| <a href="torrents.php?action=edit&amp;id=<?php 
            echo $TorrentID;
            ?>
" class="tooltip" title="Edit">ED</a>
<?php 
        }
        if (check_perms('torrents_delete') || $UserID == $LoggedUser['ID']) {
            ?>
							| <a href="torrents.php?action=delete&amp;torrentid=<?php 
            echo $TorrentID;
            ?>
" class="tooltip" title="Remove">RM</a>
<?php 
        }
        ?>
							| <a href="torrents.php?torrentid=<?php 
        echo $TorrentID;
        ?>
" class="tooltip" title="Permalink">PL</a>
						]</span>
						&raquo; <a href="#" onclick="$('#torrent_<?php 
        echo $TorrentID;
        ?>
').gtoggle(); return false;"><?php 
        echo $ExtraInfo;
        ?>
</a>
					</td>
					<td class="number_column nobr"><?php 
        echo Format::get_size($Size);
        ?>
</td>
					<td class="number_column"><?php 
        echo number_format($Snatched);
        ?>
</td>
					<td class="number_column"><?php 
        echo number_format($Seeders);
        ?>
</td>
					<td class="number_column"><?php 
        echo number_format($Leechers);
        ?>
</td>
				</tr>
				<tr class="releases_<?php 
        echo $ReleaseType;
        ?>
 groupid_<?php 
        echo $GroupID;
        ?>
 edition_<?php 
        echo $EditionID;
        ?>
 torrentdetails pad<?php 
        if (!isset($_GET['torrentid']) || $_GET['torrentid'] != $TorrentID) {
            ?>
 hidden<?php 
        }
        ?>
" id="torrent_<?php 
        echo $TorrentID;
        ?>
">
					<td colspan="5">
						<blockquote>
							Uploaded by <?php 
        echo Users::format_username($UserID, false, false, false);
        ?>
 <?php 
        echo time_diff($TorrentTime);
        if ($Seeders == 0) {
            if ($LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 1209600) {
                ?>
								<br /><strong>Last active: <?php 
                echo time_diff($LastActive);
                ?>
</strong>
<?php 
            } else {
                ?>
								<br />Last active: <?php 
                echo time_diff($LastActive);
            }
            if ($LastActive != '0000-00-00 00:00:00' && time() - strtotime($LastActive) >= 345678 && time() - strtotime($LastReseedRequest) >= 864000) {
                ?>
								<br /><a href="torrents.php?action=reseed&amp;torrentid=<?php 
                echo $TorrentID;
                ?>
&amp;groupid=<?php 
                echo $GroupID;
                ?>
" class="brackets">Request re-seed</a>
<?php 
            }
        }
        ?>
						</blockquote>
<?php 
        if (check_perms('site_moderate_requests')) {
            ?>
						<div class="linkbox">
							<a href="torrents.php?action=masspm&amp;id=<?php 
            echo $GroupID;
            ?>
&amp;torrentid=<?php 
            echo $TorrentID;
            ?>
" class="brackets">Mass PM snatchers</a>
						</div>
<?php 
        }
        ?>
						<div class="linkbox">
							<a href="#" class="brackets" onclick="show_peers('<?php 
        echo $TorrentID;
        ?>
', 0); return false;">View peer list</a>
<?php 
        if (check_perms('site_view_torrent_snatchlist')) {
            ?>
							<a href="#" class="brackets tooltip" onclick="show_downloads('<?php 
            echo $TorrentID;
            ?>
', 0); return false;" title="View the list of users that have clicked the &quot;DL&quot; button.">View download list</a>
							<a href="#" class="brackets tooltip" onclick="show_snatches('<?php 
            echo $TorrentID;
            ?>
', 0); return false;" title="View the list of users that have reported a snatch to the tracker.">View snatch list</a>
<?php 
        }
        ?>
							<a href="#" class="brackets" onclick="show_files('<?php 
        echo $TorrentID;
        ?>
'); return false;">View file list</a>
<?php 
        if ($Reported) {
            ?>
							<a href="#" class="brackets" onclick="show_reported('<?php 
            echo $TorrentID;
            ?>
'); return false;">View report information</a>
<?php 
        }
        ?>
						</div>
						<div id="peers_<?php 
        echo $TorrentID;
        ?>
" class="hidden"></div>
						<div id="downloads_<?php 
        echo $TorrentID;
        ?>
" class="hidden"></div>
						<div id="snatches_<?php 
        echo $TorrentID;
        ?>
" class="hidden"></div>
						<div id="files_<?php 
        echo $TorrentID;
        ?>
" class="hidden"><?php 
        echo $FileTable;
        ?>
</div>
<?php 
        if ($Reported) {
            ?>
						<div id="reported_<?php 
            echo $TorrentID;
            ?>
" class="hidden"><?php 
            echo $ReportInfo;
            ?>
</div>
<?php 
        }
        if (!empty($Description)) {
            echo "\n\t\t\t\t\t\t<blockquote>" . Text::full_format($Description) . '</blockquote>';
        }
        ?>
					</td>
				</tr>
<?php 
    }
}
Example #20
0
    ?>
">
				<td class="nobr"><?php 
    echo $IP;
    ?>
</td>
				<td><?php 
    echo $Browser;
    ?>
</td>
				<td><?php 
    echo $OperatingSystem;
    ?>
</td>
				<td><?php 
    echo time_diff($LastUpdate);
    ?>
</td>
				<td>
					<form class="delete_form" name="session" action="" method="post">
						<input type="hidden" name="action" value="sessions" />
						<input type="hidden" name="auth" value="<?php 
    echo $LoggedUser['AuthKey'];
    ?>
" />
						<input type="hidden" name="session" value="<?php 
    echo $ThisSessionID;
    ?>
" />
						<input type="submit" value="<?php 
    echo $ThisSessionID == $SessionID ? 'Current" disabled="disabled' : 'Log out';
Example #21
0
		cc.Time 
		FROM collages_comments AS cc
		LEFT JOIN users_main AS um ON um.ID=cc.UserID
		WHERE CollageID='$CollageID' 
		ORDER BY ID DESC LIMIT 15");
	$CommentList = $DB->to_array();	
}
foreach ($CommentList as $Comment) {
	list($CommentID, $Body, $UserID, $Username, $CommentTime) = $Comment;
?>
		<div class="box">
			<div class="head">By <?php 
echo format_username($UserID, $Username);
?>
 <?php 
echo time_diff($CommentTime);
?>
 <a href="reports.php?action=report&amp;type=collages_comment&amp;id=<?php 
echo $CommentID;
?>
">[Report Comment]</a></div>
			<div class="pad"><?php 
echo $Text->full_format($Body);
?>
</div>
		</div>
<?
}
?>
		<div class="box pad">
			<a href="collages.php?action=comments&amp;collageid=<?php 
Example #22
0
 function format_time_diff($begin_time, $end_time)
 {
     $res = time_diff($begin_time, $end_time);
     $format_str = $res['day'] > 0 ? $res['day'] . '天' : '';
     $format_str .= $res['hour'] > 0 ? $res['hour'] . '小时' : '';
     $format_str .= $res['min'] > 0 ? $res['min'] . '分钟' : '';
     $format_str .= $res['sec'] . '秒';
     return $format_str;
 }
Example #23
0
$user = get_logged_in_user(false);
if ($user) {
    BoltUser::lookup($user);
}
$courses = BoltCourse::enum();
start_table();
table_header("Course", "Status");
foreach ($courses as $course) {
    if ($course->hidden && !($user->bolt->flags & BOLT_FLAG_SHOW_ALL)) {
        continue;
    }
    $e = $user ? BoltEnrollment::lookup($user->id, $course->id) : null;
    if ($e) {
        $start = date_str($e->create_time);
        $view = BoltView::lookup_id($e->last_view_id);
        $ago = time_diff(time() - $view->start_time);
        $pct = number_format($view->fraction_done * 100, 0);
        $status = "Started {$start}\n            <br>Last visit: {$ago} ago\n            <br>{$pct}% done\n        ";
        if ($view->fraction_done < 1) {
            $status .= "<br><a href=bolt_sched.php?course_id={$course->id}&action=resume>Resume</a>\n            ";
        }
        $status .= "<br><a href=bolt_sched.php?course_id={$course->id}&action=start>Restart</a>\n            | <a href=bolt_course.php?course_id={$course->id}>History</a>\n        ";
    } else {
        $status = "\n            <a href=bolt_sched.php?course_id={$course->id}&action=start>Start</a>\n        ";
    }
    row2_init("<b>{$course->name}</b>\n        <br><span class=note>{$course->description}</span>", $status);
    show_refreshes();
    echo "</td></tr>\n";
}
end_table();
page_tail();
Example #24
0
            if ($ResolverID) {
                $Resolver = Users::format_username($ResolverID, true, true, true, true);
            } else {
                $Resolver = '(unresolved)';
            }
            ?>
				<tr>
					<td><a href="staffpm.php?action=viewconv&amp;id=<?php 
            echo $ID;
            ?>
"><?php 
            echo display_str($Subject);
            ?>
</a></td>
					<td><?php 
            echo time_diff($Date, 2, true);
            ?>
</td>
					<td><?php 
            echo $Assigned;
            ?>
</td>
					<td><?php 
            echo $Resolver;
            ?>
</td>
				</tr>
<?php 
        }
        ?>
			</table>
Example #25
0
			<td><span style="float:left;"><?php 
echo display_str($IP);
?>
</span><span style="float:right;">[<a href="userhistory.php?action=ips&amp;userid=<?php 
echo $UserID;
?>
" title="History">H</a>|<a href="user.php?action=search&amp;ip_history=on&amp;ip=<?php 
echo display_str($IP);
?>
" title="Search">S</a>]</span></td>
			<td><?php 
echo display_str($Uses);
?>
</td>
			<td><?php 
echo time_diff($Joined);
?>
</td>
		</tr>
<?	} ?>
	</table>
	<div class="linkbox">
<? echo $Pages; ?>
	</div>
<? } else { ?>
	<h2 align="center">There are currently no users with more then <?php 
echo IP_OVERLAPS;
?>
 IP overlaps.</h2>
<? }
show_footer();
Example #26
0
		</td>
		<td class="body" valign="top">
			<div id="content<?php 
echo $PostID;
?>
">
<?php 
echo $Text->full_format($Body);
?>
<? if($EditedUserID){ ?>
				<br /><br />Last edited by
				<?php 
echo format_username($EditedUserID, $EditedUsername);
?>
 <?php 
echo time_diff($EditedTime);
?>
<? } ?>
			</div>
		</td>
	</tr>
</table>
<?	} ?>
		<div class="linkbox">
		<?php 
echo $Pages;
?>
		</div>
<?
if(!$LoggedUser['DisablePosting']) { ?>
			<br />
Example #27
0
            ?>
&amp;authkey=<?php 
            echo $LoggedUser['AuthKey'];
            ?>
&amp;torrent_pass=<?php 
            echo $LoggedUser['torrent_pass'];
            ?>
" title="Download" class="brackets tooltip">DL</a>
								uploaded by <a href="user.php?id=<?php 
            echo $ExtraUploaderID;
            ?>
"><?php 
            echo $ExtraUploaderName;
            ?>
</a> <?php 
            echo time_diff($ExtraTime);
            ?>
 <a href="#" onclick="Switch(<?php 
            echo $ReportID;
            ?>
, <?php 
            echo $TorrentID;
            ?>
, <?php 
            echo $ExtraID;
            ?>
); return false;" class="brackets">Switch</a>
<?php 
            $First = false;
        }
    }
Example #28
0
			</td>
			<td>
				<?php 
    if ($UserID != 0) {
        echo Users::format_username($UserID, true, true, true, true);
    }
    ?>
			</td>
			<td>
				<?php 
    echo $Bans;
    ?>
			</td>
			<td>
				<?php 
    echo time_diff($BannedUntil);
    ?>
			</td>
			<td>
				<form class="manage_form" name="bans" action="" method="post">
					<input type="hidden" name="auth" value="<?php 
    echo $LoggedUser['AuthKey'];
    ?>
" />
					<input type="hidden" name="id" value="<?php 
    echo $ID;
    ?>
" />
					<input type="hidden" name="action" value="login_watch" />
					<input type="submit" name="submit" value="Unban" />
				</form>
Example #29
0
foreach ($News as $NewsItem) {
    list($NewsID, $Title, $Body, $NewsTime) = $NewsItem;
    if (strtotime($NewsTime) > time()) {
        continue;
    }
    ?>
		<div id="news<?php 
    echo $NewsID;
    ?>
" class="box news_post">
			<div class="head">
				<strong><?php 
    echo Text::full_format($Title);
    ?>
</strong> <?php 
    echo time_diff($NewsTime);
    if (check_perms('admin_manage_news')) {
        ?>
				- <a href="tools.php?action=editnews&amp;id=<?php 
        echo $NewsID;
        ?>
" class="brackets">Edit</a>
<?php 
    }
    ?>
			<span style="float: right;"><a href="#" onclick="$('#newsbody<?php 
    echo $NewsID;
    ?>
').gtoggle(); this.innerHTML = (this.innerHTML == 'Hide' ? 'Show' : 'Hide'); return false;" class="brackets">Hide</a></span>
			</div>
Example #30
0
">Report #<?php 
    echo $ReportID;
    ?>
</a></strong></td>
					<td>
						<strong><?php 
    echo $Type['title'];
    ?>
</strong> was reported by <a href="user.php?id=<?php 
    echo $SnitchID;
    ?>
"><?php 
    echo $SnitchName;
    ?>
</a> <?php 
    echo time_diff($ReportedTime);
    ?>
						<a href="reports.php?action=compose&amp;to=<?php 
    echo $SnitchID;
    ?>
&amp;reportid=<?php 
    echo $ReportID;
    ?>
&amp;type=<?php 
    echo $Short;
    ?>
&amp;thingid=<?php 
    echo $ThingID;
    ?>
" class="brackets">Contact</a>
					</td>