This patch file updates files since 02/27/06.  Just replace the files with the ones in this .zip.  Do NOT run install.php or upgrade.php again.

04/23/06 - Manual instructions

- In stories.php on line 689 change.
	if($olduid != $uid) { 
to
	if($uid && $olduid != $uid) {
- In reviews.php change line 79 to:
	list($title, $authoruid) = mysql_fetch_array($storyquery);
- In user.php change line 374 to:
	$query = "INSERT INTO ".$tableprefix."fanfiction_authors (penname, realname, bio, email, website, date, password, userskin, AOL, ICQ, MSN, Yahoo, contact, betareader, ageconsent, alertson) VALUES ('".addslashes($_POST['newpenname'])."', '".$_POST['realname']."', '".strip_tags(addslashes($_POST['bio']), $allowed_tags)."', '".strip_tags($_POST['email'], $allowed_tags)."', '".strip_tags($_POST['website'], $allowed_tags)."', now(), '$encryppass', '".$_POST['skinnew']."', '".strip_tags($_POST['AOL'], $allowed_tags)."', '".strip_tags($_POST['ICQ'], $allowed_tags)."', '".strip_tags($_POST['MSN'], $allowed_tags)."', '".strip_tags($_POST['Yahoo'], $allowed_tags)."', '".$_POST['ageconsent']."', '$newreviews', '$betareader', '$useralertson')";
- Also in user.php, multiple changes to the managefaves function.  Just switch out the entire function.  Order by clauses were added to three of the queries and the series link was corrected.
- In stories.php move line 782 which should be:
	if(!$sid && !$chapid) return _ERROR;
to line 786 beneath:
	else if($confirmed == "yes") {
- Also in stories.php replace line 835.  This will make it so that admins deleting stories go back to the admin area and not their account area.
- In search.php replace the section beginning on line 234 for ratings to be as follows:  (makes the ratings search ANY instead of ALL for multiple selections)
	if($rid) {
		foreach($rid as $r) {
			if($r == -1) continue; // if you're including them all you don't really need to search for that
			$ratings[] = "stories.rid = '$r'";
		}
		$qwhere[] = "(".implode(" OR ", $ratings).")";
		$cwhere[] = "(".implode(" OR ", $ratings).")";
	}
- Also in search.php, on line 55 change $scountuery to $scountquery (typo missing Q)
- search.php again, change $swhere to $scwhere on 247, 255, 263, and 271 (there are two identical lines one after the other, change one to read $scwhere)
- And finally, search.php on lines 125 and 207 add "seriesid as subid, owner," after SELECT.  A big thanks to abates for tracking down these bugs and providing the fixes.
- In viewuser.php on line 137 change "fav.uid = fav.uid = " to just "fav.uid = " 
- Also in viewuser.php on line 145 add "DATE_FORMAT(stories.updated, '%Y.%m.%d') as updatesort" to the query so that it reads:
	$s2query = "SELECT stories.*, author.penname, DATE_FORMAT(stories.date, '$datum') as date, DATE_FORMAT(stories.updated, '$datum') as updated, DATE_FORMAT(stories.updated, '%Y.%m.%d') as updatesort FROM ".$tableprefix."fanfiction_stories as stories, ".$tableprefix."fanfiction_favstor as fav, ".$tableprefix."fanfiction_authors as author WHERE fav.uid = '".$_GET['uid']."' AND stories.uid = author.uid AND fav.sid = stories.sid ORDER BY ".($_GET['sort'] == "update" ? "updatesort DESC" : "stories.title");
- In header.php move the following line down to directly above the closing </head> tag.  For those manually updating, it's not necessary and doesn't solve any bugs, it just opens up some interesting possibilities using extra_header.php.
	<link rel=\"stylesheet\" type=\"text/css\" href='$skindir/style.css'>
- Also in header.php at line 39, I added _BASEDIR to the include for config.php.  The other changes in the lines below (up to the include for the blocks_config.php)are not important for sites that are already installed.  They'll push people who haven't set up their site to the install script.  For those manually updating, you can safely ignore all but line 39.
- SMTP and SendMail support.  
	Upload the new includes/ folder.  
	There are 4 new definitions in en.php towards the bottom of the file.  They're marked.
	Replace the contact function in viewuser.php.  
	Replace everything from "if($_POST['submit'])" to "else" in contact.php
	In admin/members.php replace the confirm yes section of the author release starting on line 43 and the entire mailusers fuction.  
	(Note: this will also fix the problems people were having with emailing admins and authors.)
	In stories.php replace the section starting on line 372 "if($validated) {" down to "if($newchapter) {" for author and admin alerts.
	In reviews.php, replace from 261 "if($review != "No Review") {" down to it's closing } (2nd one around line 271)
	In admin/stories.php:
		replace from line 85 to the line that starts "mysql_query("UPDATE..." in the validate function
		in the yesletter and noletter functions replace from "if($_POST['submit'])" to "else {"
		