while($result = $db->fetch_array($query)) {
$db->query("UPDATE ".X_PREFIX."members SET postnum=postnum-{$result['pidcount']} WHERE username='".$db->escape($result['author'])."'");
}
********************************
* Replace With:
********************************
$query2 = $db->query("SELECT author FROM ".X_PREFIX."posts WHERE tid=$tid ORDER BY dateline LIMIT 1");
if (1 == $db->num_rows($query2)) {
$firstauthor = $query2['author'];
} else {
$firstauthor = '';
}
while($result = $db->fetch_array($query)) {
$postcountmoney = (int)$result['pidcount'] * (int)$SHOP['spd']; //calculate money to subtract
if ($result['author'] == $firstauthor) $postcountmoney += (int)$SHOP['std'] - (int)$SHOP['spd'];
$db->query("UPDATE ".X_PREFIX."members SET postnum=postnum-{$result['pidcount']}, money=money-$postcountmoney WHERE username='".$db->escape($result['author'])."'");
}
********************************
* Find Code:
********************************
$db->query("UPDATE ".X_PREFIX."members SET postnum=postnum-{$result['pidcount']} WHERE username='$dbauthor'");
********************************
* Replace With:
********************************
$postcountmoney = (int)$result['pidcount'] * (int)$SHOP['spd']; //calculate money to subtract
$db->query("UPDATE ".X_PREFIX."members SET postnum=postnum-{$result['pidcount']}, money=money-$postcountmoney WHERE username='$dbauthor'");
==================================================================================================== |