Browse code

rename search.php to avoid conflict

Jimmi08 authored on 2021/04/05 11:59:16
Showing 6 changed files
... ...
@@ -36,9 +36,13 @@ Note: e107 clears sessions, so class2.php has to be loaded after get_session_var
36 36
 
37 37
 ### search.php
38 38
 
39
+rename to searching.php for efiction
40
+
39 41
 ### news.php
40 42
 
41 43
 ### index.php
44
+e107 has to be used
45
+- added recent menu to e107 menus
42 46
 
43 47
 ### contact.php
44 48
 
... ...
@@ -1,4 +1,4 @@
1
-INSERT INTO `test3fanfiction_pagelinks` (`link_id`, `link_name`, `link_text`, `link_url`, `link_target`, `link_access`) VALUES (1, 'home', 'Home', 'index.php', '0', 0),
1
+INSERT INTO `e107_fanfiction_pagelinks` (`link_id`, `link_name`, `link_text`, `link_url`, `link_target`, `link_access`) VALUES (1, 'home', 'Home', 'index.php', '0', 0),
2 2
 (2, 'recent', 'Most Recent', 'browse.php?type=recent', '0', 0),
3 3
 (3, 'login', 'Login', 'user.php?action=login', '0', 0),
4 4
 (4, 'adminarea', 'Admin', 'admin.php', '0', 2),
... ...
@@ -8,7 +8,7 @@ INSERT INTO `test3fanfiction_pagelinks` (`link_id`, `link_name`, `link_text`, `l
8 8
 (8, 'members', 'Members', 'authors.php?action=list', '0', 0),
9 9
 (9, 'authors', 'Authors', 'authors.php?list=authors', '0', 0),
10 10
 (10, 'help', 'Help', 'viewpage.php?page=help', '0', 0),
11
-(11, 'search', 'Search', 'search.php', '0', 0),
11
+(11, 'search', 'Search', 'searching.php', '0', 0),
12 12
 (12, 'series', 'Series', 'browse.php?type=series', '0', 0),
13 13
 (13, 'tens', 'Top Tens', 'toplists.php', '0', 0),
14 14
 (14, 'challenges', 'Challenges', 'browse.php?type=challenges', '0', 0),
... ...
@@ -523,7 +523,7 @@ function charlist($characters) {
523 523
 }
524 524
 
525 525
 // Most of the pages that list stories and series use this fuction.  This handles showing the series and stories and pagination of the two together when needed
526
-function search($storyquery, $countquery, $pagelink = "search.php?", $pagetitle = 0) {
526
+function search($storyquery, $countquery, $pagelink = "searching.php?", $pagetitle = 0) {
527 527
 	global $tpl, $new, $ratingslist, $itemsperpage, $reviewsallowed, $output, $dateformat, $current, $featured, $favorites, $retired, $ageconsent, $classtypelist, $classlist, $offset, $recentdays;
528 528
      
529 529
 	$count = dbquery($countquery);
... ...
@@ -1,446 +1,442 @@
1 1
 <?php
2 2
 
3
-
4
-
5
-
6 3
 // Defines the doc type.  Most people will not need to change this.
7
-define ("_DOCTYPE", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">");
4
+define('_DOCTYPE', '<!doctype html>');
8 5
 
9 6
 // Your alphabet list.  If you need other than single characters be sure to enclose the character entity in quotes.  For example: "&#338;"
10
-define ("_OTHER", "Other");
11
-$alphabet = array( 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', _OTHER );
7
+define('_OTHER', 'Other');
8
+$alphabet = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', _OTHER);
12 9
 
13 10
 // General...used in many pages.
14 11
 
15
-define ("_ACTIONSUCCESSFUL", "The action was successful.");
16
-define ("_ACTIONCANCELLED", "The requested action was cancelled.");
17
-define ("_ACTIVE", "Active");
18
-define ("_ADD", "Add");
19
-define ("_ADDAUTHOR2FAVES", "Add Author to Favorites");
20
-define ("_ADDSTORY2FAVES", "Add Story to Favorites");
21
-define ("_ADDTOFAVORITES", "Add to Favorites");
22
-define ("_ADMINOPTIONS", "Admin Options");
23
-define ("_AGECHECK", "Age Consent Required");
24
-define ("_AGECONSENT", "I am of the age of consent in my locale to view materials with adult content.&nbsp; I realize that by agreeing, the normal warnings for stories with adult content will be by-passed.");
25
-define ("_ALL", "All");
26
-define ("_ALLOWEDTAGS", "<span style=\"font-weight: bold; text-decoration: underline;\">Note:</span> Allowed HTML tags are: ".htmlentities(preg_replace("/></", "> <", $allowed_tags)));
27
-define ("_ALLSTORIES", "All Stories");
28
-define ("_ALPHA", "Alphabetically");
29
-define ("_ANONYMOUS", "Anonymous");
30
-define ("_AUTHORSNOTES", "Author's Notes");
31
-define ("_BACK2ACCT", "Back to <a href=\"member.php\">your account</a> area.");
32
-define ("_BACK2ADMIN", "Back to <a href=\"admin.php\">Admin</a> area.");
33
-define ("_BACK2CATS", "Back to Main Categories");
34
-define ("_BACK2PREVIOUS", "Back to Previous.");
35
-define ("_BACK2STORY", "<a href='viewstory.php?sid=%s'>Back to story.</a>");
36
-define ("_BACK2SERIES", "<a href='series.php?seriesid=%s'>Back to series.</a>");
37
-define ("_BACK2REVIEWS", "<a href='reviews.php?%s'>Back to reviews.</a>");
38
-define ("_BY", "by");
39
-define ("_CAPTCHAFAIL", "The security code you entered did not match.  Please <a href=\"javascript: history.back(1)\">try again.</a>");
40
-define ("_CAPTCHANOTE", "Enter the security code shown below:");
41
-define ("_CATEGORIES", "Categories");
42
-define ("_CATEGORY", "Category");
43
-define ("_CATLOCKED", "This category is locked.");
44
-define ("_CATOPTIONS", "Category Options");
45
-define ("_CLEAR", "Clear");
46
-define ("_CHAPTER", "Chapter");
47
-define ("_CHAPTERS", "Chapters");
48
-define ("_CHARACTERS", "Characters");
49
-define ("_CHOOSECAT", "Choose a Category");
50
-define ("_CONFIRMDELETE", "Are you sure you want to delete this?");
51
-define ("_COAUTHORSEARCH", "Type in the first few letters of the person's penname.  The first ten matches will appear in a list.  Click on the person's name to select them as a co-author.");
52
-define ("_DELETE", "Delete");
53
-define ("_DISLIKE", "dislike");
54
-define ("_DOWN", "down arrow");
55
-define ("_EDIT", "Edit");
56
-define ("_EDITFAVORITES", "Edit Favorites");
57
-define ("_EMAIL", "E-mail");
58
-define ("_EMAILFAILED", "The email could not be sent.  Please <a href='"._BASEDIR."contact.php'>contact the administrator</a> to report this problem.");
59
-define ("_ERROR", "<strong>Error!</strong>We encountered an error.  Please go back and try again.");
60
-define ("_FATALERROR", "<b>A fatal MySQL error was encountered.</b><br />");
61
-define ("_FSTORY", "Feature");
62
-define ("_GO", "Go");
63
-define ("_HALFSTAR", "half-star");
64
-define ("_JAVASCRIPTOFF", "You must have javascript enabled for this form to work properly."); // Modified for version 3.0
65
-define ("_LIKE", "like");
66
-define ("_LOGIN", "Log In");
67
-define ("_PLEASELOGIN", "Please login to access this feature.");
68
-define ("_MEMBER", "Member");
69
-define ("_MEMBERS", "Members");
70
-define ("_MOSTRECENT", "Most Recent");
71
-define ("_MOVE", "Move");
72
-define ("_MOVETOP", "Move to Top"); // Really only used in the admin files, but we need it in the header.
73
-define ("_MULTIPLECATEGORIES", 
74
-"<span style=\"text-decoration: underline; font-weight: bold;\">Note:</span> You may select multiple categories.  
12
+define('_ACTIONSUCCESSFUL', 'The action was successful.');
13
+define('_ACTIONCANCELLED', 'The requested action was cancelled.');
14
+define('_ACTIVE', 'Active');
15
+define('_ADD', 'Add');
16
+define('_ADDAUTHOR2FAVES', 'Add Author to Favorites');
17
+define('_ADDSTORY2FAVES', 'Add Story to Favorites');
18
+define('_ADDTOFAVORITES', 'Add to Favorites');
19
+define('_ADMINOPTIONS', 'Admin Options');
20
+define('_AGECHECK', 'Age Consent Required');
21
+define('_AGECONSENT', 'I am of the age of consent in my locale to view materials with adult content.&nbsp; I realize that by agreeing, the normal warnings for stories with adult content will be by-passed.');
22
+define('_ALL', 'All');
23
+define('_ALLOWEDTAGS', '<span style="font-weight: bold; text-decoration: underline;">Note:</span> Allowed HTML tags are: '.htmlentities(preg_replace('/></', '> <', $allowed_tags)));
24
+define('_ALLSTORIES', 'All Stories');
25
+define('_ALPHA', 'Alphabetically');
26
+define('_ANONYMOUS', 'Anonymous');
27
+define('_AUTHORSNOTES', "Author's Notes");
28
+define('_BACK2ACCT', 'Back to <a href="member.php">your account</a> area.');
29
+define('_BACK2ADMIN', 'Back to <a href="admin.php">Admin</a> area.');
30
+define('_BACK2CATS', 'Back to Main Categories');
31
+define('_BACK2PREVIOUS', 'Back to Previous.');
32
+define('_BACK2STORY', "<a href='viewstory.php?sid=%s'>Back to story.</a>");
33
+define('_BACK2SERIES', "<a href='series.php?seriesid=%s'>Back to series.</a>");
34
+define('_BACK2REVIEWS', "<a href='reviews.php?%s'>Back to reviews.</a>");
35
+define('_BY', 'by');
36
+define('_CAPTCHAFAIL', 'The security code you entered did not match.  Please <a href="javascript: history.back(1)">try again.</a>');
37
+define('_CAPTCHANOTE', 'Enter the security code shown below:');
38
+define('_CATEGORIES', 'Categories');
39
+define('_CATEGORY', 'Category');
40
+define('_CATLOCKED', 'This category is locked.');
41
+define('_CATOPTIONS', 'Category Options');
42
+define('_CLEAR', 'Clear');
43
+define('_CHAPTER', 'Chapter');
44
+define('_CHAPTERS', 'Chapters');
45
+define('_CHARACTERS', 'Characters');
46
+define('_CHOOSECAT', 'Choose a Category');
47
+define('_CONFIRMDELETE', 'Are you sure you want to delete this?');
48
+define('_COAUTHORSEARCH', "Type in the first few letters of the person's penname.  The first ten matches will appear in a list.  Click on the person's name to select them as a co-author.");
49
+define('_DELETE', 'Delete');
50
+define('_DISLIKE', 'dislike');
51
+define('_DOWN', 'down arrow');
52
+define('_EDIT', 'Edit');
53
+define('_EDITFAVORITES', 'Edit Favorites');
54
+define('_EMAIL', 'E-mail');
55
+define('_EMAILFAILED', "The email could not be sent.  Please <a href='"._BASEDIR."contact.php'>contact the administrator</a> to report this problem.");
56
+define('_ERROR', '<strong>Error!</strong>We encountered an error.  Please go back and try again.');
57
+define('_FATALERROR', '<b>A fatal MySQL error was encountered.</b><br />');
58
+define('_FSTORY', 'Feature');
59
+define('_GO', 'Go');
60
+define('_HALFSTAR', 'half-star');
61
+define('_JAVASCRIPTOFF', 'You must have javascript enabled for this form to work properly.'); // Modified for version 3.0
62
+define('_LIKE', 'like');
63
+define('_LOGIN', 'Log In');
64
+define('_PLEASELOGIN', 'Please login to access this feature.');
65
+define('_MEMBER', 'Member');
66
+define('_MEMBERS', 'Members');
67
+define('_MOSTRECENT', 'Most Recent');
68
+define('_MOVE', 'Move');
69
+define('_MOVETOP', 'Move to Top'); // Really only used in the admin files, but we need it in the header.
70
+define(
71
+    '_MULTIPLECATEGORIES',
72
+    "<span style=\"text-decoration: underline; font-weight: bold;\">Note:</span> You may select multiple categories.  
75 73
 <u>Please be aware that when you select a category in the drop-down menu below, the options in the list will change to display that category's sub-categories.</u>
76
- Press the 'Select >' button to add it to your choices. You may clear your selections at any time using the 'Clear' button.");
77
-define ("_MULTIPLESELECT", "Hold the CTRL key to make multiple selections.");
78
-define ("_NAME", "Name");
79
-define ("_NAUGHTYWORDS", "You have triggered our bad language filters.  We require that all content not behind an age verification warning be suitable for all audiences.  This includes titles, summaries, and names (for anonymous reviews, challenges, etc.). Please <a href=\"javascript: history.back(1)\">try again.</a>");
80
-define ("_NEXT", "Next");
81
-define ("_NEW", "New!");
82
-define ("_NO", "No");
83
-define ("_NODBFUNCTIONALITY", "It appears no applicable database functionality for PHP has not been enabled in the php configuration for this website.  Please consult the PHP documentation or ask your hosting provider.");
84
-define ("_NOMAILSENT", "We encountered an error.  No e-mail was sent.");
85
-define ("_NONE", "None");
86
-define ("_NOSKIN", "The skin you selected in your user profile seems to be missing.  The site's default skin will be used instead. Please edit your profile to choose another skin.");
87
-define ("_NORESULTS", "No results found.");
88
-define ("_NOTAUTHORIZED", "You are not authorized to access that function.");
89
-define ("_NOTCONNECTED", "ERROR: Failed to connect to the database!");
90
-define ("_OPTIONS", "Options");
91
-define ("_OR", "or");
92
-define ("_ORPHAN", "Orphan");
93
-define ("_OTHERRESULTS", "Other Results");
94
-define ("_PENNAME", "Penname");
95
-define ("_PFSTORY", "Past Featured Story");
96
-define ("_POSSIBLEHACK", "A hacking attempt has been detected.");
97
-define ("_PREVIEW", "Preview");
98
-define ("_PREVIOUS", "Previous");
99
-define ("_PRINTER", "Printer");
100
-define ("_ORDER", "Order");
101
-define ("_RATING", "Rating");
102
-define ("_RATINGS", "Ratings");
103
-define ("_REMOVE", "Remove");
104
-define ("_REQUIREDINFO", "Some of the required information is missing.  Please check your input.");
105
-define ("_REVIEW", "Review");
106
-define ("_REVIEWNOTE", "<span style=\"text-decoration: underline; font-weight: bold;\">Note:</span> You may submit either a rating or a review or both.");
107
-define ("_REVIEWRATING", _RATING);
108
-define ("_REVIEWS", "Reviews");
109
-define ("_RETIRE", "Retire");
110
-define ("_RETIRED", "Retired");
111
-define ("_RUSERSONLY", "Registered Users Only");
112
-define ("_SELECT", "Select");
113
-define ("_SELECTCATS", "Selected Categories");
114
-define ("_SERIES", "Series");
115
-define ("_SORT", "Sort");
116
-define ("_STAR", "star"); 
117
-define ("_STORIES", "Stories");
118
-define ("_STORY", "Story");
119
-define ("_SUBMIT", "Submit");
120
-define ("_SUMMARY", "Summary");
121
-define ("_TEXT", "Text");
122
-define ("_TINYMCETOGGLE", "Use tinyMCE");
123
-define ("_TITLE", "Title");
124
-define ("_TOC", "Table of Contents");
125
-define ("_TOPLEVEL", "Top Level Category"); // Really only used in the admin, but needs to load with the header.
126
-define ("_UP", "up arrow");
127
-define ("_WIP", "Work in Progress Only"); // Added 01/12/07
128
-define ("_YES", "Yes");
74
+ Press the 'Select >' button to add it to your choices. You may clear your selections at any time using the 'Clear' button."
75
+);
76
+define('_MULTIPLESELECT', 'Hold the CTRL key to make multiple selections.');
77
+define('_NAME', 'Name');
78
+define('_NAUGHTYWORDS', 'You have triggered our bad language filters.  We require that all content not behind an age verification warning be suitable for all audiences.  This includes titles, summaries, and names (for anonymous reviews, challenges, etc.). Please <a href="javascript: history.back(1)">try again.</a>');
79
+define('_NEXT', 'Next');
80
+define('_NEW', 'New!');
81
+define('_NO', 'No');
82
+define('_NODBFUNCTIONALITY', 'It appears no applicable database functionality for PHP has not been enabled in the php configuration for this website.  Please consult the PHP documentation or ask your hosting provider.');
83
+define('_NOMAILSENT', 'We encountered an error.  No e-mail was sent.');
84
+define('_NONE', 'None');
85
+define('_NOSKIN', "The skin you selected in your user profile seems to be missing.  The site's default skin will be used instead. Please edit your profile to choose another skin.");
86
+define('_NORESULTS', 'No results found.');
87
+define('_NOTAUTHORIZED', 'You are not authorized to access that function.');
88
+define('_NOTCONNECTED', 'ERROR: Failed to connect to the database!');
89
+define('_OPTIONS', 'Options');
90
+define('_OR', 'or');
91
+define('_ORPHAN', 'Orphan');
92
+define('_OTHERRESULTS', 'Other Results');
93
+define('_PENNAME', 'Penname');
94
+define('_PFSTORY', 'Past Featured Story');
95
+define('_POSSIBLEHACK', 'A hacking attempt has been detected.');
96
+define('_PREVIEW', 'Preview');
97
+define('_PREVIOUS', 'Previous');
98
+define('_PRINTER', 'Printer');
99
+define('_ORDER', 'Order');
100
+define('_RATING', 'Rating');
101
+define('_RATINGS', 'Ratings');
102
+define('_REMOVE', 'Remove');
103
+define('_REQUIREDINFO', 'Some of the required information is missing.  Please check your input.');
104
+define('_REVIEW', 'Review');
105
+define('_REVIEWNOTE', '<span style="text-decoration: underline; font-weight: bold;">Note:</span> You may submit either a rating or a review or both.');
106
+define('_REVIEWRATING', _RATING);
107
+define('_REVIEWS', 'Reviews');
108
+define('_RETIRE', 'Retire');
109
+define('_RETIRED', 'Retired');
110
+define('_RUSERSONLY', 'Registered Users Only');
111
+define('_SELECT', 'Select');
112
+define('_SELECTCATS', 'Selected Categories');
113
+define('_SERIES', 'Series');
114
+define('_SORT', 'Sort');
115
+define('_STAR', 'star');
116
+define('_STORIES', 'Stories');
117
+define('_STORY', 'Story');
118
+define('_SUBMIT', 'Submit');
119
+define('_SUMMARY', 'Summary');
120
+define('_TEXT', 'Text');
121
+define('_TINYMCETOGGLE', 'Use tinyMCE');
122
+define('_TITLE', 'Title');
123
+define('_TOC', 'Table of Contents');
124
+define('_TOPLEVEL', 'Top Level Category'); // Really only used in the admin, but needs to load with the header.
125
+define('_UP', 'up arrow');
126
+define('_WIP', 'Work in Progress Only'); // Added 01/12/07
127
+define('_YES', 'Yes');
129 128
 
130 129
 // Login
131 130
 
132
-define ("_REMEMBERME", "Remember Me");
133
-define ("_MEMBERLOGIN", "Member Login");
131
+define('_REMEMBERME', 'Remember Me');
132
+define('_MEMBERLOGIN', 'Member Login');
134 133
 
135 134
 // Browse
136
-define ("_BROWSE", "Browse");
137
-define ("_RECENTSTORIES", "Stories updated in the last ".$recentdays." days.");
138
-define ("_EMAILSENT", "Your e-mail has been sent.");
139
-define ("_TITLES", "Titles");
135
+define('_BROWSE', 'Browse');
136
+define('_RECENTSTORIES', 'Stories updated in the last '.$recentdays.' days.');
137
+define('_EMAILSENT', 'Your e-mail has been sent.');
138
+define('_TITLES', 'Titles');
140 139
 // Contact Us
141
-define ("_YOUREMAIL", "Your E-mail");
142
-define ("_CONTACTUS", "Contact Us");
140
+define('_YOUREMAIL', 'Your E-mail');
141
+define('_CONTACTUS', 'Contact Us');
143 142
 
144 143
 // Members/Authors page
145
-define ("_AUTHORS" , "Authors");
146
-define ("_BETAS", "Beta-readers");
147
-define ("_ALLMEMBERS", "All Members");
148
-define ("_SITEADMINS", "Site Admins");
144
+define('_AUTHORS', 'Authors');
145
+define('_BETAS', 'Beta-readers');
146
+define('_ALLMEMBERS', 'All Members');
147
+define('_SITEADMINS', 'Site Admins');
149 148
 
150 149
 // News
151
-define ("_COMMENTS", "Comments");
152
-define ("_NEWS", "News");
150
+define('_COMMENTS', 'Comments');
151
+define('_NEWS', 'News');
153 152
 
154 153
 // Reviews
155
-define ("_ALREADYRESPONDED", "You have already responded to that review!");
156
-define ("_BACKTOSTORY", "Back to story.");
157
-define ("_DELETEREVIEW", "Delete Review");
158
-define ("_DISLIKED", "Disliked");
159
-define ("_LIKED", "Liked");
160
-define ("_MISSINGINFO", "You must supply either a review or rating.");
161
-define ("_MISSINGINFO2", "Rating a story without writing a review is not allowed.  You must write a review.");
162
-define ("_OPINION", "Opinion");
163
-define ("_RESPECTNOTE", " Please be respectful and polite when contacting an author.");
164
-define ("_RESPOND", "Respond");
165
-define ("_REVEMAIL1", "New Review at $sitename for ");
166
-define ("_REVEMAIL2", "Hello,
154
+define('_ALREADYRESPONDED', 'You have already responded to that review!');
155
+define('_BACKTOSTORY', 'Back to story.');
156
+define('_DELETEREVIEW', 'Delete Review');
157
+define('_DISLIKED', 'Disliked');
158
+define('_LIKED', 'Liked');
159
+define('_MISSINGINFO', 'You must supply either a review or rating.');
160
+define('_MISSINGINFO2', 'Rating a story without writing a review is not allowed.  You must write a review.');
161
+define('_OPINION', 'Opinion');
162
+define('_RESPECTNOTE', ' Please be respectful and polite when contacting an author.');
163
+define('_RESPOND', 'Respond');
164
+define('_REVEMAIL1', "New Review at $sitename for ");
165
+define('_REVEMAIL2', "Hello,
167 166
   You have received a new review at $sitename.\r\n You can view your new review at <a href='$url/reviews.php?%1\$s'>$url/reviews.php?%1\$s</a>.
168 167
 If you no longer wish to receive e-mails such as this, please go to <a href='$url/user.php'>your account</a>\r\n
169 168
 on $sitename, and edit your profile."); // Modified 11-12-05
170
-define ("_REVIEWSFOR", "Reviews For");
171
-define ("_REVTHANKYOU", "Thank you for your review!");
172
-define ("_SIGNED", "Signed");
173
-define ("_VIEWALLREVIEWS", "View All Reviews");
169
+define('_REVIEWSFOR', 'Reviews For');
170
+define('_REVTHANKYOU', 'Thank you for your review!');
171
+define('_SIGNED', 'Signed');
172
+define('_VIEWALLREVIEWS', 'View All Reviews');
174 173
 
175 174
 // Search
176 175
 
177
-define ("_10LISTS", "Top Ten Lists");
178
-define ("_10LARGESERIES", "Ten Largest Series");
179
-define ("_10SMALLSERIES", "Ten Smallest Series");
180
-define ("_10REVIEWEDSERIES", "Ten Most Reviewed Series");
181
-define ("_10FAVSERIES", "Ten Favorite Series");
182
-define ("_10SHORTSTORY", "Ten Shortest Stories");
183
-define ("_10LONGSTORY", "Ten Longest Stories");
184
-define ("_10REVIEWEDSTORY", "Ten Most Reviewed Stories");
185
-define ("_10FAVSTORY", "Ten Favorite Stories");
186
-define ("_10FAVAUTHOR", "Ten Favorite Authors");
187
-define ("_10PROLIFICAUTHOR", "Ten Most Prolific Authors");
188
-define ("_10PROLIFICREVIEWER", "Ten Most Prolific Reviewers");
189
-define ("_ADVANCED", "Advanced Search");
190
-define ("_COMPLETEONLY", "Completed Only");
191
-define ("_EXCLUDE", "to Exclude");
192
-define ("_FULLTEXT", "Full Text");
193
-define ("_INCLUDE", "to Include");
194
-define ("_RESULTS", "Search Results");
195
-define ("_SEARCHTERM", "Search term");
196
-define ("_SEARCHTERMTOOSHORT", "Your search term was too short.  Your search term must be a minimum of three characters long. <a href='search.php'>Try again.</a>");
197
-define ("_SIMPLE", "Simple Search");
198
-define ("_WORDCOUNT", "Word count");
199
-define ("_SEARCH", "Search");
176
+define('_10LISTS', 'Top Ten Lists');
177
+define('_10LARGESERIES', 'Ten Largest Series');
178
+define('_10SMALLSERIES', 'Ten Smallest Series');
179
+define('_10REVIEWEDSERIES', 'Ten Most Reviewed Series');
180
+define('_10FAVSERIES', 'Ten Favorite Series');
181
+define('_10SHORTSTORY', 'Ten Shortest Stories');
182
+define('_10LONGSTORY', 'Ten Longest Stories');
183
+define('_10REVIEWEDSTORY', 'Ten Most Reviewed Stories');
184
+define('_10FAVSTORY', 'Ten Favorite Stories');
185
+define('_10FAVAUTHOR', 'Ten Favorite Authors');
186
+define('_10PROLIFICAUTHOR', 'Ten Most Prolific Authors');
187
+define('_10PROLIFICREVIEWER', 'Ten Most Prolific Reviewers');
188
+define('_ADVANCED', 'Advanced Search');
189
+define('_COMPLETEONLY', 'Completed Only');
190
+define('_EXCLUDE', 'to Exclude');
191
+define('_FULLTEXT', 'Full Text');
192
+define('_INCLUDE', 'to Include');
193
+define('_RESULTS', 'Search Results');
194
+define('_SEARCHTERM', 'Search term');
195
+define('_SEARCHTERMTOOSHORT', "Your search term was too short.  Your search term must be a minimum of three characters long. <a href='searching.php'>Try again.</a>");
196
+define('_SIMPLE', 'Simple Search');
197
+define('_WORDCOUNT', 'Word count');
198
+define('_SEARCH', 'Search');
200 199
 
201 200
 // Series
202
-define ("_ADD2SERIES", "Add to Series");
203
-define ("_ADDSERIES", "Add New Series");
204
-define ("_ADDSERIES2FAVES", "Add Series to Favorites");
205
-define ("_BACKTOSERIES", "Back to the Series"); // Added 11-06-05
206
-define ("_CHOOSEAUTHOR", "Choose another author");
207
-define ("_CLOSED", "Closed"); // Added 02-10-07
208
-define ("_CONFIRMREMOVE", "Are you sure you want to remove this from the series?"); // Added 12-22-05
209
-define ("_DELETESERIES", "Delete Series");
210
-define ("_EDITSERIES", "Edit Series");
211
-define ("_MANAGESERIES", "Manage Series");
212
-define ("_MODERATED", "Moderated"); // Added 02-10-07
213
-define ("_OPEN", "Open");
214
-define ("_OPENNOTE", "<span style=\"font-weight: bold; text-decoration: underline;\">Note:</span>  An open series is a shared universe (sometimes called a sandbox) in which other authors may add to the series.  
201
+define('_ADD2SERIES', 'Add to Series');
202
+define('_ADDSERIES', 'Add New Series');
203
+define('_ADDSERIES2FAVES', 'Add Series to Favorites');
204
+define('_BACKTOSERIES', 'Back to the Series'); // Added 11-06-05
205
+define('_CHOOSEAUTHOR', 'Choose another author');
206
+define('_CLOSED', 'Closed'); // Added 02-10-07
207
+define('_CONFIRMREMOVE', 'Are you sure you want to remove this from the series?'); // Added 12-22-05
208
+define('_DELETESERIES', 'Delete Series');
209
+define('_EDITSERIES', 'Edit Series');
210
+define('_MANAGESERIES', 'Manage Series');
211
+define('_MODERATED', 'Moderated'); // Added 02-10-07
212
+define('_OPEN', 'Open');
213
+define('_OPENNOTE', '<span style="font-weight: bold; text-decoration: underline;">Note:</span>  An open series is a shared universe (sometimes called a sandbox) in which other authors may add to the series.  
215 214
 By marking your series as open, <u>other authors will be able to add to the series.</u>  A moderated series will allow other authors to add to the series, but those entries must be approved by the series owner. 
216
-Only the series owner (and the site admins) may add to a closed series.");
217
-define ("_REMOVEFROM", "Remove From Series");
218
-define ("_SERIESNOTE", "<span style=\"font-weight: bold; text-decoration: underline;\">Note:</span>  You will choose the stories to add to your series on the next page.");
219
-define ("_SERIESNOTE2", "<span style=\"font-weight: bold; text-decoration: underline;\">Note:</span>  You will set the order of your stories and subseries on the next page.");
220
-define ("_SERIESTYPE", "Series Type"); // Added 02-10-07
221
-define ("_SERIESTITLEREQUIRED", "A title for the series is required!");
222
-define ("_NEWSERIESITEMS", "New items have been submitted to your series, %1\$s, at $sitename.  To validate these additions log in to your account.");
223
-define ("_SERIESITEMSSUBS", "New items for %1\$s at $sitename");
215
+Only the series owner (and the site admins) may add to a closed series.');
216
+define('_REMOVEFROM', 'Remove From Series');
217
+define('_SERIESNOTE', '<span style="font-weight: bold; text-decoration: underline;">Note:</span>  You will choose the stories to add to your series on the next page.');
218
+define('_SERIESNOTE2', '<span style="font-weight: bold; text-decoration: underline;">Note:</span>  You will set the order of your stories and subseries on the next page.');
219
+define('_SERIESTYPE', 'Series Type'); // Added 02-10-07
220
+define('_SERIESTITLEREQUIRED', 'A title for the series is required!');
221
+define('_NEWSERIESITEMS', "New items have been submitted to your series, %1\$s, at $sitename.  To validate these additions log in to your account.");
222
+define('_SERIESITEMSSUBS', "New items for %1\$s at $sitename");
224 223
 
225 224
 // Stories
226 225
 
227
-define ("_ADDNEWCHAPTER", "Add New Chapter");
228
-define ("_ADDNEWSTORY", "Add New Story");
229
-define ("_ADDSTORY", "Add Story");
230
-define ("_AUTHOR", "Author");
231
-define ("_AUTHORALERTNOTE", "One of your favorite authors at $sitename has posted a new story.<br><br>%1\$s "._BY." %2\$s<br><br>%3\$s<br><br><a href=\"$url/viewstory.php?sid=%4\$d\">$url/viewstory.php?sid=%4\$d</a>If you no longer wish to receive e-mails such as this, please go to <a href='$url/user.php'>your account</a>\r\n
226
+define('_ADDNEWCHAPTER', 'Add New Chapter');
227
+define('_ADDNEWSTORY', 'Add New Story');
228
+define('_ADDSTORY', 'Add Story');
229
+define('_AUTHOR', 'Author');
230
+define('_AUTHORALERTNOTE', "One of your favorite authors at $sitename has posted a new story.<br><br>%1\$s "._BY." %2\$s<br><br>%3\$s<br><br><a href=\"$url/viewstory.php?sid=%4\$d\">$url/viewstory.php?sid=%4\$d</a>If you no longer wish to receive e-mails such as this, please go to <a href='$url/user.php'>your account</a>\r\n
232 231
 on $sitename, and edit your profile.");  // Modified 2-3-10 to add reminder for turning off alerts
233
-define ("_CHAPTERNOTES", "Chapter Notes");
234
-define ("_CHAPTERTITLE", "Chapter Title");
235
-define ("_COAUTHORS", "Co-Authors");
236
-define ("_COMPLETE", "Complete");
237
-define ("_CURRENT", "Current");
238
-define ("_DELETECHAPTERTITLE", "Delete Chapter");
239
-define ("_DELETESTORY", "Are you sure you want to delete this story? All chapters beneath it will be deleted as well!");
240
-define ("_DELETESTORYTITLE", "Delete Story");
241
-define ("_EDITCHAPTER", "Edit Chapter");
242
-define ("_EDITSTORY", "Edit Story");
243
-define ("_ENDNOTES", "End Notes");
244
-define ("_FEATURED", "Featured");
245
-define ("_HIDECHAPTERS", "Hide Chapters");
246
-define ("_INVALIDUPLOAD", "Invalid Upload!  File uploads must be in plain text or html format.");
247
-define ("_LOCKED", "This category is locked.");
248
-define ("_MANAGESTORIES", "Manage Stories");
249
-define ("_MISSINGFIELDS", "Some of the required information is missing.  Please check your input.  Required fields are title, summary, ".($multiplecats ? strtolower(_CATEGORIES.", ") : "")."rating, and story text."); // Modified 11/06/05 - If categories are turned off don't show category as required field. :)
250
-define ("_NEWSTORYAT", "New Story at ");
251
-define ("_NEWSTORYAT2", "A new story has been submitted to the validation queue at $sitename.<br><br> %1\$s by %2\$s<br><br>%3\$s\n\nIf you no longer wish to receive e-mails such as this, please go to <a href='$url/user.php'>your account</a>\r\n
232
+define('_CHAPTERNOTES', 'Chapter Notes');
233
+define('_CHAPTERTITLE', 'Chapter Title');
234
+define('_COAUTHORS', 'Co-Authors');
235
+define('_COMPLETE', 'Complete');
236
+define('_CURRENT', 'Current');
237
+define('_DELETECHAPTERTITLE', 'Delete Chapter');
238
+define('_DELETESTORY', 'Are you sure you want to delete this story? All chapters beneath it will be deleted as well!');
239
+define('_DELETESTORYTITLE', 'Delete Story');
240
+define('_EDITCHAPTER', 'Edit Chapter');
241
+define('_EDITSTORY', 'Edit Story');
242
+define('_ENDNOTES', 'End Notes');
243
+define('_FEATURED', 'Featured');
244
+define('_HIDECHAPTERS', 'Hide Chapters');
245
+define('_INVALIDUPLOAD', 'Invalid Upload!  File uploads must be in plain text or html format.');
246
+define('_LOCKED', 'This category is locked.');
247
+define('_MANAGESTORIES', 'Manage Stories');
248
+define('_MISSINGFIELDS', 'Some of the required information is missing.  Please check your input.  Required fields are title, summary, '.($multiplecats ? strtolower(_CATEGORIES.', ') : '').'rating, and story text.'); // Modified 11/06/05 - If categories are turned off don't show category as required field. :)
249
+define('_NEWSTORYAT', 'New Story at ');
250
+define('_NEWSTORYAT2', "A new story has been submitted to the validation queue at $sitename.<br><br> %1\$s by %2\$s<br><br>%3\$s\n\nIf you no longer wish to receive e-mails such as this, please go to <a href='$url/user.php'>your account</a>\r\n
252 251
 on $sitename, and edit your profile.");  // Modified 2-3-10 to add reminder for turning off alerts
253
-define ("_NOSTORYTEXT", "You must include the text of your story either as an upload or as input into the textarea.");
254
-define ("_READS", "Read Count");
255
-define ("_ROUNDROBIN", "Round robin");
256
-define ("_STORYADDED", "Your story has been added. If the admin is reviewing submissions, then it will appear to the public after they have okayed it. In the meantime, you can always edit the story in your account area.");
257
-define ("_STORYALERT", "Update to favorites at $sitename");
258
-define ("_STORYALERTNOTE", "%1\$s by %2\$s, one of your favorite stories at $sitename, has been updated.<br><br><a href=\"$url/viewstory.php?sid=%3\$d&amp;chapter=%4\$d\">$url/viewstory.php?sid=%3\$d&amp;chapter=%4\$d</a>\n\nIf you no longer wish to receive e-mails such as this, please go to <a href='$url/user.php'>your account</a>\r\n
252
+define('_NOSTORYTEXT', 'You must include the text of your story either as an upload or as input into the textarea.');
253
+define('_READS', 'Read Count');
254
+define('_ROUNDROBIN', 'Round robin');
255
+define('_STORYADDED', 'Your story has been added. If the admin is reviewing submissions, then it will appear to the public after they have okayed it. In the meantime, you can always edit the story in your account area.');
256
+define('_STORYALERT', "Update to favorites at $sitename");
257
+define('_STORYALERTNOTE', "%1\$s by %2\$s, one of your favorite stories at $sitename, has been updated.<br><br><a href=\"$url/viewstory.php?sid=%3\$d&amp;chapter=%4\$d\">$url/viewstory.php?sid=%3\$d&amp;chapter=%4\$d</a>\n\nIf you no longer wish to receive e-mails such as this, please go to <a href='$url/user.php'>your account</a>\r\n
259 258
 on $sitename, and edit your profile."); // Modified 2-3-10 to add reminder for turning off alerts
260
-define ("_STORYNOTES", "Story Notes");
261
-define ("_STORYTEXTTEXT", "Story Text (text)");
262
-define ("_STORYTEXTFILE", "Story Text (file)");
263
-define ("_STORYUPDATED", "The story has been updated.");
264
-define ("_VALIDATED", "Validated");
265
-define ("_VIEWCHAPTERS", "View Chapters");
266
-define ("_WORDCOUNTFAILED", "Your story failed to meet the required minimum or maximum word count for story submission on this site.  Each chapter must be".($minwords ? " no less than ".$minwords : "").($maxwords ? ($minwords ? " and" : "")." no more than $maxwords " : "")." words long.");
267
-
259
+define('_STORYNOTES', 'Story Notes');
260
+define('_STORYTEXTTEXT', 'Story Text (text)');
261
+define('_STORYTEXTFILE', 'Story Text (file)');
262
+define('_STORYUPDATED', 'The story has been updated.');
263
+define('_VALIDATED', 'Validated');
264
+define('_VIEWCHAPTERS', 'View Chapters');
265
+define('_WORDCOUNTFAILED', 'Your story failed to meet the required minimum or maximum word count for story submission on this site.  Each chapter must be'.($minwords ? ' no less than '.$minwords : '').($maxwords ? ($minwords ? ' and' : '')." no more than $maxwords " : '').' words long.');
268 266
 
269 267
 // User
270 268
 
271
-define ("_USERACCOUNT", "Member Account");
269
+define('_USERACCOUNT', 'Member Account');
272 270
 
273 271
 // User --  Edit prefs
274
-define ("_ALERTSON2", "Contact when favorites are updated.");
275
-define ("_BETANOTE", "I would like to volunteer to be a beta-reader for others.");
276
-define ("_CONTACTREVIEWS", "Contact for new reviews");
277
-define ("_CONTACTRESPOND", "Contact when author responds to review");
278
-define ("_DEFAULTSORT", "Default Story Sort");
279
-define ("_DISPLAYINDEX", "Display table of contents for stories.");
280
-define ("_EDITPREFS", "Edit Preferences");
281
-define ("_REQUIREDFIELDS", "Indicates required fields.");
282
-define ("_SKIN", "Skin");
283
-define ("_USETINYMCE", "Use tinyMCE WYSWYG editor");
272
+define('_ALERTSON2', 'Contact when favorites are updated.');
273
+define('_BETANOTE', 'I would like to volunteer to be a beta-reader for others.');
274
+define('_CONTACTREVIEWS', 'Contact for new reviews');
275
+define('_CONTACTRESPOND', 'Contact when author responds to review');
276
+define('_DEFAULTSORT', 'Default Story Sort');
277
+define('_DISPLAYINDEX', 'Display table of contents for stories.');
278
+define('_EDITPREFS', 'Edit Preferences');
279
+define('_REQUIREDFIELDS', 'Indicates required fields.');
280
+define('_SKIN', 'Skin');
281
+define('_USETINYMCE', 'Use tinyMCE WYSWYG editor');
284 282
 
285 283
 // User - Edit Bio/Registration (default)
286
-define ("_AOL", "AOL IM");
287
-define ("_BADEMAIL", "That address doesn't appear to be in our database. Please <a href=\"member.php?action=lostpassword\">try again.</a>");
288
-define ("_BADUSERNAME", "Sorry! Usernames can only contain letters, numbers, underscores, hyphens, or spaces, and must be between 3 and 20 characters long.");
289
-define ("_BIO", "Bio");
290
-define ("_EDITPERSONAL", "Edit Personal Information");
291
-define ("_EMAILINUSE", "This email address has already been used to sign up for an account. If you've lost your password, please generate a new one by using the <a href=\"member.php?action=lostpassword\">lost password</a> feature.");
292
-define ("_ICQ", "ICQ");
293
-define ("_INVALIDEMAIL", "The e-mail address you supplied is an invalid format.");
294
-define ("_NEWACCOUNT", "New Account");
295
-define ("_NEWPEN", "%1\$s ( %2\$d ) changed penname %3\$s ( %4\$d ) to %5\$s.");
296
-define ("_MSN", "MSN IM");
297
-define ("_PASSWORD", "Password");
298
-define ("_PASSWORD2", "Confirm Password");
299
-define ("_PASSWORDTWICE", "You must enter your new password twice. Please <a href=\"member.php?action=".$action."\">try again</a>.");
300
-define ("_PWDREQUIRED", "A password is required to access this function.");
301
-define ("_PENEMAILREQUIRED", "You must fill out the penname and email fields. Please <a href=\"member.php?action=newaccount\">try again</a>.");
302
-define ("_PENNAMEINUSE", "This penname is already in use.");
303
-define ("_REALNAME", "Real name");
304
-define ("_REGISTER", "Register");
305
-define ("_REGLOG", "%1\$s (%2\$d) registered from IP address %3\$s.");
306
-define ("_SIGNUPSUBJECT", "Welcome to $sitename");
307
-define ("_SIGNUPMESSAGE", "Hello, you or someone using your email has signed you up at $sitename. Your login and password are below:\n\n");
308
-define ("_SIGNUPTHANKS", "Thank you for signing up! You will receive ".(!$pwdsetting ? "your temporary password" : "a confirmation")." at the e-mail address you provided.");
309
-define ("_SIGNUPWARNING",  "It is recommended that you log in and change the password to something easier for you to remember.");
310
-define ("_TRYAGAIN", "Please try again.");
311
-define ("_WEBSITE", "Website");
312
-define ("_YAHOO", "Yahoo IM");
284
+define('_AOL', 'AOL IM');
285
+define('_BADEMAIL', "That address doesn't appear to be in our database. Please <a href=\"member.php?action=lostpassword\">try again.</a>");
286
+define('_BADUSERNAME', 'Sorry! Usernames can only contain letters, numbers, underscores, hyphens, or spaces, and must be between 3 and 20 characters long.');
287
+define('_BIO', 'Bio');
288
+define('_EDITPERSONAL', 'Edit Personal Information');
289
+define('_EMAILINUSE', "This email address has already been used to sign up for an account. If you've lost your password, please generate a new one by using the <a href=\"member.php?action=lostpassword\">lost password</a> feature.");
290
+define('_ICQ', 'ICQ');
291
+define('_INVALIDEMAIL', 'The e-mail address you supplied is an invalid format.');
292
+define('_NEWACCOUNT', 'New Account');
293
+define('_NEWPEN', '%1$s ( %2$d ) changed penname %3$s ( %4$d ) to %5$s.');
294
+define('_MSN', 'MSN IM');
295
+define('_PASSWORD', 'Password');
296
+define('_PASSWORD2', 'Confirm Password');
297
+define('_PASSWORDTWICE', 'You must enter your new password twice. Please <a href="member.php?action='.$action.'">try again</a>.');
298
+define('_PWDREQUIRED', 'A password is required to access this function.');
299
+define('_PENEMAILREQUIRED', 'You must fill out the penname and email fields. Please <a href="member.php?action=newaccount">try again</a>.');
300
+define('_PENNAMEINUSE', 'This penname is already in use.');
301
+define('_REALNAME', 'Real name');
302
+define('_REGISTER', 'Register');
303
+define('_REGLOG', '%1$s (%2$d) registered from IP address %3$s.');
304
+define('_SIGNUPSUBJECT', "Welcome to $sitename");
305
+define('_SIGNUPMESSAGE', "Hello, you or someone using your email has signed you up at $sitename. Your login and password are below:\n\n");
306
+define('_SIGNUPTHANKS', 'Thank you for signing up! You will receive '.(!$pwdsetting ? 'your temporary password' : 'a confirmation').' at the e-mail address you provided.');
307
+define('_SIGNUPWARNING', 'It is recommended that you log in and change the password to something easier for you to remember.');
308
+define('_TRYAGAIN', 'Please try again.');
309
+define('_WEBSITE', 'Website');
310
+define('_YAHOO', 'Yahoo IM');
313 311
 
314 312
 // User - Image Management
315 313
 
316
-define ("_ALLOWEDEXT","Only files with the following extensions are allowed: ");
317
-define ("_ALREADYEXISTS", "Uploading <strong>%s...Error!</strong> Sorry, a file with this name already exists.");
318
-define ("_BADFILENAMES", "You have tried to upload the following files with invalid characters inside the filename.");
319
-define ("_FILENAME", "Filename");
320
-define ("_FILENOTEXISTS", "The file <strong>%s</strong> does not exist.");
321
-define ("_IMAGE", "Image");
322
-define ("_IMAGECODE", "HTML code to use image in story");
323
-define ("_IMAGETOOBIG", "This image is too big. Images may only be $imagewidth wide by $imageheight high. Please <a href=\"member.php?action=manageimages&upload=upload\">try again</a>.");
324
-define ("_INVALIDNAME", "Sorry, the filename contains invalid characters. Use only alphanumerical chars and separate parts of the name (if needed) with an underscore. <br>A valid filename ends with one dot followed by the extension.");
325
-define ("_MANAGEIMAGES", "Manage Images");
326
-define ("_MAXFILENAME", "The filename exceeds the maximum length of %s characters.");
327
-define ("_MAXFSSERVER", "The uploaded file exceeds the max. upload filesize directive in the server configuration.");
328
-define ("_MAXFSFORM", "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form.");
329
-define ("_NODIRECTORY", "Sorry, the upload directory doesn't exist!");
330
-define ("_NOFILESSELECTED", "Select at least on file.");
331
-define ("_NOFILESELECTED", "No file was uploaded.");
332
-define ("_PARTIALUPLOAD", "The uploaded file was only partially uploaded");
333
-define ("_RENAMEDTO", "The uploaded file was renamed to <b>%s</b>.");
334
-define ("_SELECTFILE", "Please select a file for upload.");
335
-define ("_UPLOADIMAGE", "Upload New Images");
336
-define ("_UPLOADSUCCESS", "<strong>%s</strong> successfully uploaded!");
337
-define ("_VIEW", "View");
338
-define ("_WRONGEXT", "You have tried to upload %1\$d files with a bad extension, the following extensions are allowed: <strong>%2\$s</strong>");
314
+define('_ALLOWEDEXT', 'Only files with the following extensions are allowed: ');
315
+define('_ALREADYEXISTS', 'Uploading <strong>%s...Error!</strong> Sorry, a file with this name already exists.');
316
+define('_BADFILENAMES', 'You have tried to upload the following files with invalid characters inside the filename.');
317
+define('_FILENAME', 'Filename');
318
+define('_FILENOTEXISTS', 'The file <strong>%s</strong> does not exist.');
319
+define('_IMAGE', 'Image');
320
+define('_IMAGECODE', 'HTML code to use image in story');
321
+define('_IMAGETOOBIG', "This image is too big. Images may only be $imagewidth wide by $imageheight high. Please <a href=\"member.php?action=manageimages&upload=upload\">try again</a>.");
322
+define('_INVALIDNAME', 'Sorry, the filename contains invalid characters. Use only alphanumerical chars and separate parts of the name (if needed) with an underscore. <br>A valid filename ends with one dot followed by the extension.');
323
+define('_MANAGEIMAGES', 'Manage Images');
324
+define('_MAXFILENAME', 'The filename exceeds the maximum length of %s characters.');
325
+define('_MAXFSSERVER', 'The uploaded file exceeds the max. upload filesize directive in the server configuration.');
326
+define('_MAXFSFORM', 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form.');
327
+define('_NODIRECTORY', "Sorry, the upload directory doesn't exist!");
328
+define('_NOFILESSELECTED', 'Select at least on file.');
329
+define('_NOFILESELECTED', 'No file was uploaded.');
330
+define('_PARTIALUPLOAD', 'The uploaded file was only partially uploaded');
331
+define('_RENAMEDTO', 'The uploaded file was renamed to <b>%s</b>.');
332
+define('_SELECTFILE', 'Please select a file for upload.');
333
+define('_UPLOADIMAGE', 'Upload New Images');
334
+define('_UPLOADSUCCESS', '<strong>%s</strong> successfully uploaded!');
335
+define('_VIEW', 'View');
336
+define('_WRONGEXT', 'You have tried to upload %1$d files with a bad extension, the following extensions are allowed: <strong>%2$s</strong>');
339 337
 
340 338
 // User - Lost password
341 339
 
342
-define ("_ENTEREMAIL", "Enter your e-mail address");
343
-define ("_LOSTPASSWORD", "Lost password");
344
-define ("_NEWPWDSUB", "New Password for $sitename");
345
-define ("_NEWPWDMSG", "Hello, you appear to have requested a new password for $sitename. Your new password is:\n\nPassword: %s\n\nIt is recommended that you log in and change the password to something easier for you to remember.");
346
-define ("_PASSWORDSENT", "A new password has been sent to your e-mail address.");
340
+define('_ENTEREMAIL', 'Enter your e-mail address');
341
+define('_LOSTPASSWORD', 'Lost password');
342
+define('_NEWPWDSUB', "New Password for $sitename");
343
+define('_NEWPWDMSG', "Hello, you appear to have requested a new password for $sitename. Your new password is:\n\nPassword: %s\n\nIt is recommended that you log in and change the password to something easier for you to remember.");
344
+define('_PASSWORDSENT', 'A new password has been sent to your e-mail address.');
347 345
 
348 346
 // User - Stats
349 347
 
350
-define ("_AUTHOROF", "Author of:");
351
-define ("_FAVOF", "Favorite author of");
352
-define ("_FAVORITE", "Favorite");
353
-define ("_MANAGEREVIEWS", "Manage Your Reviews");
354
-define ("_STATSFOR", "Statistics for ");
355
-define ("_UNRESPONDED", "Unresponded");
356
-define ("_YOURFAVORITES", "Your Favorites");
357
-define ("_YOURSTATS", "Your Statistics");
358
-define ("_YOURREVIEWS", "Your Reviews");
348
+define('_AUTHOROF', 'Author of:');
349
+define('_FAVOF', 'Favorite author of');
350
+define('_FAVORITE', 'Favorite');
351
+define('_MANAGEREVIEWS', 'Manage Your Reviews');
352
+define('_STATSFOR', 'Statistics for ');
353
+define('_UNRESPONDED', 'Unresponded');
354
+define('_YOURFAVORITES', 'Your Favorites');
355
+define('_YOURSTATS', 'Your Statistics');
356
+define('_YOURREVIEWS', 'Your Reviews');
359 357
 
360 358
 // User - Manage Favorites
361 359
 
362
-define ("_MANAGEFAVORITES", "Manage Favorites");
363
-define ("_REMOVEFAV", "Remove Favorite");
360
+define('_MANAGEFAVORITES', 'Manage Favorites');
361
+define('_REMOVEFAV', 'Remove Favorite');
364 362
 
365 363
 // User - Login
366 364
 
367
-define ("_WRONGPASSWORD", "That password doesn't match the one in our database. Please <a href=\"member.php?action=login\">try again</a> or retrieve a <a href=\"member.php?action=lostpassword\">new password</a> if you can't remember yours.");
368
-define ("_ACCOUNTLOCKED", "This account has been locked by the adminstrators of this site.  Please <a href='contact.php'>contact</a> the site adminstrators for more information.");
369
-define ("_NOSUCHACCOUNT", "There is no such account on our website."); // Added 6-18-2008
365
+define('_WRONGPASSWORD', "That password doesn't match the one in our database. Please <a href=\"member.php?action=login\">try again</a> or retrieve a <a href=\"member.php?action=lostpassword\">new password</a> if you can't remember yours.");
366
+define('_ACCOUNTLOCKED', "This account has been locked by the adminstrators of this site.  Please <a href='contact.php'>contact</a> the site adminstrators for more information.");
367
+define('_NOSUCHACCOUNT', 'There is no such account on our website.'); // Added 6-18-2008
370 368
 
371 369
 // User - Review Response
372
-define("_AUTHORSRESPONSE", "Author's Response");
373
-define ("_RESPONSESUBJECT", "Author Response to Your Review at $sitename");
374
-define ("_RESPONSETEXT", "{penname} has responded to your review.\r\n\r\nYou can see the response at <a href=\"".$url."/reviews.php?reviewid={review}\">".$url."/reviews.php?reviewid={review}</a>");
370
+define('_AUTHORSRESPONSE', "Author's Response");
371
+define('_RESPONSESUBJECT', "Author Response to Your Review at $sitename");
372
+define('_RESPONSETEXT', "{penname} has responded to your review.\r\n\r\nYou can see the response at <a href=\"".$url.'/reviews.php?reviewid={review}">'.$url.'/reviews.php?reviewid={review}</a>');
375 373
 
376 374
 // View story
377 375
 
378
-define ("_ACCESSDENIED", "Access denied. This story has not been validated by the adminstrators of this site.");
379
-define ("_ARCHIVEDAT", "This story archived at");
380
-define ("_BACK2INDEX", "Back to index");
381
-define ("_CONTINUE", "Continue");
382
-define ("_CONTRIBUTE2RR", "Contribute to Round Robin");
383
-define ("_INVALIDSTORY", "That story does not exist on this archive.  You may <a href='search.php'>search</a> for it or return to <a href='index.php'>the home page.</a>");
384
-define ("_LOGINTOREVIEW", "You must %1\$s (%2\$s) to review.");
385
-define ("_SUBMITREVIEW", "Submit a Review");
386
-define ("_TEXTSIZE", "Text Size");
376
+define('_ACCESSDENIED', 'Access denied. This story has not been validated by the adminstrators of this site.');
377
+define('_ARCHIVEDAT', 'This story archived at');
378
+define('_BACK2INDEX', 'Back to index');
379
+define('_CONTINUE', 'Continue');
380
+define('_CONTRIBUTE2RR', 'Contribute to Round Robin');
381
+define('_INVALIDSTORY', "That story does not exist on this archive.  You may <a href='searching.php'>search</a> for it or return to <a href='index.php'>the home page.</a>");
382
+define('_LOGINTOREVIEW', 'You must %1$s (%2$s) to review.');
383
+define('_SUBMITREVIEW', 'Submit a Review');
384
+define('_TEXTSIZE', 'Text Size');
387 385
 
388 386
 // View User
389 387
 
390
-define ("_ADMINISTRATOR", "Administrator");
391
-define ("_CONTACT", "Contact");
392
-define ("_CONTACTAUTHOR", "Contact Author:");
393
-define ("_EDITADMIN", "Edit Admin Privileges");
394
-define ("_FAVORITEAUTHORS", "Favorite Authors"); // Added for 3.0
395
-define ("_FAVORITESERIES", "Favorite Series"); // Added for 3.0
396
-define ("_FAVORITESTORIES", "Favorite Stories"); // Added for 3.0
397
-define ("_FAVORITESOF", "Favorites of "); // Added for 3.0
398
-define ("_LOCKMEM", "Lock Account");
399
-define ("_MAKEADMIN", "Make User an Admin");
400
-define ("_REVOKEADMIN", "Revoke Admin Privileges");
401
-define ("_REVOKEVAL", "Revoke Validation");
402
-define ("_REVIEWSBY", "Reviews by ");
403
-define ("_SERIESBY", "Series by ");
404
-define ("_SITESIG", "This message was sent to you from $sitename located at <a href='$url'>$url</a>.");
405
-define ("_SITESIG2", "This message was sent to you by %s from $sitename located at <a href='$url'>$url</a>.");
406
-define ("_STORIESBY", "Stories by");
407
-define ("_SUBJECT", "Subject");
408
-define ("_UNLOCKMEM", "Unlock Account");
409
-define ("_VALIDATE", "Validate");
410
-
411
-// Tooltip help for various items.  
412
-define ("_HELP_NEWREV", "Check this box if you wish to receive an e-mail notice each time you get a new review.");
413
-define ("_HELP_NEWRESP", "Check this box if you wish to receive an e-mail notice each time an author resonds to your review.");
414
-define ("_HELP_FAVALERT", "Check this box if you wish to receive an e-mail notice each time one of your favorite stories is updated or when one of your favorites author's publishes a new story.");
415
-define ("_HELP_BETA", "Check this box if you are willing to have other author's contact you to read their stories before they are published and provide the feedback and help the author requests.");
416
-define ("_HELP_TOC", "Check this box if you wish to see the story index first rather than the first chapter of the story on multi-chapters.");
417
-define ("_HELP_TINYMCE", "Check this box if you wish to use the tinyMCE editor when entering content in forms.  You will have the option to toggle the editor on/off if need be.");
418
-define ("_HELP_AGE", "By agreeing, you are confirming you are above the age of majority in your locality and that you wish to view the adult oriented material on this site.");
419
-define ("_HELP_DEFAULTSORT", "Select the order in which to sort stories by default.  Your choices are Alphabetically or Most Recent (newest to oldest).");
420
-define ("_HELP_SKIN", "Choose the appearance of the site.");
388
+define('_ADMINISTRATOR', 'Administrator');
389
+define('_CONTACT', 'Contact');
390
+define('_CONTACTAUTHOR', 'Contact Author:');
391
+define('_EDITADMIN', 'Edit Admin Privileges');
392
+define('_FAVORITEAUTHORS', 'Favorite Authors'); // Added for 3.0
393
+define('_FAVORITESERIES', 'Favorite Series'); // Added for 3.0
394
+define('_FAVORITESTORIES', 'Favorite Stories'); // Added for 3.0
395
+define('_FAVORITESOF', 'Favorites of '); // Added for 3.0
396
+define('_LOCKMEM', 'Lock Account');
397
+define('_MAKEADMIN', 'Make User an Admin');
398
+define('_REVOKEADMIN', 'Revoke Admin Privileges');
399
+define('_REVOKEVAL', 'Revoke Validation');
400
+define('_REVIEWSBY', 'Reviews by ');
401
+define('_SERIESBY', 'Series by ');
402
+define('_SITESIG', "This message was sent to you from $sitename located at <a href='$url'>$url</a>.");
403
+define('_SITESIG2', "This message was sent to you by %s from $sitename located at <a href='$url'>$url</a>.");
404
+define('_STORIESBY', 'Stories by');
405
+define('_SUBJECT', 'Subject');
406
+define('_UNLOCKMEM', 'Unlock Account');
407
+define('_VALIDATE', 'Validate');
408
+
409
+// Tooltip help for various items.
410
+define('_HELP_NEWREV', 'Check this box if you wish to receive an e-mail notice each time you get a new review.');
411
+define('_HELP_NEWRESP', 'Check this box if you wish to receive an e-mail notice each time an author resonds to your review.');
412
+define('_HELP_FAVALERT', "Check this box if you wish to receive an e-mail notice each time one of your favorite stories is updated or when one of your favorites author's publishes a new story.");
413
+define('_HELP_BETA', "Check this box if you are willing to have other author's contact you to read their stories before they are published and provide the feedback and help the author requests.");
414
+define('_HELP_TOC', 'Check this box if you wish to see the story index first rather than the first chapter of the story on multi-chapters.');
415
+define('_HELP_TINYMCE', 'Check this box if you wish to use the tinyMCE editor when entering content in forms.  You will have the option to toggle the editor on/off if need be.');
416
+define('_HELP_AGE', 'By agreeing, you are confirming you are above the age of majority in your locality and that you wish to view the adult oriented material on this site.');
417
+define('_HELP_DEFAULTSORT', 'Select the order in which to sort stories by default.  Your choices are Alphabetically or Most Recent (newest to oldest).');
418
+define('_HELP_SKIN', 'Choose the appearance of the site.');
421 419
 
422 420
 // Log strings
423
-define ("_LOG_ADMIN_DEL", "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> deleted <a href='viewstory.php?sid=%4\$d'>%3\$s</a> by <a href='viewuser.php?uid=%6\$d'>%5\$s</a>.");
424
-define ("_LOG_ADMIN_EDIT", "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> edited <a href='viewstory.php?sid=%4\$d'>%3\$s</a> by <a href='viewuser.php?uid=%6\$d'>%5\$s</a>.");
425
-define ("_LOG_ADMIN_DEL_CHAPTER", "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> deleted <a href='viewstory.php?sid=%4\$d'>%3\$s</a> by <a href='viewuser.php?uid=%6\$d'>%5\$s</a>, chapter %7\$d");
426
-define ("_LOG_ADMIN_EDIT_CHAPTER", "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> edited <a href='viewstory.php?sid=%4\$d'>%3\$s</a> by <a href='viewuser.php?uid=%6\$d'>%5\$s</a>, chapter %7\$d");
427
-define ("_LOG_ADMIN_EDIT_AUTHOR", "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> changed the author of <a href='viewstory.php?sid=%4\$d'>%3\$s</a> by <a href='viewuser.php?uid=%8\$7'>%5\$s</a> to <a href='viewuser.php?uid=%6\$d'>%5\$s</a>.");
428
-define ("_LOG_ADMIN_DEL_SERIES", "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> deleted the series '%3\$s'.");
429
-define ("_LOG_ADMIN_EDIT_SERIES", "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> edited the series '<a href='viewseries.php?seriesid=%4\$d'>%3\$s</a>'.");
430
-define ("_LOG_ADMIN_DEL_FROM_SERIES", "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> deleted <a href='viewstory.php?sid=%4\$d'>%3\$s</a> by <a href='viewuser.php?uid=%6\$d'>%5\$s</a> from '<a href='viewseries.php?seriesid=%8\$d'>%7\$s</a>.'");
431
-define ("_LOG_BAD_LOGIN", "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> entered a wrong password trying to log in.");
432
-define ("_LOG_LOST_PASSWORD", "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> requested a new password.  Password sent: %3\$s.");
433
-define ("_LOG_ADMIN_REG", "%1\$s (%2\$d) was registered by %3\$s (%4\$d) from IP address %5\$s.");
434
-define ("_LOG_REGISTER", "%1\$s (%2\$d) registered from IP address %3\$s.");
435
-define ("_LOG_REVIEW", "%1\$s wrote '%2\$s' as a review for '%3\$s'.");
436
-define ("_LOG_EDIT_REVIEW", "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> edited <a href='reviews.php?reviewid=%4\$d'>a review</a> for '%3\$s'.");
421
+define('_LOG_ADMIN_DEL', "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> deleted <a href='viewstory.php?sid=%4\$d'>%3\$s</a> by <a href='viewuser.php?uid=%6\$d'>%5\$s</a>.");
422
+define('_LOG_ADMIN_EDIT', "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> edited <a href='viewstory.php?sid=%4\$d'>%3\$s</a> by <a href='viewuser.php?uid=%6\$d'>%5\$s</a>.");
423
+define('_LOG_ADMIN_DEL_CHAPTER', "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> deleted <a href='viewstory.php?sid=%4\$d'>%3\$s</a> by <a href='viewuser.php?uid=%6\$d'>%5\$s</a>, chapter %7\$d");
424
+define('_LOG_ADMIN_EDIT_CHAPTER', "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> edited <a href='viewstory.php?sid=%4\$d'>%3\$s</a> by <a href='viewuser.php?uid=%6\$d'>%5\$s</a>, chapter %7\$d");
425
+define('_LOG_ADMIN_EDIT_AUTHOR', "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> changed the author of <a href='viewstory.php?sid=%4\$d'>%3\$s</a> by <a href='viewuser.php?uid=%8\$7'>%5\$s</a> to <a href='viewuser.php?uid=%6\$d'>%5\$s</a>.");
426
+define('_LOG_ADMIN_DEL_SERIES', "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> deleted the series '%3\$s'.");
427
+define('_LOG_ADMIN_EDIT_SERIES', "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> edited the series '<a href='viewseries.php?seriesid=%4\$d'>%3\$s</a>'.");
428
+define('_LOG_ADMIN_DEL_FROM_SERIES', "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> deleted <a href='viewstory.php?sid=%4\$d'>%3\$s</a> by <a href='viewuser.php?uid=%6\$d'>%5\$s</a> from '<a href='viewseries.php?seriesid=%8\$d'>%7\$s</a>.'");
429
+define('_LOG_BAD_LOGIN', "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> entered a wrong password trying to log in.");
430
+define('_LOG_LOST_PASSWORD', "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> requested a new password.  Password sent: %3\$s.");
431
+define('_LOG_ADMIN_REG', '%1$s (%2$d) was registered by %3$s (%4$d) from IP address %5$s.');
432
+define('_LOG_REGISTER', '%1$s (%2$d) registered from IP address %3$s.');
433
+define('_LOG_REVIEW', "%1\$s wrote '%2\$s' as a review for '%3\$s'.");
434
+define('_LOG_EDIT_REVIEW', "<a href='viewuser.php?uid=%2\$d'>%1\$s</a> edited <a href='reviews.php?reviewid=%4\$d'>a review</a> for '%3\$s'.");
437 435
 
438 436
 // Report Types
439 437
 
440
-define ("_REPORT", "Report");
441
-define ("_MISSING", "Missing Information");
442
-define ("_RULESVIOLATION", "Violation of Rules");
443
-define ("_BUGREPORT", "Bug Report");
444
-define ("_REPORTTHIS", "Report This");
445
-
446
-?>
447 438
\ No newline at end of file
439
+define('_REPORT', 'Report');
440
+define('_MISSING', 'Missing Information');
441
+define('_RULESVIOLATION', 'Violation of Rules');
442
+define('_BUGREPORT', 'Bug Report');
443
+define('_REPORTTHIS', 'Report This');
448 444
deleted file mode 100644
... ...
@@ -1,339 +0,0 @@
1
-<?php
2
-// ----------------------------------------------------------------------
3
-// Copyright (c) 2007 by Tammy Keefer
4
-// Valid HTML 4.01 Transitional
5
-// Based on eFiction 1.1
6
-// Copyright (C) 2003 by Rebecca Smallwood.
7
-// http://efiction.sourceforge.net/
8
-// ----------------------------------------------------------------------
9
-// LICENSE
10
-//
11
-// This program is free software; you can redistribute it and/or
12
-// modify it under the terms of the GNU General Public License (GPL)
13
-// as published by the Free Software Foundation; either version 2
14
-// of the License, or (at your option) any later version.
15
-//
16
-// This program is distributed in the hope that it will be useful,
17
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
18
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
-// GNU General Public License for more details.
20
-//
21
-// To read the license please visit http://www.gnu.org/copyleft/gpl.html
22
-// ----------------------------------------------------------------------
23
-
24
-
25
-// Page Setup
26
-// Set the current page id.  Because search does multiple things there are multiple possibilities
27
-if(isset($_POST['submit']) || isset($_GET['offset'])) $current = "searchresults";
28
-else $current = "search";
29
-if(isset($_GET['action']) && $_GET['action'] == "advanced") $displayform = 1;
30
-// Now set up the page
31
-
32
-$displayform = 1;
33
-
34
-
35
-include ("header.php");
36
-
37
-if(file_exists("$skindir/browse.tpl")) $tpl = new TemplatePower( "$skindir/browse.tpl" );
38
-else $tpl = new TemplatePower("default_tpls/browse.tpl");
39
-if(file_exists("$skindir/listings.tpl")) $tpl->assignInclude( "listings", "./$skindir/listings.tpl" );
40
-else $tpl->assignInclude( "listings", "./default_tpls/listings.tpl" );
41
-
42
-include("includes/pagesetup.php");
43
-
44
-
45
-$searchtype = (isset($_REQUEST['searchtype']) ? $_REQUEST['searchtype'] : "simple");
46
-$searchterm =  (isset($_REQUEST['searchterm']) ? escapestring($_REQUEST['searchterm']) : false);
47
-
48
-if(isset($_POST['submit']) || isset($_GET['offset'])) {
49
-	$output .= "<div id=\"pagetitle\">"._RESULTS."</div>";
50
-	$query = array();
51
-	$countquery = array();
52
-	$scountquery = array();	
53
-	if($searchtype == "fulltext") {
54
-		$query = "SELECT stories.*, "._PENNAMEFIELD." as penname, UNIX_TIMESTAMP(stories.date) as date, UNIX_TIMESTAMP(stories.updated) as updated FROM "._AUTHORTABLE.", ".TABLEPREFIX."fanfiction_stories as stories, ".TABLEPREFIX."fanfiction_chapters as chapter WHERE chapter.storytext LIKE '%$searchterm%' AND chapter.sid = stories.sid AND stories.uid = "._UIDFIELD;
55
-		$countquery = "SELECT count(stories.sid) FROM ".TABLEPREFIX."fanfiction_stories as stories, ".TABLEPREFIX."fanfiction_chapters as chapter WHERE chapter.storytext LIKE '%$searchterm%' AND chapter.sid = stories.sid GROUP BY stories.sid";
56
-		$query .= " "._ORDERBY;
57
-		search($query, $countquery);
58
-		$tpl->assign("output", $output);
59
-		$tpl->printToScreen();
60
-		dbclose( );			
61
-		exit( );
62
-	}
63
-	if($searchterm && strlen($searchterm) < 3) {
64
-		errorExit(_SEARCHTERMTOOSHORT);
65
-	}
66
-	if($searchterm) {
67
-		if($searchtype == "title") {
68
-			$query[] = "stories.title LIKE '%$searchterm%'";
69
-			$countquery[] = "stories.title LIKE '%$searchterm%'";
70
-			$scountquery[] = "series.title LIKE '%$searchterm%'";
71
-		}
72
-		if($searchtype == "summary") {
73
-			$query[] = "stories.summary LIKE '%$searchterm%'";
74
-			$countquery[] = "stories.summary LIKE '%$searchterm%'";
75
-			$scountquery[] = "series.summary LIKE '%$searchterm%'";
76
-		}
77
-		if($searchtype == "penname") {
78
-			$authorquery = dbquery(_MEMBERLIST." WHERE "._PENNAMEFIELD." LIKE '%$searchterm%' GROUP BY "._UIDFIELD);
79
-			$authorlist = array();
80
-			while($auth = dbassoc($authorquery)) {
81
-				$authorlist[] = $auth['uid'];
82
-			}
83
-			if(count($authorlist) > 0) {
84
-				$authors = implode(",",$authorlist);
85
-				$query = "SELECT stories.*, "._PENNAMEFIELD." as penname, UNIX_TIMESTAMP(stories.date) as date, UNIX_TIMESTAMP(stories.updated) as updated FROM ("._AUTHORTABLE.", ".TABLEPREFIX."fanfiction_stories as stories) LEFT JOIN ".TABLEPREFIX."fanfiction_coauthors as coauth ON coauth.sid = stories.sid WHERE "._UIDFIELD." = stories.uid AND stories.validated > 0 AND (FIND_IN_SET(stories.uid, '$authors') > 0 OR FIND_IN_SET(coauth.uid, '$authors') > 0) ";
86
-				$countquery = "SELECT COUNT(stories.sid) FROM ".TABLEPREFIX."fanfiction_stories as stories LEFT JOIN ".TABLEPREFIX."fanfiction_coauthors as coauth ON coauth.sid = stories.sid WHERE stories.validated > 0 AND (FIND_IN_SET(stories.uid, '$authors') > 0 OR FIND_IN_SET(coauth.uid, '$authors') > 0)";
87
-				search($query, $countquery);
88
-				$tpl->assign("output", $output);
89
-				$tpl->printToScreen();
90
-				dbclose( );			
91
-				exit( );
92
-			}
93
-			else {
94
-				$query[] = "1 = 0";
95
-				$countquery[] = "1 = 0";
96
-				$scountquery[] = "1 = 0";
97
-			}
98
-		}
99
-		if($searchtype == "advanced") {
100
-			$query[] = "(stories.summary LIKE '%$searchterm%' OR stories.title LIKE '%$searchterm%') ";
101
-			$countquery[] = "(stories.summary LIKE '%$searchterm%' OR stories.title LIKE '%$searchterm%') ";
102
-			$scountquery[] = "(summary LIKE '%$searchterm%' OR title LIKE '%$searchterm%') ";
103
-		}
104
-	}
105
-	if(isset($_REQUEST['authors'])) {
106
-		$authors = isarray($_REQUEST['authors']) ? $_REQUEST['authors'] : explode(",", $_REQUEST['authors']);
107
-		$authors = array_filter($authors, "isNumber");
108
-		if($authors) {
109
-			$authors = implode(",", $authors);
110
-			$query[] = "FIND_IN_SET(stories.uid, '$authors') > 0";
111
-			$countquery[] = "FIND_IN_SET(stories.uid, '$authors') > 0";
112
-			$scountquery[] = "FIND_IN_SET(series.uid, '$authors') > 0";
113
-		}
114
-		else {
115
-			$query[] = "1 = 0";
116
-			$countquery[] = "1 = 0";
117
-			$scountquery[] = "1 = 0";
118
-		}
119
-	}
120
-	if(isset($_REQUEST['catid'])) {
121
-		$catid = is_array($_REQUEST['catid']) ? $_REQUEST['catid'] : explode(",", $_REQUEST['catid']);
122
-		$catid = array_filter($catid, "isNumber");
123
-	}
124
-	if(!isset($catid)) $catid = array("false");
125
-	$categories = array( );
126
-	// Get the recursive list.
127
-	foreach($catid as $cat) {
128
-		if($cat == "false" || empty($cat)) continue;
129
-		$categories = array_merge($categories, recurseCategories($cat));
130
-		}
131
-	// Now format the SQL
132
-	foreach($categories as $cat) {
133
-		$catstories[] = "FIND_IN_SET($cat, stories.catid) > 0 ";
134
-		$catseries[] = "FIND_IN_SET($cat, series.catid) > 0 ";
135
-	}
136
-	// Now implode the SQL list
137
-	if(!empty($catstories)) {
138
-		$query[] = "(".implode(" OR ", $catstories).")";
139
-		$countquery[] = "(".implode(" OR ", $catstories).")";
140
-		$scountquery[] = "(".implode(" OR ", $catseries).")";
141
-	}
142
-	if(isset($_REQUEST['charid'])) {
143
-		$charid = is_array($_REQUEST['charid']) ? $_REQUEST['charid'] : explode(",", $_REQUEST['charid']);
144
-	}
145
-	else $charid = array( );
146
-	if(isset($_REQUEST['charlist1'])) $charid[] = $_REQUEST['charlist1'];
147
-	if(isset($_REQUEST['charlist2'])) $charid[] = $_REQUEST['charlist2'];
148
-	$charid = array_filter($charid, "isNumber");
149
-	if(count($charid) > 0) {
150
-		foreach($charid as $c) {
151
-			if(!empty($c)) {
152
-				$charstories[] = "FIND_IN_SET($c, stories.charid) > 0 ";
153
-				$charseries[] = "FIND_IN_SET($c, series.characters) > 0 ";
154
-			}
155
-		}
156
-		if(count($charstories) > 0) {
157
-			$query[] = "(".implode(" AND ", $charstories).")";
158
-			$countquery[] = "(".implode(" AND ", $charstories).")";
159
-		}
160
-		if(count($charseries) > 0) $scountquery[] = "(".implode(" AND ", $charseries).")";
161
-	}
162
-
163
-	if(isset($_REQUEST['rid'])) $rid = is_array($_REQUEST['rid']) ? $_REQUEST['rid'] : explode(",", $_REQUEST['rid']);
164
-	else $rid = array();
165
-	if(count($rid) > 0) {
166
-		$rid = array_filter($rid, "isNumber");
167
-		$query[] = findclause('rid', $rid);
168
-		$countquery[] = findclause('rid', $rid);
169
-	}
170
-	if(isset($_REQUEST['complete'])) {
171
-		$query[] = "stories.completed = '1'";
172
-		$countquery[] = "stories.completed = '1'";
173
-	}
174
-	$classin = array( );
175
-	$classex = array( );
176
-	foreach($classtypelist as $id => $vars) {
177
-		$opts = array( );
178
-		$exopts = array( );
179
-		if(isset($_POST["class_".$id])) $opts = array_filter($_POST["class_".$id], "isNumber");
180
-		else if(isset($_GET["class_".$id])) {
181
-			$opts = array_merge($opts, explode(",", $_GET["class_".$id]));
182
-			$opts = array_filter($opts, "isNumber");
183
-		}
184
-		else if(isset($_REQUEST[$vars["name"]])) $opts[] = array($_REQUEST[$vars["name"]]);
185
-		$classin = array_merge($classin, $opts);
186
-		if(isset($_POST["exclass_".$id])) $exopts = array_filter($_POST["exclass_".$id], "isNumber");
187
-		else if(isset($_GET["exclass_".$id])) {
188
-			$exopts = array_merge($exopts, explode(",", $_GET["exclass_".$id]));
189
-			$exopts = array_filter($exopts, "isNumber");
190
-		}
191
-		$classex = array_merge($classex, $exopts);
192
-		unset($opts, $exopts);
193
-	}
194
-	if($classin) {
195
-		foreach($classin as $class) {
196
-			$query[] = "FIND_IN_SET($class, stories.classes) > 0";
197
-			$countquery[] = "FIND_IN_SET($class, stories.classes) > 0";
198
-			$scountquery[] = "FIND_IN_SET($class, series.classes) > 0";
199
-		}
200
-	}
201
-	if($classex) {
202
-		foreach($classex as $class) {
203
-			$query[] = "FIND_IN_SET($class, stories.classes) = 0";
204
-			$countquery[] = "FIND_IN_SET($class, stories.classes) = 0";
205
-			$scountquery[] = "FIND_IN_SET($class, series.classes) = 0";
206
-		}
207
-	}
208
-	// Begin story length
209
-	unset($wordcount);
210
-	$wordlow = isset($_REQUEST['wordlow']) && isNumber($_REQUEST['wordlow']) ? $_REQUEST['wordlow'] : "-500";
211
-	$wordhigh = isset($_REQUEST['wordhigh']) && isNumber($_REQUEST['wordhigh']) ? $_REQUEST['wordhigh'] : "1000000";
212
-	if($wordlow != "-500") $wordcount = "stories.wordcount > ".$wordlow;
213
-	if($wordhigh != "1000000") 
214
-	{
215
-		if($wordcount) $wordcount .= " AND stories.wordcount < ".$wordhigh;
216
-		else $wordcount = "stories.wordcount < ".$wordhigh;
217
-	}
218
-	if($wordhigh < $wordlow) $wordcount = "stories.wordcount < ".$wordlow;
219
-	if(!empty($wordcount)) {
220
-		$query[] = "($wordcount)";
221
-		$countquery[] = "($wordcount)";
222
-	}
223
-	// End wordcount
224
-
225
-	$codeblocks = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'browseterms'");
226
-	while($code = dbassoc($codeblocks)) {
227
-		eval($code['code_text']);
228
-	}
229
-
230
-	$query = (count($query) > 0 ? " AND ".implode(" AND ", $query) : "")." "._ORDERBY;
231
-	$countquery = count($countquery) > 0 ? " AND ".implode(" AND ", $countquery) : "";
232
-	if(count($scountquery) > 0) $scountquery = " WHERE ".implode(" AND ", $scountquery);
233
-	search(_STORYQUERY.$query, _STORYCOUNT.$countquery);
234
-	$otherresults = array( );
235
-	$termArray = array_merge($_GET, $_POST);
236
-	$termsList = array();
237
-	foreach($termArray as $term => $value) {
238
-		if($term == "submit" || $term == "wordhigh" || $term == "wordlow" || empty($value) || $term == "formname" || $term == "searchtype") continue;
239
-		$termsList[$term] = "$term=".(is_array($value) ? implode(",", $value) : $value);
240
-	}
241
-	$terms = implode("&amp;", $termsList);
242
-	if(!empty($scountquery)) {
243
-		$seriesresults = dbquery(_SERIESCOUNT.$scountquery);
244
-		list($scount) = dbrow($seriesresults);
245
-		if($scount > 0) $otherresults[] = "<a href='browse.php?type=series$terms'>$scount "._SERIES."</a>";
246
-	}
247
-	$codeblocks = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'otherresults'");
248
-	while($code = dbassoc($codeblocks)) {
249
-		eval($code['code_text']);
250
-	}
251
-	if(count($otherresults) > 0) $tpl->assign("otherresults", "<div id='otherresults'><span class='label'>"._OTHERRESULTS.":</span> ".implode(", ", $otherresults)."</div>");
252
-}
253
-else {
254
-	if($searchtype == "simple") {
255
-		$output .= "<div id=\"pagetitle\">"._SIMPLE."</div><div style='text-align: center;'><form method=\"post\" enctype=\"multipart/form-data\" action=\"search.php\">
256
-		<div class=\"tblborder\" style=\"width: 320px; padding: 5px; margin: 0 auto;\">
257
-		<select name=\"searchtype\">
258
-		<option value=\"penname\">"._PENNAME."</option>
259
-		<option value=\"title\">"._TITLE."</option>
260
-		<option value=\"summary\">"._SUMMARY."</option>";
261
-		if($store == "mysql")
262
-			$output .= "<option value=\"fulltext\">"._FULLTEXT."</option>";
263
-		$output .= "</select> <INPUT type=\"text\" class=\"textbox\" name=\"searchterm\" size=\"20\"> ";
264
-		$output .= "<INPUT type=\"submit\" class=\"button\" name=\"submit\" value=\""._SUBMIT."\" size=\"20\">
265
-		<div style=\"font-size: 8pt; text-align: right;\"><a href=\"search.php?searchtype=advanced\">"._ADVANCED."</a></div></div></form></div>";
266
-	}
267
-	else {
268
-		$output .= "<div id=\"pagetitle\">"._ADVANCED."</div><div>
269
-			<form method=\"POST\" name=\"form\" enctype=\"multipart/form-data\" action=\"search.php?searchtype=advanced\">
270
-			<div class=\"tblborder\" style=\"width: 90%; margin: 0 auto; padding: 10px;\">";
271
-		if($multiplecats) {
272
-			include("includes/categories.php");
273
-			$output .= "<input type=\"hidden\" name=\"formname\" value=\"search\">";
274
-		}
275
-		$output .= "<div style='float: left; width: 99%;'>";
276
-		if(count($charlist) > 0) {
277
-			$output .= "<div style=\"float: left; width: 49%;\"><label for=\"charname\">"._CHARACTERS.": </label><br />\n";
278
-			$output .= "<select name=\"charid[]\"  style=\"width: 90%;\" multiple size=\"5\" id=\"charid\">";
279
-			foreach($charlist as $charid => $info) {
280
-				if($info['catid'] != -1) continue;
281
-				$output .= "<option value=\"".$charid."\">" .stripslashes($info['name'] ). "</option>\n";
282
-			}
283
-			$output .= "</select></div>";
284
-		}
285
-		$result = dbquery("SELECT rid, rating FROM ".TABLEPREFIX."fanfiction_ratings ORDER BY rating");
286
-		if(dbnumrows($result)) {
287
-			$output .= "<div style=\"float: left; width: 49%;\"><label for=\"rid\">"._RATINGS.":</label><br /><select id=\"rid\" style=\"width: 90%;\" multiple size=\"5\"name=\"rid[]\"><option value=\"-1\">"._ALL."</option>";
288
-			while ($ratingresults = dbassoc($result))
289
-			{
290
-				$output .= "<option value=\"".$ratingresults['rid']."\">".$ratingresults['rating']."</option>\n";
291
-			}
292
-			$output .= "</select></div>";
293
-		}
294
-		$output .= "<div style=\"clear: both;\">&nbsp;</div>";
295
-		$output .= " <div style=\"text-align: center;\">"._MULTIPLESELECT."</div>";
296
-		$result = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_classtypes ORDER BY classtype_name");
297
-		while($type = dbassoc($result)) {
298
-			$result2 = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_classes WHERE class_type = '".$type['classtype_id']."' ORDER BY class_name");
299
-			$select = "";
300
-			while ($class = dbassoc($result2)) {
301
- 				$select .= "<option value=\"".$class['class_id']."\">".$class['class_name']."</option>";
302
-			}
303
-			$output .= "<div>
304
-				<div style=\"float: left; width: 49%; margin-bottom: 1em;\"><label for=\"class_".$type['classtype_id']."\">".$type['classtype_title']." "._INCLUDE.":</label><br />
305
-					 <select name=\"class_".$type['classtype_id']."[]\" id=\"class_".$type['classtype_id']."\"  style=\"width: 95%;\" multiple size=\"5\">$select</select></div>
306
-				<div style=\"float: left; width: 49%; margin-bottom: 1em;\"><label for=\"exclass_".$type['classtype_id']."\">".$type['classtype_title']." "._EXCLUDE.":</label><br />
307
-					 <select name=\"exclass_".$type['classtype_id']."[]\"  id=\"exclass_".$type['classtype_id']."\"  style=\"width: 95%;\" multiple size=\"5\">$select</select></div>
308
-				</div>";
309
-		}
310
-		$output .= "</div><label for=\"completed\">"._COMPLETEONLY.":</label> <input type=\"checkbox\" class=\"checkbox\" id=\"completed\" name=\"completed\" value=\"ON\"><label for=\"wordlow\">"._WORDCOUNT.":</label> <select size=\"1\" id=\"wordlow\" name=\"wordlow\">
311
-  <option value='-500'>&lt; 500</option>
312
-  <option>1000</option>
313
-  <option>5000</option>
314
-  <option>10000</option>
315
-  <option>50000</option>
316
-  <option>100000</option>
317
-  <option value='1000000'>100000+</option>
318
-  </select> - <select size=\"1\" name=\"wordhigh\">
319
-  <option value='1000000'>100000+</option>
320
-  <option>100000</option>
321
-  <option>50000</option>
322
-  <option>10000</option>
323
-  <option>5000</option>
324
-  <option>1000</option>
325
-  <option value='-500'>&lt; 500</option>
326
-  </select><br /><br /><label for=\"searchterm\">"._SEARCHTERM.": </label><INPUT type=\"text\" class=\"textbox\" name=\"searchterm\" id=\"searchterm\" size=\"20\">
327
-  
328
-  <label for=\"sortorder\">"._SORT.":</label> <select name=\"sortorder\" id=\"sortorder\"><option value=\"alpha\">"._ALPHA."</option><option value=\"update\">"._MOSTRECENT."</option></select>";
329
-	$codequery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'searchform'");
330
-	while($code = dbassoc($codequery)) {
331
-		eval($code['code_text']);
332
-	}
333
-$output .= "<div id='submitdiv'><input name=\"submit\" id=\"submit\" value=\""._SUBMIT."\" type=\"submit\" class=\"button\"></div></div></form></div>";
334
-	}
335
-}
336
-$tpl->assign("output", $output);
337
-$tpl->printToScreen();
338
-dbclose( );
339
-?>
340 0
\ No newline at end of file
341 1
new file mode 100644
... ...
@@ -0,0 +1,375 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// Copyright (c) 2007 by Tammy Keefer
4
+// Valid HTML 4.01 Transitional
5
+// Based on eFiction 1.1
6
+// Copyright (C) 2003 by Rebecca Smallwood.
7
+// http://efiction.sourceforge.net/
8
+// ----------------------------------------------------------------------
9
+// LICENSE
10
+//
11
+// This program is free software; you can redistribute it and/or
12
+// modify it under the terms of the GNU General Public License (GPL)
13
+// as published by the Free Software Foundation; either version 2
14
+// of the License, or (at your option) any later version.
15
+//
16
+// This program is distributed in the hope that it will be useful,
17
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
+// GNU General Public License for more details.
20
+//
21
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
22
+// ----------------------------------------------------------------------
23
+
24
+// Page Setup
25
+// Set the current page id.  Because search does multiple things there are multiple possibilities
26
+if (isset($_POST['submit']) || isset($_GET['offset'])) {
27
+    $current = 'searchresults';
28
+} else {
29
+    $current = 'search';
30
+}
31
+if (isset($_GET['action']) && $_GET['action'] == 'advanced') {
32
+    $displayform = 1;
33
+}
34
+// Now set up the page
35
+
36
+$displayform = 1;
37
+
38
+include 'header.php';
39
+
40
+if (file_exists("$skindir/browse.tpl")) {
41
+    $tpl = new TemplatePower("$skindir/browse.tpl");
42
+} else {
43
+    $tpl = new TemplatePower('default_tpls/browse.tpl');
44
+}
45
+if (file_exists("$skindir/listings.tpl")) {
46
+    $tpl->assignInclude('listings', "./$skindir/listings.tpl");
47
+} else {
48
+    $tpl->assignInclude('listings', './default_tpls/listings.tpl');
49
+}
50
+
51
+include 'includes/pagesetup.php';
52
+
53
+$searchtype = (isset($_REQUEST['searchtype']) ? $_REQUEST['searchtype'] : 'simple');
54
+$searchterm = (isset($_REQUEST['searchterm']) ? escapestring($_REQUEST['searchterm']) : false);
55
+
56
+if (isset($_POST['submit']) || isset($_GET['offset'])) {
57
+    $output .= '<div id="pagetitle">'._RESULTS.'</div>';
58
+    $query = array();
59
+    $countquery = array();
60
+    $scountquery = array();
61
+    if ($searchtype == 'fulltext') {
62
+        $query = 'SELECT stories.*, '._PENNAMEFIELD.' as penname, UNIX_TIMESTAMP(stories.date) as date, UNIX_TIMESTAMP(stories.updated) as updated FROM '._AUTHORTABLE.', '.TABLEPREFIX.'fanfiction_stories as stories, '.TABLEPREFIX."fanfiction_chapters as chapter WHERE chapter.storytext LIKE '%$searchterm%' AND chapter.sid = stories.sid AND stories.uid = "._UIDFIELD;
63
+        $countquery = 'SELECT count(stories.sid) FROM '.TABLEPREFIX.'fanfiction_stories as stories, '.TABLEPREFIX."fanfiction_chapters as chapter WHERE chapter.storytext LIKE '%$searchterm%' AND chapter.sid = stories.sid GROUP BY stories.sid";
64
+        $query .= ' '._ORDERBY;
65
+        search($query, $countquery);
66
+        $tpl->assign('output', $output);
67
+        $tpl->printToScreen();
68
+        dbclose();
69
+        exit();
70
+    }
71
+    if ($searchterm && strlen($searchterm) < 3) {
72
+        errorExit(_SEARCHTERMTOOSHORT);
73
+    }
74
+    if ($searchterm) {
75
+        if ($searchtype == 'title') {
76
+            $query[] = "stories.title LIKE '%$searchterm%'";
77
+            $countquery[] = "stories.title LIKE '%$searchterm%'";
78
+            $scountquery[] = "series.title LIKE '%$searchterm%'";
79
+        }
80
+        if ($searchtype == 'summary') {
81
+            $query[] = "stories.summary LIKE '%$searchterm%'";
82
+            $countquery[] = "stories.summary LIKE '%$searchterm%'";
83
+            $scountquery[] = "series.summary LIKE '%$searchterm%'";
84
+        }
85
+        if ($searchtype == 'penname') {
86
+            $authorquery = dbquery(_MEMBERLIST.' WHERE '._PENNAMEFIELD." LIKE '%$searchterm%' GROUP BY "._UIDFIELD);
87
+            $authorlist = array();
88
+            while ($auth = dbassoc($authorquery)) {
89
+                $authorlist[] = $auth['uid'];
90
+            }
91
+            if (count($authorlist) > 0) {
92
+                $authors = implode(',', $authorlist);
93
+                $query = 'SELECT stories.*, '._PENNAMEFIELD.' as penname, UNIX_TIMESTAMP(stories.date) as date, UNIX_TIMESTAMP(stories.updated) as updated FROM ('._AUTHORTABLE.', '.TABLEPREFIX.'fanfiction_stories as stories) LEFT JOIN '.TABLEPREFIX.'fanfiction_coauthors as coauth ON coauth.sid = stories.sid WHERE '._UIDFIELD." = stories.uid AND stories.validated > 0 AND (FIND_IN_SET(stories.uid, '$authors') > 0 OR FIND_IN_SET(coauth.uid, '$authors') > 0) ";
94
+                $countquery = 'SELECT COUNT(stories.sid) FROM '.TABLEPREFIX.'fanfiction_stories as stories LEFT JOIN '.TABLEPREFIX."fanfiction_coauthors as coauth ON coauth.sid = stories.sid WHERE stories.validated > 0 AND (FIND_IN_SET(stories.uid, '$authors') > 0 OR FIND_IN_SET(coauth.uid, '$authors') > 0)";
95
+                search($query, $countquery);
96
+                $tpl->assign('output', $output);
97
+                $tpl->printToScreen();
98
+                dbclose();
99
+                exit();
100
+            } else {
101
+                $query[] = '1 = 0';
102
+                $countquery[] = '1 = 0';
103
+                $scountquery[] = '1 = 0';
104
+            }
105
+        }
106
+        if ($searchtype == 'advanced') {
107
+            $query[] = "(stories.summary LIKE '%$searchterm%' OR stories.title LIKE '%$searchterm%') ";
108
+            $countquery[] = "(stories.summary LIKE '%$searchterm%' OR stories.title LIKE '%$searchterm%') ";
109
+            $scountquery[] = "(summary LIKE '%$searchterm%' OR title LIKE '%$searchterm%') ";
110
+        }
111
+    }
112
+    if (isset($_REQUEST['authors'])) {
113
+        $authors = isarray($_REQUEST['authors']) ? $_REQUEST['authors'] : explode(',', $_REQUEST['authors']);
114
+        $authors = array_filter($authors, 'isNumber');
115
+        if ($authors) {
116
+            $authors = implode(',', $authors);
117
+            $query[] = "FIND_IN_SET(stories.uid, '$authors') > 0";
118
+            $countquery[] = "FIND_IN_SET(stories.uid, '$authors') > 0";
119
+            $scountquery[] = "FIND_IN_SET(series.uid, '$authors') > 0";
120
+        } else {
121
+            $query[] = '1 = 0';
122
+            $countquery[] = '1 = 0';
123
+            $scountquery[] = '1 = 0';
124
+        }
125
+    }
126
+    if (isset($_REQUEST['catid'])) {
127
+        $catid = is_array($_REQUEST['catid']) ? $_REQUEST['catid'] : explode(',', $_REQUEST['catid']);
128
+        $catid = array_filter($catid, 'isNumber');
129
+    }
130
+    if (!isset($catid)) {
131
+        $catid = array('false');
132
+    }
133
+    $categories = array();
134
+    // Get the recursive list.
135
+    foreach ($catid as $cat) {
136
+        if ($cat == 'false' || empty($cat)) {
137
+            continue;
138
+        }
139
+        $categories = array_merge($categories, recurseCategories($cat));
140
+    }
141
+    // Now format the SQL
142
+    foreach ($categories as $cat) {
143
+        $catstories[] = "FIND_IN_SET($cat, stories.catid) > 0 ";
144
+        $catseries[] = "FIND_IN_SET($cat, series.catid) > 0 ";
145
+    }
146
+    // Now implode the SQL list
147
+    if (!empty($catstories)) {
148
+        $query[] = '('.implode(' OR ', $catstories).')';
149
+        $countquery[] = '('.implode(' OR ', $catstories).')';
150
+        $scountquery[] = '('.implode(' OR ', $catseries).')';
151
+    }
152
+    if (isset($_REQUEST['charid'])) {
153
+        $charid = is_array($_REQUEST['charid']) ? $_REQUEST['charid'] : explode(',', $_REQUEST['charid']);
154
+    } else {
155
+        $charid = array();
156
+    }
157
+    if (isset($_REQUEST['charlist1'])) {
158
+        $charid[] = $_REQUEST['charlist1'];
159
+    }
160
+    if (isset($_REQUEST['charlist2'])) {
161
+        $charid[] = $_REQUEST['charlist2'];
162
+    }
163
+    $charid = array_filter($charid, 'isNumber');
164
+    if (count($charid) > 0) {
165
+        foreach ($charid as $c) {
166
+            if (!empty($c)) {
167
+                $charstories[] = "FIND_IN_SET($c, stories.charid) > 0 ";
168
+                $charseries[] = "FIND_IN_SET($c, series.characters) > 0 ";
169
+            }
170
+        }
171
+        if (count($charstories) > 0) {
172
+            $query[] = '('.implode(' AND ', $charstories).')';
173
+            $countquery[] = '('.implode(' AND ', $charstories).')';
174
+        }
175
+        if (count($charseries) > 0) {
176
+            $scountquery[] = '('.implode(' AND ', $charseries).')';
177
+        }
178
+    }
179
+
180
+    if (isset($_REQUEST['rid'])) {
181
+        $rid = is_array($_REQUEST['rid']) ? $_REQUEST['rid'] : explode(',', $_REQUEST['rid']);
182
+    } else {
183
+        $rid = array();
184
+    }
185
+    if (count($rid) > 0) {
186
+        $rid = array_filter($rid, 'isNumber');
187
+        $query[] = findclause('rid', $rid);
188
+        $countquery[] = findclause('rid', $rid);
189
+    }
190
+    if (isset($_REQUEST['complete'])) {
191
+        $query[] = "stories.completed = '1'";
192
+        $countquery[] = "stories.completed = '1'";
193
+    }
194
+    $classin = array();
195
+    $classex = array();
196
+    foreach ($classtypelist as $id => $vars) {
197
+        $opts = array();
198
+        $exopts = array();
199
+        if (isset($_POST['class_'.$id])) {
200
+            $opts = array_filter($_POST['class_'.$id], 'isNumber');
201
+        } elseif (isset($_GET['class_'.$id])) {
202
+            $opts = array_merge($opts, explode(',', $_GET['class_'.$id]));
203
+            $opts = array_filter($opts, 'isNumber');
204
+        } elseif (isset($_REQUEST[$vars['name']])) {
205
+            $opts[] = array($_REQUEST[$vars['name']]);
206
+        }
207
+        $classin = array_merge($classin, $opts);
208
+        if (isset($_POST['exclass_'.$id])) {
209
+            $exopts = array_filter($_POST['exclass_'.$id], 'isNumber');
210
+        } elseif (isset($_GET['exclass_'.$id])) {
211
+            $exopts = array_merge($exopts, explode(',', $_GET['exclass_'.$id]));
212
+            $exopts = array_filter($exopts, 'isNumber');
213
+        }
214
+        $classex = array_merge($classex, $exopts);
215
+        unset($opts, $exopts);
216
+    }
217
+    if ($classin) {
218
+        foreach ($classin as $class) {
219
+            $query[] = "FIND_IN_SET($class, stories.classes) > 0";
220
+            $countquery[] = "FIND_IN_SET($class, stories.classes) > 0";
221
+            $scountquery[] = "FIND_IN_SET($class, series.classes) > 0";
222
+        }
223
+    }
224
+    if ($classex) {
225
+        foreach ($classex as $class) {
226
+            $query[] = "FIND_IN_SET($class, stories.classes) = 0";
227
+            $countquery[] = "FIND_IN_SET($class, stories.classes) = 0";
228
+            $scountquery[] = "FIND_IN_SET($class, series.classes) = 0";
229
+        }
230
+    }
231
+    // Begin story length
232
+    unset($wordcount);
233
+    $wordlow = isset($_REQUEST['wordlow']) && isNumber($_REQUEST['wordlow']) ? $_REQUEST['wordlow'] : '-500';
234
+    $wordhigh = isset($_REQUEST['wordhigh']) && isNumber($_REQUEST['wordhigh']) ? $_REQUEST['wordhigh'] : '1000000';
235
+    if ($wordlow != '-500') {
236
+        $wordcount = 'stories.wordcount > '.$wordlow;
237
+    }
238
+    if ($wordhigh != '1000000') {
239
+        if ($wordcount) {
240
+            $wordcount .= ' AND stories.wordcount < '.$wordhigh;
241
+        } else {
242
+            $wordcount = 'stories.wordcount < '.$wordhigh;
243
+        }
244
+    }
245
+    if ($wordhigh < $wordlow) {
246
+        $wordcount = 'stories.wordcount < '.$wordlow;
247
+    }
248
+    if (!empty($wordcount)) {
249
+        $query[] = "($wordcount)";
250
+        $countquery[] = "($wordcount)";
251
+    }
252
+    // End wordcount
253
+
254
+    $codeblocks = dbquery('SELECT * FROM '.TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'browseterms'");
255
+    while ($code = dbassoc($codeblocks)) {
256
+        eval($code['code_text']);
257
+    }
258
+
259
+    $query = (count($query) > 0 ? ' AND '.implode(' AND ', $query) : '').' '._ORDERBY;
260
+    $countquery = count($countquery) > 0 ? ' AND '.implode(' AND ', $countquery) : '';
261
+    if (count($scountquery) > 0) {
262
+        $scountquery = ' WHERE '.implode(' AND ', $scountquery);
263
+    }
264
+    search(_STORYQUERY.$query, _STORYCOUNT.$countquery);
265
+    $otherresults = array();
266
+    $termArray = array_merge($_GET, $_POST);
267
+    $termsList = array();
268
+    foreach ($termArray as $term => $value) {
269
+        if ($term == 'submit' || $term == 'wordhigh' || $term == 'wordlow' || empty($value) || $term == 'formname' || $term == 'searchtype') {
270
+            continue;
271
+        }
272
+        $termsList[$term] = "$term=".(is_array($value) ? implode(',', $value) : $value);
273
+    }
274
+    $terms = implode('&amp;', $termsList);
275
+    if (!empty($scountquery)) {
276
+        $seriesresults = dbquery(_SERIESCOUNT.$scountquery);
277
+        list($scount) = dbrow($seriesresults);
278
+        if ($scount > 0) {
279
+            $otherresults[] = "<a href='browse.php?type=series$terms'>$scount "._SERIES.'</a>';
280
+        }
281
+    }
282
+    $codeblocks = dbquery('SELECT * FROM '.TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'otherresults'");
283
+    while ($code = dbassoc($codeblocks)) {
284
+        eval($code['code_text']);
285
+    }
286
+    if (count($otherresults) > 0) {
287
+        $tpl->assign('otherresults', "<div id='otherresults'><span class='label'>"._OTHERRESULTS.':</span> '.implode(', ', $otherresults).'</div>');
288
+    }
289
+} else {
290
+    if ($searchtype == 'simple') {
291
+        $output .= '<div id="pagetitle">'._SIMPLE."</div><div style='text-align: center;'><form method=\"post\" enctype=\"multipart/form-data\" action=\"searching.php\">
292
+		<div class=\"tblborder\" style=\"width: 320px; padding: 5px; margin: 0 auto;\">
293
+		<select name=\"searchtype\">
294
+		<option value=\"penname\">"._PENNAME.'</option>
295
+		<option value="title">'._TITLE.'</option>
296
+		<option value="summary">'._SUMMARY.'</option>';
297
+        if ($store == 'mysql') {
298
+            $output .= '<option value="fulltext">'._FULLTEXT.'</option>';
299
+        }
300
+        $output .= '</select> <INPUT type="text" class="textbox" name="searchterm" size="20"> ';
301
+        $output .= '<INPUT type="submit" class="button" name="submit" value="'._SUBMIT.'" size="20">
302
+		<div style="font-size: 8pt; text-align: right;"><a href="searching.php?searchtype=advanced">'._ADVANCED.'</a></div></div></form></div>';
303
+    } else {
304
+        $output .= '<div id="pagetitle">'._ADVANCED.'</div><div>
305
+			<form method="POST" name="form" enctype="multipart/form-data" action="searching.php?searchtype=advanced">
306
+			<div class="tblborder" style="width: 90%; margin: 0 auto; padding: 10px;">';
307
+        if ($multiplecats) {
308
+            include 'includes/categories.php';
309
+            $output .= '<input type="hidden" name="formname" value="search">';
310
+        }
311
+        $output .= "<div style='float: left; width: 99%;'>";
312
+        if (count($charlist) > 0) {
313
+            $output .= '<div style="float: left; width: 49%;"><label for="charname">'._CHARACTERS.": </label><br />\n";
314
+            $output .= '<select name="charid[]"  style="width: 90%;" multiple size="5" id="charid">';
315
+            foreach ($charlist as $charid => $info) {
316
+                if ($info['catid'] != -1) {
317
+                    continue;
318
+                }
319
+                $output .= '<option value="'.$charid.'">'.stripslashes($info['name'])."</option>\n";
320
+            }
321
+            $output .= '</select></div>';
322
+        }
323
+        $result = dbquery('SELECT rid, rating FROM '.TABLEPREFIX.'fanfiction_ratings ORDER BY rating');
324
+        if (dbnumrows($result)) {
325
+            $output .= '<div style="float: left; width: 49%;"><label for="rid">'._RATINGS.':</label><br /><select id="rid" style="width: 90%;" multiple size="5"name="rid[]"><option value="-1">'._ALL.'</option>';
326
+            while ($ratingresults = dbassoc($result)) {
327
+                $output .= '<option value="'.$ratingresults['rid'].'">'.$ratingresults['rating']."</option>\n";
328
+            }
329
+            $output .= '</select></div>';
330
+        }
331
+        $output .= '<div style="clear: both;">&nbsp;</div>';
332
+        $output .= ' <div style="text-align: center;">'._MULTIPLESELECT.'</div>';
333
+        $result = dbquery('SELECT * FROM '.TABLEPREFIX.'fanfiction_classtypes ORDER BY classtype_name');
334
+        while ($type = dbassoc($result)) {
335
+            $result2 = dbquery('SELECT * FROM '.TABLEPREFIX."fanfiction_classes WHERE class_type = '".$type['classtype_id']."' ORDER BY class_name");
336
+            $select = '';
337
+            while ($class = dbassoc($result2)) {
338
+                $select .= '<option value="'.$class['class_id'].'">'.$class['class_name'].'</option>';
339
+            }
340
+            $output .= '<div>
341
+				<div style="float: left; width: 49%; margin-bottom: 1em;"><label for="class_'.$type['classtype_id'].'">'.$type['classtype_title'].' '._INCLUDE.':</label><br />
342
+					 <select name="class_'.$type['classtype_id'].'[]" id="class_'.$type['classtype_id']."\"  style=\"width: 95%;\" multiple size=\"5\">$select</select></div>
343
+				<div style=\"float: left; width: 49%; margin-bottom: 1em;\"><label for=\"exclass_".$type['classtype_id'].'">'.$type['classtype_title'].' '._EXCLUDE.':</label><br />
344
+					 <select name="exclass_'.$type['classtype_id'].'[]"  id="exclass_'.$type['classtype_id']."\"  style=\"width: 95%;\" multiple size=\"5\">$select</select></div>
345
+				</div>";
346
+        }
347
+        $output .= '</div><label for="completed">'._COMPLETEONLY.':</label> <input type="checkbox" class="checkbox" id="completed" name="completed" value="ON"><label for="wordlow">'._WORDCOUNT.":</label> <select size=\"1\" id=\"wordlow\" name=\"wordlow\">
348
+  <option value='-500'>&lt; 500</option>
349
+  <option>1000</option>
350
+  <option>5000</option>
351
+  <option>10000</option>
352
+  <option>50000</option>
353
+  <option>100000</option>
354
+  <option value='1000000'>100000+</option>
355
+  </select> - <select size=\"1\" name=\"wordhigh\">
356
+  <option value='1000000'>100000+</option>
357
+  <option>100000</option>
358
+  <option>50000</option>
359
+  <option>10000</option>
360
+  <option>5000</option>
361
+  <option>1000</option>
362
+  <option value='-500'>&lt; 500</option>
363
+  </select><br /><br /><label for=\"searchterm\">"._SEARCHTERM.': </label><INPUT type="text" class="textbox" name="searchterm" id="searchterm" size="20">
364
+  
365
+  <label for="sortorder">'._SORT.':</label> <select name="sortorder" id="sortorder"><option value="alpha">'._ALPHA.'</option><option value="update">'._MOSTRECENT.'</option></select>';
366
+        $codequery = dbquery('SELECT * FROM '.TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'searchform'");
367
+        while ($code = dbassoc($codequery)) {
368
+            eval($code['code_text']);
369
+        }
370
+        $output .= "<div id='submitdiv'><input name=\"submit\" id=\"submit\" value=\""._SUBMIT.'" type="submit" class="button"></div></div></form></div>';
371
+    }
372
+}
373
+$tpl->assign('output', $output);
374
+$tpl->printToScreen();
375
+dbclose();