|
...
|
...
|
@@ -169,6 +169,7 @@ function seriesreview($thisseries) {
|
|
169
|
169
|
|
|
170
|
170
|
global $ratings;
|
|
171
|
171
|
|
|
|
172
|
+ if(is_int($thisseries)) $thisseries = (string)$thisseries;
|
|
172
|
173
|
if(!isNumber($thisseries)) return;
|
|
173
|
174
|
$storylist = storiesInSeries($thisseries);
|
|
174
|
175
|
$serieslist = subseriesList($thisseries);
|
|
...
|
...
|
@@ -194,7 +195,7 @@ $newcount = dbquery("SELECT count(reviewid) as totalcount FROM ".TABLEPREFIX."fa
|
|
194
|
195
|
(count($serieslist) > 0 ? " OR (FIND_IN_SET(item, '".(implode(",", $serieslist))."') > 0 AND type = 'SE')" : "").
|
|
195
|
196
|
") AND review != 'No Review'");
|
|
196
|
197
|
list($totalcount) = dbrow($newcount);
|
|
197
|
|
-if($totalcount) $update = dbquery("UPDATE ".TABLEPREFIX."fanfiction_series SET rating = '".round($totalreviews)."', reviews = '$totalcount' WHERE seriesid = '$thisseries'");
|
|
|
198
|
+if($totalcount) $update = dbquery("UPDATE ".TABLEPREFIX."fanfiction_series SET rating = '".($totalcount ? round((float)$totalreviews) : 0)."', reviews = '".(int)$totalcount."', numstories = '".count($storylist)."' WHERE seriesid = '$thisseries'");
|
|
198
|
199
|
$parentq = dbquery("SELECT seriesid FROM ".TABLEPREFIX."fanfiction_inseries WHERE subseriesid = '$thisseries' AND seriesid != '$thisseries'");
|
|
199
|
200
|
while($parent2 = dbassoc($parentq)) { seriesreview($parent2['seriesid']); }
|
|
200
|
201
|
|