(at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For information about Extend-A-Story and its authors, please visit the website: http://www.sir-toby.com/extend-a-story/ */ require __DIR__ . "/include/Extend-A-Story.php"; use Extend_A_Story\HardStoryException; use Extend_A_Story\Util; $command = Util::getStringParam($_REQUEST, "command"); $episode = Util::getIntParam($_REQUEST, "episode"); $lockKey = Util::getIntParamDefault($_POST, "lockKey", 0); $commandModifier = Util::getStringParamDefault($_POST, "commandModifier", ""); $extendedLink = Util::getStringParamDefault($_POST, "extendedLink", ""); $title = Util::getStringParamDefault($_POST, "title", ""); $text = Util::getStringParamDefault($_POST, "text", ""); $scheme = Util::getIntParamDefault($_POST, "scheme", 1); $authorName = Util::getStringParamDefault($_POST, "authorName", ""); $authorEmail = Util::getStringParamDefault($_POST, "authorEmail", ""); $mailto = Util::getIntParamDefault($_POST, "mailto", 0); $notify = Util::getIntParamDefault($_POST, "notify", 0); $linkable = Util::getIntParamDefault($_POST, "linkable", 0); $extendable = Util::getIntParamDefault($_POST, "extendable", 0); $linkCount = 0; $warning = ""; $createdEpisode = 0;
</TR> </TABLE> </CENTER> <?php require __DIR__ . "/include/config/Footer.php"; ?> </BODY></HTML> <?php exit; } $episode = Util::getIntParam($_POST, "episode"); $lockKey = Util::getIntParam($_POST, "lockKey"); $dbStatement = Util::getDbConnection()->prepare("SELECT Parent, " . "Status, " . "LockKey " . "FROM Episode " . "WHERE EpisodeID = :episode"); $dbStatement->bindParam(":episode", $episode, PDO::PARAM_INT); $dbStatement->execute(); $row = $dbStatement->fetch(PDO::FETCH_NUM); if (!$row) { throw new HardStoryException("Problem fetching episode row from the database."); } $parent = $row[0]; $status = $row[1]; $episodeLockKey = $row[2]; if ($status != 1 && $status != 3) { ?> <HTML><HEAD> <TITLE>Clearing Error - Episode <?php
$dbStatement->bindParam(":newUserName", $newUserName, PDO::PARAM_STR); $dbStatement->bindParam(":editedUserID", $editedUserID, PDO::PARAM_INT); $dbStatement->execute(); if ($dbStatement->rowCount() != 1) { throw new HardStoryException("Unable to update user."); } if ($userID == $editedUserID) { $userName = $newUserName; } $message = "User Edited"; } else { $message = "Problems editing user:<P>" . $message; } } if ($command == "deleteUserSave") { $deletedUserID = Util::getIntParam($_POST, "userID"); if ($deletedUserID == 0) { $message = "You must select a user to delete."; } else { if ($deletedUserID == $userID) { $message = "You cannot delete yourself."; } else { $dbStatement = Util::getDbConnection()->prepare("DELETE " . "FROM User " . "WHERE UserID = :deletedUserID"); $dbStatement->bindParam(":deletedUserID", $deletedUserID, PDO::PARAM_INT); $dbStatement->execute(); if ($dbStatement->rowCount() != 1) { throw new HardStoryException("Unable to delete user."); } $message = "User Deleted"; } }
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For information about Extend-A-Story and its authors, please visit the website: http://www.sir-toby.com/extend-a-story/ */ require __DIR__ . "/include/Extend-A-Story.php"; use Extend_A_Story\Util; Util::getSessionAndUserIDs($sessionID, $userID); $storyName = Util::getStringValue("StoryName"); $siteName = Util::getStringValue("SiteName"); $storyHome = Util::getStringValue("StoryHome"); $siteHome = Util::getStringValue("SiteHome"); $episode = Util::getIntParam($_GET, "episode"); $dbStatement = Util::getDbConnection()->prepare("SELECT Link.SourceEpisodeID, " . "Episode.Title " . "FROM Link, " . "Episode " . "WHERE Link.SourceEpisodeID = Episode.EpisodeID " . "AND Link.TargetEpisodeID = :episode " . "ORDER BY Episode.EpisodeID"); $dbStatement->bindParam(":episode", $episode, PDO::PARAM_INT); $dbStatement->execute(); $rows = $dbStatement->fetchAll(PDO::FETCH_NUM); ?> <HTML><HEAD> <TITLE><?php echo $storyName; ?> : Back Link Trace for Episode <?php echo $episode; ?> </TITLE> </HEAD><BODY>
$dbStatement->bindParam(":sessionID", $sessionID, PDO::PARAM_INT); $dbStatement->bindParam(":episode", $episode, PDO::PARAM_INT); $dbStatement->execute(); if ($dbStatement->rowCount() != 1) { throw new HardStoryException("Unable to unlock the episode record."); } $message = "Link Added"; $command = "Done"; } else { $message = "Problem adding link:<P>" . $message; $command = "AddLink"; } } $linkID = 0; if ($command == "DeleteSelectedLink" || $command == "DeleteSelectedLinkSave") { $linkID = Util::getIntParam($_REQUEST, "linkID"); $dbStatement = Util::getDbConnection()->prepare("SELECT SourceEpisodeID, " . "IsCreated, " . "IsBackLink, " . "Description " . "FROM Link " . "WHERE LinkID = :linkID"); $dbStatement->bindParam(":linkID", $linkID, PDO::PARAM_INT); $dbStatement->execute(); $row = $dbStatement->fetch(PDO::FETCH_NUM); if (!$row) { throw new HardStoryException("Unable to fetch link row from database."); } if ($row[0] != $episode) { $message .= "The specified link does not belong to this episode.<BR>"; } if ($row[1] == "Y" && $row[2] == "N") { $message .= "The destination of this link has been created.<BR>"; } if (empty($message)) { $description = $row[3];