Please keep track of any changes here. Please include your name, the date, all the files you edited, and a brief summary (one sentence should do):

9/21/05 - Tammy

- Added missing _NEWADMIN definition to en.php
- Fixed error in INSERT statement in user.php causing blank screens when member 1st signs up
- Fixed error in UPDATE statement when password is changed
- Fixed count query in member's function in admin.php
- Fixed validation problem in stories.php
- Added multiple categories note back into stories.php and search.php (went missing along the way somewhere)

9/15/05 - Rebecca

- Minor adjustments to documents, adding anchors
- Templating documents, same font/size/etc.

9/25/05 - Tammy

- Fixed language call in user.php 
- Fixed tables.sql to add missing challenges table info
- Minor correction in creating_blocks.htm in the docs folder

9/29/05 - Tammy

- Changed mysql error reporting in 2 places in admin.php
- Fixed problem in news.php keeping news from displaying
- Fixed bad calls to .tpl files in series.php
- Fixed css formating in challenges
- Fixed YIM link in viewuser.php
- Fixed missing <div> tag in categories.php
- Slight modification to challenges.tpl 
- Added 2 missing defines to en.php
- Changed func.pagemenu.php to define {sitename} and {slogan} all the time not just when the skin is missing

10/04/05 - Tammy 

- Added <div> to categories.php and categories block to clear float
- Fixed logout cookie problem that allowed admin privileges after admin logged out 
- Fixed problem with admin adding new authors
- Fixed members_list.php for lists in admin.php
- Fixed problem in stats page in user.php (if author wasn't in anyone's favorites it was returning no info from the query)
- Fixed the form in the editbio function.  If alerts were turned off, the betareader checkbox was removed along with the alerts box.

10/09/05 - Tammy

- Added error message for lost password function when mail isn't sent.
- Fixed skin problem on login page.  The user's skin choice was being overridden by the site settings.
- Found missing ! in challenges.php that had members being asked to log in even though they already were
- After discussion with Carissa I changed categories, featured, random, and recent block to allow users to use blocks within .tpl files for compatibility with 1.1 skins.  New admin.php's were added for each.
- Fixed missing define in admin.php 

10/12/05 - Tammy

- Moved charset into language file.  Changed in header.php and en.php
- Fixed image upload in user.php.  Problems with register globals off I believe.  Also changed the folder from username to userid.
- Fixed 3 column layout.
- added {output} to user.tpl in default_tpls.  Needed for favorite authors list.
- Missing $tableprefix declaration in viewuser.php fixed.
- Updated penname search.  Original would only find first author result.  New version will find all authors that match that term.  


10/13/05 - Tammy

- Fixed several problems in challenges.php
- Fixed problem with alert e-mails when new story is added by admin.
- Fixed missing global declaration in blocks function in admin.php
- Fixed typo in storyblock.php that was causing a broken link to challenges.

10/16/05 - Tammy

- Modified menu block to allow the setup of multiple menus.  No admin panel for this option as yet though.  Copy the menu line in blocks_config.php and change the title to create a new menu.
- Modified func.pagemenu.php to make pagelinks global variables instead of putting them in header.  Also added a new variable assignment "page_id".  This can be used in a container div around your pages to allow you to set different looks via CSS depending on the page. 
- Fixed paging problem in the search function.
- Fixed favorites list in viewuser.php
- Added missing information to seriesblock.php and series.php.  Genres, warnings, etc. didn't get added to the block display when I added those.
- Changed a couple of the default .tpls. See above.
- Added tos.php to display Terms of Service outside of user registration.
- Added terms of serice and submission rules links to func.pagement.php 
- Added ability in func.reviewform.php and reviews.php to edit reviews.  
- Modified how blocks are saved in the admin panel to avoid conflicts with block settings in the current skin.

10/18/05 - Tammy

- Moved where slashes are stripped from $sitename and $slogan to above the language file inclusion as $sitename is used within and needs to be slash-free.
- Modified news block and header to fix grouping problem with the SQL join
- Added a check in categories block and page and members_list.php for no value for columns being set in config.php.  If no value (or zero) it's set to 1 to avoid division by 0 errors
- Fixed a query problem in categories.php that left out the seriesid from the results.
- Modified storyblock.php to addslashes to warning text otherwise we get javascript errors if someone's used ' or " in their warning text.
- Fixed edit of warnings in admin panel.

10/19/05 - Tammy

- Fixed the bug with admins adding stories for author's the story would go in under the admin instead.
- Added nl2br to the news block and archive so new lines will show up in news stories now.
- Fixed spacing issue in stories.php

10/20/05 - Tammy

- Removed echo command from fix category counts function in admin
- Fixed block admin function was missing a parameter in calling save_blocks()
- Fixed css issue in categories function in admin.php
- Fixed issue in user.php with registration process that caused pennames and emails to not be validated.

10/22/05 - Tammy

- Added some security checks to the contact us and contact member forms to prevent injection attacks.
- Added a check in header.php to check for XXS attacks via $_GET and kill the page if one is detected.
- Added global declaration of $allowed_tags in series.php, stories.php and challenges.php where it was missing.  
- Added some security checks to reviews to strip out disallowed tags while I was at it.
- Fixed problem in step 4 of  the install script.  The 'locked' field got messed up somehow.
- Reorganized how users are logged out to hopefully prevent problems with variables staying in memory.
- Slight modifications in news block and news archive page. Changed the order from the news id to the news time. If someone deleted an item or moved their database, the order could have been messed up using the id #.
- Fixed admin editing stories.  Was trying to use admin's uid to load story not author's.
- Removed review form and options from viewstory.php and reviews.php when anonymous reviews are turned off and not loggedin
- Changed formselect.php to formselect.js in series.php and challenges.php
- Fixed edit and delete as admin problems where script was trying to call from admin's uid not author's
- Added "Edit" links to "View Submitted" page in admin.php
- Challenges were not originally going to be listed in the stories and series block information.  As such they got left out of the DB query.  Fixed now.
- Making {series} and {challenges} global TPL variables for the page links meant I needed to change those links in the storyblock and seriesblock files changed to {serieslinks} and {challengelinks} for the blocks

10/24/05

- Moved where variables.php is called in header.php to allow code to be echo'd into the header.
- Added button in categories page of the admin panel to re-generate the formselect.js.

10/26/05

- Updated the docs.  
- Fixed dates in rss.
- Slight modification to TinyMCE settings in header.php
- Fixed bug that let people submit a story with no categories selected.
- Small change to contact.php to help prevent spammers hijacking the form.
- Changed order by in build_formjs function to hopefully solve problem reported by Calic0cat.

10/27/05

- Fixed problem with category sort form.
- Tweaked the naughty words filter.
- Fixed the full-text search in the search form.
- Fixed AGAIN everything from 10/04 that hadn't already been reported again and fixed.  Must have been overwritten somewhere.
- Fixed "Add to Series" link for open series.
- For open series removed option to delete story from series except for admin's and series owner.
- Fixed reviews link on viewstory page.  Reviews weren't being displayed if you weren't logged in.

10/28/05 

- Fixed reviews and favorites links in series.
- Fixed display of favorite series in viewuser.php
- Fixed news problem in admin.php
- Modified the current list so authors and members lists don't both show up as current.
- Made the "Choose another author" link when adding stories to a series available only to the owner of the series and the admins.
- Fixed the "Choose another author" link to output list of authors.

10/29/05

- Added admin panel for the foul language censor.
- Added css classes to form elements.  Classes are: .checkbox, .radio, .button, .textbox (select, textarea, text, file inputs)
- Removed paragraph tags from around notes and story textareas in stories.php so it doesn't break TinyMCE. Thanks to West4me for tracking the error down.

10/30/05

- Separated admin.php into multiple includes in admin/ folder to make things easier in the future.
- Modified the formselect.js to keep people from selecting locked tables in stories.php.  Update to en.js because of this.  This required adding a hidden form element to stories.php, search.php, series.php, and challenges.php
- Changed columns in textarea's from 60 to 58 because TinyMCE was forcing the textareas outside the form box.  Looks okay at 58 when TinyMCE is off.

10/31/05

- Fixed issue with validation of authors.  The author was being validated even though the admin had chosen no.
- Fixed AIM status icon issues in viewuser.php and user.php.
- Fixed Yahoo status link problem in stats page in user.php
- Fixed problem with age consent not being saved when a user updates their profile.
- Fixed error with one category archives not allowing stories to be submitted.  
- Added a couple short functions to handle whether or not magic_quotes is on our off.
- Fixed viewstory for a round robin so the chapter's author appears correctly.

11/2/05 - Tammy

- Added author's notes to the printable version of viewstory.php
- Added error checking in viewstory.php on line 95.
- Fixed addslash problem in admin/news.php
- Fixed missing " in admin/genres.php
- Fixed character menu 2 in categories.php
- Modified text sizer in view stories to allow text size to be set in skins
- Modified the dirty words filter so it doesn't choke if admin removes all words from the list.
- Changed func.reviewform.php to hide the ratings note when ratings are turned off
- Added author drop down to the chapter form for admin's only.

11/3/05 - Tammy

- Fixed missing " in stories.php and modified the author drop down in the chapter form so it shows the correct author as selected at start.
- Fixed missing language defines for review emails.
- Added review response step to upgrade.php
- Fixed bug that was allowing regular users to see admin options in challenges and series.
- Fixed bug with round robins being displayed properly in viewstory.php
- Fixed admin editing a chapter bug that was putting the story in the admin's files instead of the authors.
- Fixed another bug in viewstory if storing the story text in the database it wouldn't show the story.  Thanks to Calash for tracking these down.
- Fixed 10 Most Prolific Reviewer list.  Was sorting by ASC instead of DESC.
- Modified admin/buildform_js.php to add slashes for double quotes ONLY and translate all other html entities into their character equivelents.
- Fixed bug in seriesblock.php that kept the categories from being displayed.

11/04/05

- Changed how cookies are handled to make it more secure.
- Fixed edit stories bug that was forcing reselection of author's name when admin previewed.
- Re-organized how blocks work so you don't have to set it to a specific block area of the page.
- Fixed contact author page. 
- Changed admin/build_formjs.php to slightly alter the javascript for category/character selects.  If someone selected a main category then
 went back to the top level categories it showed the first category in the list, therefore making it impossible to select that category and see its
subcategories.  Only a problem in FF.
- Fixed yes/no letter problem in admin panel and changed it so the skin doesn't show in the pop-up window.
- Fixed adding admin form so the category select works.
- Added new option to admin panel for the info block for style 2 - variables.

11/06/05

- Fixed favorites stats in user page.
- Added check in account registration to try to catch people not submitting valid email addresses.
- Further added security checks on cookie login.
- Fixed problem in rss feed caused by &, ", ', < or > in story title or summary.
- I believe I've got the problem with <br />'s and previewing figured out when TinyMCE is turned off.
- Added back in the setting for index only on blocks.  Setting a block to index only when it's only visible on the index page should improve site performance. 
Especially for larger sites. And I HIGHLY recommend you set it so if it only appears on the index page.
- Fixed respond to reviews function in user panel.
- Returned 1-5 to 1-10 in the reviews form.
- Added page_id tag to viewstory.php
- Fixed link to review a series in drop-down list on series page
- Editing a story now works.  If missing fields are found it reports it instead of just returning you to the edit form.
- Modified storyblock.php and the featured, random, and recent stories blocks to fix problems with ' and " in warning text.

11/07/05

- Fixed recent page so pagelinks appear and the stories should now be ordered by date and time instead of just date.
- Fixed advanced search page searching for ratings, genres, and warnings.  
- Reworked the viewstory page so if the visitor hasn't passed the checks on the pop-up menu they don't see the story.  Also tweaked the printable function slightly while I was at it to include author's notes.
- Fixed category paging issue.
- Links in to other user's profiles in the user stats page should now work.
- Validation and Revoke Validation links for authors should now work.
- Fixed the story count behind the author's name in the member's page and elsewhere so that non-validated stories aren't included in the count.
- Added $tableprefix to the validation check in viewstory.php
- Admin's no longer have to re-select author's name when adding new chapter.
- After an admin adds a new chapter they are returned to the edit story page so they can add another chapter if they desire.
- Admin entered stories are auto-validated now.
- Fixed admin list in admin/members.php to include level 4 admins.
- Fixed variables.php in the default_tpls to conform with the changed blocks scheme.
- Fixed charset in stories.php and viewstory.php to use define.

11/09/05

- Added a bit of CSS to the printable function to force margins on the page.
- Removed the update from edit story and edit chapter in stories.php
- Fixed pagination problem in search, challenges, and categories.
- Fixed pagination problem in authors.php that was passing the offset to pages that shouldn't have gotten it
- Fixed {reviewslink} in reviews.php
- Fixed problem in the formselect.js that was throwing errors when adding categories for an admin to oversee and only there.
- Modified the default_tpls variables.php to conform to the updated blocks format.
- Fixed the admins list in admin/admins.php and admin/members.php
- Updated the en.php language file.  Slightly modified the min/max word message so if you only set min or max the other didn't appear as "maximum of 0 words." for example
- Added template.php back into the .zip.  Got left out. :P
- Updated upgrade.php to added { } around an else that was causing errors if someone had deleted their config.php file.
- Updated install.php and moved config.php and dbconfig.php to the docs folder to prevent some of the problems we've been having with
people over-writing config files when upgrading.
- Moved where $current is set in a couple files so that it was before header.php was called.  Not really necessary, but you can do some pretty neat things with variables.php with it that way.
- Fixed at least one error in admins adding stories if they have categories that they oversee set. 

11/11/05

- Updated en.php to include _UP and _DOWN for alt/title text on the arrows.  Also added, _CATERROR and _REVIEWRATING
- Updated serveral files to fix hard coded language. stories.php, admin/stories.php, series.php, blocks.php, search.php, blocks/menu/admin.php
- Fixed problem where adminoptions were showing up for regular members in reviews.  
- Changed _RATING to _REVIEWRATING in func.reviewform.php
- Fixed missing letter in series list.
- Fixed missing WHERE in admin/members.php
- Fixed "Edit - Story" link in validate function in admin/stories.php
- Modified viewstory.php so admins and authors can view non-validated stories.  Anyone else gets kicked to an error.
- Fixed pagination in Feature Stories page in search.php
- Fixed validation bug in viewstory.php for the printable function.
- Fixed admin/ratings.php to show that "Age Consent" was checked.  Wasn't getting set to "selected" in the form when all three options were marked.
- Added a check in admin/categories.php to prevent a category being set as it's own parent.  This causes an infinite loop and breaks LOTS of things.
- Added a check in stories.php to make sure when editing a story that at least 1 category is selected for the story.  Otherwise it breaks the update of the story information and category counts.
- Removed phpinfo.php.  We'll make this available as a separate download for debugging purposes, but it's a security hazard if left on the site.

11/13/05

- Changed the login slightly so that if a story id is passed (as in warning text pop-ups) it will automatically take you back to the story once you've logged in.
- Added jump menu in reviews so you can select only a specific chapter to view.
- Changed the delete function in stories.php so if the user is deleting a chapter in a multi-chapter story it will return them to the edit story page.
- Fixed problem in manage images with deleting an image.
- Removed font-size attribute in eFiction skin that was interfering with text sizer.
- Fixed error in news that was causing problems with comments with ', ", etc. in them.
- Modified en.php to fix problem with review notifications.
- Fixed edit chapter link in admin/stories.php.
- Added "print copyright" to messages in admin/settings.php
- Admin author's list still had an issue with "WHERE"  Fixed now.
- "No letter" link in admin/stories.php still had old myopen javascript call instead of pop.
- Updated recent block so that if $numupdated is not set.  $numupdated becomes 3 to prevent SQL errors.
- Modified header.php so that a story's title and author would appear in the header when in viewstory.php
- Modified the check for admin categories in newstory.php to work correctly with multiple categories.  Admins should now get email notifications
- Modified stories.php admin check for new chapters so it checks for admin permissions correctly.

11/14/05

- Fixed bug in news archive from missing '
- Updated info block to remove hard coded text and imporve options.
- Updated user.php so after responding to a review the author is sent back to the story's reviews.
- Added chapter number to the jump menu. 
- After reviewing a story, the link now takes you to the next chapter in the story if there is one.
- Fixed the authors list in admin/members.php so the columns are correct
- Fixed the review email.
- Ditto the story alert emails and submitted queue notices.

11/16/05

- Fixed the review email.
- Ditto the story alert emails and submitted queue notices.  While I was at it I also made them all html and added title, author, and summary information.
- Added #currentletter for the current letter being displayed in the alphabet list to titles.php, challenges.php, series.php and members_list.php
- Added #currentpage <span> around current page number in categories.php, challenges.php, series.php, titles.php, search.php, reviews.php, members_list.php, and news.php
- Put a check in header.php to add http:// to the site url if not set with one and subtract any trailing /'s so all the url's will work in all the e-mails. :)
- Fixed pagination issues for "Authors Only" in authors.php and admin/members.php
- Moved variables.php call from header.php to func.pagemenu.php so variables.php can be used to assign information to the $tpl
- Created a check for extra_header.php in header.php.  If you need extra information in the header such as a javascript or special css call extra_header.php  You can  use a general one in the main folder for all skins or one specific to the skin in your skin folder.
- Modified viewstory.php's chapter drop down menu slightly to compensate for a bug in Safari.

11/23/05

- tinyMCE and the block admin panel weren't playing well together.  Changed how the block settings are saved so that apostrophes, etc are properly \'d.
- Reworked viewstory.php and the default_tpl for such so that when a chapter doesn't have author's notes the author's notes will disappear.
- Modified the upgrade script to fix problem with data insert to the chapters table.  Thanks to bsky92 for testing.  Appears to be working.
- Modified the en.php for word count failure.
- Fixed # of reviews in user stats panel in user.php
- Fixed spacing for Anonymous in reviews.php
- Re-worked the categories block so it's easier to space it as desired.
- Fixed release of authors and revokation of author's validation problems.
- Fixed mail users issues.
- Fixed update of story when new chapter added issue.
- Fixed sort function in categories.php
- Fixed pagination issues in search.php

11/25/05

- Modified login, registration, and manage images in user.php to prevent SQL injection attacks
- Modifiied viewstory.php to prevent SQL injection attacks via $_GET[sid]
- Modified storyblock.php, seriesblock.php, func.pagemenu.php, functions.php, func.reviewform.php and all the blocks to prevent error messages revealing path info.
- Modified titles.php, series.php, authors.php, and challenges.php to prevent SQL injection attack via $_GET[let]
- Modified CSS in header.php so categories block didn't interfere with categories page

11/27/05

- Modified how words are counted in stories.php to hopefully get a better word count.
- Added a cleanup function in viewstory.php to hopefully clean up MS Word smart quote issues.
- Fixed series query in viewuser.php so series genres, characters, and warnings appear in listing
- Added checks for SQL injection in challenges.php and series.php and to be really paranoid a few in stories.php too
- Removed extra ; in header.php css
- Fixed revoke problem in members_list.php and admin/members.php
- Fixed editing admin privileges in admin/members.php so you don't go to the profile first
- Fixed unclosed div tag in func.reviewform.php
- Added admin options to storyblock for the story's author.  Also added admin option in storyblock on challenge page to remove the story from the challenge
- Added admin option in series block to remove story from a challenge on a challenge page

11/29/05

- Added a little paranoia code to stories.php to prevent SQL injection
- Fixed the paranoia code in series.php
- Added one more place where smart quotes needed to be cleaned up and also added a few more character issues with smart quotes.

11/30/05

- Fixed delete chapter link on validate page in admin panel
- Tweaked viewstory.php some more to hopefully fix the last of the line break and smart quotes issues
- Change the tpl option in the info block to be a global assignment so it works in all of the blocks.
- Tweaked the security check in series.php a little more so it would allow series to be managed.
- Fixed 2 problems in upgrade.php  One caused an error message in step 2 and the other caused the chapter titles to disappear.

12/06/05

- Added a new check in viewstory.php to catch errors when no author can be found.
- Fixed header problem in mail user function.
- Fixed row problem in categories block
- Changed stories.php so that deleting a non-validated story does not lower category counts
- If when adding a chapter there's no story id, it won't be added.  An error will display instead and put them back into preview mode.
- Fixed bug in uploading in edit chapter.
- changed x.gif to X.gif in admin/members.php
- Fixed sorts in categories.php
- Fixed display of characters, etc in series.
- Fixed problem in pop-up warnings for "Register User Only" stories
- Removed duplicate entries in en.php
- Upgrade fix take 2.  Checked the chapters insert again.  It should work.
- Beefed up the spam checks in contact.php and viewuser.php

12/09/05

- Fixed the security update for image uploads.  It wasn't working quite right.
- Fixed a typo in storyblock.php that kept the override of the default featured graphic from working
- Added a line to header.php to help with W3 Compliancy.  It forces & in urls to be written as &amp; in the text of page.
- Added check for tags in email in user.php.
- Strip tags from the admin inputs.
- Fixed problem with quotation marks in previews/edits of titles in challenges, series, stories, and chapters.
- Added maxlength tags in the same ^ to prevent user's from entering content that would get truncated in the database
- Did the same for reviewers name.
- Fixed reviews so that if visitor doesn't have access to read the story they can't use the reviews page to bypass the popups.
- Fixed the mySQL error when adding chapters.  So now title, summary, characters, categories will display at the top of the page correctly
- Fixed categories so under the main categories "No results found." is no longer displayed.
- Fixed the listings.tpl in default2 skin.

12/10/05

- Removed SQL statement from rss.php

12/16/05

- Added an ini_set statement in header.php to help the script validate to standards.
- Fixed mysql error when adding a chapter in stories.php
- Admins can now edit reviews. Authors can respond and delete.
- Fixed reviews popup.
- More paranoia on the contact form and user.php.  Also made it so they'd send html mail.
- Fixed bottom set of links in the "view submitted" admin panel

12/19/05

- Fixed the bug in user.php that prevented people from registering and editing their profile
- Added check in the same to keep non-admin's from editing other member's profiles
- Fixed advanced search function so that if a category isn't selected it doesn't error out.

12/29/05

- Modified series.php to make it clearer how to remove a story from a series.  
- Fixed admin links in storyblock.php. 
- Added 3 new options in settings.
   - authors may delete reviews.  Decide what reviews (if any) authors may delete for their stories.
   - default sort.  Choose whether stories are sorted alphabetically or by update by default.  Works in categories.php, challenges.php, and search.php. I left it off of titles.php as that's designed to be an alphabetical list.
   - story index.  Adds the story index back in as an option.  You'll need to add the storyindexblock to your viewstory.tpl file in your skins though.  Because you'll need to add it to your existing skins, it is set to off by default.
	Sample: 
<!-- START BLOCK : storyindexblock -->
      <p><b>{chapternumber}. {title} </b>by {author} [{reviews} - {numreviews}] {ratingpics} ({wordcount} words)<br />
	{chapternotes}</p>
<!-- END BLOCK : storyindexblock -->
- Added storyindexblock to default_tpl's viewstory.tpl (see above)
- Added _ORDERBY, _STORYINDEX, _REVDELETE, and _DEFAULTSORT to en.php.  Do NOT translate _ORDERBY!!
- Added urldecode to categories.php and search.php to handle pagination problems.  
- Added line 339 to editbio function in user.php to prevent non-admins from editing other user's information.  The code abates supplied in the forums would have worked as well.
- Fixed missing http:// on line 223 in user.php as reported by abates.
- Fixed revoke in admin/members.php.  
- Changed hard-coding of default chapter title in stories.php.  
- Updating of story word count missing when adding new chapter.  
- Changed titles.php so instead of the A titles it shows the first ## stories. 
- For all files that send email I added the following to the headers if it was not already there so messages would be sent in html format.
- viewstory.php was changed to include the story index information.  The change also added the story's information to the printable function (genres,warnings, etc) and made that same information available to be included on the page.  The variables to use are the same as in the storyblock in listings.tpl. 
- Added the @ symbol in front of the ini_set at the top of the file.  Thanks for the catch eyedam.
- Updated the admin panel for the menu block.

01/05/06

- Fixed single chapter problem in viewstory.php on line 377 add "|| $chapters == 1"
- Added missing variables to globals in settings.  Add $revdelete, $storyindex, $defaultsort to the end of the list
- Fixed display in categories.php on line 112 add AND author.uid = stories.uid to the storyquery
- Fixed order error in challenges.php.  On line 268 add "DATE_FORMAT(stories.updated, '%Y.%m.%d') as updatesort" in front of FROM in the query.

01/21/06

- Added line 43 to seriesblock.php. Line is: unset($catid, $characters, $challenges);
- Added "chapter.storytext" to line 144 in admin/stories.php just after "chapter.title" in list
- In challenges.php on line 283 added a space after </span> and before "
- Same change online 75 of members_list.php and 77 and 118 of titles.php
- Added $chalid to list on line 200 in challenges.php to fix story/series removal problem.
- Replaced lines 157 and 158 in search.php to correct errors in full text search.  Just replace the whole lines.  
- In viewuser.php on line 86 add "validated = 1 AND " just after the word "WHERE".  This will keep non-validated stories out of the count of the author's stories.
- Replaced the preg_match expression on line 349 in user.php to prevent pennames with less than 2 characters and more than 30
- In categories.php on line 169 remove the period after stories.title and replace the character section from lines 119 to 147 with the one in this update (problem with magic_quotes and characters with apostrophes)

02/11/06

- There's a simplified default_tpls in this update.  The original one was just a skin I'd been working on when I developed that little "uh oh" mechanism.  I stripped out the graphics and stuck it in there for testing purposes.  And there it remained.  I didn't change much if anything on the .tpl files themselves.  Mostly the changes were to style.css.  It should not change any skins already developed though.  I tested it on quite a few.
- In titles.php removed let=A&amp; on lines 72, 76, and 79
- In user.php changed line 349 to:
	if($penname && !preg_match("!^[a-z0-9_ ]{3,20}$!i", $penname)) return "<div style='text-align: center;'>"._BADUSERNAME."</div>";
- fixed the remove function in challenges.php.  You can just replace the whole thing.  Sorry, can't remember the exact steps. :blush:
- In search.php there's a section marked changed 01/23 (starts around line 208).  This fixes problems some people were having with categories when they searched and makes the same changes for characters as well.  This doesn't fix everything with the search.  If you've got ( ), [], or the like in your characters, the paginatoin will still break, but to fix that will require a major re-write on that section of the script.  For now, avoid those characters.
- Changed line 115 in storyblock.php so level 3 admins will see admin options.  Changed line 39 in seriesblock.php for similar reasons except for series level 4 admins were getting admin options all around.
- In viewstory.php the CleanupSmartQuotes function starting on line 33 got updated to include some more problem characters.  Same thing in admin/stories.php
- There's a marked section in members_list.php that was changed to make the mutli-column members list work slightly better.
- Similar section marked in categories.php and blocks/categories/categories.php.
- The css at the bottom of the header was changes slightly as well.  This and the 2 changes above will keep floats from floating out the bottom of the containing blocks. 
- In viewuser.php changed $sort .= to $sort = (removed the period)
- Removed a section starting at line 47 in contact.php that repeated.  Also added labels to the form at lines 87-89.  Does not change functionality, it just makes it more friendly for those using assistive devices such as screen readers.
- On line 149 in series.php changed both occurances of add2faves to addtofaves, and on lines 142 and 143 changed $storyinfo[uid] to $owneruid
- Replace line 23 in admin/settings.php to add the new storyindex and revdelete variables to the list.
- In admin/settings.php added line 105 for tinyMCE settings file.  Then in header.php lines 134 to 143 changed to load that file if it exists. 
- Related to above, there's a tinyMCE.txt in the messages folder.  This is the settings for the more advanced theme that people have been adding.  Offered as an example/default.
- Replace line 269 in admin/categories.php "$s3 = ...." (added "AND validated = '1' to the end)
- In viewstory.php find "else $storytext .= $story[storytext];" around line 168 and replace it with "else $storytext .= $chapter[storytext];"
- In news.php at lines 125 and 126 change "skins/$skin" to "$skindir"
- Replace line 100 in reviews.php.  This is the $query = line in the else clause.  The change will let reviews for deleted chapters show.  Then on line 141 change _CHAPTER."$reviews[inorder]" to _NONE   (deleted chapters don't have an inorder number....you could also change it to "" your preference)

This next section will allow you to put files in subdirectories if you wish.  

In header.php find: (around line 35)

header ("Expires: 0"); 

After it add: 

$folder_level = "";
while (!file_exists($folder_level."config.php")) { $folder_level .= "../"; }
define("_BASEDIR", $folder_level);

Two lines below that change:

if(file_exists("blocks_config.php")) include("blocks_config.php");

to:

if(file_exists(_BASEDIR."blocks_config.php")) include(_BASEDIR."blocks_config.php");

Scroll down towards the bottom and find:

if(is_dir("skins/$skin")) $skindir ="skins/$skin";
else $skindir = "default_tpls";

Replace it with:

if(is_dir(_BASEDIR."skins/$skin")) $skindir =_BASEDIR."skins/$skin";
else $skindir = _BASEDIR."default_tpls";

Open func.pagemenu.php and add _BASEDIR in front of each of the links.  For instance, change:

	$pagelinks["login"] = "<a href=\"user.php\">"._LOGIN."</a>";

to
	$pagelinks["login"] = "<a href=\""._BASEDIR."user.php\">"._LOGIN."</a>";

Additionally, add _BASEDIR to the image src for the RSS link.

	$rss = "<a href=\""._BASEDIR."rss.php\"><img src=\""._BASEDIR."images/xml.gif\" alt=\""._RSS."\" border=\"0\"></a>";

Add the following line to the list of global declarations at line 65.

	$tpl->assignGlobal("basedir", _BASEDIR);

This will let you use {basedir} in your skins to point to the right path for your images.

On line 67, add _BASEDIR:

	$tpl->assign( "footer", file_get_contents(_BASEDIR."messages/copyright.txt") );

Same thing on line 71:

	$tpl->assign( "footer", file_get_contents(_BASEDIR."messages/copyright.txt") );

And 74:

			include(_BASEDIR."blocks/$value[file]");

In template, change:

else $tpl = new TemplatePower("default_tpls/default.tpl");

to 

else $tpl = new TemplatePower(_BASEDIR."default_tpls/default.tpl");

02/19/06

- viewstory.php and stories.php are included here because it looks like a couple people might have missed an update.  So this is a catch up for you.
- search.php added lines 215 and 220.
- admin/stories.php lines 207 and 248 replaces By with "._BY." for language translations.
- lines 66 and 67 in admin/warnings.php added strip_tags.
- en.php.  added lowercase to _MISSINGFIELDS.  Some people also apparently missed the addition of _ORDERBY

02/27/06

- in header.php on replace line 153.  Small tweak to force the columns to spread over the entire area in FF.
	html>body #category_content, html>body #categoryblock { display: table; width: 100%; }
- also in header.php on lines 114 and 115 add _BASEDIR.
- replace line 284 in search.php
- remove $sitename from _NEWSTORYAT definition in your language file (en.php)
- Updated the version in en.php to 2.0.4 just to give people a reference point and encourage them to update.
- Updated install.php and upgrade.php

03/10/06

- in header.php at line 48 add the following three lines:

if(!$columns) $columns = 1;
if(!$numupdated) $numupdated = 1;
if(!$itemsperpage) $itemsperpage = 10;

These changes will prevent those settings from being empty and crashing the script.

- in user.php change $action to $_GET['action'] on line 38
- in viewuser.php change fav.favuid, to fav.favuid as uid, on line 160
- in challenges.php on line 319 add a space between SELECT and *
- in your language file find _NEWSTORYAT and change it to include $sitename at the end (see the en.php included)
- in admin/stories.php find _NEWSTORYAT and remove $sitename from the end.
- on line 333 of viewstory.php change $level < 3 to $level < 4

03/31/06 - Manual instructions

- In search.php replace lines 121 and 183.  This fixes problems with searches with ' in them.
- Replace line 30 of admin/blocks.php  This should solve the problems people have been having with saving blocks.
- Replace lines 81 and 82 in viewuser.php This solves the sort problem reported by SteveD3.  Thanks!
- Add line 38 to viewstory.php at the beginning of the CleanupSmartQuotes function.  Trying to sort out when and when not to run the cleanup to get rid of funky characters without adding new funky characters. :)
- In admin/members.php change $mailtext to nl2br($mailtext) on line 240.  Should solve new line problems in e-mails.
- Also in viewstory.php from lines 122 to 132 change all occurances of $storyinfo to $story.  Solves missing genre and warning problems in printable function.
- In stories.php delete lines 648 to 658.  This section:
		if($_FILES['storyfile']['name']) {
			if ($_FILES['storyfile']['type'] != 'text/html' && $_FILES['storyfile']['type'] != 'text/plain')
 				$output .= "<strong>"._INVALIDUPLOAD."</strong><br><br>";
			else {
				$texts = file($_FILES['storyfile']['tmp_name']);
				foreach ($texts as $text) {
					if($_FILES['storyfile']['type'] == 'text/html') $story .= stripinput(strip_tags(rtrim($text, "\n\r\t")." ", $allowed_tags));
					else $storytext .= stripinput(strip_tags($text, $allowed_tags));
				}
			}
		}
- Then in stories.php find in the editstory function this line:
			foreach($delcats as $cat) { categoryitems($cat, -1); }
After it add: 
			if($admin) {
				$authquery = mysql_query("SELECT uid FROM ".$tableprefix."fanfiction_stories WHERE sid = '".$sid."'");
				list($olduid) = mysql_fetch_row($authquery);
				if($olduid != $uid) {
					if($store == "files") {
						$chapters = mysql_query("SELECT chapid FROM ".$tableprefix."fanfiction_chapters WHERE sid = '$sid' AND uid = '$olduid'");
						while($chap = mysql_fetch_assoc($chapters)) {
							$chapid = $chap['chapid'];
							$storytext = "";
							if($out = fopen ("$storiespath/$olduid/$chapid.txt", "r"))
							while (!feof($out)) {
								$storytext .= fgets($out, 10000);
							}
							fclose($out);
							unlink("$storiespath/$olduid/$chapid.txt"); 
							if($storytext) {
								if( !file_exists( "$storiespath/$uid/" ) ) {
									mkdir("$storiespath/$uid", 0755);
									chmod("$storiespath/$uid", 0777);
								}
								$handle = fopen("$storiespath/$uid/$chapid.txt", 'w');
								if ($handle) {
									fwrite($handle, $storytext);
									fclose($handle);
								}
								chmod("$storiespath/$uid/$chapid.txt", 0644);
							}
							mysql_query("UPDATE ".$tableprefix."fanfiction_chapters SET uid = '$uid' WHERE chapid = '$chapid' LIMIT 1");
						}
					}
					else $chapupdate = mysql_query("UPDATE ".$tableprefix."fanfiction_chapters SET uid = '$uid' WHERE sid = '$sid' AND uid = '$olduid'");
					$switch = mysql_query("UPDATE ".$tableprefix."fanfiction_stories SET uid = '$uid' WHERE sid = '$sid' LIMIT 1");
				}
			}
- In categories.php replace from with section from this archive from line 289:
	if(!$numstories && !$numseries && $searchstring) $tpl->assign("pagelinks", "<div style='text-align: center;'>"._NORESULTS."</div>");
to line 325:
	$tpl->printToScreen();

- In admin/news.php on lines 85 and 88 change itemsperpage to $itemsperpage (missing $)
- In admin/stories.php on line 52 change "ORDER BY story.title" to "ORDER BY story.title ASC, chapter.inorder ASC"

04/24/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 {"

04/27/06 - Manual instructions

- There are a few slight changes in en.php for _NEWPWDMSG and _SIGNUPMESSAGE
- In user.php switch out the lostpassword function.  
- In user.php in the editbio function add:
			include("includes/emailer.php");
  after:
	if($_POST['submit'])
		{
  then find:
						$mailtext = _SIGNUPMESSAGE._LOGIN.": $penname\n"._PASSWORD.": $pass \n\n";
						if(!$pwdsetting) $mailtext .= _SIGNUPWARNING;
						$headers .= "From: $siteemail<$siteemail>\n";
						$headers .= "X-Sender: <$siteemail>\n";
						$headers .= "X-Mailer: PHP\n"; //mailer
						$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
						$headers .= "Return-Path: <$siteemail>\n";
						$headers .= "Content-type: text/html; charset="._CHARSET."\r\n";

						mail($_POST['email'], $subject, $mailtext, $headers);

  replace with:
						$mailtext = _SIGNUPMESSAGE._LOGIN.": $penname<br />"._PASSWORD.": $pass <br /><br />";
						if(!$pwdsetting) $mailtext .= _SIGNUPWARNING;
						sendemail($penname, $_POST['email'], $sitename, $siteemail, $subject, $mailtext, "html");
- Also in user.php replace line 436 with the line below to add the red astericks for required fields in the password inputs.
		 	$output .= "<tr><td colspan=\"2\">"._PASSWORD.": ".($_GET['action'] == "newaccount" ? "<font color=\"red\">*</font>" : "")." <INPUT name=\"password\" class=\"textbox\" value=\"\" type=\"password\"> <INPUT name=\"password2\" class=\"textbox=\" value=\"\" type=\"password\"></td></tr>";
- Again user.php replace line 442-444.  This will fix the no value not being checked and adds a span around the yes and no options so they stay together on the same line.
				$output .= "<tr><td colspan=\"2\">"._AGECONSENT."<span style='white-space: nowrap;'>
					<input type=\"radio\" class=\"radio\" value=\"1\" name=\"ageconsent\" ".($user['ageconsent'] ? " checked" : "")."> "._YES."
					<input type=\"radio\" class=\"radio\" value=\"0\" ".($user['ageconsent'] == 0? " checked" : "")." name=\"ageconsent\"> "._NO."</span></td></tr>";
- I included the changes, but forgot to include the file for contact.php in the last update. So here it is again:
	Replace everything from "if($_POST['submit'])" to "else" in contact.php

05/07/06 - Manual instructions

- In blocks/categories/categories.php add the while statement on line 12 then the corresponding } at line 23
- In reviews.php at line 262 add: include_once("includes/emailer.php");
- In reviews.php replace line 202 to prevent reviews without seriesid or sid
- Also in reviews.php replace the deletereview function.
- In search.php on line 397 change -500 to 500
- In search.php replace line 286 (change < to <=) 
- In search.php replace the section beginning on line 234 down to the closing } around line 243
- In challenges.php replace line 242 to line 249
- In admin/settings.php there were a few html errors.  I'm hoping no one has added their own settings and you can just replace this file.  If not, PM or email me and I'll run down the list.


05/15/06 - Manual instructions

Because this involves an exploit that allows a lower level admin to take control of the site as a level 1 admin, I 
don't want to advertise the exact issue and cause problems for sites that haven't updated their files.  
Therefore, no manual instructions are being offered publicly.  PM or email me if you have modified either 
admin.php or admin/admins.php and need the manual instructions.


06/01/06 - Manual instructions

- Replace line 187 in user.php. Thanks to SteveD3 for finding the error and providing the fix.
See http://www.efiction.wallflowergirl.com/forums/viewtopic.php?t=2973 for full explanation.
- In reviews.php:
    -Replace lines 121 and 122.  
    -On line 41 add $level to the list of global variables.
This will prevent level 4 "admins" from being able to delete and edit reviews. 
- Also in reviews.php, replace lines 108 and 175 to keep non-validated chapters from showing up in the jump list.
- Also in reviews.php, replace the section starting at line 275 and ending at line 295 and the section from line 230 to 253. 
(Or the lazy way, replace the entire addreview function) This will prevent the submission of reviews for non-validated chapters and stories.
- In reviews.php on line 204 change "$tpl>" to "$tpl->".  Missing "-" Thanks eyedam.
- More for reviews.php, replace line 316.  Again thanks to eyedam.
- More in reviews.php, on line 307 change $level < 3 to $level <=3 so level 3 admins can delete reviews.  More thanks to eyedam's sharp eye.
- Another change in reviews.php thanks to eyedam again.  Replace line 202.
- One more in reviews.php. Goto line 292 and add the following lines directly beneath
				if($result['member'] != $useruid && (!$adminloggedin && $level < 3)) {
					$output = "<div style=\"text-align: center; margin: 2em;\">"._NOTAUTHORIZED."</div>";
					$tpl->assign("output", $output);
					return;
				}
- In admin/characters.php there were a number of changes from lines 66 to 93 (the "addform" section)  Replace those lines.
- In admin/stories.php replace lines 118 to 160 (in the validate function) Does not change functionality, just cleans things up a bit and fixes the reported problem with the spacing in warnings lists
- In viewstory.php move line 369 up to line 357 (outside the if statement).


06/04/06 - Manual instructions

- In user.php replace lines 484 and 490 (both in lostpassword function so you could also just 
copy and paste the function if your line numbers don't match up)
- In reviews.php replace line 234 (See: http://www.efiction.wallflowergirl.com/forums/index.php?topic=3052.0)
- Updated upgrade.php as well to correct errors in step 1.

07/09/06 - Manual instructions

- In user.php replace the lost password function.  Moved a couple lines around 
and switched a fail message.  Now the password won't be reset unless the e-mail 
returns a successful send of the email first.
- In your langauge file add new define for _EMAILFAILED
	define ("_EMAILFAILED", "The e-mail failed to be sent.");
- On line 27 of func.reviewform.php change $action to $_GET['action'] 
- In reviews.php on lines 308 and 315 change $uid to $useruid
- In viewstory.php on line 148 change $story['notes'] to $chapter['notes'] (Thanks to Steve3D)
- In user.php a new check has been added to the manageimages function.
It starts at line 582.  Comments around it to designate start and end.  This check
deals with a bug in IE that allows scripts to be run with fake images.
- In user.php replace line 186 (in the stats function the 3rd line beginning with $authorquery)
- In reviews.php on line 204 change $tpl> to $tpl-> (add hyphen) (Thanks to Eyedam)

08/24/06 - Manual instructions

- in header.php add the following lines at line 39:

$output = "";
if(ini_get('register_globals')) {
	foreach($_SESSION as $k => $v) {
		unset($GLOBALS[$k]);
	}
}

- In challenges.php replace the respond( ) function.  (Sorry can't be more specific than that.)
- Also in challenges.php replace the security check section at the top.  
- In header.php goto line 92 which is:
	if($userdata['level']) $_SESSION['adminloggedin'] = 1;
Add directly below it:
	else $_SESSION['adminloggedin'] = 0;

08/28/06 - Manual instructions

- Find:

unset($check_url);

after it add:

$output = "";
if(empty($useruid)) {
	$adminloggedin = 0;
	$loggedin = 0;
	$level = 0;
}
if(ini_get('register_globals')) {
	foreach($_SESSION as $k => $v) {
		unset($GLOBALS[$k]);
	}
}

If you updated earlier in the week part of this will already be there.  
I'm just listing it here again for those who requested a clarification.

- In user.php find this section around line 78:

				if($passwd[level] != 0) {
					$_SESSION['adminloggedin'] = 1;
					$_SESSION['email'] = $passwd['email'];
					$_SESSION['admincats'] = $passwd['categories'];
			     	}

Directly beneath it add:

				else {
					$_SESSION['adminloggedin'] = 0;
				}
