| ... | ... |
@@ -75,7 +75,7 @@ function relevelcategory($cat, $leveldown) {
|
| 75 | 75 |
dbquery("DELETE FROM ".TABLEPREFIX."fanfiction_categories WHERE parentcatid = '$catid'");
|
| 76 | 76 |
$stories = dbquery("SELECT title,sid, catid FROM ".TABLEPREFIX."fanfiction_stories WHERE FIND_IN_SET(catid, '$catid')");
|
| 77 | 77 |
while($story = dbassoc($stories)) {
|
| 78 |
- $cats = explode(",", $story[catid]);
|
|
| 78 |
+ $cats = explode(",", $story['catid']);
|
|
| 79 | 79 |
if(count($cats) == 1) $newcat = "-1"; |
| 80 | 80 |
else $newcat = implode(",", array_dif($cats, array($catid)));
|
| 81 | 81 |
dbquery("UPDATE ".TABLEPREFIX."fanfiction_stories SET catid = '$newcat' WHERE sid = '$story[sid]' LIMIT 1");
|
| ... | ... |
@@ -232,4 +232,4 @@ function relevelcategory($cat, $leveldown) {
|
| 232 | 232 |
$output .= "<tr><td class=\"tblborder\" colspan=\"4\" align=\"center\"><a href=\"admin.php?action=categories&cat=new\">"._NEWMAIN."</a></td></tr></table>"; |
| 233 | 233 |
} |
| 234 | 234 |
|
| 235 |
-?> |
|
| 236 | 235 |
\ No newline at end of file |
| 236 |
+?> |
| ... | ... |
@@ -42,7 +42,7 @@ function categoryitems($catid, $value) |
| 42 | 42 |
if($cat['leveldown'] > 0) $pcats[] = $cat['parentcatid']; |
| 43 | 43 |
if(!in_array($cat['catid'], $cats)) $cats[] = $cat['catid']; |
| 44 | 44 |
} |
| 45 |
- if(count($pcats) > 0) $catquery = dbquery("SELECT catid, parentcatid, leveldown FROM ".TABLEPREFIX."fanfiction_categories WHERE FIND_IN_SET(catid, '".implode($pcats)."') GROUP BY catid");
|
|
| 45 |
+ if($pcats && (count($pcats) > 0)) $catquery = dbquery("SELECT catid, parentcatid, leveldown FROM ".TABLEPREFIX."fanfiction_categories WHERE FIND_IN_SET(catid, '".implode($pcats)."') GROUP BY catid");
|
|
| 46 | 46 |
else unset($catquery); |
| 47 | 47 |
} |
| 48 | 48 |
dbquery("UPDATE ".TABLEPREFIX."fanfiction_categories SET numitems = (numitems + $value) WHERE FIND_IN_SET(catid, '".implode(",", $cats)."')");
|