Example #1
0
    echo _PM_NONE_FOUND;
}
?>
        <button type="submit" class="submit button" style="vertical-align: middle;">Delete</button>
        </form>
		</div>
		<div class="sep">
			<div class="f_left mar_left">
				<form action="<?php 
echo url(".");
?>
" method="get">
				<select class="smalltext" name="filterOut" onchange="this.form.submit()">
				<option>*</option>
				<?php 
$result = sql_query("SELECT `useUsername`, COUNT(*) AS `count` FROM `pms`,`users` " . dbWhere(array("pmsPmUser*" => "useid", "pmsCreatorDelete" => '0', "pmsCreator" => $_auth["useid"])) . getTwitWhere("pmsPmUser") . "GROUP BY `pmsPmUser` ORDER BY `useUsername`");
while ($rowData = sql_next($result)) {
    echo '<option ';
    if (isset($_GET["filterOut"]) && $_GET["filterOut"] == $rowData["useUsername"]) {
        echo 'selected="selected" ';
    }
    echo 'value="' . $rowData["useUsername"] . '">' . $rowData["useUsername"] . " (" . fuzzy_number($rowData["count"]) . ")</option>";
}
sql_free($result);
?>
				</select>
				</form>
			</div>
			<?php 
navControls($sentOffset, $_pm_per_page, $totalCount, "", "", "", "", "sentOffset");
?>
Example #2
0
function showChildComments($comid, $comObjType, $level, $showChilds = true, $first = false, $oldestFirst = true)
{
    global $_cmd, $_commentsPerPage, $_config;
    if ($comObjType == "com") {
        $sql = "SELECT `comCreator` FROM `comments`" . dbWhere(array("comid" => $comid));
        $comResult = sql_query($sql);
        if (!($comData = mysql_fetch_assoc($comResult))) {
            return false;
        }
        if (isTwit($comData["comCreator"])) {
            return false;
        }
        if (!isLoggedIn()) {
            $result = sql_query("SELECT `useGuestAccess` FROM `useExtData`" . dbWhere(array("useEid" => $comData["comCreator"])));
            if (!mysql_result($result, 0)) {
                return false;
            }
        }
    }
    if ($level > 0) {
        $offset = 0;
    } else {
        $offset = isset($_GET["offset"]) ? intval($_GET["offset"]) : 0;
    }
    $isLastOffset = isset($_GET["offset"]) && $_GET["offset"] == "last";
    if ($_cmd[0] != "user" || $isLastOffset) {
        $result = sql_query("SELECT COUNT(*) FROM `comments` " . "WHERE `comObjType` = '{$comObjType}' AND `comObj` = '{$comid}'" . getTwitWhere("comCreator"));
        $totalcount = mysql_result($result, 0);
        if ($isLastOffset && $_cmd[0] == "user") {
            $lastOffset = floor($totalcount / $_commentsPerPage) * $_commentsPerPage;
            redirect(url(".", array("last" => $lastOffset, "offset" => $lastOffset)));
        }
    } else {
        $totalcount = $offset + $_commentsPerPage + 1;
    }
    $result = sql_query("SELECT * FROM `comments` " . "WHERE `comObjType` = '{$comObjType}' " . "AND `comObj` = '{$comid}' " . getTwitWhere("comCreator") . "ORDER BY `comSubmitDate`" . ($oldestFirst ? "" : " DESC") . " LIMIT " . $offset . "," . ($_commentsPerPage + 1));
    if (!mysql_num_rows($result)) {
        return false;
    }
    $minLevel = 2;
    //$_cmd[0] == "view" ? 2 : 3;
    if ($level >= $minLevel && $_cmd[0] != "comment") {
        for ($i = 0; $i <= $level - 1; $i++) {
            ?>
			<div class="<?php 
            echo $level > 0 && $i < $level - 1 ? "cmt_border_left" : "";
            ?>
">
			<?php 
        }
        $result1 = sql_query("SELECT `comSubmitDate` FROM `comments` WHERE `comid` = '{$comid}' LIMIT 1");
        $comSubmitDate = mysql_result($result1, 0);
        $readURL = url("comment/" . $comid . ($_config["checkSubmitDate"] ? "/" . preg_replace('/[^0-9]/', "", $comSubmitDate) : ''));
        ?>
		<div class="a_left smalltext" style="padding-top: 4px; padding-left: 20px">
			<a href="<?php 
        echo $readURL;
        ?>
#replies"><?php 
        echo _READ_MORE_REPLIES;
        ?>
			<?php 
        echo getIMG(url() . "images/emoticons/nav-next.png");
        ?>
</a>
		</div>
		<?php 
        for ($i = 0; $i <= $level - 1; $i++) {
            echo "</div>";
        }
        return true;
    }
    $commentsToGo = $_commentsPerPage;
    $useids = array();
    $comments = array();
    while ($comData = mysql_fetch_assoc($result)) {
        $useids[] = $comData["comCreator"];
        $comments[] = $comData;
    }
    prefetchUserData(array_unique($useids));
    foreach ($comments as $comData) {
        $first = false;
        showComment($comData, $level);
        if ($showChilds) {
            showChildComments($comData["comid"], "com", $level + 1, true, false, $oldestFirst);
        }
        $commentsToGo--;
        if (!$commentsToGo) {
            break;
        }
        // do not display more than $_commentsPerPage comments
    }
    if ($level == 0) {
        ?>
		<div class="padded">
			<?php 
        navControls($offset, $_commentsPerPage, $totalcount);
        ?>
		</div>
		<?php 
    }
    return true;
}