Пример #1
0
function getTopCreators2($dbw, $cutoff, $start)
{
    global $table, $join, $where, $cond, $andcond;
    $result = "<ol>";
    $sql = "select nap_page from newarticlepatrol left join page on nap_page = page_id where page_namespace = 0\n\t\t\tand nap_timestamp > '{$cutoff}' and nap_timestamp < '{$start}'; ";
    wfDebug("Dashboard top creators: {$sql}\n");
    debugMsg("getting nap {$nap} ");
    $res = $dbw->query($sql, __METHOD__);
    $pages = array();
    $revisions = array();
    while ($row = $dbw->fetchObject($res)) {
        $pages[] = $row->nap_page;
    }
    debugMsg("getting min revisions on pages " . sizeof($pages) . " pages ");
    $count = 0;
    foreach ($pages as $page_id) {
        $revisions[$page_id] = selectField($table, array("min(rev_id)"), array("rev_page" => $page_id));
        $count++;
        if ($count % 100 == 0) {
            debugMsg("done {$count}");
        }
    }
    $users = array();
    debugMsg("getting users on newly created pages " . sizeof($revisions) . " revisions ");
    $count = 0;
    foreach ($revisions as $page_id => $rev_id) {
        if (empty($rev_id)) {
            #echo "<!---uh oh: {$page_id} has no min rev!-->";
            continue;
        }
        $u = selectField($dbw, "select rev_user_text from {$table} where rev_id={$rev_id}");
        if (!isset($users[$u])) {
            $users[$u] = 1;
        } else {
            $users[$u]++;
        }
        $count++;
        if ($count % 100 == 0) {
            debugMsg("done {$count}");
        }
    }
    debugMsg("sorting " . sizeof($users) . " users");
    asort($users, SORT_NUMERIC);
    $users = array_reverse($users);
    array_splice($users, 20);
    $yy = 0;
    debugMsg("outputting all of this now " . sizeof($users) . " users");
    foreach ($users as $u => $c) {
        $x = User::newFromName($u);
        $c = nf($c);
        if (!$x) {
            $result .= "<li>{$u} - {$c} new articles created</li>\n";
        } else {
            $result .= "<li> " . getUserLink($x) . " - {$c} new articles created" . getUserToolLinks($x) . "</li>\n";
        }
        $yy++;
        if ($yy == 20) {
            break;
        }
    }
    $result .= "</ol>";
    return $result;
}
Пример #2
0
					<a href="<?php 
    echo url("pm/read/" . $rowData["pmsid"]);
    ?>
">
						<?php 
    echo getIMG(url() . "images/emoticons/pmout.png");
    ?>
						<?php 
    echo formatText($rowData["pmsTitle"], false, true);
    ?>
					</a>
					<?php 
    echo _PM_FOR;
    ?>
					<?php 
    echo getUserLink($rowData["pmsPmUser"]);
    ?>
				</div>
				<div class="f_right mar_bottom a_right">
					<?php 
    echo date($_auth['useDateFormat'], applyTimezone(strtotime($rowData["pmsSubmitDate"])));
    ?>
				</div>
				<div class="clear">&nbsp;</div>
				<?php 
    iefixEnd();
    $found = true;
}
if (!$found) {
    echo _PM_NONE_FOUND;
}
Пример #3
0
?>
	</div>
	<div class="header_title">
		<?php 
echo formatText($objData["objTitle"]);
?>
		<div class="subheader">
			<?php 
if ($objData["objCollab"] > 0) {
    printf(_BY_AND, getUserLink($objData["objCreator"]), getUserLink($objData["objCollab"]) . " " . ($objData["objCollabConfirmed"] ? "" : "(" . _UNCONFIRMED . ")"));
} else {
    printf(_BY, getUserLink($objData["objCreator"]));
}
if ($objData["objForUser"] > 0) {
    echo " ";
    printf(_FOR, getUserLink($objData["objForUser"]));
}
?>
		</div>
	</div>
	<div style="clear: both" class="normaltext">

		<div class="tab<?php 
echo $active == 1 ? " tab_active" : "";
?>
"
			onclick="document.location='<?php 
echo url("view/" . ($isExtras ? "e" : "") . $objid);
?>
'">
			<?php 
Пример #4
0
$statsPublic = $useData["useid"] != $_auth["useid"] ? $useData["useStatsPublic"] : true;
if (isLoggedIn() && $objData["objCollab"] == $_auth["useid"] && $objData["objCollabConfirmed"]) {
    $statsPublic = true;
}
// Show filename and collab status to HDStaff+ and IPs to Moderators+
if (atLeastHelpdesk()) {
    ?>
			<div>
				
				<?php 
    if ($objData["objCollab"] > 0) {
        ?>
	
					<div>
						Collaboration With: <?php 
        echo getUserLink($objData["objCollab"]);
        ?>
						<br />
						Collaboration Status: <?php 
        echo $objData["objCollabConfirmed"] ? "Confirmed" : "Unconfirmed";
        ?>
					</div>
					<?php 
    }
    if (!$isExtras) {
        ?>
					<div>
						<?php 
        echo _FILE;
        ?>
:
Пример #5
0
    if (!isset($donations[$useid]["total"])) {
        $donations[$useid]["total"] = 0;
    }
    if (!isset($donations[$useid]["lastmonth"])) {
        $donations[$useid]["lastmonth"] = 0;
    }
    $donations[$useid]["total"] += $donData["donAmtSum"];
}
$result = sql_query("SELECT `donCreator`,SUM(`donAmt`) AS `donAmtSum`,MAX(`donDate`) AS `donDateLatest` " . "FROM `donations` " . "WHERE `donCreator` <> '0' AND `donDate` > CURDATE() - INTERVAL 1 MONTH " . "GROUP BY `donCreator` " . "ORDER BY `donDateLatest` DESC");
while ($donData = mysql_fetch_assoc($result)) {
    $useid = $donData["donCreator"];
    $donations[$useid]["lastmonth"] += $donData["donAmtSum"];
}
?>
	<table border="0" cellpadding="4" cellspacing="0"><tr>
	<?php 
$cols = 0;
foreach ($donations as $donCreator => $donAmount) {
    echo "<td>" . getUserAvatar("", $donCreator, false, true) . "</td>" . '<td style="padding-right: 30px">' . getUserLink($donCreator) . '<div class="mar_left error">' . sprintf("%01.2f", $donAmount["total"]) . ' <span class="normaltext">/ ' . sprintf("%01.2f", $donAmount["lastmonth"]) . '</span>' . "</div></td>";
    $cols++;
    if ($cols >= 4) {
        $cols = 0;
        echo "</tr><tr>";
    }
}
?>
	</tr></table>
</div>

</div>
Пример #6
0
    $modLimit = "";
} else {
    $modLimit = "LIMIT {$modOffset},30";
}
$modResult = sql_query("SELECT * FROM `adminChat` ORDER BY `adcSubmitdate` DESC {$modLimit}");
while ($modData = mysql_fetch_assoc($modResult)) {
    ?>
				<div class="sep mar_left mar_right">
					#<?php 
    echo $modData["adcId"];
    ?>
 - <?php 
    echo gmdate($_auth["useDateFormat"], applyTimezone(strtotime($modData["adcSubmitDate"])));
    ?>
					- <?php 
    echo getUserLink($modData["adcCreator"]);
    ?>
:
					<?php 
    echo formatText($modData["adcText"]);
    ?>
				</div>
				<?php 
}
mysql_free_result($modResult);
?>
			<div class="sep a_center">
				<?php 
iefixStart();
$commentName = "modMessage";
$commentNoOptions = true;
Пример #7
0
function putRequestDetail($hlpData, $hddData)
{
    global $_auth;
    ?>
	<div class="container2 mar_bottom">
		<?php 
    if ($hddData["hddAttachment"] != "") {
        ?>
			<div class="f_right a_right" style="margin-left : 2em; margin-bottom : 1em;">
				<b>Attachment</b>:<br />
				<a target="new-tab"
					href="<?php 
        echo url("/") . $hddData["hddAttachment"] . "/" . $hddData["hddAttachOrigName"];
        ?>
">
					<?php 
        echo htmlspecialchars($hddData["hddAttachOrigName"]);
        ?>
</a>
				<?php 
        echo getIMG(url() . "images/emoticons/zip.png");
        ?>
			</div>
			<?php 
    }
    ?>
		<div class="mar_bottom">
			<?php 
    echo getRequestPrivacyText($hddData["hddPrivacy"], $hlpData);
    ?>
		</div>
		<div>
			<?php 
    echo getUserLink($hddData["hddCreator"]);
    ?>
:
			<?php 
    echo formatText($hddData["hddMessage"], true, true);
    ?>
		</div>
	</div>
	<?php 
}
Пример #8
0
     $markAsReadOp = "mj";
     $user = getUserLink($data["updUser"]);
     $avatar = getUserAvatar("", $data["updUser"], true);
     $usernameData = getUserData($data["updUser"]);
     $username = $usernameData["useUsername"];
     $result = sql_query("SELECT `jouTitle`,LEFT(`jouEntry`,500) AS `jouText` FROM `journals` " . "WHERE `jouid` = '" . $data["updObj"] . "'");
     if (mysql_num_rows($result) > 0) {
         $title = mysql_result($result, 0, 0);
         $body = mysql_result($result, 0, 1);
         $url = url("journal/" . strtolower($username) . "/" . $data["updObj"]);
     }
     $caption = getIMG(url() . "images/emoticons/journal.png") . " " . sprintf(_UPD_JOURNAL, $user, "");
     break;
 case updTypeJournalPoll:
     $markAsReadOp = "mp";
     $user = getUserLink($data["updUser"]);
     $avatar = getUserAvatar("", $data["updUser"], true);
     $usernameData = getUserData($data["updUser"]);
     $username = $usernameData["useUsername"];
     $result = sql_query("SELECT `polSubject`,LEFT(`polComment`,500) AS `polText` FROM `polls` " . "WHERE `polid` = '" . $data["updObj"] . "'");
     if (mysql_num_rows($result)) {
         $title = mysql_result($result, 0, 0);
         $body = mysql_result($result, 0, 1);
         $url = url("poll/" . strtolower($username) . "/" . $data["updObj"]);
     }
     $caption = getIMG(url() . "images/emoticons/poll.png") . " " . sprintf(_UPD_POLL, $user, "");
     break;
 case updTypeAnnouncement:
     $markAsReadOp = "ma";
     $clubname = "[" . _UNKNOWN . "]";
     $result = sql_query("SELECT `cluName` FROM `clubs` " . "WHERE `cluid` = '" . $data["updUser"] . "' LIMIT 1");
Пример #9
0
    }
}
prefetchUserData(array_unique($useids));
foreach ($objList as $objData) {
    $togo--;
    if ($togo < 0) {
        break;
    }
    $microId = generateId();
    $thumbId = generateId();
    $u = getUserData($objData["objCreator"]);
    $objTitle = formatText($objData["objTitle"]) . ' <br />';
    if ($objData["objCollab"] > 0) {
        $objTitle .= sprintf(_BY_AND, getUserLink($u["useid"]), getUserLink($objData["objCollab"]));
    } else {
        $objTitle .= sprintf(_BY, getUserLink($u["useid"]));
    }
    if ($objData["objThumbDefault"]) {
        $src = urlf() . "images/litthumb.png";
    } else {
        $src = urlf() . applyIdToPath("files/thumbs/", $objData["objid"]) . "-" . preg_replace('/[^0-9]/', "", $objData["objLastEdit"]) . ".jpg";
    }
    $url = url("view/" . $objData["objid"]);
    if ($limit > 1) {
        echo '<span id="' . $microId . '" ' . "onmouseover=\"open_tab(this,'{$tabsId}','{$thumbId}')\">" . '<a href="' . $url . '">' . '<img alt="' . _ALT_THUMB . '" class="microthumb' . ($objData["objMature"] ? " mature" : "") . ($objData["objPending"] ? " pending" : "") . ($objData["objDeleted"] ? " deleted" : "") . '" src="' . $src . '" title="' . strip_tags($objTitle) . '" />' . '</a></span>' . "\n";
    }
    $bigList .= '<div ' . ($first ? "" : 'style="display: none" ') . 'id="' . $thumbId . '">' . '<table align="center" border="0" cellpadding="0" cellspacing="0"><tr><td class="a_center v_middle pad_top" style="height: ' . $tableHeight . 'px">' . '<div style="width: ' . $tableWidth . 'px">' . '<a href="' . $url . '">' . '<img alt="' . strip_tags($objTitle) . '" class="thumb' . ($objData["objMature"] ? " mature" : "") . ($objData["objPending"] ? " pending" : "") . ($objData["objDeleted"] ? " deleted" : "") . '" src="' . $src . '" title="' . strip_tags($objTitle) . '" />' . '</a></div></td></tr></table>' . "\n" . '<table border="0" cellpadding="0" cellspacing="0" class="wide" style="height: 40px"><tr><td class="a_center v_middle">' . '<div>' . $objTitle . '</div>' . "\n" . '</td></tr></table></div>' . "\n";
    if ($first) {
        $first = false;
        $firstMicroId = $microId;
        $firstThumbId = $thumbId;
Пример #10
0
">
				<?php 
        echo _READ_EXPLANATION;
        ?>
				<?php 
        echo getIMG(url() . "images/emoticons/nav-next.png");
        ?>
</a>
		</div>
		<?php 
    }
} else {
    ?>
	<div class="mar_bottom largetext">
		<?php 
    echo $_cmd[0] != "" && $_cmd[0] != "user" ? getUserLink($polData["polCreator"]) . ": " : "";
    ?>
		<?php 
    echo formatText($polData["polSubject"]);
    ?>
	</div>
	<div class="mar_bottom">
		<?php 
    echo formatText($polData["polComment"]);
    ?>
	</div>
	<?php 
}
if (!$_auth["useid"] || $polData["polCreator"] == $_auth["useid"]) {
    $alreadyVoted = true;
} else {
Пример #11
0
<?php

include_once INCLUDES . "layout!sidebar-func.php";
?>
<div class="padded" style="padding-top: 0">
	<?php 
putSidebarModStuff();
?>
	<?php 
/*<div class="caption"><?= _ACCOUNT ?>:</div>*/
?>
	<div class="container2 a_center">
		<div>
			<?php 
if (isLoggedIn()) {
    printf(_WELCOME_USER, getUserLink($_auth["useid"]));
} else {
    printf(_WELCOME_USER, "guest");
}
?>
		</div>
		<?php 
if (isLoggedIn()) {
    ?>
			<div class="sep">
				<a href="<?php 
    echo url("updates");
    ?>
"><b><?php 
    echo _UPDATES;
    ?>
Пример #12
0
			
			
				<?php 
    if (isset($_POST["useEmailReq"])) {
        $useEmailReq = $_POST["useEmailReq"];
        $result = sql_query("SELECT `useEid` FROM `useExtData` WHERE `useEmail` = '" . addslashes($useEmailReq) . "' LIMIT 1");
        $resultcount = mysql_num_rows($result);
        if ($resultcount == 0) {
            echo "No user found with this email.";
        } else {
            $useId = mysql_fetch_assoc($result);
            ?>
							<div class="mar_bottom">
							<b>Result</b>: 
							<?php 
            echo 'User ' . getUserLink($useId["useEid"]);
            ?>
							</div>
							<?php 
        }
    }
    ?>
			
			</div>
			<?php 
    echo iefixEnd();
    ?>

</div>
<?php 
}
Пример #13
0
function showThumbnails($params)
{
    global $_config, $_cmd, $_auth;
    if (!isset($params["quickSearch"])) {
        $params["quickSearch"] = false;
    }
    if (!isset($params["isFavorites"])) {
        $params["isFavorites"] = false;
    }
    if (!isset($params["showDeleted"])) {
        $params["showDeleted"] = false;
    }
    if (!isset($params["countDisabled"])) {
        $params["countDisabled"] = false;
    }
    if (!isset($params["select"])) {
        $params["select"] = "SELECT * FROM `objects`";
    }
    if (!isset($params["where"])) {
        $params["where"] = "1";
    }
    if (!isset($params["having"])) {
        $params["having"] = "";
    }
    if (!isset($params["maxcols"])) {
        $params["maxcols"] = 4;
    }
    if (!isset($params["isExtras"])) {
        $params["isExtras"] = false;
    }
    if (!isset($params["disableFiltering"])) {
        $params["disableFiltering"] = false;
    }
    if (!isset($params["onDisplayFiltering"])) {
        $params["onDisplayFiltering"] = false;
    }
    if (!isset($params["sortById"])) {
        $params["sortById"] = "";
    }
    //if( !isset( $params[ "noMostFaved" ]))
    $params["noMostFaved"] = false;
    if (!isLoggedIn()) {
        if ($params["where"] == "1") {
            $params["where"] = "`objGuestAccess` = '1'";
        } else {
            $params["where"] = "(" . $params["where"] . ") AND `objGuestAccess` = '1'";
        }
    }
    // Define the sorting method. There are 5 sorting methods:
    //
    // 0 - newest first
    // 1 - oldest first
    // 2 - most viewed
    // 3 - most faved
    // 4 - random
    // 5 - relevant
    if (isset($params["order"])) {
        $order = $params["order"];
    } else {
        if ($_cmd[0] == "search") {
            $order = isset($_GET["order"]) ? intval($_GET["order"]) : (isset($_COOKIE["yGalOrder"]) ? intval($_COOKIE["yGalOrder"]) : 0);
        } else {
            $order = isset($_GET["order"]) ? intval($_GET["order"]) : (isset($_COOKIE["yGalOrderSearch"]) ? intval($_COOKIE["yGalOrderSearch"]) : 0);
        }
    }
    if ($params["noMostFaved"] && ($order == 2 || $order == 3)) {
        $order = 0;
    }
    if ($params["isExtras"] && $order == 2) {
        $order = 0;
    }
    // Disable sorting by favs and views for the searching engine because it's too slow :(
    if ($_cmd[0] == "search" && $order != 0 && $order != 1) {
        $order = 0;
    }
    $order1 = $order;
    // Disable sorting by popularity for favourites because it's too slow :(
    if ($_cmd[0] == "favourites" && $order1 != 0 && $order1 != 1) {
        $order1 = 0;
    }
    switch ($order1) {
        case 1:
            if ($params["sortById"]) {
                $orderString = "ORDER BY " . $params["sortById"];
            } else {
                $orderString = $params["isFavorites"] ? "ORDER BY `favSubmitDate`" : "ORDER BY `objSubmitDate`";
            }
            break;
        case 2:
            $orderString = "ORDER BY `objPopularity` DESC";
            /*
            $params[ "select" ] = str_replace(
            	"FROM `objects`",
            	"FROM `objects` USE INDEX(`objPopularity`)",
            	$params[ "select" ]);
            */
            break;
        default:
            if ($params["sortById"]) {
                $orderString = "ORDER BY " . $params["sortById"] . " DESC";
            } else {
                $orderString = $params["isFavorites"] ? "ORDER BY `favSubmitDate` DESC" : "ORDER BY `objSubmitDate` DESC";
            }
    }
    // Define the amount of thumbnails to show. The default value is 12.
    if (isset($params["limit"])) {
        $limit = $params["limit"];
    } else {
        $limit = isset($_GET["limit"]) ? intval($_GET["limit"]) : (isset($_COOKIE["yGalLimit"]) ? intval($_COOKIE["yGalLimit"]) : 12);
        if ($limit != 8 && $limit != 12 && $limit != 24 && $limit != 48) {
            $limit = 12;
        }
    }
    // All pages except the front page "remember" the new
    // sorting/limiting settings.
    if ($_cmd[0] != "") {
        if (!$params["noMostFaved"]) {
            if ($_cmd[0] == "search") {
                setcookie("yGalOrder", $order, strtotime("+9 years"), "/", "." . $_config["galRoot"]);
            } else {
                setcookie("yGalOrderSearch", $order, strtotime("+9 years"), "/", "." . $_config["galRoot"]);
            }
        }
        setcookie("yGalLimit", $limit, strtotime("+1 month"), "/", "." . $_config["galRoot"]);
    }
    // Define the current offset.
    $offset = isset($_GET["offset"]) ? intval($_GET["offset"]) : 0;
    if ($offset < 0) {
        $offset = 0;
    }
    if (!$params["disableFiltering"]) {
        // If the user isn't mature, hide mature submissions.
        applyObjFilters($params["where"]);
        if (isset($params["folderWhere"])) {
            applyObjFilters($params["folderWhere"]);
        }
        if (isset($params["folderCalcWhere"])) {
            applyObjFilters($params["folderCalcWhere"]);
        }
        if (!$params["showDeleted"]) {
            $params["where"] = "(" . $params["where"] . ") " . "AND `objDeleted` = '0' AND `objPending` = '0'";
            if (isset($params["folderWhere"])) {
                $params["folderWhere"] = "(" . $params["folderWhere"] . ") " . "AND `objDeleted` = '0' AND `objPending` = '0'";
            }
            if (isset($params["folderCalcWhere"])) {
                $params["folderCalcWhere"] = "(" . $params["folderCalcWhere"] . ") " . "AND `objDeleted` = '0' AND `objPending` = '0'";
            }
        }
    }
    $totalFolders = 0;
    $gallery = array();
    if (isset($params["folderParent"])) {
        $gallery[-1] = -1;
        $limit--;
    }
    if (isset($params["folderSelect"])) {
        $query = $params["folderSelect"] . " WHERE " . $params["folderWhere"] . " GROUP BY `folid` ORDER BY `folName` LIMIT {$offset}, {$limit}";
        $result = sql_query($query);
        while ($folData = mysql_fetch_assoc($result)) {
            $gallery[-$folData["folid"]] = $folData;
        }
        $query = $params["folderSelect"] . " WHERE " . $params["folderWhere"] . " GROUP BY `folid`";
        $result = sql_query($query);
        $totalFolders = mysql_num_rows($result);
        $offset -= $totalFolders;
    }
    // Query all the currently visible thumbnails and store the data in the
    // $gallery array.
    if ($params["countDisabled"]) {
        $selectCmd = $params["select"];
    } else {
        $selectCmd = preg_replace('/^SELECT/', "SELECT SQL_CALC_FOUND_ROWS", $params["select"]);
    }
    $tmpOffset = $offset < 0 ? 0 : $offset;
    $tmpLimit = $offset < 0 ? $limit + $offset : $limit;
    $limit1 = $limit;
    if ($params["countDisabled"]) {
        $limit1++;
    }
    $query = "{$selectCmd} WHERE " . $params["where"] . " " . $params["having"] . " {$orderString} LIMIT {$tmpOffset}, {$limit1}";
    /*
    if( $_auth[ "useid" ] == 7 )
    {
    	echo $query;
    }
    */
    $result = sql_query($query);
    while ($objData = mysql_fetch_assoc($result)) {
        $gallery[$objData["objid"]] = $objData;
    }
    // Calculate the total amount of submissions that's possible to browse
    // through with the current options.
    if ($params["countDisabled"]) {
        $totalCount = $offset + $limit;
        if (count($gallery) > $limit) {
            $totalCount++;
        }
    } else {
        $result = sql_query("SELECT FOUND_ROWS()");
        $totalCount = $totalFolders + mysql_result($result, 0);
    }
    // Generate the navigation bar.
    if ($_cmd[0] == "") {
        $galleryNavs = "";
    } else {
        iefixStart();
        ob_start();
        $tmpOffset = isset($_GET["offset"]) ? intval($_GET["offset"]) : 0;
        navControls($tmpOffset, $limit, $totalCount);
        ?>
		<div class="a_center">
			<?php 
        if ($params["quickSearch"]) {
            ?>
				<form action="<?php 
            echo url("search");
            ?>
" method="get">
				<?php 
            foreach ($_GET as $key => $value) {
                if ($key != "keywordList" && $key != "offset") {
                    echo '<input name="' . htmlspecialchars($key) . '" type="hidden" value="' . htmlspecialchars($value) . '" />';
                }
            }
            ?>
				<select name="keywordList" onchange="this.form.submit();">
				<option value=""></option>
				<option value=""><?php 
            echo _SEARCH;
            ?>
</option>
				<?php 
            // By default, select the first root keyword group.
            $result = sql_query("SELECT `keyid` FROM `keywords` " . "WHERE `keySubcat` = '0' ORDER BY `keyWord` LIMIT 1");
            if (mysql_num_rows($result)) {
                $mainSubcat = mysql_result($result, 0);
            } else {
                $mainSubcat = 0;
            }
            if (isset($_GET["keywordList"])) {
                // If it's already a search request then see what keyword groups are
                // involved in the search and allow selection of siblings inside
                // those groups.
                $list = preg_split('/\\s/', $_GET["keywordList"], -1, PREG_SPLIT_NO_EMPTY);
            } else {
                $list = array($mainSubcat);
            }
            $first1 = true;
            $where1 = "`keyid` IN(";
            foreach ($list as $keyid) {
                $keyid = intval($keyid);
                if ($keyid == 0) {
                    continue;
                }
                $result = sql_query("SELECT `keySubcat` FROM `keywords` " . "WHERE `keyid` = '{$keyid}' LIMIT 1");
                if (mysql_num_rows($result) > 0) {
                    $keySubcat = mysql_result($result, 0);
                    $where1 .= ($first1 ? "" : ",") . "'{$keySubcat}'";
                    $first1 = false;
                }
            }
            if ($mainSubcat > 0) {
                $where1 .= ($first1 ? "" : ",") . "'{$mainSubcat}'";
            }
            $where1 .= ")";
            $limit1 = 5;
            $result = sql_query("SELECT `keyid`,`keyWord` FROM `keywords` " . "WHERE {$where1} ORDER BY `keyWord` LIMIT {$limit1}");
            while ($keyData = mysql_fetch_assoc($result)) {
                $keyData["keyWord"] = trim(preg_replace('/^.*\\|/', "", $keyData["keyWord"]));
                if (preg_match('/\\@$/', $keyData["keyWord"])) {
                    continue;
                }
                ?>
					<optgroup label="<?php 
                echo $keyData["keyWord"];
                ?>
">
					<?php 
                $result2 = sql_query("SELECT * FROM `keywords` " . "WHERE `keySubcat` = '" . $keyData["keyid"] . "' ORDER BY `keyWord`");
                while ($rowData = mysql_fetch_assoc($result2)) {
                    $rowData["keyWord"] = trim(preg_replace('/^.*\\|/', "", $rowData["keyWord"]));
                    if (preg_match('/\\@$/', $rowData["keyWord"])) {
                        continue;
                    }
                    ?>
						<option <?php 
                    echo isset($_GET["keywordList"]) && $_GET["keywordList"] == $rowData["keyid"] ? 'selected="selected"' : "";
                    ?>
							value="<?php 
                    echo $rowData["keyid"];
                    ?>
"><?php 
                    echo htmlspecialchars($rowData["keyWord"]);
                    ?>
</option>
						<?php 
                }
                ?>
					</optgroup>
					<?php 
            }
            ?>
				</select>
				</form>
				&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
				<?php 
        }
        ?>
			<form action="<?php 
        echo url(".");
        ?>
" method="get">
			<?php 
        foreach ($_GET as $key => $value) {
            if ($key != "order" && $key != "limit" && $key != "offset") {
                echo '<input name="' . htmlspecialchars($key) . '" type="hidden" value="' . htmlspecialchars($value) . '" />';
            }
        }
        ?>
			<select name="order">
				<option <?php 
        echo $order == 0 ? 'selected="selected"' : "";
        ?>
 value="0"><?php 
        echo _NEWEST_FIRST;
        ?>
</option>
				<option <?php 
        echo $order == 1 ? 'selected="selected"' : "";
        ?>
 value="1"><?php 
        echo _OLDEST_FIRST;
        ?>
</option>
				<?php 
        if ($_cmd[0] != "search" && $_cmd[0] != "favourites") {
            if (!$params["noMostFaved"]) {
                if (!$params["isExtras"]) {
                    ?>
							<option <?php 
                    echo $order == 2 ? 'selected="selected"' : "";
                    ?>
 value="2"><?php 
                    echo _CLUB_POPULAR;
                    ?>
</option>
							<?php 
                }
                /*
                ?>
                <option <?= $order == 3 ? 'selected="selected"' : "" ?> value="3"><?=_MOST_VIEWED ?></option>
                <?
                */
            }
            /*
            ?>
            <!--<option <?= $order == 4 ? 'selected="selected"' : "" ?> value="4"><?=_RANDOM ?></option>-->
            <?
            
            if( $_cmd[ 0 ] == "search" )
            {
            	?>
            	<option <?= $order == 5 ? 'selected="selected"' : "" ?> value="5"><?=_SEARCH_RELEVANT ?></option>
            	<?
            }
            */
        }
        ?>
			</select>
			<?php 
        $tmpLimit = $limit;
        if (isset($params["folderParent"])) {
            $tmpLimit++;
        }
        ?>
			<select name="limit">
				<option <?php 
        echo $tmpLimit == 8 ? 'selected="selected"' : "";
        ?>
 value="8"><?php 
        echo fuzzy_number(8);
        ?>
</option>
				<option <?php 
        echo $tmpLimit == 12 ? 'selected="selected"' : "";
        ?>
 value="12"><?php 
        echo fuzzy_number(12);
        ?>
</option>
				<option <?php 
        echo $tmpLimit == 24 ? 'selected="selected"' : "";
        ?>
 value="24"><?php 
        echo fuzzy_number(24);
        ?>
</option>
				<option <?php 
        echo $tmpLimit == 48 ? 'selected="selected"' : "";
        ?>
 value="48"><?php 
        echo fuzzy_number(48);
        ?>
</option>
			</select>

			<input class="submit" type="submit" value="<?php 
        echo _UPDATE;
        ?>
"
				style="vertical-align: middle" />

			</form>
		</div>
		<?php 
        $galleryNavs = ob_get_contents();
        ob_end_flush();
        ?>
		<div class="hline">&nbsp;</div>
		<?php 
        iefixEnd();
    }
    $cols = 0;
    $imagesToGo = $limit;
    if (isset($params["folderParent"])) {
        $imagesToGo++;
    }
    $useids = array();
    foreach ($gallery as $objData) {
        if (isset($objData["objCreator"])) {
            $useids[] = $objData["objCreator"];
        }
    }
    prefetchUserData(array_unique($useids));
    if ($params["onDisplayFiltering"]) {
        // Prepare user filters array (used below).
        $useFilters = preg_split('/[^0-9]/', $_auth["useObjFilters"], 63, PREG_SPLIT_NO_EMPTY);
    }
    foreach ($gallery as $objid => $objData) {
        if ($objid < 0) {
            // Show a folder icon.
            ?>
			<div class="gallery_col">
				<div class="a_center padded mar_bottom<?php 
            echo $cols < 3 ? " mar_right" : "";
            ?>
">
					<?php 
            if (isset($params["folderParent"])) {
                $url = url(($params["isExtras"] ? "extras" : "gallery") . "/" . strtolower($params["folderParent"]["useUsername"]));
                ?>
						<div style="padding-top: 35px;">
							<a href="<?php 
                echo $url;
                ?>
">
								<?php 
                echo getIMG(urlf() . "images/folder_up.png");
                ?>
<br />
								<b><?php 
                echo _SET_FOLDER_BACK;
                ?>
</b>
							</a>
						</div>
						<?php 
            } else {
                $url = url(($params["isExtras"] ? "extras" : "gallery") . "/" . strtolower($params["folderCreator"]["useUsername"]) . "/" . $objData["folIdent"]);
                ?>
						<div style="background: url(<?php 
                echo urlf() . "images/folder.png";
                ?>
) center top no-repeat; height: 140px;">
							<div style="padding-top: 35px">
								<a href="<?php 
                echo $url;
                ?>
"><?php 
                echo getFolderIcon($objData["folid"]);
                ?>
</a>
							</div>
						</div>
						<div>
							<b><a href="<?php 
                echo $url;
                ?>
"><?php 
                echo formatText($objData["folName"], false, true);
                ?>
</a></b>
						</div>
						<?php 
                if (isset($params["folderCalcWhere"])) {
                    $query = $params["folderCalc"] . " WHERE " . $params["folderCalcWhere"] . " AND `objFolder` = '" . $objData["folid"] . "'";
                    $result = sql_query($query);
                    echo "( " . fuzzy_number(mysql_result($result, 0)) . " )";
                }
            }
            ?>
				</div>
			</div>
			<?php 
        } else {
            // Show a thumbnail.
            if ($params["onDisplayFiltering"]) {
                // Check objDeleted, objPending, objMature manually.
                if ($objData["objDeleted"] || $objData["objPending"]) {
                    continue;
                    // Don't show deleted/pending
                }
                if (count($useFilters) > 0) {
                    $objFilters = preg_split('/[^0-9]/', $objData["objMature"], 63, PREG_SPLIT_NO_EMPTY);
                    $isFiltered = false;
                    foreach ($objFilters as $filter) {
                        if (in_array($filter, $useFilters)) {
                            $isFiltered = true;
                            break;
                        }
                    }
                    if ($isFiltered) {
                        continue;
                        // Don't show filtered objects
                    }
                }
            }
            $anchor = url("view/" . ($params["isExtras"] ? "e" : "") . $objData["objid"]);
            if ($params["isExtras"]) {
                $src = $objData["objThumbURL"];
            } elseif ($objData["objThumbDefault"]) {
                $src = urlf() . "images/litthumb.png";
            } else {
                $src = urlf() . applyIdToPath("files/thumbs/", $objData["objid"]) . "-" . preg_replace('/[^0-9]/', "", $objData["objLastEdit"]) . ".jpg";
            }
            $objTitle = formatText($objData["objTitle"]);
            // Do not display "by <artist_name>" in /gallery and /galleryclubs.
            if ($_cmd[0] != "gallery" && $_cmd[0] != "galleryclubs" && $_cmd[0] != "extras") {
                $objTitle .= "<br /> ";
                if ($objData["objCollab"] > 0) {
                    $objTitle .= sprintf(_BY_AND, getUserLink($objData["objCreator"]), getUserLink($objData["objCollab"]));
                } else {
                    $objTitle .= sprintf(_BY, getUserLink($objData["objCreator"]));
                }
            } else {
                if ($objData["objCollab"] > 0) {
                    $objTitle .= " <br />" . sprintf(_BY_COLLAB_WITH, getUserLink($objData["objCollab"]));
                }
            }
            if ($objData["objForUser"] > 0 && $_cmd[0] != "gifts") {
                $objTitle .= " <br />" . sprintf(_FOR, getUserLink($objData["objForUser"]));
            }
            // Display "in <club_name>" in /gallery and /galleryclubs if the
            // work is submitted to a club.
            if ($_cmd[0] == "galleryclubs" || $_cmd[0] == "gallery" && $objData["objForClub"] > 0) {
                $result = sql_query("SELECT `cluName` FROM `clubs` " . "WHERE `cluid` = '" . $objData["objForClub"] . "'");
                if (mysql_num_rows($result) > 0) {
                    $club = '<a href="' . url("club/" . $objData["objForClub"]) . '">' . mysql_result($result, 0) . '</a>';
                    $objTitle .= '<br /> ' . sprintf(_IN, $club);
                }
            }
            ?>
			<div class="gallery_col">
				<div class="a_center padded mar_bottom<?php 
            echo $cols < 3 ? " mar_right" : "";
            ?>
">
					<a href="<?php 
            echo $anchor;
            ?>
">
						<?php 
            echo getIMG($src, 'alt="' . strip_tags($objTitle) . '" class="thumb' . ($objData["objMature"] && isLoggedIn() ? " mature" : "") . ($objData["objPending"] ? " pending" : "") . ($objData["objDeleted"] ? " deleted" : "") . '" width="' . $objData["objThumbWidth"] . '" height="' . $objData["objThumbHeight"] . '" title="' . strip_tags($objTitle) . '"');
            ?>
</a>
					<div><?php 
            echo $objTitle;
            ?>
</div>
				</div>
			</div>
			<?php 
        }
        $cols++;
        if ($cols >= $params["maxcols"]) {
            $cols = 0;
            ?>
			<div class="clear">&nbsp;</div>
			<?php 
        }
        $imagesToGo--;
        if ($imagesToGo <= 0) {
            break;
        }
    }
    if (count($gallery) == 0) {
        ?>
		<div><?php 
        echo _NO_SUBMISSIONS;
        ?>
</div>
		<?php 
    }
    if ($_cmd[0] != "" || $params["limit"] == 12) {
        ?>
		<div class="hline">&nbsp;</div>
		<?php 
    }
    // On the front page also show the "More >" link which leads to the
    // global gallery browsing.
    if ($_cmd[0] == "" && $params["limit"] == 12) {
        ?>
		<div class="a_right mar_bottom mar_right">
			<a class="disable_wrapping smalltext" href="<?php 
        echo url("browse");
        ?>
">
			<?php 
        echo _MORE;
        ?>
			<?php 
        echo getIMG(url() . "images/emoticons/nav-next.png");
        ?>
			</a>
		</div>
		<?php 
    }
    echo $galleryNavs;
    ?>
	<div class="clear">&nbsp;</div>
	<?php 
}
Пример #14
0
		<div class="container2 mar_bottom notsowide">
			<?php 
    echo iefixStart();
    ?>
			<div class="a_center largetext">
				Suspend / Ban
			</div>
			<form action="<?php 
    echo url(".");
    ?>
" method="post">
			<div class="sep mar_left mar_right">
				<div class="caption">
					<?php 
    echo sprintf(_MOD_SUSPENDED_UNTIL, getUserLink($useData["useid"]));
    ?>
:
				</div>
				<div>
					<input type="text" name="suspendUntil" size="40"
						value="<?php 
    echo gmdate("j F Y H:i", applyTimezone($suspendedUntil));
    ?>
" />
				</div>

				<div class="mar_left smalltext">
					<?php 
    $susLeft = $suspendedUntil - time();
    $susLeft = round(($susLeft < 0 ? 0 : $susLeft) / (60 * 60 * 24));
Пример #15
0
function showComment($comData, $level, $showParent = false, $markAsReadId = '', $commentCountId = '', $markAsReadId2 = '')
{
    global $_config, $_signatureCache, $_auth, $_cmd, $_currentPageURL;
    // _HACKFIX - facsimilnym 2011-09-05
    // Workaround for the "blank" useDateFormat that ~140,000 users have.
    // Setting it up here, since there's like 5 code paths.
    if (!isset($_auth["useDateFormat"]) || $_auth["useDateFormat"] == "") {
        $_auth["useDateFormat"] = "Y-m-d \\@ g:i A";
    }
    if (isset($comData["pmsid"])) {
        $comData["comid"] = $comData["pmsid"];
        $comData["comCreator"] = $comData["pmsCreator"];
        $comData["comNoEmoticons"] = $comData["pmsNoEmoticons"];
        $comData["comNoSig"] = $comData["pmsNoSig"];
        $comData["comNoBBCode"] = $comData["pmsNoBBCode"];
        $comData["comSubject"] = $comData["pmsTitle"];
        $comData["comSubjectDateHide"] = true;
        $comData["comComment"] = $comData["pmsComment"];
        $comData["comObj"] = $comData["pmsObj"];
        $comData["comObjType"] = "pms";
        $comData["comSubmitDate"] = $comData["pmsSubmitDate"];
        $comData["comSubmitIp"] = $comData["pmsSubmitIp"];
        $comData["comLastEdit"] = $comData["pmsLastEdit"];
        $comData["comEditIp"] = $comData["pmsEditIp"];
        $comData["comTotalEdits"] = $comData["pmsTotalEdits"];
        $comData["comPmUser"] = $comData["pmsPmUser"];
    }
    if (isTwit($comData["comCreator"])) {
        return;
    }
    if (!isLoggedIn()) {
        $result = sql_query("SELECT `useGuestAccess` FROM `useExtData`" . dbWhere(array("useEid" => $comData["comCreator"])));
        if (!mysql_result($result, 0)) {
            return;
        }
    }
    $commentID = "yg-cmt" . $comData["comid"];
    $instantReplyOuterId = $commentID . "InstantReplyOuter";
    $instantReplyId = $commentID . "InstantReplyId";
    if (!isset($comData["comNoEmoticons"])) {
        $comData["comNoEmoticons"] = false;
    }
    if (!isset($comData["comNoSig"])) {
        $comData["comNoSig"] = false;
    }
    if (!isset($comData["comNoBBCode"])) {
        $comData["comNoBBCode"] = false;
    }
    if (isset($comData["pmsid"])) {
        if ($comData["comCreator"] != $_auth["useid"] && $comData["comPmUser"] != $_auth["useid"]) {
            echo '<div class="container2">' . _PM_NO_ACCESS . '</div>';
            return;
        }
    }
    $levellim = $level < 8 ? $level : 8;
    for ($i = 0; $i <= $levellim; $i++) {
        ?>
		<div class="<?php 
        echo $i == $levellim ? "pad_top" : "";
        echo $level > 0 && $i < $levellim ? "cmt_border_left" : "";
        ?>
">
		<?php 
    }
    //	if($_cmd[0] != "comment")
    echo '<a name="comment' . $comData["comid"] . '"></a>';
    //	echo '<div'.($markAsReadId != "" ? ' id="'.$markAsReadId.'"' : "" ).'>'; // Comment outer
    //	echo '<div'.($markAsReadId != "" ? ' id="'.$markAsReadId.'_"' : "" ).' class="container2">'; // Comment body
    echo '<div class="container2">';
    // Comment body
    iefixStart();
    // display parent comment
    if ($showParent && isset($comData["comObjType"]) && $comData["comObjType"] == "com") {
        $result = sql_query("SELECT * FROM `comments` WHERE `comid` = '" . $comData["comObj"] . "' LIMIT 1");
        if ($parData = mysql_fetch_assoc($result)) {
            ?>
			<div class="caption reminder_cap">
				<?php 
            echo sprintf(_WROTE, getUserLink($parData["comCreator"]));
            ?>
:
			</div>
			<div class="reminder">
				<?php 
            echo formatText($parData["comComment"], $parData["comNoEmoticons"], $parData["comNoBBCode"]);
            ?>
			</div>
			<?php 
        }
    } elseif ($showParent && isset($comData["pmsid"])) {
        $result = sql_query("SELECT * FROM `pms` WHERE `pmsid` = '" . $comData["comObj"] . "' LIMIT 1");
        if ($parData = mysql_fetch_assoc($result)) {
            if ($parData["pmsCreator"] == $_auth["useid"] || $parData["pmsPmUser"] == $_auth["useid"]) {
                ?>
				<div class="caption reminder_cap">
					<?php 
                echo sprintf(_WROTE, getUserLink($parData["pmsCreator"]));
                ?>
:
				</div>
				<div class="reminder">
					<?php 
                echo formatText($parData["pmsComment"], $parData["pmsNoEmoticons"], $parData["pmsNoBBCode"]);
                ?>
				</div>
				<?php 
            }
        }
    }
    if ($comData["comCreator"] != 0) {
        ?>
		<div class="f_right mar_left a_center" style="position: relative; top: -3px; left: 3px">
			<?php 
        echo getUserAvatar("", $comData["comCreator"], true);
        ?>
		</div>
		<?php 
    }
    if (isset($comData["comSubject"])) {
        if (!isset($comData["comSubjectDateHide"])) {
            ?>
<div class="smalltext mar_bottom"><?php 
            // Show IPs to moderators+ (as an acronym).
            if (atLeastModerator() && isset($comData["comSubmitIp"]) && isset($comData["comEditIp"])) {
                ?>
				<acronym style="cursor: help" title="Submitted from <?php 
                echo getDotDecIp($comData["comSubmitIp"]);
                ?>
, last edited from <?php 
                echo getDotDecIp($comData["comEditIp"]);
                ?>
">
				<?php 
            }
            printf(_COMMENT_POSTED_ON, gmdate($_auth["useDateFormat"], applyTimezone(strtotime($comData["comSubmitDate"]))));
            // Close the acronym opened above.
            if (atLeastModerator() && isset($comData["comSubmitIp"]) && isset($comData["comEditIp"])) {
                ?>
				</acronym>
				<?php 
            }
            ?>
</div><?php 
        }
        ?>
		<div class="largetext mar_bottom"><b><?php 
        echo formatText($comData["comSubject"], false, true);
        ?>
</b></div>
		<?php 
    }
    ?>
	<div class="commentData">
		<?php 
    $allowImages = isset($comData["comAllowImages"]) && $comData["comAllowImages"];
    echo formatText($comData["comComment"], $comData["comNoEmoticons"], $comData["comNoBBCode"], $allowImages);
    ?>
	</div>
	<?php 
    if (!$comData["comNoSig"] && $_cmd[0] != "updates") {
        if (!isset($_signatureCache[$comData["comCreator"]])) {
            $result = sql_query("SELECT `useSignature` FROM `useExtData` WHERE `useEid` = '" . $comData["comCreator"] . "' LIMIT 1");
            if (mysql_num_rows($result)) {
                $_signatureCache[$comData["comCreator"]] = mysql_result($result, 0);
            } else {
                $_signatureCache[$comData["comCreator"]] = "";
            }
        }
        if ($_signatureCache[$comData["comCreator"]] != "") {
            ?>
			<div class="hline" style="margin-right: 60px;">&nbsp;</div>
			<div class="smalltext">
			<?php 
            echo formatText($_signatureCache[$comData["comCreator"]]);
            ?>
			</div>
			<?php 
        }
    }
    ?>
	<div class="clear">&nbsp;</div>
	<?php 
    if (isset($comData["newid"])) {
        // News page.
        $result = sql_query("SELECT COUNT(*) FROM `comments` " . "WHERE `comObjType` = 'new' AND `comObj` = '" . $comData["newid"] . "'");
        $newsCount = mysql_result($result, 0);
        $newsURL = url("news/" . $comData["newid"]);
        ?>
		<div class="sep">
			<a href="<?php 
        echo $newsURL;
        ?>
">
			<span class="button smalltext" style="float: right"
				onclick="document.location='<?php 
        echo $newsURL;
        ?>
';"><?php 
        echo _COMMENTS;
        ?>
				<?php 
        if (!$_auth["useStatsHide"]) {
            echo "(" . fuzzy_number($newsCount) . ")";
        }
        ?>
			</span></a>
		</div>
		<?php 
    }
    if ($comData["comid"]) {
        ?>
		<div class="sep commentActions">
			<?php 
        getCommentParent($comData, $parentURL, $parentType, $parentTitle, false);
        getCommentParent($comData, $rootURL, $rootType, $rootTitle, true);
        $replyURL = url("comment/" . $comData["comid"] . ($_config["checkSubmitDate"] ? "/" . preg_replace('/[^0-9]/', "", $comData["comSubmitDate"]) : ''));
        $replyCommentId = $commentID . "ReplyCommentId";
        $replyButtonId = $commentID . "ReplyButtonId";
        $replyScript = "var elin = get_by_id( '" . $instantReplyId . "' );" . "var elb = get_by_id( '" . $replyButtonId . "' );" . "if( !elb ) return false;" . "if( elb.innerHTML == '" . _CANCEL . "' ) {" . "  reset_focus(); " . "  collapseAnim( '{$instantReplyOuterId}', -30, 0, '' ); " . "  elb.innerHTML = '" . _REPLY . "';" . "  return false;" . "}" . "_IR = { " . "commentId: '" . $replyCommentId . "'," . "commentName: 'comment'," . "commentDefault: ''," . "commentWide: true," . "commentRows: 7," . "commentNoBBCode: " . (isLoggedIn() && $_auth["useNoBBCode"] ? "true" : "false") . "," . "commentNoEmoticons: " . (isLoggedIn() && $_auth["useNoEmoticons"] ? "true" : "false") . "," . "commentNoOptions: false," . "commentNoSig: " . (isLoggedIn() && $_auth["useNoSig"] ? "true" : "false") . "," . "emoticonPopupURL: '" . url("emoticons", array("popup" => "yes", "comment" => $replyCommentId)) . "'," . "previewURL: '" . url("preview", array("popup" => "yes")) . "'" . "};" . "var ht = showReplyForm( '" . $replyURL . "', '" . $_currentPageURL . "' );" . "elin.innerHTML = ht;" . "collapseAnim( '{$instantReplyOuterId}', 30, 0, 'set_focus( \\'' + _IR.commentId + '\\' );' ); " . "elb.innerHTML = '" . _CANCEL . "';" . "return false;";
        if (!isset($comData["pmsid"]) && $replyURL != url(".") && $_cmd[0] != "editcomment") {
            ?>
				<span class="button smalltext" style="float: right"
					id="<?php 
            echo $replyButtonId;
            ?>
" onclick="<?php 
            echo $replyScript;
            ?>
">
					<?php 
            echo _REPLY;
            ?>
				</span>
				<?php 
        }
        if ($_cmd[0] == "comment" && $rootURL != url(".") && $level == 0) {
            ?>
				<a href="<?php 
            echo $rootURL;
            ?>
" title="<?php 
            echo htmlspecialchars($rootTitle);
            ?>
">
				<span class="button smalltext" style="float: right"
					onclick="document.location='<?php 
            echo $rootURL;
            ?>
';">
					<?php 
            echo _ROOT;
            ?>
 (<?php 
            echo $rootType;
            ?>
)
				</span></a>
				<?php 
        }
        if ($_cmd[0] == "comment" && $parentURL != url(".") && $level == 0 && $parentURL != $rootURL) {
            ?>
				<a href="<?php 
            echo $parentURL;
            ?>
" title="<?php 
            echo htmlspecialchars($parentTitle);
            ?>
">
				<span class="button smalltext" style="float: right"
					onclick="document.location='<?php 
            echo $parentURL;
            ?>
';">
					<?php 
            echo _PARENT;
            ?>
 (<?php 
            echo $parentType;
            ?>
)
				</span></a>
				<?php 
        }
        if ($_cmd[0] == "updates") {
            $comid = $comData["comid"];
            $script = "add_operation( 'm{$comid}' );\n" . "\$('{$markAsReadId}').hide(); " . ($markAsReadId2 != "" ? "if() \$('{$markAsReadId2}').hide(); " : "") . "var elb = \$( '{$replyButtonId}' );" . "if( !elb ) return false;" . "if( elb.innerHTML == '" . _CANCEL . "' ) {" . "  reset_focus(); " . "  collapseAnim( '{$instantReplyOuterId}', -30, 0, '' ); " . "  elb.innerHTML = '" . _REPLY . "';" . "  return false;" . "}" . "comment_count--; " . "\$('_updCmtCnt').innerHTML = fuzzy_number( comment_count ); " . "\$('_globCmtCnt').innerHTML = fuzzy_number( comment_count );";
            ?>
				<div id="<?php 
            echo $id1 = $commentID . "Updates1";
            ?>
" class="button smalltext" style="display: none; float: right"
					onclick="<?php 
            echo $script;
            ?>
"><?php 
            echo _MARK_AS_READ;
            ?>
: <span class="error"><?php 
            echo _CLICK_TO_CONFIRM;
            ?>
</span></div>
				<div id="<?php 
            echo $id2 = $commentID . "Updates2";
            ?>
" class="button smalltext" style="float: right"
					onclick="$('<?php 
            echo $id1;
            ?>
').show(); $('<?php 
            echo $id2;
            ?>
').hide();"><?php 
            echo _MARK_AS_READ;
            ?>
</div>
				<?php 
        }
        if ((atLeastSModerator() || $comData["comCreator"] == $_auth["useid"]) && $_cmd[0] != "editcomment" && $_cmd[0] != "updates") {
            $editURL = isset($comData["pmsid"]) ? url("editpm/" . $comData["pmsid"]) : url("editcomment/" . $comData["comid"]);
            ?>
				<a href="<?php 
            echo $editURL;
            ?>
">
				<span class="button smalltext" style="float: right"
					onclick="document.location='<?php 
            echo $editURL;
            ?>
';">
					<?php 
            echo _EDIT;
            ?>
				</span></a>
				<?php 
        }
        ?>
			<div class="f_left mar_top smalltext">
				<?php 
        // Show IPs to moderators+ (as an acronym).
        if (atLeastModerator()) {
            ?>
					<acronym style="cursor: help" title="Submitted from <?php 
            echo getDotDecIp($comData["comSubmitIp"]);
            ?>
, last edited from <?php 
            echo getDotDecIp($comData["comEditIp"]);
            ?>
">
					<?php 
        }
        if (!isset($comData["pmsid"])) {
            ?>
					<a class="originalUrl" href="<?php 
            echo $replyURL;
            ?>
">#</a>
					<?php 
        }
        printf(_COMMENT_POSTED_ON, gmdate($_auth["useDateFormat"], applyTimezone(strtotime($comData["comSubmitDate"]))));
        if (isset($comData["comTotalEdits"]) && $comData["comTotalEdits"] > 0) {
            echo "<br />" . sprintf(_COMMENT_EDITED, $comData["comTotalEdits"], gmdate($_auth["useDateFormat"], applyTimezone(strtotime($comData["comLastEdit"]))));
        }
        // Close the acronym opened above.
        if (atLeastModerator()) {
            ?>
					</acronym>
					<?php 
        }
        ?>
			</div>
		</div>
		<?php 
    }
    ?>
	<div class="clear">&nbsp;</div>
	<?php 
    iefixEnd();
    echo '</div>';
    // Comment body
    //echo '</div>'; // Comment outer
    ?>
	<table cellspacing="0" cellpadding="0" width="100%"><tr><td>
	<div id="<?php 
    echo $instantReplyOuterId;
    ?>
" style="display: none">
		<div class="cmt_border_left" style="padding: 4px; padding-right: 0;" id="<?php 
    echo $instantReplyOuterId;
    ?>
_">
			<div class="caption smalltext"><?php 
    echo _REPLY;
    ?>
:</div>
			<div style="padding: 1px; padding-bottom: 5px" id="<?php 
    echo $instantReplyId;
    ?>
"><br /></div>
		</div>
	</div>
	</td></tr></table>
	<?php 
    for ($i = 0; $i <= $levellim; $i++) {
        echo "</div>";
    }
}
Пример #16
0
							</tr>
							<?php 
    }
    if ($abuData["aburMod"] != "?") {
        ?>
							<tr class="v_top">
								<td class="a_right"><b><?php 
        echo _ADMINISTRATOR;
        ?>
</b>:</td>
								<td><span class="error">(<?php 
        echo $abuData["aburMod"];
        ?>
)</span>
									<?php 
        echo getUserLink($abuData["aburModName"]);
        ?>
:
									<?php 
        echo formatText($abuData["aburModComment"]);
        ?>
</td>
							</tr>
							<?php 
    }
    if (trim($abuData["abuReason"]) != "" && $abuData["aburMod"] != "+") {
        ?>
							<tr class="v_top">
								<td class="a_right"><b><?php 
        echo _ABUSE_RULE;
        ?>
Пример #17
0
if (!isset($maxcols)) {
    $maxcols = 4;
}
$imagesToGo = $limit;
foreach ($gallery as $objData) {
    $anchor = url("view/" . $objData["objid"]);
    if ($objData["objThumbDefault"]) {
        $src = url() . "images/litthumb.png";
    } else {
        $src = url() . applyIdToPath("files/thumbs/", $objData["objid"]) . "-" . preg_replace('/[^0-9]/', "", $objData["objRevisionDate"]) . ".jpg";
    }
    $useResult = mysql_query("SELECT `useUsername` FROM `users` WHERE `useid` = '" . $objData["objCreator"] . "' LIMIT 1") or trigger_error(_ERR_MYSQL);
    $useData = mysql_fetch_assoc($useResult);
    $objTitle = htmlspecialchars($objData["objTitle"]);
    if ($_cmd[0] != "gallery" && $_cmd[0] != "galleryclubs") {
        $objTitle .= '<br /> ' . sprintf(_BY, getUserLink($objData["objCreator"]));
    }
    if ($_cmd[0] == "galleryclubs" || $_cmd[0] == "gallery" && $objData["objForClub"] > 0) {
        $result = mysql_query("SELECT `cluName` FROM `clubs` WHERE `cluid` = '" . $objData["objForClub"] . "'");
        if (mysql_num_rows($result)) {
            $club = '<a href="' . url("club/" . $objData["objForClub"]) . '">' . mysql_result($result, 0) . '</a>';
            $objTitle .= '<br /> in ' . $club;
            // TODO: i18n "in %s"
        }
    }
    echo '<div class="gallery_col"><div class="a_center padded mar_bottom' . ($cols < 3 ? " mar_right" : "") . '"><a href="' . $anchor . '">' . getIMG($src, 'alt="' . strip_tags($objTitle) . '" class="thumb' . ($objData["objMature"] ? " mature" : "") . ($objData["objPending"] ? " pending" : "") . ($objData["objDeleted"] ? " deleted" : "") . '" width="' . $objData["objThumbWidth"] . '" height="' . $objData["objThumbHeight"] . '" title="' . strip_tags($objTitle) . '"') . '</a>' . "\n" . '<div class="">' . $objTitle . '</div></div></div>';
    $cols++;
    if ($cols >= $maxcols) {
        $cols = 0;
        echo '<div class="clear">&nbsp;</div>';
    }
Пример #18
0
function getObjectThumb($objid = 0, $size = 30, $isExtras = false)
{
    global $_auth;
    $objid = intval($objid);
    $where = "`objid` = '{$objid}'";
    if (!atLeastHelpdesk()) {
        $where = "({$where}) AND `objDeleted` = '0' AND `objPending` = '0'";
    }
    applyObjFilters($where);
    $result = sql_query("SELECT * FROM `" . ($isExtras ? "extras" : "objects") . "` WHERE {$where} LIMIT 1");
    // check if the object exists - Why did this say club before?
    if (!($objData = mysql_fetch_assoc($result))) {
        // no?
        return getIMG(urlf() . "images/nothumb.gif", 'alt="[' . _BBCODE_THUMB . '=' . $objid . ']" title="' . sprintf(_UNKNOWN_SUBMISSION, $objid) . '" class="microthumb"');
    }
    if (!isLoggedIn()) {
        $sql = "SELECT `useGuestAccess` FROM `useExtData`" . dbWhere(array("useEid" => $objData["objCreator"]));
        $result = sql_query($sql);
        if (!mysql_result($result, 0)) {
            return getIMG(urlf() . "images/nothumb.gif", 'alt="[' . _BBCODE_THUMB . '=' . $objid . ']" title="' . sprintf(_UNKNOWN_SUBMISSION, $objid) . '" class="microthumb"');
        }
    }
    // found the object
    if (!$isExtras && $objData["objThumbDefault"]) {
        $filename = "images/litthumb.png";
    } else {
        $filename = $isExtras ? "" : findNewestFileById("files/thumbs/", $objid, "images/nothumb.gif");
    }
    $width = round($objData["objThumbWidth"] * $size / 100);
    $height = round($objData["objThumbHeight"] * $size / 100);
    $objTitle = htmlspecialchars($objData["objTitle"]) . ' <br /> ';
    if ($objData["objCollab"] > 0) {
        $objTitle .= sprintf(_BY_AND, getUserLink($objData["objCreator"]), getUserLink($objData["objCollab"]));
    } else {
        $objTitle .= sprintf(_BY, getUserLink($objData["objCreator"]));
    }
    $src = $isExtras ? $objData["objThumbURL"] : urlf() . $filename;
    if ($size < 100) {
        makeFloatingThumb(strip_tags($objTitle), $src, $objData["objThumbWidth"], $objData["objThumbHeight"], $objData["objMature"], true, $onmouseover, $onmouseout);
    } else {
        $onmouseover = "";
        $onmouseout = "";
    }
    $str = '<a href="' . url("view/" . ($isExtras ? "e" : "") . $objData["objid"]) . '">' . getIMG($src, 'alt="[' . _BBCODE_THUMB . '=' . $objid . ']" class="microthumb' . ($objData["objMature"] ? " mature" : "") . '" ' . 'style="width: ' . $width . 'px; height: ' . $height . 'px" ' . 'onmouseover="' . $onmouseover . '" onmouseout="' . $onmouseout . '" ' . 'title="' . strip_tags($objTitle) . '"', true) . '</a> ';
    return $str;
}
Пример #19
0
function get_resource_table_entry($resource_tablename, $resource_column, $value) {
  $query="select * from \"%s\" where \"%s\" = '%s'";
  $query_args=array($resource_tablename, $resource_column, $value);
  $result=db_query($query, $query_args);

  if(!$result) {
    //Error occured
    die(return_error('Error fetching resource info'));
  }
  else {
    $col_info=getDBColDesc($resource_tablename);

    $table_info=GetTableColsOfType($resource_tablename, 'resource', - 1, 'italics');
    $italics_columns=$table_info['italics_columns'];

    $i=0;
    $summary="";

    if($obj=db_fetch_object($result)) {
      foreach($obj as $key=>$val) {
        if($key != AUTO_DBCOL_PREFIX . 'id') {
          $value=$val;
          if(strpos($italics_columns, "'{$key}'") !== FALSE) {
            $value=($val == '' ? '&nbsp;' : '<i>' . str_replace(" ", "&nbsp;", $val) . '</i>');
          }
          if($key == AUTO_DBCOL_PREFIX . 'created_by' || $key == AUTO_DBCOL_PREFIX . 'modified_by') {
            $value=getUserLink($val);
          }
          $summary.=getInfoEntry(($col_info[$key] == "" ? $key : $col_info[$key]), $value);
        }
      }
    }
    else {
      $summary="<tr><td><b>No info found.</b></td></tr>";
    }
    $html=<<< EOF

<div id="resource">

  <div class="summary">

    <table cellspacing="0">

      <tbody>{$summary}

      </tbody>

    </table>

  </div>

</div>
EOF;
    echo $html;
  }
}
Пример #20
0
    ?>
		<div class="hline">&nbsp;</div>
	<?php 
    iefixEnd();
    ?>
	<?php 
} else {
    $membersNavs = "";
}
$artistsToGo = $limit;
foreach ($members as $useData) {
    ?>
	<div class="gallery_col mar_bottom">
		<?php 
    echo getUserAvatar("", $useData["useid"], false, true);
    echo " &nbsp; " . getUserLink($useData["useid"]);
    ?>
	</div>
	<?php 
    $artistsToGo--;
    if (!$artistsToGo) {
        break;
    }
}
if (!count($members)) {
    echo '<div>' . _NO_MEMBERS . '</div>';
}
echo '<div class="hline">&nbsp;</div>';
echo $membersNavs;
?>
<div class="clear">&nbsp;</div>
Пример #21
0
					<b><?php 
    echo _ADMINISTRATOR;
    ?>
</b>:
					<span class="largetext error">
						<b><?php 
    echo $decisions[$objData["aburMod"]];
    ?>
</b></span>
				</div>
				<div class="padded">
					<?php 
    echo getIMG(url() . "images/emoticons/comment.png");
    ?>
					<?php 
    echo getUserLink($objData["aburModName"]);
    ?>
:
					<?php 
    echo formatText($objData["aburModComment"]);
    ?>
				</div>
				<?php 
}
if ($objData["abuResolved"] == "1") {
    ?>
				<div>
					<b><?php 
    echo _ABUSE_OVERALL_DECISION;
    ?>
</b>:
Пример #22
0
<?php

include_once INCLUDES . "layout!sidebar-func.php";
if (isLoggedIn()) {
    ?>
	<div style="margin-bottom : 8px;">
		<?php 
    $w = str_replace(" ", "<br />", sprintf(_WELCOME_USER, "[user]"));
    $w = str_replace("[user]", "<b>" . getUserLink($_auth["useid"]) . "</b>", $w);
    echo $w;
    ?>
	</div>
	<?php 
    putSidebarUpdates();
    if ($_newUI == 2 && isLoggedIn()) {
        ?>
		<div class="ui2-layout-bg ui2-separator"></div>
		<table cellspacing="0" cellpadding="0" border="0" style="text-align : left; padding-right : 8px; margin : 0 auto;"><tr><td>
			<a href="<?php 
        echo url("/");
        ?>
">
				<?php 
        echo getIMG(url() . "images/ui2/news.png", 'alt="" style="height : 18px;"');
        ?>
				<?php 
        echo _WHATSNEW;
        ?>
</a><br />
			<a href="<?php 
        echo url("browse");
    ?>
	</td></tr></table>
	<div class="notsowide" style="margin-left : 0.7em; padding-top : 0.7em;">
		<?php 
    $url = url("helpdesk/request/improve/faq/" . $faqData["hfqid"]);
    ?>
		<div class="mar_top">
			This article was created by <?php 
    echo getUserLink($faqData["hfqCreatedBy"]);
    ?>
 on <?php 
    echo gmdate($_auth["useDateFormat"], applyTimezone(strtotime($faqData["hfqCreateDate"])));
    if ($faqData["hfqEditDate"] != $faqData["hfqCreateDate"]) {
        ?>
				and was last modified by <?php 
        echo getUserLink($faqData["hfqEditedBy"]);
        ?>
 on <?php 
        echo gmdate($_auth["useDateFormat"], applyTimezone(strtotime($faqData["hfqEditDate"])));
    }
    ?>
.
		</div>
		<div class="mar_top">
			If you feel that this article is outdated, needs improvement
			or lacks some important tags that would help to link it better
			with the other articles, please <a href="<?php 
    echo $url;
    ?>
">report to helpdesk</a>.
		</div>