| ... | ... |
@@ -212,7 +212,7 @@ if($current == "viewstory"){
|
| 212 | 212 |
$squery = dbquery("SELECT sid, inorder FROM ".TABLEPREFIX."fanfiction_chapters WHERE chapid = ".$chapid." LIMIT 1");
|
| 213 | 213 |
list($sid, $chapter) = dbrow($squery); |
| 214 | 214 |
} |
| 215 |
- $titlequery = dbquery("SELECT story.title, story.coauthors, "._PENNAMEFIELD." as penname, story.summary FROM ".TABLEPREFIX."fanfiction_stories as story, "._AUTHORTABLE." WHERE sid = '$sid' AND "._UIDFIELD." = story.uid LIMIT 1");
|
|
| 215 |
+ $titlequery = dbquery("SELECT story.title, story.coauthors, "._PENNAMEFIELD." as penname, story.summary FROM ".TABLEPREFIX."fanfiction_stories as story, "._AUTHORTABLE." WHERE sid = '".(($sid) ?? null)."' AND "._UIDFIELD." = story.uid LIMIT 1");
|
|
| 216 | 216 |
if($story = dbassoc($titlequery)) {
|
| 217 | 217 |
$authlink[] = $story['penname']; |
| 218 | 218 |
if($story['coauthors']) {
|
| ... | ... |
@@ -32,7 +32,7 @@ else $textsize = 0; |
| 32 | 32 |
if(empty($chapter)) $chapter = isset($_GET['chapter']) && isNumber($_GET['chapter']) ? $_GET['chapter'] : false; |
| 33 | 33 |
|
| 34 | 34 |
// Get the story information |
| 35 |
- $storyquery = dbquery("SELECT "._PENNAMEFIELD." as penname, "._UIDFIELD." as uid, story.*, story.date as date, story.updated as updated, story.validated as valid FROM ".TABLEPREFIX."fanfiction_stories as story, "._AUTHORTABLE." WHERE story.sid = '".$sid."' AND story.uid = "._UIDFIELD);
|
|
| 35 |
+ $storyquery = dbquery("SELECT "._PENNAMEFIELD." as penname, "._UIDFIELD." as uid, story.*, story.date as date, story.updated as updated, story.validated as valid FROM ".TABLEPREFIX."fanfiction_stories as story, "._AUTHORTABLE." WHERE story.sid = '".(($sid) ?? null)."' AND story.uid = "._UIDFIELD);
|
|
| 36 | 36 |
$storyinfo = dbassoc($storyquery); |
| 37 | 37 |
|
| 38 | 38 |
if(!$storyinfo) {
|
| ... | ... |
@@ -41,7 +41,7 @@ if(empty($chapter)) $chapter = isset($_GET['chapter']) && isNumber($_GET['chapte |
| 41 | 41 |
if (file_exists("$skindir/default.tpl")) $tpl = new TemplatePower("$skindir/default.tpl");
|
| 42 | 42 |
else $tpl = new TemplatePower("default_tpls/default.tpl");
|
| 43 | 43 |
$title = "Story was not found"; |
| 44 |
- $text = "Story with ID " . $sid . " is not in database"; |
|
| 44 |
+ $text = "Story with ID " . (($sid) ?? null) . " is not in database"; |
|
| 45 | 45 |
include("includes/pagesetup.php");
|
| 46 | 46 |
$tpl->assign("output", "<div id='pagetitle'>" . $title . "</div>" . write_error($text));
|
| 47 | 47 |
$tpl->printToScreen(); |