/** * getTombstoneOrBlank: Same as above, but return blank text instead of "a work." The number of functions * related to tombstones is a bit silly; it would be better to build this functionality into getTombstone() via * another parameter and then just refactor. So...FIXME. * * @wid The work id * @return Tombstone, or blank text */ function getTombstoneOrBlank($wid) { global $dbh; return workHasTombstone($wid) ? getTombstone($wid, true) : ""; }
} ); </script> </head> <body style="background-color:#fff"> <form id="descForm" action="descriptionProcessor.php" method="post"> <h2>Edit Description</h2> Here, you can add some information about this work. <p/> <!-- Display the work image. If it already has a tombstone (artist name/birth-death dates), show that as well. --> <img src="img.php?img=<?php echo $workId; ?> " style="width:300;margin-left:auto;margin-right:auto;display:block;"/> <center> <?php if (workHasTombstone($workId)) { echo getTombstone($workId); } ?> </center> <!-- Work ID is passed as a hidden field. For the "mode" field, we must be updating the description if the work already has one, so set the value accordingly. --> <input type="hidden" name="work" value="<?php echo $workId; ?> "/> <input type="hidden" name="mode" value="<?php echo workHasDescription($workId) ? "update" : "new"; ?> "/> <p/>
$collectionQuery = $dbh->prepare("SELECT work,w1.id AS url FROM " . $userTable . " LEFT OUTER JOIN works AS w1 ON w1.id = " . $userTable . ".work"); $collectionQuery->execute(); $userName = $row['cn']; while ($item = $collectionQuery->fetch()) { if ($ind % 3 == 0) { // 3 x n grid echo "</div><div style=\"display:table-row;\">"; } // Link the work image to workview.php (shadowbox). echo "<div class=\"collCell\"><a href=\"workview.php?wid=" . $item['url'] . "\" rel=\"shadowbox\">"; // Include the sentiment div, which contains the heart icon players can click to "love" a work. // (Handled in sentiment.js) echo "<div class=\"imgMouseOver\" name=\"" . $item['url'] . "\" style=\"background:url('img.php?img=" . $item['url'] . "');background-size:contain;background-repeat:no-repeat;\"/><div class=\"sentiment\" name=\"" . $item['url'] . "\" style=\"background-color: rgba(0,0,0,0.5);position:relative;float:left;width:20px;height:20px;padding:5px;overflow: none;z-index:-200;\"></div></div></a>"; echo "<div class=\"collCellCaption\">"; // Show tombstone, if there is one. if (workHasTombstone($item['url'])) { echo getTombstone($item['url'], false); } echo "</div></div>\n"; $ind++; } } echo "</div>\n"; ?> </div> </body> <?php include 'jewel.php'; ?> </html>
$stmt = $dbh->prepare("UPDATE tombstones SET approved = ? WHERE id = ?"); $stmt->bindParam(1, $approvalAction); $stmt->bindParam(2, $challengeId); $stmt->execute(); if ($action === "approve") { adjustPoints($player, 10); createNotification($player, $E_ACHIEVEMENT, "Your tombstone for " . getTombstone($work, true) . " was approved by the game administrator! You receive " . $CURRENCY_SYMBOL . "10."); } else { createNotification($player, $E_ACHIEVEMENT, "Your tombstone for " . getTombstone($work, true) . " was rejected by the game administrator! You can create a new tombstone to try again."); $stmt = $dbh->prepare("DELETE FROM tombstones WHERE id = ?"); $stmt->bindParam(1, $challengeId); $stmt->execute(); } } else { if ($mode === "d") { $approvalAction = $action === "approve" ? 1 : 0; $stmt = $dbh->prepare("UPDATE work_descriptions SET approved = ? WHERE id = ?"); $stmt->bindParam(1, $approvalAction); $stmt->bindParam(2, $challengeId); $stmt->execute(); if ($action === "approve") { adjustPoints($player, 10); createNotification($player, $E_ACHIEVEMENT, "Your description for " . (workHasTombstone($work) ? getTombstone($work, true) : "a work") . " was approved! You receive " . $CURRENCY_SYMBOL . "10."); } else { createNotification($player, $E_ACHIEVEMENT, "Your description for " . (workHasTombstone($work) ? getTombstone($work, true) : "a work") . " was rejected! You can modify the description and try again."); } } } ?>
while ($row = $stmt->fetch()) { echo "<li>" . $row['description'] . "</li>\n"; } echo "</ol>\n"; // ...and get rid of it. $drop = $dbh->prepare("DROP TABLE " . $provTable); $drop->execute(); ?> </div> </div> <div id="image"> <h3> <?php // Image div. Print out the tombstone if the user has supplied one. if (workHasTombstone($workid)) { echo getTombstone($workid); } ?> </h3> <div> <center> <?php // And include the full-size image. echo "<img src=\"img.php?img=" . $workid . "\" alt=\"[image]\" />\n"; ?> </center> </div> </div> <div id="description">