コード例 #1
0
 public static function hash($key_column, $value_column, $conditions = array(), $paging_params = false)
 {
     $colquote = db_params('column_quote_char');
     $query = "SELECT {$colquote}" . $key_column . "{$colquote}, {$colquote}" . $value_column . "{$colquote} FROM " . get_called_class() . sql_where($conditions);
     if ($paging_params) {
         $query .= sql_orders_limits($paging_params);
     }
     return query_to_hash($query);
 }
コード例 #2
0
ファイル: submission.php プロジェクト: brocococonut/yGallery
function submitModifiedTitle($objid, $title, $comment, $mature, $forClub, $folder = 0, $collab = 0, $gift = 0, $forClub2 = 0, $forClub3 = 0)
{
    $oldCollab = 0;
    $collabConfirmed = 0;
    $objCreator = 0;
    $sql = "SELECT `objCollab`, `objCollabConfirmed`, `objCreator` " . "FROM `objects`, `objExtData`" . dbWhere(array("objid*" => "objEid", "objid" => $objid));
    $objResult = sql_query($sql);
    if ($objData = mysql_fetch_assoc($objResult)) {
        $oldCollab = $objData["objCollab"];
        $collabConfirmed = $objData["objCollabConfirmed"];
        $objCreator = $objData["objCreator"];
    }
    mysql_free_result($objResult);
    if ($forClub2 == $forClub) {
        $forClub2 = 0;
    }
    if ($forClub3 == $forClub || $forClub3 == $forClub2) {
        $forClub3 = 0;
    }
    sql_where(array("cloObject" => $objid));
    sql_delete("clubObjects");
    if ($forClub > 0) {
        sql_values(array("cloObject" => $objid, "cloClub" => $forClub));
        sql_insert("clubObjects");
    }
    if ($forClub2 > 0) {
        sql_values(array("cloObject" => $objid, "cloClub" => $forClub2));
        sql_insert("clubObjects");
    }
    if ($forClub3 > 0) {
        sql_values(array("cloObject" => $objid, "cloClub" => $forClub3));
        sql_insert("clubObjects");
    }
    $values = array("objTitle" => $title, "objMature" => $mature, "objForClub" => $forClub, "objForClub2" => $forClub2, "objForClub3" => $forClub3, "objFolder" => $folder);
    if (!$collabConfirmed || atLeastSModerator()) {
        $values["objCollab"] = $collab;
    }
    $values["objForUser"] = $gift;
    $sql = "UPDATE `objects`" . dbSet($values) . dbWhere(array("objid" => $objid));
    sql_query($sql);
    $values = array("objComment" => $comment);
    if ($collab == 0 && atLeastSModerator()) {
        $values["objCollabConfirmed"] = 0;
    }
    $sql = "UPDATE `objExtData`" . dbSet($values) . dbWhere(array("objEid" => $objid));
    sql_query($sql);
    updateSearchCache($objid);
    updateObjCount($objCreator);
    updateObjCount($collab);
    if ($collab != $oldCollab) {
        updateObjCount($oldCollab);
    }
}
コード例 #3
0
function recountTagReferences($tagid)
{
    sql_where(array("hfmTag" => $tagid));
    $count = sql_count("helpdeskFAQTagMap");
    if ($count > 0) {
        sql_values(array("hftCount" => $count));
        sql_where(array("hftid" => $tagid));
        sql_update("helpdeskFAQTags");
    } else {
        sql_where(array("hftid" => $tagid));
        sql_delete("helpdeskFAQTags");
    }
}
コード例 #4
0
ファイル: asset.php プロジェクト: brocococonut/yGallery
        $_asset_out[ "gen_time" ] = round((
        	$secdiff * 1000000 + $usecdiff ) / 1000000, 3 );
        */
        asset_write_json($_asset_out);
    } else {
        echo "{ _kind: 'error', message: 'There is no handler for asset: " + $kind + "' }";
    }
    if (0) {
        // Store profiler information.
        $time_start = $_stats["startTime"];
        $time_end = gettimeofday();
        $secdiff = $time_end["sec"] - $time_start["sec"];
        $usecdiff = $time_end["usec"] - $time_start["usec"];
        $generationTime = round(($secdiff * 1000000 + $usecdiff) / 1000000, 3);
        $page = "asset::" . $kind;
        sql_where(array("prfPage" => $page));
        if (sql_count("profiler") > 0) {
            sql_query("UPDATE `profiler` SET `prfCount` = `prfCount` + 1, " . "`prfTime` = `prfTime` + '" . $generationTime . "' " . "WHERE `prfPage` = '" . addslashes($page) . "'");
        } else {
            sql_values(array("prfPage" => $page, "prfCount" => 1, "prfTime" => $generationTime));
            sql_insert("profiler");
        }
    }
}
echo "]";
return;
/**
 * Writes a Javascript object containing specified asset data.
 *
 * @param assetData Asset data (can write either request or result data).
 */
コード例 #5
0
ファイル: p_watchclub.php プロジェクト: brocococonut/yGallery
// Adds club $_cmd[ 1 ] to the current user's watch list.
// watCreator in the `watches` table is the club that we watch.
// watUser is the user who is watching the club.
if ($_auth["useid"] && !$_config["readOnly"]) {
    // Check if this club exists.
    $result = sql_query("SELECT `cluid`,`cluCreator` FROM `clubs`,`cluExtData` " . "WHERE `cluEid` = `cluid` AND `cluid` = '" . intval($_cmd[1]) . "' LIMIT 1");
    if ($cluData = mysql_fetch_assoc($result)) {
        // Check if the club is already +watch'd.
        $result = sql_query("SELECT `watid` FROM `watches` " . "WHERE `watUser` = '" . $_auth["useid"] . "' " . "AND `watCreator` = '" . $cluData["cluid"] . "' " . "AND `watType` = 'clu' LIMIT 1");
        if ($watData = mysql_fetch_assoc($result)) {
            // +watch'd already? remove them from the watches.
            if (!isset($_GET["disableUnwatch"])) {
                sql_query("DELETE FROM `watches` WHERE `watid` = '" . $watData["watid"] . "' LIMIT 1");
            }
        } else {
            // It's not watch'd? add it to the watches then.
            sql_query("INSERT INTO `watches`(`watCreator`,`watUser`,`watSubmitDate`,`watType`) " . "VALUES('" . $cluData["cluid"] . "','" . $_auth["useid"] . "',NOW(),'clu')");
            // Notify the club's owner about the +watch.
            addUpdate(updTypeMessageWatchClub, $cluData["cluCreator"], $cluData["cluid"], $_auth["useid"]);
        }
        // Recalculate club watcher-count
        sql_where(array("watType" => "clu", "watCreator" => $cluData["cluid"]));
        $watcherCount = sql_count("watches");
        sql_where(array("cluEid" => $cluData["cluid"]));
        sql_values(array("cluWatcherCount" => $watcherCount));
        sql_update("cluExtData");
    }
}
redirect(url("club/" . intval($_cmd[1])));
// Get back to the club page.
コード例 #6
0
<div class="header">
	Request Details
</div>
<div class="notsowide">
	<?php 
sql_where(array("hlpid" => $_cmd[2]));
if ($hlpData = sql_row("helpdesk")) {
    putRequestData($hlpData, true);
}
?>
</div>
<form action="<?php 
echo url("helpdesk");
?>
" method="get">
<button class="smalltext">
	<?php 
echo getIMG(url() . "images/emoticons/nav-prev.png");
?>
	Return to list
</button>
</form>
コード例 #7
0
    function putTagList($title, $order)
    {
        ?>
		<div style="margin-left : 2em;">
			<?php 
        echo $title;
        ?>
:
		</div>
		<ul style="margin : 0.3em 1.2em; padding : 0; padding-left : 2em;">
		<?php 
        sql_order($order);
        sql_where(array("hftCount>" => 0));
        $tagResult = sql_rowset("helpdeskFAQTags");
        while ($tagData = sql_next($tagResult)) {
            $url = url("helpdesk/faq/tag", array("tag" => $tagData["hftName"]));
            ?>
<li><a href="<?php 
            echo $url;
            ?>
"><?php 
            echo $tagData["hftName"];
            ?>
</a> (<?php 
            echo $tagData["hftCount"];
            ?>
)</li><?php 
        }
        sql_free($tagResult);
        ?>
		</ul>
		<?php 
    }
コード例 #8
0
$tagName = $_GET["tag"];
?>
<div class="header">
	<?php 
echo $tagName;
?>
	<div class="subheader">
		All articles tagged with '<?php 
echo $tagName;
?>
'
	</div>
</div>
<ul>
<?php 
sql_where(array("hftName" => $tagName, "hfmTag*" => "hftid", "hfmArticle*" => "hfqid", "hfqCategory*" => "hfcid"));
$result = sql_rowset("helpdeskFAQ, helpdeskFAQCats, helpdeskFAQTagMap, helpdeskFAQTags");
if (sql_num_rows($result) == 0) {
    ?>
--<?php 
} else {
    while ($data = sql_next($result)) {
        $url = url("helpdesk/faq/" . $data["hfcIdent"] . "/" . $data["hfqIdent"]);
        $title = htmlspecialchars(preg_replace('/^.*\\|/', "", $data["hfqTitle"]));
        ?>
<li><a href="<?php 
        echo $url;
        ?>
"><?php 
        echo $title;
        ?>
コード例 #9
0
        ?>
</a><?php 
        $tags[] = $tagData["hftid"];
    }
    sql_free($tagResult);
    if (count($tags) == 0) {
        echo "--";
    }
    ?>
		</div>
		<?php 
    if (count($tags) > 0) {
        ob_start();
        $processedIds = array($faqData["hfqid"]);
        foreach ($tags as $tagid) {
            sql_where(array("hfmTag" => $tagid, "hfmArticle*" => "hfqid", "hfqCategory*" => "hfcid"));
            $result = sql_rowset("helpdeskFAQ, helpdeskFAQCats, helpdeskFAQTagMap");
            while ($data = sql_next($result)) {
                if (in_array($data["hfqid"], $processedIds)) {
                    continue;
                }
                $url = url("helpdesk/faq/" . $data["hfcIdent"] . "/" . $data["hfqIdent"]);
                $title = preg_replace('/^.*\\|/', "", $data["hfqTitle"]);
                ?>
<li><a href="<?php 
                echo $url;
                ?>
"><?php 
                echo htmlspecialchars($title);
                ?>
</a></li><?php 
コード例 #10
0
ファイル: comments.php プロジェクト: brocococonut/yGallery
/**
 * Functions reads the POST data and adds a new comment to the database.
 */
function processCommentReply($objid, $objType)
{
    global $_auth, $_config;
    $noEmoticons = isset($_POST["commentNoEmoticons"]) ? 1 : 0;
    $noSig = isset($_POST["commentNoSig"]) ? 1 : 0;
    $noBBCode = isset($_POST["commentNoBBCode"]) ? 1 : 0;
    $root_objid = $objid;
    $root_objType = $objType;
    $parent_objid = $objid;
    $parent_objType = $objType;
    if ($objType == "com") {
        $comResult = sql_query("SELECT `comRootObj`,`comRootObjType`,`comObj`,`comObjType` " . "FROM `comments`" . dbWhere(array("comid" => $objid)));
        if ($comData = mysql_fetch_row($comResult)) {
            $root_objid = $comData[0];
            $root_objType = $comData[1];
            $parent_objid = $comData[2];
            $parent_objType = $comData[3];
        }
        mysql_free_result($comResult);
        if ($parent_objid != $objid && $parent_objid != $root_objid) {
            $comResult = sql_query("SELECT `comObj`,`comObjType` " . "FROM `comments`" . dbWhere(array("comid" => $parent_objid)));
            if ($comData = mysql_fetch_row($comResult)) {
                $parent_objid = $comData[0];
                $parent_objType = $comData[1];
            }
            mysql_free_result($comResult);
        }
    }
    // 16000 characters maximum.
    $commentText = substr($_POST["comment"], 0, 16000);
    $userIp = getHexIp($_SERVER["REMOTE_ADDR"]);
    // Add the comment to the database.
    sql_query("INSERT INTO `comments`" . dbValues(array("comObj" => $objid, "comObjType" => $objType, "comRootObj" => $root_objid, "comRootObjType" => $root_objType, "comCreator" => $_auth["useid"], "comSubmitDate!" => "NOW()", "comComment" => $commentText, "comSubmitIp" => $userIp, "comEditIp" => $userIp, "comNoEmoticons" => $noEmoticons, "comNoSig" => $noSig, "comNoBBCode" => $noBBCode)));
    $comid = mysql_insert_id();
    // Now let's find out who created the parent object for this comment
    // (that would be a user id).
    $parentCreator = 0;
    switch ($objType) {
        case "obj":
            $collab = 0;
            $result = sql_query("SELECT `objCreator`, `objCollab`, `objCollabConfirmed` " . "FROM `objects`, `objExtData`" . dbWhere(array("objid*" => "objEid", "objid" => $objid)));
            if ($data = mysql_fetch_assoc($result)) {
                $parentCreator = $data["objCreator"];
                $collab = $data["objCollabConfirmed"] ? $data["objCollab"] : 0;
                // Also gather Fan-to-Artist statistics...
                $where = array("fanUser" => $_auth["useid"], "fanArtist" => $parentCreator);
                sql_where($where);
                if (sql_count("fans") == 0) {
                    $where["fanNumComments"] = 1;
                    sql_values($where);
                    sql_insert("fans");
                } else {
                    sql_where($where);
                    sql_values(array("fanNumComments!" => "`fanNumComments` + 1"));
                    sql_update("fans");
                }
                if ($collab > 0) {
                    $where = array("fanUser" => $_auth["useid"], "fanArtist" => $collab);
                    sql_where($where);
                    if (sql_count("fans") == 0) {
                        $where["fanNumComments"] = 1;
                        sql_values($where);
                        sql_insert("fans");
                    } else {
                        sql_where($where);
                        sql_values(array("fanNumComments!" => "`fanNumComments` + 1"));
                        sql_update("fans");
                    }
                }
            }
            // If this submission is in user's updates, mark it as viewed
            // automatically.
            markAsRead(updTypeArt, $objid);
            updateSearchCache($objid);
            if ($collab > 0 && $collab != $_auth["useid"]) {
                addUpdate(updTypeComment, $collab, $comid, $_auth["useid"]);
            }
            break;
        case "ext":
            // extra objects
            $result = sql_query("SELECT `objCreator` FROM `extras` " . "WHERE `objid` = '{$objid}' LIMIT 1");
            $parentCreator = mysql_num_rows($result) > 0 ? mysql_result($result, 0) : 0;
            // If this submission is in user's updates, mark it as viewed
            // automatically.
            markAsRead(updTypeArtExtra, $objid);
            break;
        case "com":
            // comments
            $result = sql_query("SELECT `comCreator` FROM `comments` " . "WHERE `comid` = '{$objid}' LIMIT 1");
            $parentCreator = mysql_num_rows($result) > 0 ? mysql_result($result, 0) : 0;
            // If this comment is in user's updates, mark it as read automatically.
            markAsRead(updTypeComment, $objid);
            break;
        case "clu":
            // clubs
            $result = sql_query("SELECT `cluCreator` FROM `cluExtData` " . "WHERE `cluEid` = '{$objid}' LIMIT 1");
            $parentCreator = mysql_num_rows($result) > 0 ? mysql_result($result, 0) : 0;
            break;
        case "jou":
            // journals
            $result = sql_query("SELECT `jouCreator` FROM `journals` " . "WHERE `jouCreatorType` = 'use' AND `jouid` = '{$objid}' LIMIT 1");
            $parentCreator = mysql_num_rows($result) > 0 ? mysql_result($result, 0) : 0;
            if ($parentCreator == 0) {
                // Not found? Maybe that journal is actually an announcement.
                $result = sql_query("SELECT `jouAnnCreator` FROM `journals` " . "WHERE `jouCreatorType` = 'clu' AND `jouid` = '{$objid}' LIMIT 1");
                $parentCreator = mysql_num_rows($result) > 0 ? mysql_result($result, 0) : 0;
            }
            // If this journal/announcement is in user's updates, mark it as read
            // automatically.
            markAsRead(updTypeJournal, $objid);
            break;
        case "pol":
            // polls
            $result = sql_query("SELECT `polCreator` FROM `polls` " . "WHERE `polid` = '{$objid}' LIMIT 1");
            $parentCreator = mysql_num_rows($result) > 0 ? mysql_result($result, 0) : 0;
            // If this poll is in user's updates, mark it as read automatically.
            markAsRead(updTypeJournalPoll, $objid);
            break;
        case "new":
            // news
            // Those who posted news on the front page should not receive
            // comments on that news to their updates.
            $parentCreator = 0;
            break;
        case "use":
            // user pages
            $parentCreator = $objid;
            break;
    }
    // Notify the parent object's creator about the new comment on their creation.
    // If the creator is not the current user, of course.
    if ($parentCreator > 0 && $parentCreator != $_auth["useid"]) {
        addUpdate(updTypeComment, $parentCreator, $comid, $_auth["useid"]);
    }
    // Redirect to the same page to clean up POST variables.
    $focus = "#comment" . ($objType == "com" ? $objid : $comid);
    if (isset($_POST["refererURL"])) {
        if (preg_match('/\\/updates\\//', $_POST["refererURL"])) {
            $focus = "";
        }
        redirect($_POST["refererURL"] . $focus);
    } else {
        redirect(url(".", array("replied" => "yes")) . $focus);
    }
}
コード例 #11
0
function sql_update_blob($table, $column, $conditions, $blob)
{
    $db = getdb();
    $stmt = $db->prepare("UPDATE " . $table . " SET `" . $column . "`= ?" . sql_where($conditions));
    $stmt->bindParam(1, $blob, PDO::PARAM_LOB);
    $db->beginTransaction();
    $stmt->execute();
    $db->commit();
    return $stmt;
}
コード例 #12
0
ファイル: p_helpdesk.php プロジェクト: brocococonut/yGallery
function putRequestData($hlpData, $showDetails = false)
{
    global $_auth;
    ?>
	<div class="container2 mar_bottom">
		<div style="margin-left : 20px;">
			<div style="margin-left : -20px; margin-top : 0.4em; float : left;">
				<?php 
    echo getIMG(url() . "images/emoticons/star.png");
    ?>
			</div>
			<?php 
    if ($hlpData["hlpReferenceType"] == "submission") {
        ?>
				<div style="float : right; margin-left : 1em; margin-bottom : 0.5em;">
					<?php 
        echo getObjectThumb($hlpData["hlpReferenceId"], 100, false);
        ?>
				</div>
				<?php 
    }
    if ($hlpData["hlpReferenceType"] == "extras") {
        ?>
				<div style="float : right; margin-left : 1em; margin-bottom : 0.5em;">
					<?php 
        echo getObjectThumb($hlpData["hlpReferenceId"], 100, true);
        ?>
				</div>
				<?php 
    }
    ?>
			<div class="header" style="padding : 0; padding-bottom : 0.3em;">
				<a href="<?php 
    echo url("helpdesk/details/" . $hlpData["hlpid"]);
    ?>
">
					<?php 
    echo getRequestCategoryText($hlpData["hlpCategory"]);
    ?>
</a>
			</div>
			<?php 
    $ref = getRequestRefText($hlpData["hlpReferenceType"], $hlpData["hlpReferenceId"]);
    if ($ref != "--") {
        ?>
				<div>
					<b>In reference to</b>: <?php 
        echo $ref;
        ?>
				</div>
				<?php 
    }
    ?>
			<div>
				<b>Status</b>:
				<?php 
    echo getRequestStatusText($hlpData["hlpStatus"]);
    ?>
			</div>
			<div>
				<b>Urgency</b>:
				<?php 
    echo getRequestUrgencyText($hlpData["hlpUrgency"]);
    ?>
			</div>
			<?php 
    $hasOwner = $hlpData["hlpOwner"] > 0;
    $isStaff = atLeastModerator();
    $isSubmitter = isLoggedIn() && $_auth["useid"] == $hlpData["hlpSubmitter"];
    $isOwner = isLoggedIn() && $_auth["useid"] == $hlpData["hlpOwner"];
    if ($isOwner && $hlpData["hlpStatus"] == "wait-assign") {
        ?>
				<div class="mar_top">
					<span class="error">Summary will be available after the request is assigned.</span>
				</div>
				<?php 
    } else {
        ?>
				<div class="mar_top">
					<?php 
        echo formatText($hlpData["hlpSummary"], true, true);
        ?>
				</div>
				<?php 
    }
    $allowedPrivacy = "'all'";
    if ($isStaff) {
        $allowedPrivacy .= ",'private','submitter','owner'";
    } else {
        if ($isSubmitter) {
            $allowedPrivacy .= ",'submitter'";
        }
        if ($isOwner) {
            $allowedPrivacy .= ",'owner'";
        }
    }
    if ($showDetails) {
        ?>
				<div style="clear : both;"></div>
				<?php 
        sql_order("hddSubmitDate");
        sql_where(array("hddItem" => $hlpData["hlpid"], "|1" => "`hddPrivacy` IN(" . $allowedPrivacy . ")"));
        $hddResult = sql_rowset("helpdeskDetails");
        while ($hddData = sql_next($hddResult)) {
            putRequestDetail($hlpData, $hddData);
        }
        sql_free($hddResult);
        $doSubmitDetail = false;
        $detailPrivacy = "?";
        if (isset($_POST["submitPrivate"])) {
            $doSubmitDetail = true;
            $detailPrivacy = "private";
        }
        if (isset($_POST["submitSubmitter"])) {
            $doSubmitDetail = true;
            $detailPrivacy = "submitter";
        }
        if (isset($_POST["submitOwner"])) {
            $doSubmitDetail = true;
            $detailPrivacy = "owner";
        }
        if (isset($_POST["submitAll"])) {
            $doSubmitDetail = true;
            $detailPrivacy = "all";
        }
        if ($doSubmitDetail) {
            addRequestDetail($hlpData["hlpid"], "detailText", "detailFile", $detailPrivacy);
            redirect(url("."));
        }
        if ($hlpData["hlpStatus"] == "completed") {
            ?>
					<span class="error"><b>COMPLETED</b></span>.
					This request's status is 'completed', no further details are accepted.
					<?php 
        } else {
            ?>
					<div class="container2 mar_bottom">
						<div class="header" style="padding-left : 0; padding-top : 0;">
							Submit new detail
						</div>
						<form action="<?php 
            echo url(".");
            ?>
" enctype="multipart/form-data" method="post">
							<div class="mar_bottom">
								<textarea name="detailText" rows="9" style="width : 95%;"></textarea>
							</div>
							<div class="mar_bottom" style="padding-right : 10%">
								(optionally) <b>Upload a file</b>:
							</div>
							<div class="mar_bottom">
								<input name="detailFile" type="file" size="30" />
							</div>
							<?php 
            if ($isSubmitter && !$hasOwner) {
                // A simple submit button.
                ?>
								<div class="mar_top">
									<input type="submit" name="submitSubmitter" value="<?php 
                echo _SUBMIT;
                ?>
" />
								</div>
								<?php 
            } else {
                ?>
								<div class="mar_top">
									Who should be able to read this detail:
								</div>
								<?php 
                if ($hasOwner) {
                    ?>
									<div class="mar_top">
										<button name="submitAll">
											<?php 
                    echo getRequestPrivacyText("all", $hlpData);
                    ?>
</button>
									</div>
									<?php 
                    if (!$isSubmitter) {
                        ?>
										<div class="mar_top">
											<button name="submitOwner">
												<?php 
                        echo getRequestPrivacyText("owner", $hlpData);
                        ?>
</button>
										</div>
										<?php 
                    }
                }
                ?>
								<div class="mar_top">
									<button name="submitSubmitter">
										<?php 
                echo getRequestPrivacyText("submitter", $hlpData);
                ?>
</button>
								</div>
								<?php 
                if ($isStaff) {
                    // Only staff can submit staff-only details :3
                    ?>
									<div class="mar_top">
										<button name="submitPrivate">
											<?php 
                    echo getRequestPrivacyText("private", $hlpData);
                    ?>
</button>
									</div>
									<?php 
                }
                ?>
								<div class="mar_top">
									* <b>Submitter</b> &mdash; The user that made the request.
									<?php 
                if ($hasOwner) {
                    ?>
										<br />
										* <b>Owner</b> &mdash; The user that owns the object questioned by the request.
										<?php 
                }
                ?>
								</div>
								<?php 
            }
            ?>
						</form>
					</div>
					<?php 
        }
    } else {
        sql_where(array("hddItem" => $hlpData["hlpid"], "|1" => "`hddPrivacy` IN(" . $allowedPrivacy . ")"));
        $detailCount = sql_count("helpdeskDetails");
        ?>
				<div style="text-align : left; margin-top : 0.6em;">
					<a href="<?php 
        echo url("helpdesk/details/" . $hlpData["hlpid"]);
        ?>
">
						View Request Details</a>
						(<?php 
        echo $detailCount;
        ?>
)
				</div>
				<div style="clear : both;"></div>
				<?php 
    }
    ?>
		</div>
	</div>
	<?php 
}
コード例 #13
0
<?php

if (!$isEditMode) {
    return;
}
if (!isset($catKey)) {
    $catKey = "";
}
if (isset($_POST[$editAction . "Category" . $catKey])) {
    sql_values(array("hfcName" => $_POST[$editAction . "Category" . $catKey], "hfcIdent" => $_POST["ident"], "hfcIsGeneral" => isset($_POST["isGeneral"])));
    if ($editAction == "Add") {
        sql_insert("helpdeskFAQCats");
    }
    if ($editAction == "Edit" && $catKey != "") {
        sql_where(array("hfcid" => $catKey));
        sql_update("helpdeskFAQCats");
    }
    redirect(url("."));
}
?>
<div><br /></div>
<div class="container2 notsowide">
	<?php 
$editCatTitle = isset($catInfo["name"]) ? $catInfo["name"] : "";
$editCatIdent = isset($catInfo["ident"]) ? $catInfo["ident"] : "";
$editCatGeneral = isset($catInfo["general"]) ? $catInfo["general"] : 1;
?>
	<form action="<?php 
echo url(".", array("enableEditMode" => "yes"));
?>
" method="post">
コード例 #14
0
ファイル: mod_artmenu.php プロジェクト: brocococonut/yGallery
        sql_values($where);
        sql_insert("fans");
    } else {
        sql_where($where);
        sql_values(array("fanNumViews!" => "`fanNumViews` + 1"));
        sql_update("fans");
    }
    if ($objData["objCollab"] > 0) {
        $where = array("fanUser" => $_auth["useid"], "fanArtist" => $objData["objCollab"]);
        sql_where($where);
        if (sql_count("fans") == 0) {
            $where["fanNumViews"] = 1;
            sql_values($where);
            sql_insert("fans");
        } else {
            sql_where($where);
            sql_values(array("fanNumViews!" => "`fanNumViews` + 1"));
            sql_update("fans");
        }
    }
}
$_pollUser = $useData["useid"];
$_documentTitle = _SUBMISSION . ": " . $objData["objTitle"];
?>
<div class="header">
	<?php 
if ($objData["objCollab"] > 0) {
    ?>
		<div class="f_right a_center normaltext" style="margin-left: 20px">
			<?php 
    echo getUserAvatar("", $objData["objCollab"], true);
コード例 #15
0
    $mysqlUptime = round(preg_replace('/.*' . preg_quote("Uptime: ") . '([0-9\\.]+).*/', "\\1", $mysqlStat), 2);
    $upDays = floor($mysqlUptime / 60 / 60 / 24);
    $upHours = floor($mysqlUptime / 60 / 60) % 24;
    $upMinutes = $mysqlUptime / 60 % 60;
    echo " <br /> " . sprintf(_PAGE_GENERATED, $generationTime) . ", MySQL: " . $queriesPerSecond . " queries/sec, " . "uptime " . $upDays . "d " . $upHours . "h " . $upMinutes . "m. &middot; Server load: {$loadavg}";
    //Testing area for new advert
    //echo '<div class="mar_top"><a href="/helpdesk/faq/general/sitesupport/">'.getIMG( url()."images/support.gif" ).'</a></div>';
}
//	Spy Versus Spy Banner
//	echo '<div class="mar_top"><a href="http://www.y-gallery.net/donate.html">'.getIMG( url()."images/spyvsspyban.gif" ).'</a></div>';
//	Teahouse Comic Banner
//	echo '<div class="mar_top"><a href="http://www.teahousecomic.com/">'.getIMG( url()."images/teahouse-banner3.gif" ).'</a></div>';
global $isSearchBot;
if (!$_isSearchBot) {
    sql_order("RAND()");
    sql_where(array("banUntil>!" => "NOW()", "banType" => "banner"));
    if ($banid = sql_value("banners", "banid")) {
        ?>
			<div class="mar_top">
			<a href="<?php 
        echo url("banner/goto/" . $banid);
        ?>
"><img alt="" src="/images/banners/<?php 
        echo $banid;
        ?>
.gif" /></a>

				<div style="font-size : 9px; margin : 0.2em;"><a href="<?php 
        echo url("helpdesk/faq/general/advert");
        ?>
">Advertise on y!Gallery</a></div>
コード例 #16
0
function update_records($table, $conditions, $newdata)
{
    $newdata = array_escape($newdata);
    $column_quote_func = db_params('column_quote_func');
    array_walk($newdata, $column_quote_func);
    if (count($newdata) > 0) {
        $query = "UPDATE " . $table . " SET " . implode(", ", $newdata) . sql_where($conditions);
        $result = sql_query_dbg($query);
        return sql_affected_rows($result);
    }
    return FALSE;
}
コード例 #17
0
<div class="header">
	<div class="header_title">
		Purge trash
	</div>
</div>
<div class="container">
	<?php 
sql_order("objTitle");
sql_where(array("objEid*" => "objid", "objPending" => 0, "objCreator" => $_auth["useid"], "objDeleted" => 1, "objDeletedBy" => $_auth["useid"], "objDeleteDate<!" => "DATE_SUB( NOW(), INTERVAL 30 DAY )"));
$result = sql_rowset("objects, objExtData");
$showForm = sql_num_rows($result) > 0 && !isset($_POST["submit"]);
if ($showForm) {
    ?>
		<form action="<?php 
    echo url(".");
    ?>
" method="post">
		<div>
			Select deleted submissions you want to purge forever:
		</div>
		<?php 
}
include_once INCLUDES . "submission.php";
while ($objData = sql_next($result)) {
    if (isset($_POST["delete" . $objData["objid"]])) {
        eraseSubmission($objData["objid"], false, false);
        notice("Purged: " . $objData["objTitle"]);
        continue;
    }
    if ($showForm) {
        ?>
コード例 #18
0
ファイル: p_access.php プロジェクト: brocococonut/yGallery
$accResult = sql_query("SELECT SUM(`accCount`) FROM `access`");
$totalCount = sql_result($accResult);
$accResult = sql_query("SELECT * FROM `access` ORDER BY `accCount` DESC LIMIT 30");
while ($accData = sql_next($accResult)) {
    ?>
	<tr>
		<td><?php 
    echo getDotDecIp($accData["accIp"]);
    ?>
</td>
		<td align="center"><?php 
    echo $accData["accCount"];
    ?>
</td>
		<td><?php 
    sql_where(array("useid*" => "useEid", "useLastIp" => $accData["accIp"]));
    $useResult = sql_rowset("users, useExtData", "useUsername");
    while ($useData = sql_next($useResult)) {
        echo $useData["useUsername"] . " ";
    }
    sql_free($useResult);
    ?>
		</td>
	</tr>
	<?php 
}
sql_free($accResult);
?>
</table>

</div>