Browse code

reviews.php: forgotten coauthors revert

Clarissa Walker authored on 2026/09/21 19:41:00
Showing 1 changed files
... ...
@@ -182,10 +182,9 @@ else if($action == "edit" || $action == "add") {
182 182
 				$uidquery = dbquery("SELECT uid,title, coauthors FROM ".TABLEPREFIX."fanfiction_stories WHERE sid = '$item'");
183 183
 				list($author, $title, $coauthors) = dbrow($uidquery);
184 184
 				if($coauthors) {
185
-					$array_coauthors = array( );
186 185
 					$coQuery = dbquery("SELECT uid FROM ".TABLEPREFIX."fanfiction_coauthors WHERE sid = '$item'");
187 186
 					while($c = dbassoc($coQuery)) {
188
-						$array_coauthors[] = $c['uid'];
187
+						$coauthors[] = $c['uid'];
189 188
 					}
190 189
 				}
191 190
 			}
... ...
@@ -204,7 +203,7 @@ else if($action == "edit" || $action == "add") {
204 203
 				}
205 204
 			}
206 205
 			if($review != "No Review" && $action == "add") {
207
-				$mailquery= dbquery("SELECT ap.newreviews,"._EMAILFIELD." as email, "._PENNAMEFIELD." as penname FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs as ap ON ap.uid = "._UIDFIELD." WHERE "._UIDFIELD." = '$author' ".(!empty($coauthors) ? " OR ".findclause(_UIDFIELD, $array_coauthors) : ""));
206
+				$mailquery= dbquery("SELECT ap.newreviews,"._EMAILFIELD." as email, "._PENNAMEFIELD." as penname FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs as ap ON ap.uid = "._UIDFIELD." WHERE "._UIDFIELD." = '$author' ".(!empty($coauthors) ? " OR ".findclause(_UIDFIELD, $coauthors) : ""));
208 207
 				while($mail = dbassoc($mailquery)) {
209 208
 					if($mail['newreviews']) {
210 209
 						include_once("includes/emailer.php");
... ...
@@ -265,11 +264,10 @@ else {
265 264
 		$story = dbassoc($storyquery);
266 265
 		$title = title_link($story);
267 266
 		$authoruid = ($story['uid']) ?? null;
268
-		$array_coauthors = array();
269 267
 		if(!empty($story['coauthors'])) {
270 268
 			$colist = dbquery("SELECT uid FROM ".TABLEPREFIX."fanfiction_coauthors WHERE sid = '$item'");
271 269
 			while($c = dbassoc($colist)) {
272
-				$array_coauthors[] = $c['uid'];
270
+				$coauthors[] = $c['uid'];
273 271
 			}
274 272
 		}
275 273
 	}
... ...
@@ -398,7 +396,7 @@ else {
398 396
 			$reviewer = $reviews['reviewer'];
399 397
 			$member = _ANONYMOUS;
400 398
 		}
401
-		if(empty($reviews['respond']) && (USERUID == $authoruid || (isset($array_coauthors) && in_array(USERUID, $array_coauthors)))) $adminlink .= " [<a href=\"user.php?action=revres&amp;reviewid=".$reviews['reviewid']."\">"._RESPOND."</a>]";
399
+		if(empty($reviews['respond']) && (USERUID == $authoruid || (isset($coauthors) && in_array(USERUID, $coauthors)))) $adminlink .= " [<a href=\"user.php?action=revres&amp;reviewid=".$reviews['reviewid']."\">"._RESPOND."</a>]";
402 400
 		$tpl->newBlock("reviewsblock");
403 401
 		$tpl->assign("reviewer"   , $reviewer );
404 402
 		$tpl->assign("reportthis", "[<a href=\""._BASEDIR."contact.php?action=report&amp;url=reviews.php?reviewid=".$reviews['reviewid']."\">"._REPORTTHIS."</a>]");