|
...
|
...
|
@@ -34,11 +34,20 @@ while($st = dbassoc($stinseries)) {
|
|
34
|
34
|
if($st['sid']) $storylist[] = $st['sid'];
|
|
35
|
35
|
else if($st['subseriesid']) $serieslist[] = $st['subseriesid'];
|
|
36
|
36
|
}
|
|
37
|
|
-$newrating = dbquery("SELECT AVG(rating) as totalreviews FROM ".TABLEPREFIX."fanfiction_reviews
|
|
38
|
|
- WHERE ((item = '$thisseries' AND type = 'SE')".
|
|
39
|
|
- (count($storylist) > 0 ? " OR (FIND_IN_SET(item, '".(implode(",", $storylist))."') > 0 AND type = 'ST')" : "").
|
|
40
|
|
- (count($serieslist) > 0 ? " OR (FIND_IN_SET(item, '".(implode(",", $serieslist))."') > 0 AND type = 'SE')" : "").
|
|
41
|
|
- ") AND rating != '-1'");
|
|
|
37
|
+if($ratings == 3) {
|
|
|
38
|
+ $newrating = dbquery("SELECT COUNT(rating) as totalreviews FROM ".TABLEPREFIX."fanfiction_reviews
|
|
|
39
|
+ WHERE ((item = '$thisseries' AND type = 'SE')".
|
|
|
40
|
+ (count($storylist) > 0 ? " OR (FIND_IN_SET(item, '".(implode(",", $storylist))."') > 0 AND type = 'ST')" : "").
|
|
|
41
|
+ (count($serieslist) > 0 ? " OR (FIND_IN_SET(item, '".(implode(",", $serieslist))."') > 0 AND type = 'SE')" : "").
|
|
|
42
|
+ ") AND rating != '-1'");
|
|
|
43
|
+ }
|
|
|
44
|
+else {
|
|
|
45
|
+ $newrating = dbquery("SELECT AVG(rating) as totalreviews FROM ".TABLEPREFIX."fanfiction_reviews
|
|
|
46
|
+ WHERE ((item = '$thisseries' AND type = 'SE')".
|
|
|
47
|
+ (count($storylist) > 0 ? " OR (FIND_IN_SET(item, '".(implode(",", $storylist))."') > 0 AND type = 'ST')" : "").
|
|
|
48
|
+ (count($serieslist) > 0 ? " OR (FIND_IN_SET(item, '".(implode(",", $serieslist))."') > 0 AND type = 'SE')" : "").
|
|
|
49
|
+ ") AND rating != '-1'");
|
|
|
50
|
+}
|
|
42
|
51
|
list($totalreviews) = dbrow($newrating);
|
|
43
|
52
|
$newcount = dbquery("SELECT count(reviewid) as totalcount FROM ".TABLEPREFIX."fanfiction_reviews
|
|
44
|
53
|
WHERE ((item = '$thisseries' AND type = 'SE')".
|
|
...
|
...
|
@@ -75,4 +84,4 @@ while($parent) {
|
|
75
|
84
|
if(dbnumrows($parentq)) list($parent) = dbrow($parentq);
|
|
76
|
85
|
else $parent = false;
|
|
77
|
86
|
}
|
|
78
|
|
-?>
|
|
79
|
87
|
\ No newline at end of file
|
|
|
88
|
+?>
|