viewstory.php: Undefined variable PHP warnings when trying to access a nonexistent or formerly existing chapter in a story dirty fix
--- a/viewstory.php
+++ b/viewstory.php
@@ -356,14 +356,14 @@
include("includes/storyblock.php");
unset($adminlinks);
if(isADMIN && uLEVEL < 3)
- $adminlinks = "<div class=\"adminoptions\"><span class='label'>"._ADMINOPTIONS.":</span> "._EDIT." - <a href=\"stories.php?action=editstory&sid=$sid&admin=1\">"._STORY."</a> "._OR." <a href=\"stories.php?action=editchapter&chapid=$chapid&admin=1\">"._CHAPTER."</a> | "._DELETE." - <a href=\"stories.php?action=delete&sid=$sid&admin=1\">"._STORY."</a> "._OR." <a href=\"stories.php?action=delete&chapid=$chapid&sid=$sid&admin=1\">"._CHAPTER."</a></div>";
+ $adminlinks = "<div class=\"adminoptions\"><span class='label'>"._ADMINOPTIONS.":</span> "._EDIT." - <a href=\"stories.php?action=editstory&sid=$sid&admin=1\">"._STORY."</a> "._OR." <a href=\"stories.php?action=editchapter&chapid=".(isset($chapid) ? $chapid : null)."&admin=1\">"._CHAPTER."</a> | "._DELETE." - <a href=\"stories.php?action=delete&sid=$sid&admin=1\">"._STORY."</a> "._OR." <a href=\"stories.php?action=delete&chapid=".(isset($chapid) ? $chapid : null)."&sid=$sid&admin=1\">"._CHAPTER."</a></div>";
if(isMEMBER && $favorites) {
$jumpmenu2 .= "<option value=\"user.php?action=favst&add=1&sid=$sid\">"._ADDSTORY2FAVES."</option><option value=\"user.php?action=favau&add=1&author=".$stories['uid'].(count($storyinfo['coauthors']) ? ",".implode(",", array_keys($storyinfo['coauthors'])) : "")."\">"._ADDAUTHOR2FAVES."</option>";
}
if($reviewsallowed ) {
if(isMEMBER || $anonreviews) {
- $reviewslink = "<a href=\"reviews.php?action=add&type=ST&item=$sid&chapid=$chapid&next=$nextchapter\">"._SUBMITREVIEW."</a>";
- $jumpmenu2 .= "<option value=\"reviews.php?action=add&type=ST&item=$sid&chapid=$chapid&next=$nextchapter\">"._SUBMITREVIEW."</option>";
+ $reviewslink = "<a href=\"reviews.php?action=add&type=ST&item=$sid&chapid=".(isset($chapid) ? $chapid : null)."&next=$nextchapter\">"._SUBMITREVIEW."</a>";
+ $jumpmenu2 .= "<option value=\"reviews.php?action=add&type=ST&item=$sid&chapid=".(isset($chapid) ? $chapid : null)."&next=$nextchapter\">"._SUBMITREVIEW."</option>";
}
else $reviewslink = write_message(sprintf(_LOGINTOREVIEW, strtolower($pagelinks['login']['link']), strtolower($pagelinks['register']['link'])));
}