Open Jimmi08 opened 2 months ago
this code looks wrong - changing it to the array
if($stories['coauthors'] == 1) {
$coauthors = array();
$coauth = dbquery("SELECT "._PENNAMEFIELD." as penname, co.uid FROM ".TABLEPREFIX."fanfiction_coauthors AS co LEFT JOIN "._AUTHORTABLE." ON co.uid = "._UIDFIELD." WHERE co.sid = '".$stories['sid']."'");
while($c = dbassoc($coauth)) {
$coauthors[$c['uid']] = $c['penname'];
}
$stories['coauthors'] = $coauthors;
unset($coauthors);
}
else if(empty($stories['coauthors'])) $stories['coauthors'] = array( );
Solution:
added story key coauthors_array to be sure what value should be used and when
There is always author (UID) OR author + coauthors_array
coauthors table was added in 3.4
dbquery("UPDATE ".TABLEPREFIX."fanfiction_stories SET coauthors = '1' WHERE coauthors != '0'");