| ... | ... |
@@ -1,484 +1,486 @@ |
| 1 |
-<?php |
|
| 2 |
-// ---------------------------------------------------------------------- |
|
| 3 |
-// eFiction 3.2 |
|
| 4 |
-// Copyright (c) 2007 by Tammy Keefer |
|
| 5 |
-// Valid HTML 4.01 Transitional |
|
| 6 |
-// Based on eFiction 1.1 |
|
| 7 |
-// Copyright (C) 2003 by Rebecca Smallwood. |
|
| 8 |
-// http://efiction.sourceforge.net/ |
|
| 9 |
-// ---------------------------------------------------------------------- |
|
| 10 |
-// LICENSE |
|
| 11 |
-// |
|
| 12 |
-// This program is free software; you can redistribute it and/or |
|
| 13 |
-// modify it under the terms of the GNU General Public License (GPL) |
|
| 14 |
-// as published by the Free Software Foundation; either version 2 |
|
| 15 |
-// of the License, or (at your option) any later version. |
|
| 16 |
-// |
|
| 17 |
-// This program is distributed in the hope that it will be useful, |
|
| 18 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 19 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 20 |
-// GNU General Public License for more details. |
|
| 21 |
-// |
|
| 22 |
-// To read the license please visit http://www.gnu.org/copyleft/gpl.html |
|
| 23 |
-// ---------------------------------------------------------------------- |
|
| 24 |
- |
|
| 25 |
-if(!defined("_CHARSET")) exit( );
|
|
| 26 |
- |
|
| 27 |
-function updatePanelOrder( ) {
|
|
| 28 |
- |
|
| 29 |
- $ptypes = dbquery("SELECT panel_type FROM ".TABLEPREFIX."fanfiction_panels GROUP BY panel_type");
|
|
| 30 |
- while($ptype = dbassoc($ptypes)) {
|
|
| 31 |
- if($ptype['panel_type'] == "A") {
|
|
| 32 |
- for($x = 1; $x < 5; $x++) {
|
|
| 33 |
- $count = 1; |
|
| 34 |
- $plist = dbquery("SELECT panel_name, panel_id FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_hidden = '0' AND panel_type = '".$ptype['panel_type']."' AND panel_level = '$x' ORDER BY panel_level, panel_order");
|
|
| 35 |
- while($p = dbassoc($plist)) {
|
|
| 36 |
- dbquery("UPDATE ".TABLEPREFIX."fanfiction_panels SET panel_order = '$count' WHERE panel_id = '".$p['panel_id']."' LIMIT 1");
|
|
| 37 |
- $count++; |
|
| 38 |
- } |
|
| 39 |
- } |
|
| 40 |
- } |
|
| 41 |
- else {
|
|
| 42 |
- $count = 1; |
|
| 43 |
- $plist = dbquery("SELECT panel_name, panel_id FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_hidden = '0' AND panel_type = '".$ptype['panel_type']."' ORDER BY ".($ptype['panel_type'] == "A" ? "panel_level," : "")."panel_order");
|
|
| 44 |
- while($p = dbassoc($plist)) {
|
|
| 45 |
- dbquery("UPDATE ".TABLEPREFIX."fanfiction_panels SET panel_order = '$count' WHERE panel_id = '".$p['panel_id']."' LIMIT 1");
|
|
| 46 |
- $count++; |
|
| 47 |
- } |
|
| 48 |
- } |
|
| 49 |
- } |
|
| 50 |
-} |
|
| 51 |
- |
|
| 52 |
-if($action == "settings") {
|
|
| 53 |
-$output .= "<h1>"._SETTINGS."</h1><div style='text-align: center;'> |
|
| 54 |
- <a href='admin.php?action=settings&sect=main'>"._MAINSETTINGS."</a> | |
|
| 55 |
- <a href='admin.php?action=settings&sect=submissions'>"._SUBMISSIONSETTINGS."</a> | |
|
| 56 |
- <a href='admin.php?action=settings&sect=sitesettings'>"._SITESETTINGS."</a> | |
|
| 57 |
- <a href='admin.php?action=settings&sect=display'>"._DISPLAYSETTINGS."</a> | |
|
| 58 |
- <a href='admin.php?action=settings&sect=reviews'>"._REVIEWSETTINGS."</a> | |
|
| 59 |
- <a href='admin.php?action=settings&sect=useropts'>"._USERSETTINGS."</a> | |
|
| 60 |
- <a href='admin.php?action=settings&sect=email'>"._EMAILSETTINGS."</a> | |
|
| 61 |
- <a href='admin.php?action=censor'>"._CENSOR."</a> <br /> |
|
| 62 |
- <a href='admin.php?action=messages&message=welcome'>"._WELCOME."</a> | |
|
| 63 |
- <a href='admin.php?action=messages&message=copyright'>"._COPYRIGHT."</a> | |
|
| 64 |
- <a href='admin.php?action=messages&message=printercopyright'>"._PRINTERCOPYRIGHT."</a> | |
|
| 65 |
- <a href='admin.php?action=messages&message=tinyMCE'>"._TINYMCE."</a> | |
|
| 66 |
- <a href='admin.php?action=messages&message=nothankyou'>"._NOTHANKYOU."</a> | |
|
| 67 |
- <a href='admin.php?action=messages&message=thankyou'>"._THANKYOU."</a><br />"; |
|
| 68 |
- $settingsquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_type = 'AS' ORDER BY panel_title");
|
|
| 69 |
- while($os = dbassoc($settingsquery)) {
|
|
| 70 |
- if($os['panel_url']) $othersettings[] = "<a href='".$os['panel_url']."'>".$os['panel_title']."</a>"; |
|
| 71 |
- } |
|
| 72 |
- if(isset($othersettings)) $output .= implode(" | ", $othersettings);
|
|
| 73 |
-$output .= "</div> "; |
|
| 74 |
-} |
|
| 75 |
- |
|
| 76 |
-$sects = array("main", "submissions", "sitesettings", "display", "reviews", "useropts", "email");
|
|
| 77 |
-//if(!isset($_GET['sect'])) $sect = "main"; |
|
| 78 |
-//else $sect = $_GET['sect']; |
|
| 79 |
-$sect = isset($_GET['sect']) ? $_GET['sect'] : "main"; |
|
| 80 |
-if(isset($_POST['submit'])) {
|
|
| 81 |
- if($sect == "main") {
|
|
| 82 |
- if(!preg_match("!^[a-z0-9_]{3,30}$!i", $_POST['newsitekey'])) $output .= write_error(_BADSITEKEY);
|
|
| 83 |
- else {
|
|
| 84 |
- $oldsitekey = $sitekey; |
|
| 85 |
- $sitekey = descript($_POST['newsitekey']); |
|
| 86 |
- $sitename = escapestring(descript(strip_tags($_POST['newsitename']))); |
|
| 87 |
- $slogan = escapestring(descript(strip_tags($_POST['newslogan']))); |
|
| 88 |
- $url = escapestring(descript(strip_tags($_POST['newsiteurl']))); |
|
| 89 |
- // if the http:// is missing add it. |
|
| 90 |
- if(substr($url, 0, 7) != "http://") $url = "http://".$url; |
|
| 91 |
- // we also want to check for a trailing slash. |
|
| 92 |
- if(substr($url, -1, 1) == "/") $url = substr($url, 0, strlen($url) - 1); |
|
| 93 |
- $tableprefix = escapestring(descript(strip_tags($_POST['newtableprefix']))); |
|
| 94 |
- $siteemail = escapestring(descript(strip_tags($_POST['newsiteemail']))); |
|
| 95 |
- $skin = escapestring(descript(strip_tags($_POST['newskin']))); |
|
| 96 |
- $language = escapestring(descript(strip_tags($_POST['newlanguage']))); |
|
| 97 |
- if(empty($sitekey)) $output .= write_message(_SITEKEYREQUIRED); |
|
| 98 |
- else {
|
|
| 99 |
- if($sitekey != $oldsitekey) $output .= write_message(_SITEKEYCHANGED); |
|
| 100 |
- $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET sitekey = '$sitekey', sitename = '$sitename', slogan = '$slogan', url = '$url', tableprefix = '$tableprefix', siteemail = '$siteemail', skin = '$skin', language = '$language' WHERE sitekey = '$oldsitekey'");
|
|
| 101 |
- } |
|
| 102 |
- } |
|
| 103 |
- } |
|
| 104 |
- else if($sect == "submissions") {
|
|
| 105 |
- $submissionsoff = $_POST['newsubmissionsoff'] == 1 ? 1 : 0; |
|
| 106 |
- $autovalidate = $_POST['newautovalidate'] == 1 ? 1 : 0; |
|
| 107 |
- $coauthallowed = $_POST['newcoauthallowed'] == 1 ? 1 : 0; |
|
| 108 |
- $store = !empty($_POST['newstore']) ? $_POST['newstore'] == "files" ? "files" : "mysql" : $store; |
|
| 109 |
- $storiespath = descript($_POST['newstoriespath']); |
|
| 110 |
- $minwords = isNumber($_POST['newminwords']) ? $_POST['newminwords'] : 0; |
|
| 111 |
- $maxwords = isNumber($_POST['newmaxwords']) ? $_POST['newmaxwords'] : 0; |
|
| 112 |
- $roundrobins = $_POST['newroundrobins'] == 1 ? 1 : 0; |
|
| 113 |
- $allowseries = $_POST['newallowseries'] && isNumber($_POST['newallowseries']) ? $_POST['newallowseries'] : 0; |
|
| 114 |
- $imageupload = $_POST['newimageupload'] == 1 ? 1 : 0; |
|
| 115 |
- $imageheight = isNumber($_POST['newimageheight']) ? $_POST['newimageheight'] : 0; |
|
| 116 |
- $imagewidth = isNumber($_POST['newimagewidth']) ? $_POST['newimagewidth'] : 0; |
|
| 117 |
- $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET submissionsoff = '$submissionsoff', autovalidate = '$autovalidate', coauthallowed = '$coauthallowed', store = '$store', storiespath = '$storiespath', minwords = '$minwords', maxwords = '$maxwords', imageupload = '$imageupload', imageheight = '$imageheight', imagewidth = '$imagewidth', roundrobins = '$roundrobins', allowseries = '$allowseries' WHERE sitekey ='".SITEKEY."'");
|
|
| 118 |
- if($action == "settings") {
|
|
| 119 |
- dbquery("UPDATE ".TABLEPREFIX."fanfiction_panels SET panel_hidden = '".($imageupload ? "0" : "1")."' WHERE panel_name LIKE 'manageimages'");
|
|
| 120 |
- dbquery("UPDATE ".TABLEPREFIX."fanfiction_panels SET panel_hidden = '".($allowseries ? "0" : "1")."' WHERE (panel_name LIKE '%series%' OR panel_title LIKE '%series%') AND panel_type != 'A' AND panel_type != 'B'");
|
|
| 121 |
- updatePanelOrder( ); |
|
| 122 |
- } |
|
| 123 |
- |
|
| 124 |
- } |
|
| 125 |
- else if($sect == "sitesettings") {
|
|
| 126 |
- $tinyMCE = $_POST['newtinyMCE'] == 1 ? 1 : 0; |
|
| 127 |
- $allowed_tags = $_POST['newallowed_tags']; |
|
| 128 |
- $favorites = $_POST['newfavorites'] == 1 ? 1 : 0; |
|
| 129 |
- $multiplecats = $_POST['newmultiplecats'] == 1 ? 1 : 0; |
|
| 130 |
- $newscomments = $_POST['newnewscomments'] == 1 ? 1 : 0; |
|
| 131 |
- $logging = $_POST['newlogging'] == 1 ? 1 : 0; |
|
| 132 |
- $maintenance = $_POST['newmaint'] == 1 ? 1 : 0; |
|
| 133 |
- $debug = $_POST['newdebug'] == 1 ? 1 : 0; |
|
| 134 |
- $captcha = $_POST['newcaptcha'] == 1 ? 1 : 0; |
|
| 135 |
- $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET tinyMCE = '$tinyMCE', favorites = '$favorites', multiplecats = '$multiplecats', allowed_tags = '$allowed_tags', newscomments = '$newscomments', logging = '$logging', maintenance = '$maintenance', debug = '$debug', captcha = '$captcha' WHERE sitekey ='".SITEKEY."'");
|
|
| 136 |
- } |
|
| 137 |
- else if($sect == "display") {
|
|
| 138 |
- $dateformat = $_POST['newdateformat'] ? descript(strip_tags($_POST['newdateformat'])) : descript(strip_tags($_POST['customdateformat'])); |
|
| 139 |
- $timeformat = $_POST['newtimeformat'] ? descript(strip_tags($_POST['newtimeformat'])) : descript(strip_tags($_POST['customtimeformat'])); |
|
| 140 |
- $extendcats = $_POST['newextendcats'] == 1 ? 1 : 0; |
|
| 141 |
- if(isset($_POST['newdisplaycolumns']) && isNumber($_POST['newdisplaycolumns'])) $displaycolumns = $_POST['newdisplaycolumns']; |
|
| 142 |
- if(isset($_POST['newitemsperpage']) && isNumber($_POST['newitemsperpage'])) $itemsperpage = $_POST['newitemsperpage']; |
|
| 143 |
- if(isset($_POST['newlinkstyle']) && isNumber($_POST['newlinkstyle'])) $linkstyle = $_POST['newlinkstyle']; |
|
| 144 |
- if(isset($_POST['newlinkrange']) && isNumber($_POST['newlinkrange'])) $linkrange = $_POST['newlinkrange']; |
|
| 145 |
- $displayindex = $_POST['newstoryindex'] == 1 ? 1 : 0; |
|
| 146 |
- $displayprofile = $_POST['newdisplayprofile'] == 1 ? 1 : 0; |
|
| 147 |
- $defaultsort = $_POST['newdefaultsort'] == 1 ? 1 : 0; |
|
| 148 |
- if(isNumber($_POST['newrecentdays'])) $recentdays = $_POST['newrecentdays']; |
|
| 149 |
- $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET dateformat = '$dateformat', timeformat = '$timeformat', extendcats = '$extendcats', displaycolumns = '$displaycolumns', itemsperpage = '$itemsperpage', displayindex = '$displayindex', defaultsort = '$defaultsort', recentdays = '$recentdays', displayprofile = '$displayprofile', linkstyle = '$linkstyle', linkrange = '$linkrange' WHERE sitekey ='".SITEKEY."'");
|
|
| 150 |
- } |
|
| 151 |
- else if($sect == "reviews") {
|
|
| 152 |
- $reviewsallowed = $_POST['newreviewsallowed'] == 1 ? 1 : 0; |
|
| 153 |
- $anonreviews = $_POST['newanonreviews'] == 1 ? 1 : 0; |
|
| 154 |
- $rateonly = $_POST['newrateonly'] == 1 ? 1 : 0; |
|
| 155 |
- $ratings = isset($_POST['newratings']) && isNumber($_POST['newratings']) ? $_POST['newratings'] : 0; |
|
| 156 |
- $revdelete = isset($_POST['newrevdelete']) && isNumber($_POST['newrevdelete']) ? $_POST['newrevdelete'] : 0; |
|
| 157 |
- $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET reviewsallowed = '$reviewsallowed', anonreviews = '$anonreviews', rateonly = '$rateonly', ratings = '$ratings', revdelete = '$revdelete' WHERE sitekey ='".SITEKEY."'");
|
|
| 158 |
- } |
|
| 159 |
- else if($sect == "useropts") {
|
|
| 160 |
- $alertson = $_POST['newalertson'] == 1 ? 1 : 0; |
|
| 161 |
- $disablepopups = $_POST['newdisablepops'] == 1 ? 1 : 0; |
|
| 162 |
- $agestatement = $_POST['newagestatement'] == 1 ? 1 : 0; |
|
| 163 |
- $pwdsetting = $_POST['newpwdsetting'] == 1 ? 1 : 0; |
|
| 164 |
- $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET alertson = '$alertson', disablepopups = '$disablepopups', agestatement = '$agestatement', pwdsetting = '$pwdsetting' WHERE sitekey ='".SITEKEY."'");
|
|
| 165 |
- } |
|
| 166 |
- else if($sect == "email") {
|
|
| 167 |
- $smtp_host = $_POST['newsmtp_host']; |
|
| 168 |
- $smtp_username = $_POST['newsmtp_username']; |
|
| 169 |
- $smtp_password = $_POST['newsmtp_password']; |
|
| 170 |
- $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET smtp_host = '$smtp_host', smtp_username = '$smtp_username', smtp_password = '$smtp_password' WHERE sitekey ='".SITEKEY."'");
|
|
| 171 |
- } |
|
| 172 |
- if($result) {
|
|
| 173 |
- $output .= write_message(_ACTIONSUCCESSFUL); |
|
| 174 |
- $sect = $sects[(array_search($sect, $sects) + 1)]; |
|
| 175 |
- if(!$sect) $sect = $sects[0]; |
|
| 176 |
- } |
|
| 177 |
- else $output .= write_error(_ERROR); |
|
| 178 |
-} |
|
| 179 |
- $settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey ='".SITEKEY."'");
|
|
| 180 |
- $settings = dbassoc($settingsresults); |
|
| 181 |
- foreach($settings as $var => $val) {
|
|
| 182 |
- $$var = stripslashes($val); |
|
| 183 |
- } |
|
| 184 |
- |
|
| 185 |
- $output .= "<form method='POST' class='tblborder' style='' enctype='multipart/form-data' action='".($action == "settings" ? "admin.php?action=settings" : $_SERVER['PHP_SELF']."?step=".$_GET['step'])."&sect=$sect'>"; |
|
| 186 |
- if($sect == "main") {
|
|
| 187 |
- $output .= "<h2>"._SITEINFO."</h2> |
|
| 188 |
- <table class='acp'> |
|
| 189 |
- <tr> |
|
| 190 |
- <td><label for='newsitekey'>"._SITEKEY.":</label></td><td><input type='text' class='textbox' name='newsitekey' value='".SITEKEY."'> <a href='#' class='pophelp'>[?]<span>"._HELP_SITEKEY."</span></a></td> |
|
| 191 |
- </tr> |
|
| 192 |
- <tr> |
|
| 193 |
- <td><label for='newsitename'>"._SITENAME.":</label></td><td><input type='text' class='textbox' name='newsitename' value='".htmlspecialchars($sitename, ENT_QUOTES)."'> <a href='#' class='pophelp'>[?]<span>"._HELP_SITENAME."</span></a></td> |
|
| 194 |
- </tr> |
|
| 195 |
- <tr> |
|
| 196 |
- <td><label for='newslogan'>"._SITESLOGAN.":</label></td><td><input type='text' class='textbox' name='newslogan' value='".htmlspecialchars($slogan, ENT_QUOTES)."'> <a href='#' class='pophelp'>[?]<span>"._HELP_SLOGAN."</span></a></td> |
|
| 197 |
- </tr> |
|
| 198 |
- <tr> |
|
| 199 |
- <td><label for='newurl'>"._SITEURL.":</label></td><td><input type='text' class='textbox' name='newsiteurl' value='$url'> <a href='#' class='pophelp'>[?]<span>"._HELP_URL."</span></a></td> |
|
| 200 |
- </tr> |
|
| 201 |
- <tr> |
|
| 202 |
- <td><label for='newtableprefix'>"._TABLEPREFIX.":</label></td><td><input type='text' class='textbox' name='newtableprefix' value='".TABLEPREFIX."'> <a href='#' class='pophelp'>[?]<span>"._HELP_TABLEPREFIX."</span></a></td> |
|
| 203 |
- </tr> |
|
| 204 |
- <tr> |
|
| 205 |
- <td><label for='newsiteemail'>"._ADMINEMAIL.":</label></td><td><input type='text' class='textbox' name='newsiteemail' value='$siteemail'> <a href='#' class='pophelp'>[?]<span>"._HELP_SITEEMAIL."</span></a></td> |
|
| 206 |
- </tr> |
|
| 207 |
- <tr> |
|
| 208 |
- <td><label for='newsiteskin'>"._DEFAULTSKIN.":</label></td><td><select name='newskin'>"; |
|
| 209 |
- $directory = opendir(_BASEDIR."skins"); |
|
| 210 |
- while($filename = readdir($directory)) {
|
|
| 211 |
- if($filename=="." || $filename==".." || !is_dir(_BASEDIR."skins/".$filename)) continue; |
|
| 212 |
- $output .= "<option value='$filename'".($skin == $filename ? " selected" : "").">$filename</option>"; |
|
| 213 |
- } |
|
| 214 |
- closedir($directory); |
|
| 215 |
- $output .= "</select> <a href='#' class='pophelp'>[?]<span>"._HELP_SITESKIN."</span></a></td> |
|
| 216 |
- </tr> |
|
| 217 |
- <tr> |
|
| 218 |
- <td><label for='newlanguage'>"._LANGUAGE.":</label></td><td><select name='newlanguage'>"; |
|
| 219 |
- $directory = opendir(_BASEDIR."languages"); |
|
| 220 |
- while($filename = readdir($directory)) {
|
|
| 221 |
- if($filename=="." || $filename==".." || substr($filename, 2) == "_admin.php") continue; |
|
| 222 |
- $output .= "<option value='".substr($filename, 0, 2)."'". |
|
| 223 |
- ($language == substr($filename, 0, strpos($filename, ".php")) ? " selected" : "")."> |
|
| 224 |
- ".substr($filename, 0, strpos($filename, ".php"))."</option>"; |
|
| 225 |
- } |
|
| 226 |
- closedir($directory); |
|
| 227 |
- $output .= "</select> <a href='#' class='pophelp'>[?]<span>"._HELP_LANGUAGE."</span></a></td></tr>"; |
|
| 228 |
- } |
|
| 229 |
- else if($sect == "submissions") {
|
|
| 230 |
- $output .= "<h2>"._SUBMISSIONSETTINGS."</h2> |
|
| 231 |
- <table class='acp'> |
|
| 232 |
- <tr> |
|
| 233 |
- <td><label for='newsubmissionsoff'>"._NOSUBS.":</label></td><td><select name='newsubmissionsoff'> |
|
| 234 |
- <option value='1'".($submissionsoff == "1" ? " selected" : "").">"._YES."</option> |
|
| 235 |
- <option value='0'".($submissionsoff == "0" ? " selected" : "").">"._NO."</option> |
|
| 236 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_SUBSOFF."</span></a></td> |
|
| 237 |
- </tr> |
|
| 238 |
- <tr> |
|
| 239 |
- <td><label for='newautovalidate'>"._AUTOVALIDATE.":</label></td><td><select name='newautovalidate'> |
|
| 240 |
- <option value='1'".($autovalidate == "1" ? "selected" : "").">"._YES."</option> |
|
| 241 |
- <option value='0'".($autovalidate == "0" ? "selected" : "").">"._NO."</option> |
|
| 242 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_AUTOVALIDATE."</span></a></td> |
|
| 243 |
- </tr> |
|
| 244 |
- <tr> |
|
| 245 |
- <td><label for='newcoauthallowed'>"._COAUTHALLOW.":</label></td><td><select name='newcoauthallowed'> |
|
| 246 |
- <option value='1'".($coauthallowed == "1" ? "selected" : "").">"._YES."</option> |
|
| 247 |
- <option value='0'".($coauthallowed == "0" ? "selected" : "").">"._NO."</option> |
|
| 248 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_COAUTHORS."</span></a></td> |
|
| 249 |
- </tr> |
|
| 250 |
- <tr> |
|
| 251 |
- <td><label for='newroundrobins'>"._ALLOWRR.":</label></td><td><select name='newroundrobins'> |
|
| 252 |
- <option value='1'".($roundrobins == "1" ? " selected" : "").">"._YES."</option> |
|
| 253 |
- <option value='0'".($roundrobins == "0" ? " selected" : "").">"._NO."</option> |
|
| 254 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_ROUNDROBINS."</span></a></td> |
|
| 255 |
- </tr> |
|
| 256 |
- <tr> |
|
| 257 |
- <td><label for='newallowseries'>"._ALLOWSERIES.":</label></td><td><select name='newallowseries'> |
|
| 258 |
- <option value='2'".($allowseries == "2" ? " selected" : "").">"._ALLMEMBERS."</option> |
|
| 259 |
- <option value='1'".($allowseries == "1" ? " selected" : "").">"._AUTHORSONLY."</option> |
|
| 260 |
- <option value='0'".($allowseries == "0" ? " selected" : "").">"._ADMINS."</option> |
|
| 261 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_ALLOWSERIES."</span></a></td> |
|
| 262 |
- </tr> |
|
| 263 |
- <tr> |
|
| 264 |
- <td><label for='newimageupload'>"._IMAGEUPLOAD.":</label></td><td><select name='newimageupload'> |
|
| 265 |
- <option value='1'".($imageupload == "1" ? " selected" : "").">"._YES."</option> |
|
| 266 |
- <option value='0'".($imageupload == "0" ? " selected" : "").">"._NO."</option> |
|
| 267 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_IMAGEUPLOAD."</span></a></td> |
|
| 268 |
- </tr> |
|
| 269 |
- <tr> |
|
| 270 |
- <td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._IMAGESIZE." <a href='#' class='pophelp'>[?]<span>"._HELP_IMAGESIZE."</span></a></legend> |
|
| 271 |
- <label for='newimageheight'>"._MAXHEIGHT.":</label> <input type='text' class='textbox=' name='newimageheight' value='$imageheight' size='5'> <br /> |
|
| 272 |
- <label for='newimagewidth'>"._MAXWIDTH.":</label> <input type='text' class='textbox=' name='newimagewidth' value='$imagewidth' size='5'></fieldset></td> |
|
| 273 |
- </tr> |
|
| 274 |
- <tr> |
|
| 275 |
- <td><label for='newstore'>"._HOWSTORE.":</label></td><td><select name='newstore' onChange='if (this.disabled) this.selectedIndex=0' disabled> |
|
| 276 |
- <option value='files'".($store == "files" || !$store ? " selected" : "").">"._FILES."</option> |
|
| 277 |
- <option value='mysql'".($store == "mysql" ? " selected" : "").">"._MYSQL."</option> |
|
| 278 |
- </select> <input class='textbox=' type='checkbox' class='checkbox' name='r1' onClick='this.form.newstore.disabled=false' checked> <a href='#' class='pophelp'>[?]<span>"._HELP_STORE."</span></a></td> |
|
| 279 |
- </tr> |
|
| 280 |
- <tr> |
|
| 281 |
- <td><label for='newstoriespath'>"._STORIESPATH.":</label></td><td><input type='text' class='textbox=' name='newstoriespath' value='$storiespath'> <a href='#' class='pophelp'>[?]<span>"._HELP_STORIESPATH."</span></a></td> |
|
| 282 |
- </tr> |
|
| 283 |
- <tr> |
|
| 284 |
- <td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._MAXMINWORDS."<a href='#' class='pophelp'>[?]<span>"._HELP_MINMAXWORDS."</span></a></legend> |
|
| 285 |
- <label for='newminwords'>"._MIN.":</label> <input type='text' class='textbox=' name='newminwords' value='$minwords' size='5'> <br /> |
|
| 286 |
- <label for='newmaxwords'>"._MAX.":</label> <input type='text' class='textbox=' name='newmaxwords' value='$maxwords' size='7'></fieldset></td></tr>"; |
|
| 287 |
- } |
|
| 288 |
- else if($sect == "sitesettings") {
|
|
| 289 |
- $output .= "<h2>"._SITESETTINGS."</h2> |
|
| 290 |
- <table class='acp'> |
|
| 291 |
- <tr> |
|
| 292 |
- <td><label for='newtinyMCE'>"._USETINYMCE.": </label></td><td><select name='newtinyMCE'> |
|
| 293 |
- <option value='1'".($tinyMCE ? " selected" : "").">"._YES."</option> |
|
| 294 |
- <option value='0'".(!$tinyMCE ? " selected" : "").">"._NO."</option> |
|
| 295 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_TINYMCE." "._TINYMCENOTE."</span></a></td> |
|
| 296 |
- </tr> |
|
| 297 |
- <tr> |
|
| 298 |
- <td><label for='newallowed_tags'>"._TAGS.": </label></td><td><input type='text' class='textbox' name='newallowed_tags' value='".($allowed_tags ? $allowed_tags : "<strong><em><br /><br><blockquote><strike><font><b><i><u><center><img><a><hr><p><ul><li><ol>")."' size='40'> <a href='#' class='pophelp'>[?]<span>"._HELP_ALLOWEDTAGS." "._TINYMCENOTE."</span></a></td> |
|
| 299 |
- </tr> |
|
| 300 |
- <tr> |
|
| 301 |
- <td><label for='newfavorites'>"._FAVORITES.": </label></td><td><select name='newfavorites'> |
|
| 302 |
- <option value='1'".($favorites == "1" ? " selected" : "").">"._YES."</option> |
|
| 303 |
- <option value='0'".($favorites == "0" ? " selected" : "").">"._NO."</option> |
|
| 304 |
- </select><a href='#' class='pophelp'>[?]<span>"._HELP_FAVORITES."</span></a></td> |
|
| 305 |
- </tr> |
|
| 306 |
- <tr> |
|
| 307 |
- <td><label for='newmultplecats'>"._NUMCATS.": </label></td><td><select name='newmultiplecats'> |
|
| 308 |
- <option value='1'".($multiplecats == "1" ? "selected" : "").">"._MORETHANONE."</option> |
|
| 309 |
- <option value='0'".($multiplecats == "0" ? "selected" : "").">"._ONLYONE."</option> |
|
| 310 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_NUMCATS."</span></a></td> |
|
| 311 |
- </tr> |
|
| 312 |
- <tr> |
|
| 313 |
- <td><label for='newnewscomments'>"._NEWSCOMMENTS.": </label></td><td><select name='newnewscomments'> |
|
| 314 |
- <option value='1'".($newscomments == "1" ? " selected" : "").">"._YES."</option> |
|
| 315 |
- <option value='0'".($newscomments == "0" ? " selected" : "").">"._NO."</option> |
|
| 316 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_NEWSCOMMENTS."</span></a></td> |
|
| 317 |
- </tr> |
|
| 318 |
- <tr> |
|
| 319 |
- <td><label for='newlogging'>"._LOGGING.": </label></td><td><select name='newlogging'> |
|
| 320 |
- <option value='1'".($logging == "1" ? " selected" : "").">"._YES."</option> |
|
| 321 |
- <option value='0'".($logging == "0" ? " selected" : "").">"._NO."</option> |
|
| 322 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_LOGGING."</span></a></td> |
|
| 323 |
- </tr> |
|
| 324 |
- <tr> |
|
| 325 |
- <td><label for='newmaint'>"._MAINTENANCE.": </label></td><td><select name='newmaint'> |
|
| 326 |
- <option value='1'".($maintenance == "1" ? " selected" : "").">"._YES."</option> |
|
| 327 |
- <option value='0'".($maintenance == "0" ? " selected" : "").">"._NO."</option> |
|
| 328 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_MAINTENANCE."</span></a></td> |
|
| 329 |
- </tr> |
|
| 330 |
- <tr> |
|
| 331 |
- <td><label for='newdebug'>"._DEBUG.": </label></td><td><select name='newdebug'> |
|
| 332 |
- <option value='1'".($debug == "1" ? " selected" : "").">"._YES."</option> |
|
| 333 |
- <option value='0'".(!isset($debug) || $debug == "0" ? " selected" : "").">"._NO."</option> |
|
| 334 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_DEBUG."</span></a></td> |
|
| 335 |
- </tr> |
|
| 336 |
- <tr> |
|
| 337 |
- <td><label for='newcaptcha'>"._CAPTCHA.": </label></td><td><select name='newcaptcha'> |
|
| 338 |
- <option value='1'".($captcha == "1" ? " selected" : "").">"._YES."</option> |
|
| 339 |
- <option value='0'".(!isset($captcha) || $captcha == "0" ? " selected" : "").">"._NO."</option> |
|
| 340 |
- </select><a href='#' class='pophelp'>[?]<span>"._HELP_CAPTCHA."</span></a></td></tr>"; |
|
| 341 |
- } |
|
| 342 |
- else if($sect == "display") {
|
|
| 343 |
- $settings = dbquery("SELECT defaultsort, displayindex FROM ".$settingsprefix."fanfiction_settings WHERE sitekey ='".SITEKEY."'");
|
|
| 344 |
- list($sitedefaultsort, $sitedisplayindex) = dbrow($settings); |
|
| 345 |
- $defaultdates = array("m/d/y", "m/d/Y", "m/d/Y", "d/m/Y", "d/m/y", "d M Y",
|
|
| 346 |
- "d.m.y", "Y.m.d", "m.d.Y", "d-m-y", "m-d-y", "M d Y", "M d, Y", "F d Y", "F d, Y"); |
|
| 347 |
- $defaulttimes = array("h:i a", "h:i A", "H:i", "g:i a", "g:i A", "G:i", "h:i:s a", "H:i:s", "g:i:s a", "g:i:s A", "G:i:s");
|
|
| 348 |
- $output .= "<h2>"._DISPLAYSETTINGS."</h2> |
|
| 349 |
- <table class='acp'> |
|
| 350 |
- <tr> |
|
| 351 |
- <td><label for='newdateformat'>"._DATEFORMAT.":</label></td><td><select name='newdateformat'><option value=''>"._SELECTONE."</option>"; |
|
| 352 |
- foreach($defaultdates as $date) {
|
|
| 353 |
- $output .= "<option value='$date'>".date("$date")."</option>";
|
|
| 354 |
- } |
|
| 355 |
- $output .= "</select> "._OR." <input type='text' name='customdateformat' class='textbox' value='$dateformat'> <a href='#' class='pophelp'>[?]<span>"._HELP_DATEFORMAT."</span></a></td> |
|
| 356 |
- </tr> |
|
| 357 |
- <tr> |
|
| 358 |
- <td><label for='newtimeformat'>"._TIMEFORMAT.":</label></td><td><select name='newtimeformat'><option value=''>"._SELECTONE."</option>"; |
|
| 359 |
- foreach($defaulttimes as $time) {
|
|
| 360 |
- $output .= "<option value='$time'>".date("$time")."</option>";
|
|
| 361 |
- } |
|
| 362 |
- $output .= " |
|
| 363 |
- </select> "._OR." <input type='text' name='customtimeformat' class='textbox' value='$timeformat'> <a href='#' class='pophelp'>[?]<span>"._HELP_TIMEFORMAT."</span></a></td> |
|
| 364 |
- </tr> |
|
| 365 |
- <tr> |
|
| 366 |
- <td><label for='newextendcats'>"._EXTENDCATS.":</label></td><td><select name='newextendcats'> |
|
| 367 |
- <option value='1'".($extendcats == "1" ? " selected" : "").">"._YES."</option> |
|
| 368 |
- <option value='0'".($extendcats == "0" ? " selected" : "").">"._NO."</option> |
|
| 369 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_EXTENDCATS."</span></a></td> |
|
| 370 |
- </tr> |
|
| 371 |
- <tr> |
|
| 372 |
- <td><label for='newdisplaycolumns'>"._COLUMNS.":</label></td><td><input type='text' class='textbox=' name='newdisplaycolumns' size='3' value='$displaycolumns'> <a href='#' class='pophelp'>[?]<span>"._HELP_COLUMNS."</span></a></td> |
|
| 373 |
- </tr> |
|
| 374 |
- <tr> |
|
| 375 |
- <td><label for='newitemsperpage'>"._NUMITEMS.":</label></td><td><input type='text' class='textbox' name='newitemsperpage' size='3' value='$itemsperpage'> <a href='#' class='pophelp'>[?]<span>"._HELP_ITEMSPERPAGE."</span></a></td> |
|
| 376 |
- </tr> |
|
| 377 |
- <tr> |
|
| 378 |
- <td><label for='newrecentdays'>"._RECENTDAYS.":</label></td><td><input type='text' class='textbox' name='newrecentdays' size='3' value='$recentdays'> <a href='#' class='pophelp'>[?]<span>"._HELP_RECENTDAYS."</span></a></td> |
|
| 379 |
- </tr> |
|
| 380 |
- <tr> |
|
| 381 |
- <td><label for='newdefaultsort'>"._DEFAULTSORT.":</label></td><td><select name='newdefaultsort'> |
|
| 382 |
- <option value='1'".($sitedefaultsort ? " selected" : "").">"._MOSTRECENT."</option> |
|
| 383 |
- <option value='0'".(!$sitedefaultsort ? " selected" : "").">"._ALPHA."</option> |
|
| 384 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_DEFAULTSORT."</span></a></td> |
|
| 385 |
- </tr> |
|
| 386 |
- <tr> |
|
| 387 |
- <td><label for='newdisplayindex'>"._STORYINDEX.":</label></td><td><select name='newstoryindex'> |
|
| 388 |
- <option value='1'".($sitedisplayindex ? " selected" : "").">"._YES."</option> |
|
| 389 |
- <option value='0'".(!$sitedisplayindex ? " selected" : "").">"._NO."</option> |
|
| 390 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_DISPLAYINDEX."</span></a></td> |
|
| 391 |
- </tr> |
|
| 392 |
- <tr> |
|
| 393 |
- <td><label for='newdisplayprofile'>"._DISPLAYPROFILE.":</label></td><td><select name='newdisplayprofile'> |
|
| 394 |
- <option value='1'".($displayprofile ? " selected" : "").">"._YES."</option> |
|
| 395 |
- <option value='0'".(!$displayprofile ? " selected" : "").">"._NO."</option> |
|
| 396 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_DISPLAYPROFILE."</span></a></td> |
|
| 397 |
- </tr> |
|
| 398 |
- <tr> |
|
| 399 |
- <td><label for='newdisplayprofile'>"._LINKSTYLE.":</label></td><td><select name='newlinkstyle'> |
|
| 400 |
- <option value='2'".($linkstyle == 2 ? " selected" : "").">"._BOTHLINKSTYLE."</option> |
|
| 401 |
- <option value='1'".($linkstyle == 1 ? " selected" : "").">"._FIRSTLAST."</option> |
|
| 402 |
- <option value='0'".(!$linkstyle ? " selected" : "").">"._NEXTPREV."</option> |
|
| 403 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_LINKSTYLE."</span></a></td> |
|
| 404 |
- </tr> |
|
| 405 |
- <tr> |
|
| 406 |
- <td><label for='newlinkrange'>"._LINKRANGE.":</label></td><td><input type='text' class='textbox=' name='newlinkrange' size='3' value='$linkrange'> <a href='#' class='pophelp'>[?]<span>"._HELP_LINKRANGE."</span></a></td></tr>"; |
|
| 407 |
- } |
|
| 408 |
- else if($sect == "reviews") {
|
|
| 409 |
- $output .= "<h2>"._REVIEWSETTINGS."</h2> |
|
| 410 |
- <table class='acp'> |
|
| 411 |
- <tr> |
|
| 412 |
- <td><label for='newreviewsallowed'>"._ONREVIEWS.":</label></td><td><select name='newreviewsallowed'> |
|
| 413 |
- <option value='1'".($reviewsallowed == "1" ? " selected" : "").">"._YES."</option> |
|
| 414 |
- <option value='0'".($reviewsallowed == "0" ? " selected" : "").">"._NO."</option> |
|
| 415 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_REVIEWSON."</span></a></td> |
|
| 416 |
- </tr> |
|
| 417 |
- <tr> |
|
| 418 |
- <td><label for='newanonreviews'>"._ANONREVIEWS.":</label></td><td><select name='newanonreviews'> |
|
| 419 |
- <option value='1'".($anonreviews == "1" ? " selected" : "").">"._YES."</option> |
|
| 420 |
- <option value='0'".($anonreviews == "0" ? " selected" : "").">"._NO."</option> |
|
| 421 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_ANONREVIEWS."</span></a></td> |
|
| 422 |
- </tr> |
|
| 423 |
- <tr> |
|
| 424 |
- <td><label for='newrevdelete'>"._REVDELETE.":</label></td><td><select name='newrevdelete'> |
|
| 425 |
- <option value='2'".($revdelete == 2 ? " selected" : "").">"._ALLREV."</option> |
|
| 426 |
- <option value='1'".($revdelete == 1 ? " selected" : "").">"._ANONREV."</option> |
|
| 427 |
- <option value='0'".(empty($revdelete) ? " selected" : "").">"._NONE."</option> |
|
| 428 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_REVDELETE."</span></a></td> |
|
| 429 |
- </tr> |
|
| 430 |
- <tr> |
|
| 431 |
- <td><label for='newratings'>"._WHATRATINGS.":</label></td><td><select name='newratings'> |
|
| 432 |
- <option value='2'".($ratings == "2" ? " selected" : "").">"._LIKESYS."</option> |
|
| 433 |
- <option value='1'".($ratings == "1" ? " selected" : "").">"._STARS."</option> |
|
| 434 |
- <option value='0'".($ratings == "0" ? " selected" : "").">"._NONE."</option> |
|
| 435 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_RATINGS."</span></a></td> |
|
| 436 |
- </tr> |
|
| 437 |
- <tr> |
|
| 438 |
- <td><label for='newrateonly'>"._ALLOWRATEONLY.":</label></td><td><select name='newrateonly'> |
|
| 439 |
- <option value='1'".($rateonly == "1" ? " selected" : "").">"._YES."</option> |
|
| 440 |
- <option value='0'".($rateonly == "0" ? " selected" : "").">"._NO."</option> |
|
| 441 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_RATEONLY."</span></a></td></tr>"; |
|
| 442 |
- } |
|
| 443 |
- else if($sect == "useropts") {
|
|
| 444 |
- $output .= "<h2>"._USERSETTINGS."</h2> |
|
| 445 |
- <table class='acp'> |
|
| 446 |
- <tr> |
|
| 447 |
- <td><label for='newalertson'>"._ALERTSON.":</label></td><td><select name='newalertson'> |
|
| 448 |
- <option value='1'".($alertson == "1" ? " selected" : "").">"._YES."</option> |
|
| 449 |
- <option value='0'".($alertson == "0" ? " selected" : "").">"._NO."</option> |
|
| 450 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_ALERTSON."</span></a></td> |
|
| 451 |
- </tr> |
|
| 452 |
- <tr> |
|
| 453 |
- <td><label for='newdisablepops'>"._USERPOPS.":</label></td><td><select name='newdisablepops'> |
|
| 454 |
- <option value='1'".($disablepopups ? " selected" : "").">"._YES."</option> |
|
| 455 |
- <option value='0'".(!$disablepopups ? " selected" : "").">"._NO."</option> |
|
| 456 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_POPUPS."</span></a></td> |
|
| 457 |
- </tr> |
|
| 458 |
- <tr> |
|
| 459 |
- <td><label for='newagestatement'>"._AGESTATEMENT.":</label></td><td><select name='newagestatement'> |
|
| 460 |
- <option value='1'".($agestatement ? " selected" : "").">"._YES."</option> |
|
| 461 |
- <option value='0'".(!$agestatement ? " selected" : "").">"._NO."</option> |
|
| 462 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_AGECONSENT."</span></a></td> |
|
| 463 |
- </tr> |
|
| 464 |
- <tr> |
|
| 465 |
- <td><label for='newpwdsetting'>"._PWDSETTING.":</label></td><td><select name='newpwdsetting'> |
|
| 466 |
- <option value='1'".($pwdsetting ? " selected" : "").">"._SELF."</option> |
|
| 467 |
- <option value='0'".(!$pwdsetting ? " selected" : "").">"._RANDOM."</option> |
|
| 468 |
- </select> <a href='#' class='pophelp'>[?]<span>"._HELP_PWD."</span></a></td></tr>"; |
|
| 469 |
- } |
|
| 470 |
- else if($sect == "email") {
|
|
| 471 |
- $output .= "<h2>"._EMAILSETTINGS."</h2> |
|
| 472 |
- <table class='acp'> |
|
| 473 |
- <tr> |
|
| 474 |
- <td><label for='newsmtp_host'>"._SMTPHOST.":</label></td><td><input name='newsmtp_host' type='text' value='$smtp_host'> <a href='#' class='pophelp'>[?]<span>"._HELP_SMTPHOST."</span></a></td> |
|
| 475 |
- </tr> |
|
| 476 |
- <tr> |
|
| 477 |
- <td><label for='newsmtp_username'>"._SMTPUSER.":</label></td><td><input name='newsmtp_username' type='text' value='$smtp_username'> <a href='#' class='pophelp'>[?]<span>"._HELP_SMTPUSER."</span></a></td> |
|
| 478 |
- </tr> |
|
| 479 |
- <tr> |
|
| 480 |
- <td><label for='newsmtp_password'>"._SMTPPASS.":</label></td><td><input name='newsmtp_password' type='password' value='$smtp_password'> <a href='#' class='pophelp'>[?]<span>"._HELP_SMTPPWD."</span></a></td></tr>"; |
|
| 481 |
- $output .= write_message(_SMTPOFF); |
|
| 482 |
- } |
|
| 483 |
- $output .= "<tr><td colspan='2'><div align='center'><input type='submit' id='submit' class='button' name='submit' value='"._SUBMIT."'></div></form></td></tr></table>"; |
|
| 1 |
+<?php |
|
| 2 |
+// ---------------------------------------------------------------------- |
|
| 3 |
+// eFiction 3.2 |
|
| 4 |
+// Copyright (c) 2007 by Tammy Keefer |
|
| 5 |
+// Valid HTML 4.01 Transitional |
|
| 6 |
+// Based on eFiction 1.1 |
|
| 7 |
+// Copyright (C) 2003 by Rebecca Smallwood. |
|
| 8 |
+// http://efiction.sourceforge.net/ |
|
| 9 |
+// ---------------------------------------------------------------------- |
|
| 10 |
+// LICENSE |
|
| 11 |
+// |
|
| 12 |
+// This program is free software; you can redistribute it and/or |
|
| 13 |
+// modify it under the terms of the GNU General Public License (GPL) |
|
| 14 |
+// as published by the Free Software Foundation; either version 2 |
|
| 15 |
+// of the License, or (at your option) any later version. |
|
| 16 |
+// |
|
| 17 |
+// This program is distributed in the hope that it will be useful, |
|
| 18 |
+// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 19 |
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 20 |
+// GNU General Public License for more details. |
|
| 21 |
+// |
|
| 22 |
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html |
|
| 23 |
+// ---------------------------------------------------------------------- |
|
| 24 |
+ |
|
| 25 |
+if(!defined("_CHARSET")) exit( );
|
|
| 26 |
+ |
|
| 27 |
+function updatePanelOrder( ) {
|
|
| 28 |
+ |
|
| 29 |
+ $ptypes = dbquery("SELECT panel_type FROM ".TABLEPREFIX."fanfiction_panels GROUP BY panel_type");
|
|
| 30 |
+ while($ptype = dbassoc($ptypes)) {
|
|
| 31 |
+ if($ptype['panel_type'] == "A") {
|
|
| 32 |
+ for($x = 1; $x < 5; $x++) {
|
|
| 33 |
+ $count = 1; |
|
| 34 |
+ $plist = dbquery("SELECT panel_name, panel_id FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_hidden = '0' AND panel_type = '".$ptype['panel_type']."' AND panel_level = '$x' ORDER BY panel_level, panel_order");
|
|
| 35 |
+ while($p = dbassoc($plist)) {
|
|
| 36 |
+ dbquery("UPDATE ".TABLEPREFIX."fanfiction_panels SET panel_order = '$count' WHERE panel_id = '".$p['panel_id']."' LIMIT 1");
|
|
| 37 |
+ $count++; |
|
| 38 |
+ } |
|
| 39 |
+ } |
|
| 40 |
+ } |
|
| 41 |
+ else {
|
|
| 42 |
+ $count = 1; |
|
| 43 |
+ $plist = dbquery("SELECT panel_name, panel_id FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_hidden = '0' AND panel_type = '".$ptype['panel_type']."' ORDER BY ".($ptype['panel_type'] == "A" ? "panel_level," : "")."panel_order");
|
|
| 44 |
+ while($p = dbassoc($plist)) {
|
|
| 45 |
+ dbquery("UPDATE ".TABLEPREFIX."fanfiction_panels SET panel_order = '$count' WHERE panel_id = '".$p['panel_id']."' LIMIT 1");
|
|
| 46 |
+ $count++; |
|
| 47 |
+ } |
|
| 48 |
+ } |
|
| 49 |
+ } |
|
| 50 |
+} |
|
| 51 |
+ |
|
| 52 |
+if($action == "settings") {
|
|
| 53 |
+$output .= "<h1>"._SETTINGS."</h1><div style='text-align: center;'> |
|
| 54 |
+ <a href='admin.php?action=settings&sect=main'>"._MAINSETTINGS."</a> | |
|
| 55 |
+ <a href='admin.php?action=settings&sect=submissions'>"._SUBMISSIONSETTINGS."</a> | |
|
| 56 |
+ <a href='admin.php?action=settings&sect=sitesettings'>"._SITESETTINGS."</a> | |
|
| 57 |
+ <a href='admin.php?action=settings&sect=display'>"._DISPLAYSETTINGS."</a> | |
|
| 58 |
+ <a href='admin.php?action=settings&sect=reviews'>"._REVIEWSETTINGS."</a> | |
|
| 59 |
+ <a href='admin.php?action=settings&sect=useropts'>"._USERSETTINGS."</a> | |
|
| 60 |
+ <a href='admin.php?action=settings&sect=email'>"._EMAILSETTINGS."</a> | |
|
| 61 |
+ <a href='admin.php?action=censor'>"._CENSOR."</a> <br /> |
|
| 62 |
+ <a href='admin.php?action=messages&message=welcome'>"._WELCOME."</a> | |
|
| 63 |
+ <a href='admin.php?action=messages&message=copyright'>"._COPYRIGHT."</a> | |
|
| 64 |
+ <a href='admin.php?action=messages&message=printercopyright'>"._PRINTERCOPYRIGHT."</a> | |
|
| 65 |
+ <a href='admin.php?action=messages&message=tinyMCE'>"._TINYMCE."</a> | |
|
| 66 |
+ <a href='admin.php?action=messages&message=nothankyou'>"._NOTHANKYOU."</a> | |
|
| 67 |
+ <a href='admin.php?action=messages&message=thankyou'>"._THANKYOU."</a><br />"; |
|
| 68 |
+ $settingsquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_type = 'AS' ORDER BY panel_title");
|
|
| 69 |
+ while($os = dbassoc($settingsquery)) {
|
|
| 70 |
+ if($os['panel_url']) $othersettings[] = "<a href='".$os['panel_url']."'>".$os['panel_title']."</a>"; |
|
| 71 |
+ } |
|
| 72 |
+ if(isset($othersettings)) $output .= implode(" | ", $othersettings);
|
|
| 73 |
+$output .= "</div> "; |
|
| 74 |
+} |
|
| 75 |
+ |
|
| 76 |
+$sects = array("main", "submissions", "sitesettings", "display", "reviews", "useropts", "email");
|
|
| 77 |
+//if(!isset($_GET['sect'])) $sect = "main"; |
|
| 78 |
+//else $sect = $_GET['sect']; |
|
| 79 |
+$sect = isset($_GET['sect']) ? $_GET['sect'] : "main"; |
|
| 80 |
+if(isset($_POST['submit'])) {
|
|
| 81 |
+ if($sect == "main") {
|
|
| 82 |
+ if(!preg_match("!^[a-z0-9_]{3,30}$!i", $_POST['newsitekey'])) $output .= write_error(_BADSITEKEY);
|
|
| 83 |
+ else {
|
|
| 84 |
+ $oldsitekey = $sitekey; |
|
| 85 |
+ $sitekey = descript($_POST['newsitekey']); |
|
| 86 |
+ $sitename = escapestring(descript(strip_tags($_POST['newsitename']))); |
|
| 87 |
+ $slogan = escapestring(descript(strip_tags($_POST['newslogan']))); |
|
| 88 |
+ $url = escapestring(descript(strip_tags($_POST['newsiteurl']))); |
|
| 89 |
+ // if the http:// is missing add it. |
|
| 90 |
+ if(substr($url, 0, 7) != "http://") $url = "http://".$url; |
|
| 91 |
+ // we also want to check for a trailing slash. |
|
| 92 |
+ if(substr($url, -1, 1) == "/") $url = substr($url, 0, strlen($url) - 1); |
|
| 93 |
+ $tableprefix = escapestring(descript(strip_tags($_POST['newtableprefix']))); |
|
| 94 |
+ $siteemail = escapestring(descript(strip_tags($_POST['newsiteemail']))); |
|
| 95 |
+ $skin = escapestring(descript(strip_tags($_POST['newskin']))); |
|
| 96 |
+ $language = escapestring(descript(strip_tags($_POST['newlanguage']))); |
|
| 97 |
+ if(empty($sitekey)) $output .= write_message(_SITEKEYREQUIRED); |
|
| 98 |
+ else {
|
|
| 99 |
+ if($sitekey != $oldsitekey) $output .= write_message(_SITEKEYCHANGED); |
|
| 100 |
+ $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET sitekey = '$sitekey', sitename = '$sitename', slogan = '$slogan', url = '$url', tableprefix = '$tableprefix', siteemail = '$siteemail', skin = '$skin', language = '$language' WHERE sitekey = '$oldsitekey'");
|
|
| 101 |
+ } |
|
| 102 |
+ } |
|
| 103 |
+ } |
|
| 104 |
+ else if($sect == "submissions") {
|
|
| 105 |
+ $submissionsoff = $_POST['newsubmissionsoff'] == 1 ? 1 : 0; |
|
| 106 |
+ $autovalidate = $_POST['newautovalidate'] == 1 ? 1 : 0; |
|
| 107 |
+ $coauthallowed = $_POST['newcoauthallowed'] == 1 ? 1 : 0; |
|
| 108 |
+ $store = !empty($_POST['newstore']) ? $_POST['newstore'] == "files" ? "files" : "mysql" : $store; |
|
| 109 |
+ $storiespath = descript($_POST['newstoriespath']); |
|
| 110 |
+ $minwords = isNumber($_POST['newminwords']) ? $_POST['newminwords'] : 0; |
|
| 111 |
+ $maxwords = isNumber($_POST['newmaxwords']) ? $_POST['newmaxwords'] : 0; |
|
| 112 |
+ $roundrobins = $_POST['newroundrobins'] == 1 ? 1 : 0; |
|
| 113 |
+ $allowseries = $_POST['newallowseries'] && isNumber($_POST['newallowseries']) ? $_POST['newallowseries'] : 0; |
|
| 114 |
+ $imageupload = $_POST['newimageupload'] == 1 ? 1 : 0; |
|
| 115 |
+ $imageheight = isNumber($_POST['newimageheight']) ? $_POST['newimageheight'] : 0; |
|
| 116 |
+ $imagewidth = isNumber($_POST['newimagewidth']) ? $_POST['newimagewidth'] : 0; |
|
| 117 |
+ $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET submissionsoff = '$submissionsoff', autovalidate = '$autovalidate', coauthallowed = '$coauthallowed', store = '$store', storiespath = '$storiespath', minwords = '$minwords', maxwords = '$maxwords', imageupload = '$imageupload', imageheight = '$imageheight', imagewidth = '$imagewidth', roundrobins = '$roundrobins', allowseries = '$allowseries' WHERE sitekey ='".SITEKEY."'");
|
|
| 118 |
+ if($action == "settings") {
|
|
| 119 |
+ dbquery("UPDATE ".TABLEPREFIX."fanfiction_panels SET panel_hidden = '".($imageupload ? "0" : "1")."' WHERE panel_name LIKE 'manageimages'");
|
|
| 120 |
+ dbquery("UPDATE ".TABLEPREFIX."fanfiction_panels SET panel_hidden = '".($allowseries ? "0" : "1")."' WHERE (panel_name LIKE '%series%' OR panel_title LIKE '%series%') AND panel_type != 'A' AND panel_type != 'B'");
|
|
| 121 |
+ updatePanelOrder( ); |
|
| 122 |
+ } |
|
| 123 |
+ |
|
| 124 |
+ } |
|
| 125 |
+ else if($sect == "sitesettings") {
|
|
| 126 |
+ $tinyMCE = $_POST['newtinyMCE'] == 1 ? 1 : 0; |
|
| 127 |
+ $allowed_tags = $_POST['newallowed_tags']; |
|
| 128 |
+ $favorites = $_POST['newfavorites'] == 1 ? 1 : 0; |
|
| 129 |
+ $multiplecats = $_POST['newmultiplecats'] == 1 ? 1 : 0; |
|
| 130 |
+ $newscomments = $_POST['newnewscomments'] == 1 ? 1 : 0; |
|
| 131 |
+ $logging = $_POST['newlogging'] == 1 ? 1 : 0; |
|
| 132 |
+ $maintenance = $_POST['newmaint'] == 1 ? 1 : 0; |
|
| 133 |
+ $debug = $_POST['newdebug'] == 1 ? 1 : 0; |
|
| 134 |
+ $captcha = $_POST['newcaptcha'] == 1 ? 1 : 0; |
|
| 135 |
+ $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET tinyMCE = '$tinyMCE', favorites = '$favorites', multiplecats = '$multiplecats', allowed_tags = '$allowed_tags', newscomments = '$newscomments', logging = '$logging', maintenance = '$maintenance', debug = '$debug', captcha = '$captcha' WHERE sitekey ='".SITEKEY."'");
|
|
| 136 |
+ } |
|
| 137 |
+ else if($sect == "display") {
|
|
| 138 |
+ $dateformat = $_POST['newdateformat'] ? descript(strip_tags($_POST['newdateformat'])) : descript(strip_tags($_POST['customdateformat'])); |
|
| 139 |
+ $timeformat = $_POST['newtimeformat'] ? descript(strip_tags($_POST['newtimeformat'])) : descript(strip_tags($_POST['customtimeformat'])); |
|
| 140 |
+ $extendcats = $_POST['newextendcats'] == 1 ? 1 : 0; |
|
| 141 |
+ if(isset($_POST['newdisplaycolumns']) && isNumber($_POST['newdisplaycolumns'])) $displaycolumns = $_POST['newdisplaycolumns']; |
|
| 142 |
+ if(isset($_POST['newitemsperpage']) && isNumber($_POST['newitemsperpage'])) $itemsperpage = $_POST['newitemsperpage']; |
|
| 143 |
+ if(isset($_POST['newlinkstyle']) && isNumber($_POST['newlinkstyle'])) $linkstyle = $_POST['newlinkstyle']; |
|
| 144 |
+ if(isset($_POST['newlinkrange']) && isNumber($_POST['newlinkrange'])) $linkrange = $_POST['newlinkrange']; |
|
| 145 |
+ $displayindex = $_POST['newstoryindex'] == 1 ? 1 : 0; |
|
| 146 |
+ $displayprofile = $_POST['newdisplayprofile'] == 1 ? 1 : 0; |
|
| 147 |
+ $defaultsort = $_POST['newdefaultsort'] == 1 ? 1 : 0; |
|
| 148 |
+ if(isNumber($_POST['newrecentdays'])) $recentdays = $_POST['newrecentdays']; |
|
| 149 |
+ $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET dateformat = '$dateformat', timeformat = '$timeformat', extendcats = '$extendcats', displaycolumns = '$displaycolumns', itemsperpage = '$itemsperpage', displayindex = '$displayindex', defaultsort = '$defaultsort', recentdays = '$recentdays', displayprofile = '$displayprofile', linkstyle = '$linkstyle', linkrange = '$linkrange' WHERE sitekey ='".SITEKEY."'");
|
|
| 150 |
+ } |
|
| 151 |
+ else if($sect == "reviews") {
|
|
| 152 |
+ $reviewsallowed = $_POST['newreviewsallowed'] == 1 ? 1 : 0; |
|
| 153 |
+ $anonreviews = $_POST['newanonreviews'] == 1 ? 1 : 0; |
|
| 154 |
+ $rateonly = $_POST['newrateonly'] == 1 ? 1 : 0; |
|
| 155 |
+ $ratings = isset($_POST['newratings']) && isNumber($_POST['newratings']) ? $_POST['newratings'] : 0; |
|
| 156 |
+ $revdelete = isset($_POST['newrevdelete']) && isNumber($_POST['newrevdelete']) ? $_POST['newrevdelete'] : 0; |
|
| 157 |
+ $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET reviewsallowed = '$reviewsallowed', anonreviews = '$anonreviews', rateonly = '$rateonly', ratings = '$ratings', revdelete = '$revdelete' WHERE sitekey ='".SITEKEY."'");
|
|
| 158 |
+ } |
|
| 159 |
+ else if($sect == "useropts") {
|
|
| 160 |
+ $alertson = $_POST['newalertson'] == 1 ? 1 : 0; |
|
| 161 |
+ $disablepopups = $_POST['newdisablepops'] == 1 ? 1 : 0; |
|
| 162 |
+ $agestatement = $_POST['newagestatement'] == 1 ? 1 : 0; |
|
| 163 |
+ $pwdsetting = $_POST['newpwdsetting'] == 1 ? 1 : 0; |
|
| 164 |
+ $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET alertson = '$alertson', disablepopups = '$disablepopups', agestatement = '$agestatement', pwdsetting = '$pwdsetting' WHERE sitekey ='".SITEKEY."'");
|
|
| 165 |
+ } |
|
| 166 |
+ else if($sect == "email") {
|
|
| 167 |
+ $smtp_host = $_POST['newsmtp_host']; |
|
| 168 |
+ $smtp_username = $_POST['newsmtp_username']; |
|
| 169 |
+ $smtp_password = $_POST['newsmtp_password']; |
|
| 170 |
+ $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET smtp_host = '$smtp_host', smtp_username = '$smtp_username', smtp_password = '$smtp_password' WHERE sitekey ='".SITEKEY."'");
|
|
| 171 |
+ } |
|
| 172 |
+ if($result) {
|
|
| 173 |
+ $output .= write_message(_ACTIONSUCCESSFUL); |
|
| 174 |
+ $sect = $sects[(array_search($sect, $sects) + 1)]; |
|
| 175 |
+ if(!$sect) $sect = $sects[0]; |
|
| 176 |
+ } |
|
| 177 |
+ else $output .= write_error(_ERROR); |
|
| 178 |
+} |
|
| 179 |
+ $settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey ='".SITEKEY."'");
|
|
| 180 |
+ $settings = dbassoc($settingsresults); |
|
| 181 |
+ |
|
| 182 |
+ foreach($settings as $var => $val) {
|
|
| 183 |
+ if(is_NULL($val)) $val = ''; |
|
| 184 |
+ $$var = stripslashes($val ); |
|
| 185 |
+ } |
|
| 186 |
+ |
|
| 187 |
+ $output .= "<form method='POST' class='tblborder' style='' enctype='multipart/form-data' action='".($action == "settings" ? "admin.php?action=settings" : $_SERVER['PHP_SELF']."?step=".$_GET['step'])."&sect=$sect'>"; |
|
| 188 |
+ if($sect == "main") {
|
|
| 189 |
+ $output .= "<h2>"._SITEINFO."</h2> |
|
| 190 |
+ <table class='acp'> |
|
| 191 |
+ <tr> |
|
| 192 |
+ <td><label for='newsitekey'>"._SITEKEY.":</label></td><td><input type='text' class='textbox' name='newsitekey' value='".SITEKEY."'> <a href='#' class='pophelp'>[?]<span>"._HELP_SITEKEY."</span></a></td> |
|
| 193 |
+ </tr> |
|
| 194 |
+ <tr> |
|
| 195 |
+ <td><label for='newsitename'>"._SITENAME.":</label></td><td><input type='text' class='textbox' name='newsitename' value='".htmlspecialchars($sitename, ENT_QUOTES)."'> <a href='#' class='pophelp'>[?]<span>"._HELP_SITENAME."</span></a></td> |
|
| 196 |
+ </tr> |
|
| 197 |
+ <tr> |
|
| 198 |
+ <td><label for='newslogan'>"._SITESLOGAN.":</label></td><td><input type='text' class='textbox' name='newslogan' value='".htmlspecialchars($slogan, ENT_QUOTES)."'> <a href='#' class='pophelp'>[?]<span>"._HELP_SLOGAN."</span></a></td> |
|
| 199 |
+ </tr> |
|
| 200 |
+ <tr> |
|
| 201 |
+ <td><label for='newurl'>"._SITEURL.":</label></td><td><input type='text' class='textbox' name='newsiteurl' value='$url'> <a href='#' class='pophelp'>[?]<span>"._HELP_URL."</span></a></td> |
|
| 202 |
+ </tr> |
|
| 203 |
+ <tr> |
|
| 204 |
+ <td><label for='newtableprefix'>"._TABLEPREFIX.":</label></td><td><input type='text' class='textbox' name='newtableprefix' value='".TABLEPREFIX."'> <a href='#' class='pophelp'>[?]<span>"._HELP_TABLEPREFIX."</span></a></td> |
|
| 205 |
+ </tr> |
|
| 206 |
+ <tr> |
|
| 207 |
+ <td><label for='newsiteemail'>"._ADMINEMAIL.":</label></td><td><input type='text' class='textbox' name='newsiteemail' value='$siteemail'> <a href='#' class='pophelp'>[?]<span>"._HELP_SITEEMAIL."</span></a></td> |
|
| 208 |
+ </tr> |
|
| 209 |
+ <tr> |
|
| 210 |
+ <td><label for='newsiteskin'>"._DEFAULTSKIN.":</label></td><td><select name='newskin'>"; |
|
| 211 |
+ $directory = opendir(_BASEDIR."skins"); |
|
| 212 |
+ while($filename = readdir($directory)) {
|
|
| 213 |
+ if($filename=="." || $filename==".." || !is_dir(_BASEDIR."skins/".$filename)) continue; |
|
| 214 |
+ $output .= "<option value='$filename'".($skin == $filename ? " selected" : "").">$filename</option>"; |
|
| 215 |
+ } |
|
| 216 |
+ closedir($directory); |
|
| 217 |
+ $output .= "</select> <a href='#' class='pophelp'>[?]<span>"._HELP_SITESKIN."</span></a></td> |
|
| 218 |
+ </tr> |
|
| 219 |
+ <tr> |
|
| 220 |
+ <td><label for='newlanguage'>"._LANGUAGE.":</label></td><td><select name='newlanguage'>"; |
|
| 221 |
+ $directory = opendir(_BASEDIR."languages"); |
|
| 222 |
+ while($filename = readdir($directory)) {
|
|
| 223 |
+ if($filename=="." || $filename==".." || substr($filename, 2) == "_admin.php") continue; |
|
| 224 |
+ $output .= "<option value='".substr($filename, 0, 2)."'". |
|
| 225 |
+ ($language == substr($filename, 0, strpos($filename, ".php")) ? " selected" : "")."> |
|
| 226 |
+ ".substr($filename, 0, strpos($filename, ".php"))."</option>"; |
|
| 227 |
+ } |
|
| 228 |
+ closedir($directory); |
|
| 229 |
+ $output .= "</select> <a href='#' class='pophelp'>[?]<span>"._HELP_LANGUAGE."</span></a></td></tr>"; |
|
| 230 |
+ } |
|
| 231 |
+ else if($sect == "submissions") {
|
|
| 232 |
+ $output .= "<h2>"._SUBMISSIONSETTINGS."</h2> |
|
| 233 |
+ <table class='acp'> |
|
| 234 |
+ <tr> |
|
| 235 |
+ <td><label for='newsubmissionsoff'>"._NOSUBS.":</label></td><td><select name='newsubmissionsoff'> |
|
| 236 |
+ <option value='1'".($submissionsoff == "1" ? " selected" : "").">"._YES."</option> |
|
| 237 |
+ <option value='0'".($submissionsoff == "0" ? " selected" : "").">"._NO."</option> |
|
| 238 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_SUBSOFF."</span></a></td> |
|
| 239 |
+ </tr> |
|
| 240 |
+ <tr> |
|
| 241 |
+ <td><label for='newautovalidate'>"._AUTOVALIDATE.":</label></td><td><select name='newautovalidate'> |
|
| 242 |
+ <option value='1'".($autovalidate == "1" ? "selected" : "").">"._YES."</option> |
|
| 243 |
+ <option value='0'".($autovalidate == "0" ? "selected" : "").">"._NO."</option> |
|
| 244 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_AUTOVALIDATE."</span></a></td> |
|
| 245 |
+ </tr> |
|
| 246 |
+ <tr> |
|
| 247 |
+ <td><label for='newcoauthallowed'>"._COAUTHALLOW.":</label></td><td><select name='newcoauthallowed'> |
|
| 248 |
+ <option value='1'".($coauthallowed == "1" ? "selected" : "").">"._YES."</option> |
|
| 249 |
+ <option value='0'".($coauthallowed == "0" ? "selected" : "").">"._NO."</option> |
|
| 250 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_COAUTHORS."</span></a></td> |
|
| 251 |
+ </tr> |
|
| 252 |
+ <tr> |
|
| 253 |
+ <td><label for='newroundrobins'>"._ALLOWRR.":</label></td><td><select name='newroundrobins'> |
|
| 254 |
+ <option value='1'".($roundrobins == "1" ? " selected" : "").">"._YES."</option> |
|
| 255 |
+ <option value='0'".($roundrobins == "0" ? " selected" : "").">"._NO."</option> |
|
| 256 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_ROUNDROBINS."</span></a></td> |
|
| 257 |
+ </tr> |
|
| 258 |
+ <tr> |
|
| 259 |
+ <td><label for='newallowseries'>"._ALLOWSERIES.":</label></td><td><select name='newallowseries'> |
|
| 260 |
+ <option value='2'".($allowseries == "2" ? " selected" : "").">"._ALLMEMBERS."</option> |
|
| 261 |
+ <option value='1'".($allowseries == "1" ? " selected" : "").">"._AUTHORSONLY."</option> |
|
| 262 |
+ <option value='0'".($allowseries == "0" ? " selected" : "").">"._ADMINS."</option> |
|
| 263 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_ALLOWSERIES."</span></a></td> |
|
| 264 |
+ </tr> |
|
| 265 |
+ <tr> |
|
| 266 |
+ <td><label for='newimageupload'>"._IMAGEUPLOAD.":</label></td><td><select name='newimageupload'> |
|
| 267 |
+ <option value='1'".($imageupload == "1" ? " selected" : "").">"._YES."</option> |
|
| 268 |
+ <option value='0'".($imageupload == "0" ? " selected" : "").">"._NO."</option> |
|
| 269 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_IMAGEUPLOAD."</span></a></td> |
|
| 270 |
+ </tr> |
|
| 271 |
+ <tr> |
|
| 272 |
+ <td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._IMAGESIZE." <a href='#' class='pophelp'>[?]<span>"._HELP_IMAGESIZE."</span></a></legend> |
|
| 273 |
+ <label for='newimageheight'>"._MAXHEIGHT.":</label> <input type='text' class='textbox=' name='newimageheight' value='$imageheight' size='5'> <br /> |
|
| 274 |
+ <label for='newimagewidth'>"._MAXWIDTH.":</label> <input type='text' class='textbox=' name='newimagewidth' value='$imagewidth' size='5'></fieldset></td> |
|
| 275 |
+ </tr> |
|
| 276 |
+ <tr> |
|
| 277 |
+ <td><label for='newstore'>"._HOWSTORE.":</label></td><td><select name='newstore' onChange='if (this.disabled) this.selectedIndex=0' disabled> |
|
| 278 |
+ <option value='files'".($store == "files" || !$store ? " selected" : "").">"._FILES."</option> |
|
| 279 |
+ <option value='mysql'".($store == "mysql" ? " selected" : "").">"._MYSQL."</option> |
|
| 280 |
+ </select> <input class='textbox=' type='checkbox' class='checkbox' name='r1' onClick='this.form.newstore.disabled=false' checked> <a href='#' class='pophelp'>[?]<span>"._HELP_STORE."</span></a></td> |
|
| 281 |
+ </tr> |
|
| 282 |
+ <tr> |
|
| 283 |
+ <td><label for='newstoriespath'>"._STORIESPATH.":</label></td><td><input type='text' class='textbox=' name='newstoriespath' value='$storiespath'> <a href='#' class='pophelp'>[?]<span>"._HELP_STORIESPATH."</span></a></td> |
|
| 284 |
+ </tr> |
|
| 285 |
+ <tr> |
|
| 286 |
+ <td colspan='2'><fieldset style='margin: 0 auto;'><legend>"._MAXMINWORDS."<a href='#' class='pophelp'>[?]<span>"._HELP_MINMAXWORDS."</span></a></legend> |
|
| 287 |
+ <label for='newminwords'>"._MIN.":</label> <input type='text' class='textbox=' name='newminwords' value='$minwords' size='5'> <br /> |
|
| 288 |
+ <label for='newmaxwords'>"._MAX.":</label> <input type='text' class='textbox=' name='newmaxwords' value='$maxwords' size='7'></fieldset></td></tr>"; |
|
| 289 |
+ } |
|
| 290 |
+ else if($sect == "sitesettings") {
|
|
| 291 |
+ $output .= "<h2>"._SITESETTINGS."</h2> |
|
| 292 |
+ <table class='acp'> |
|
| 293 |
+ <tr> |
|
| 294 |
+ <td><label for='newtinyMCE'>"._USETINYMCE.": </label></td><td><select name='newtinyMCE'> |
|
| 295 |
+ <option value='1'".($tinyMCE ? " selected" : "").">"._YES."</option> |
|
| 296 |
+ <option value='0'".(!$tinyMCE ? " selected" : "").">"._NO."</option> |
|
| 297 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_TINYMCE." "._TINYMCENOTE."</span></a></td> |
|
| 298 |
+ </tr> |
|
| 299 |
+ <tr> |
|
| 300 |
+ <td><label for='newallowed_tags'>"._TAGS.": </label></td><td><input type='text' class='textbox' name='newallowed_tags' value='".($allowed_tags ? $allowed_tags : "<strong><em><br /><br><blockquote><strike><font><b><i><u><center><img><a><hr><p><ul><li><ol>")."' size='40'> <a href='#' class='pophelp'>[?]<span>"._HELP_ALLOWEDTAGS." "._TINYMCENOTE."</span></a></td> |
|
| 301 |
+ </tr> |
|
| 302 |
+ <tr> |
|
| 303 |
+ <td><label for='newfavorites'>"._FAVORITES.": </label></td><td><select name='newfavorites'> |
|
| 304 |
+ <option value='1'".($favorites == "1" ? " selected" : "").">"._YES."</option> |
|
| 305 |
+ <option value='0'".($favorites == "0" ? " selected" : "").">"._NO."</option> |
|
| 306 |
+ </select><a href='#' class='pophelp'>[?]<span>"._HELP_FAVORITES."</span></a></td> |
|
| 307 |
+ </tr> |
|
| 308 |
+ <tr> |
|
| 309 |
+ <td><label for='newmultplecats'>"._NUMCATS.": </label></td><td><select name='newmultiplecats'> |
|
| 310 |
+ <option value='1'".($multiplecats == "1" ? "selected" : "").">"._MORETHANONE."</option> |
|
| 311 |
+ <option value='0'".($multiplecats == "0" ? "selected" : "").">"._ONLYONE."</option> |
|
| 312 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_NUMCATS."</span></a></td> |
|
| 313 |
+ </tr> |
|
| 314 |
+ <tr> |
|
| 315 |
+ <td><label for='newnewscomments'>"._NEWSCOMMENTS.": </label></td><td><select name='newnewscomments'> |
|
| 316 |
+ <option value='1'".($newscomments == "1" ? " selected" : "").">"._YES."</option> |
|
| 317 |
+ <option value='0'".($newscomments == "0" ? " selected" : "").">"._NO."</option> |
|
| 318 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_NEWSCOMMENTS."</span></a></td> |
|
| 319 |
+ </tr> |
|
| 320 |
+ <tr> |
|
| 321 |
+ <td><label for='newlogging'>"._LOGGING.": </label></td><td><select name='newlogging'> |
|
| 322 |
+ <option value='1'".($logging == "1" ? " selected" : "").">"._YES."</option> |
|
| 323 |
+ <option value='0'".($logging == "0" ? " selected" : "").">"._NO."</option> |
|
| 324 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_LOGGING."</span></a></td> |
|
| 325 |
+ </tr> |
|
| 326 |
+ <tr> |
|
| 327 |
+ <td><label for='newmaint'>"._MAINTENANCE.": </label></td><td><select name='newmaint'> |
|
| 328 |
+ <option value='1'".($maintenance == "1" ? " selected" : "").">"._YES."</option> |
|
| 329 |
+ <option value='0'".($maintenance == "0" ? " selected" : "").">"._NO."</option> |
|
| 330 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_MAINTENANCE."</span></a></td> |
|
| 331 |
+ </tr> |
|
| 332 |
+ <tr> |
|
| 333 |
+ <td><label for='newdebug'>"._DEBUG.": </label></td><td><select name='newdebug'> |
|
| 334 |
+ <option value='1'".($debug == "1" ? " selected" : "").">"._YES."</option> |
|
| 335 |
+ <option value='0'".(!isset($debug) || $debug == "0" ? " selected" : "").">"._NO."</option> |
|
| 336 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_DEBUG."</span></a></td> |
|
| 337 |
+ </tr> |
|
| 338 |
+ <tr> |
|
| 339 |
+ <td><label for='newcaptcha'>"._CAPTCHA.": </label></td><td><select name='newcaptcha'> |
|
| 340 |
+ <option value='1'".($captcha == "1" ? " selected" : "").">"._YES."</option> |
|
| 341 |
+ <option value='0'".(!isset($captcha) || $captcha == "0" ? " selected" : "").">"._NO."</option> |
|
| 342 |
+ </select><a href='#' class='pophelp'>[?]<span>"._HELP_CAPTCHA."</span></a></td></tr>"; |
|
| 343 |
+ } |
|
| 344 |
+ else if($sect == "display") {
|
|
| 345 |
+ $settings = dbquery("SELECT defaultsort, displayindex FROM ".$settingsprefix."fanfiction_settings WHERE sitekey ='".SITEKEY."'");
|
|
| 346 |
+ list($sitedefaultsort, $sitedisplayindex) = dbrow($settings); |
|
| 347 |
+ $defaultdates = array("m/d/y", "m/d/Y", "m/d/Y", "d/m/Y", "d/m/y", "d M Y",
|
|
| 348 |
+ "d.m.y", "Y.m.d", "m.d.Y", "d-m-y", "m-d-y", "M d Y", "M d, Y", "F d Y", "F d, Y"); |
|
| 349 |
+ $defaulttimes = array("h:i a", "h:i A", "H:i", "g:i a", "g:i A", "G:i", "h:i:s a", "H:i:s", "g:i:s a", "g:i:s A", "G:i:s");
|
|
| 350 |
+ $output .= "<h2>"._DISPLAYSETTINGS."</h2> |
|
| 351 |
+ <table class='acp'> |
|
| 352 |
+ <tr> |
|
| 353 |
+ <td><label for='newdateformat'>"._DATEFORMAT.":</label></td><td><select name='newdateformat'><option value=''>"._SELECTONE."</option>"; |
|
| 354 |
+ foreach($defaultdates as $date) {
|
|
| 355 |
+ $output .= "<option value='$date'>".date("$date")."</option>";
|
|
| 356 |
+ } |
|
| 357 |
+ $output .= "</select> "._OR." <input type='text' name='customdateformat' class='textbox' value='$dateformat'> <a href='#' class='pophelp'>[?]<span>"._HELP_DATEFORMAT."</span></a></td> |
|
| 358 |
+ </tr> |
|
| 359 |
+ <tr> |
|
| 360 |
+ <td><label for='newtimeformat'>"._TIMEFORMAT.":</label></td><td><select name='newtimeformat'><option value=''>"._SELECTONE."</option>"; |
|
| 361 |
+ foreach($defaulttimes as $time) {
|
|
| 362 |
+ $output .= "<option value='$time'>".date("$time")."</option>";
|
|
| 363 |
+ } |
|
| 364 |
+ $output .= " |
|
| 365 |
+ </select> "._OR." <input type='text' name='customtimeformat' class='textbox' value='$timeformat'> <a href='#' class='pophelp'>[?]<span>"._HELP_TIMEFORMAT."</span></a></td> |
|
| 366 |
+ </tr> |
|
| 367 |
+ <tr> |
|
| 368 |
+ <td><label for='newextendcats'>"._EXTENDCATS.":</label></td><td><select name='newextendcats'> |
|
| 369 |
+ <option value='1'".($extendcats == "1" ? " selected" : "").">"._YES."</option> |
|
| 370 |
+ <option value='0'".($extendcats == "0" ? " selected" : "").">"._NO."</option> |
|
| 371 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_EXTENDCATS."</span></a></td> |
|
| 372 |
+ </tr> |
|
| 373 |
+ <tr> |
|
| 374 |
+ <td><label for='newdisplaycolumns'>"._COLUMNS.":</label></td><td><input type='text' class='textbox=' name='newdisplaycolumns' size='3' value='$displaycolumns'> <a href='#' class='pophelp'>[?]<span>"._HELP_COLUMNS."</span></a></td> |
|
| 375 |
+ </tr> |
|
| 376 |
+ <tr> |
|
| 377 |
+ <td><label for='newitemsperpage'>"._NUMITEMS.":</label></td><td><input type='text' class='textbox' name='newitemsperpage' size='3' value='$itemsperpage'> <a href='#' class='pophelp'>[?]<span>"._HELP_ITEMSPERPAGE."</span></a></td> |
|
| 378 |
+ </tr> |
|
| 379 |
+ <tr> |
|
| 380 |
+ <td><label for='newrecentdays'>"._RECENTDAYS.":</label></td><td><input type='text' class='textbox' name='newrecentdays' size='3' value='$recentdays'> <a href='#' class='pophelp'>[?]<span>"._HELP_RECENTDAYS."</span></a></td> |
|
| 381 |
+ </tr> |
|
| 382 |
+ <tr> |
|
| 383 |
+ <td><label for='newdefaultsort'>"._DEFAULTSORT.":</label></td><td><select name='newdefaultsort'> |
|
| 384 |
+ <option value='1'".($sitedefaultsort ? " selected" : "").">"._MOSTRECENT."</option> |
|
| 385 |
+ <option value='0'".(!$sitedefaultsort ? " selected" : "").">"._ALPHA."</option> |
|
| 386 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_DEFAULTSORT."</span></a></td> |
|
| 387 |
+ </tr> |
|
| 388 |
+ <tr> |
|
| 389 |
+ <td><label for='newdisplayindex'>"._STORYINDEX.":</label></td><td><select name='newstoryindex'> |
|
| 390 |
+ <option value='1'".($sitedisplayindex ? " selected" : "").">"._YES."</option> |
|
| 391 |
+ <option value='0'".(!$sitedisplayindex ? " selected" : "").">"._NO."</option> |
|
| 392 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_DISPLAYINDEX."</span></a></td> |
|
| 393 |
+ </tr> |
|
| 394 |
+ <tr> |
|
| 395 |
+ <td><label for='newdisplayprofile'>"._DISPLAYPROFILE.":</label></td><td><select name='newdisplayprofile'> |
|
| 396 |
+ <option value='1'".($displayprofile ? " selected" : "").">"._YES."</option> |
|
| 397 |
+ <option value='0'".(!$displayprofile ? " selected" : "").">"._NO."</option> |
|
| 398 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_DISPLAYPROFILE."</span></a></td> |
|
| 399 |
+ </tr> |
|
| 400 |
+ <tr> |
|
| 401 |
+ <td><label for='newdisplayprofile'>"._LINKSTYLE.":</label></td><td><select name='newlinkstyle'> |
|
| 402 |
+ <option value='2'".($linkstyle == 2 ? " selected" : "").">"._BOTHLINKSTYLE."</option> |
|
| 403 |
+ <option value='1'".($linkstyle == 1 ? " selected" : "").">"._FIRSTLAST."</option> |
|
| 404 |
+ <option value='0'".(!$linkstyle ? " selected" : "").">"._NEXTPREV."</option> |
|
| 405 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_LINKSTYLE."</span></a></td> |
|
| 406 |
+ </tr> |
|
| 407 |
+ <tr> |
|
| 408 |
+ <td><label for='newlinkrange'>"._LINKRANGE.":</label></td><td><input type='text' class='textbox=' name='newlinkrange' size='3' value='$linkrange'> <a href='#' class='pophelp'>[?]<span>"._HELP_LINKRANGE."</span></a></td></tr>"; |
|
| 409 |
+ } |
|
| 410 |
+ else if($sect == "reviews") {
|
|
| 411 |
+ $output .= "<h2>"._REVIEWSETTINGS."</h2> |
|
| 412 |
+ <table class='acp'> |
|
| 413 |
+ <tr> |
|
| 414 |
+ <td><label for='newreviewsallowed'>"._ONREVIEWS.":</label></td><td><select name='newreviewsallowed'> |
|
| 415 |
+ <option value='1'".($reviewsallowed == "1" ? " selected" : "").">"._YES."</option> |
|
| 416 |
+ <option value='0'".($reviewsallowed == "0" ? " selected" : "").">"._NO."</option> |
|
| 417 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_REVIEWSON."</span></a></td> |
|
| 418 |
+ </tr> |
|
| 419 |
+ <tr> |
|
| 420 |
+ <td><label for='newanonreviews'>"._ANONREVIEWS.":</label></td><td><select name='newanonreviews'> |
|
| 421 |
+ <option value='1'".($anonreviews == "1" ? " selected" : "").">"._YES."</option> |
|
| 422 |
+ <option value='0'".($anonreviews == "0" ? " selected" : "").">"._NO."</option> |
|
| 423 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_ANONREVIEWS."</span></a></td> |
|
| 424 |
+ </tr> |
|
| 425 |
+ <tr> |
|
| 426 |
+ <td><label for='newrevdelete'>"._REVDELETE.":</label></td><td><select name='newrevdelete'> |
|
| 427 |
+ <option value='2'".($revdelete == 2 ? " selected" : "").">"._ALLREV."</option> |
|
| 428 |
+ <option value='1'".($revdelete == 1 ? " selected" : "").">"._ANONREV."</option> |
|
| 429 |
+ <option value='0'".(empty($revdelete) ? " selected" : "").">"._NONE."</option> |
|
| 430 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_REVDELETE."</span></a></td> |
|
| 431 |
+ </tr> |
|
| 432 |
+ <tr> |
|
| 433 |
+ <td><label for='newratings'>"._WHATRATINGS.":</label></td><td><select name='newratings'> |
|
| 434 |
+ <option value='2'".($ratings == "2" ? " selected" : "").">"._LIKESYS."</option> |
|
| 435 |
+ <option value='1'".($ratings == "1" ? " selected" : "").">"._STARS."</option> |
|
| 436 |
+ <option value='0'".($ratings == "0" ? " selected" : "").">"._NONE."</option> |
|
| 437 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_RATINGS."</span></a></td> |
|
| 438 |
+ </tr> |
|
| 439 |
+ <tr> |
|
| 440 |
+ <td><label for='newrateonly'>"._ALLOWRATEONLY.":</label></td><td><select name='newrateonly'> |
|
| 441 |
+ <option value='1'".($rateonly == "1" ? " selected" : "").">"._YES."</option> |
|
| 442 |
+ <option value='0'".($rateonly == "0" ? " selected" : "").">"._NO."</option> |
|
| 443 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_RATEONLY."</span></a></td></tr>"; |
|
| 444 |
+ } |
|
| 445 |
+ else if($sect == "useropts") {
|
|
| 446 |
+ $output .= "<h2>"._USERSETTINGS."</h2> |
|
| 447 |
+ <table class='acp'> |
|
| 448 |
+ <tr> |
|
| 449 |
+ <td><label for='newalertson'>"._ALERTSON.":</label></td><td><select name='newalertson'> |
|
| 450 |
+ <option value='1'".($alertson == "1" ? " selected" : "").">"._YES."</option> |
|
| 451 |
+ <option value='0'".($alertson == "0" ? " selected" : "").">"._NO."</option> |
|
| 452 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_ALERTSON."</span></a></td> |
|
| 453 |
+ </tr> |
|
| 454 |
+ <tr> |
|
| 455 |
+ <td><label for='newdisablepops'>"._USERPOPS.":</label></td><td><select name='newdisablepops'> |
|
| 456 |
+ <option value='1'".($disablepopups ? " selected" : "").">"._YES."</option> |
|
| 457 |
+ <option value='0'".(!$disablepopups ? " selected" : "").">"._NO."</option> |
|
| 458 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_POPUPS."</span></a></td> |
|
| 459 |
+ </tr> |
|
| 460 |
+ <tr> |
|
| 461 |
+ <td><label for='newagestatement'>"._AGESTATEMENT.":</label></td><td><select name='newagestatement'> |
|
| 462 |
+ <option value='1'".($agestatement ? " selected" : "").">"._YES."</option> |
|
| 463 |
+ <option value='0'".(!$agestatement ? " selected" : "").">"._NO."</option> |
|
| 464 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_AGECONSENT."</span></a></td> |
|
| 465 |
+ </tr> |
|
| 466 |
+ <tr> |
|
| 467 |
+ <td><label for='newpwdsetting'>"._PWDSETTING.":</label></td><td><select name='newpwdsetting'> |
|
| 468 |
+ <option value='1'".($pwdsetting ? " selected" : "").">"._SELF."</option> |
|
| 469 |
+ <option value='0'".(!$pwdsetting ? " selected" : "").">"._RANDOM."</option> |
|
| 470 |
+ </select> <a href='#' class='pophelp'>[?]<span>"._HELP_PWD."</span></a></td></tr>"; |
|
| 471 |
+ } |
|
| 472 |
+ else if($sect == "email") {
|
|
| 473 |
+ $output .= "<h2>"._EMAILSETTINGS."</h2> |
|
| 474 |
+ <table class='acp'> |
|
| 475 |
+ <tr> |
|
| 476 |
+ <td><label for='newsmtp_host'>"._SMTPHOST.":</label></td><td><input name='newsmtp_host' type='text' value='$smtp_host'> <a href='#' class='pophelp'>[?]<span>"._HELP_SMTPHOST."</span></a></td> |
|
| 477 |
+ </tr> |
|
| 478 |
+ <tr> |
|
| 479 |
+ <td><label for='newsmtp_username'>"._SMTPUSER.":</label></td><td><input name='newsmtp_username' type='text' value='$smtp_username'> <a href='#' class='pophelp'>[?]<span>"._HELP_SMTPUSER."</span></a></td> |
|
| 480 |
+ </tr> |
|
| 481 |
+ <tr> |
|
| 482 |
+ <td><label for='newsmtp_password'>"._SMTPPASS.":</label></td><td><input name='newsmtp_password' type='password' value='$smtp_password'> <a href='#' class='pophelp'>[?]<span>"._HELP_SMTPPWD."</span></a></td></tr>"; |
|
| 483 |
+ $output .= write_message(_SMTPOFF); |
|
| 484 |
+ } |
|
| 485 |
+ $output .= "<tr><td colspan='2'><div align='center'><input type='submit' id='submit' class='button' name='submit' value='"._SUBMIT."'></div></form></td></tr></table>"; |
|
| 484 | 486 |
?> |
| 485 | 487 |
\ No newline at end of file |
| ... | ... |
@@ -1,451 +1,443 @@ |
| 1 |
-<?php |
|
| 2 |
-// ---------------------------------------------------------------------- |
|
| 3 |
-// Copyright (c) 2007 by Tammy Keefer |
|
| 4 |
-// Based on eFiction 1.1 |
|
| 5 |
-// Copyright (C) 2003 by Rebecca Smallwood. |
|
| 6 |
-// http://efiction.sourceforge.net/ |
|
| 7 |
-// ---------------------------------------------------------------------- |
|
| 8 |
-// LICENSE |
|
| 9 |
-// |
|
| 10 |
-// This program is free software; you can redistribute it and/or |
|
| 11 |
-// modify it under the terms of the GNU General Public License (GPL) |
|
| 12 |
-// as published by the Free Software Foundation; either version 2 |
|
| 13 |
-// of the License, or (at your option) any later version. |
|
| 14 |
-// |
|
| 15 |
-// This program is distributed in the hope that it will be useful, |
|
| 16 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 17 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 18 |
-// GNU General Public License for more details. |
|
| 19 |
-// |
|
| 20 |
-// To read the license please visit http://www.gnu.org/copyleft/gpl.html |
|
| 21 |
-// ---------------------------------------------------------------------- |
|
| 22 |
- |
|
| 23 |
-// Force the argument separator to be standards compliant |
|
| 24 |
-@ ini_set('arg_separator.output','&');
|
|
| 25 |
-if(isset($_GET['debug'])) @ error_reporting(E_ALL); |
|
| 26 |
-if(isset($_GET['benchmark'])) {
|
|
| 27 |
- list($usec, $sec) = explode(" ", microtime());
|
|
| 28 |
- $start = ((float)$usec + (float)$sec); |
|
| 29 |
-} |
|
| 30 |
-$headerSent = false; |
|
| 31 |
-if(get_magic_quotes_gpc()){
|
|
| 32 |
- foreach($_POST as $var => $val) {
|
|
| 33 |
- $_POST[$var] = is_array( $val ) ? array_map( 'stripslashes', $val ) : stripslashes( $val ); |
|
| 34 |
- } |
|
| 35 |
- foreach($_GET as $var => $val) {
|
|
| 36 |
- $_GET[$var] = is_array( $val ) ? array_map( 'stripslashes', $val ) : stripslashes( $val ); |
|
| 37 |
- } |
|
| 38 |
-} |
|
| 39 |
- |
|
| 40 |
-// Defines the character set for your language/location |
|
| 41 |
-define ("_CHARSET", "utf-8");
|
|
| 42 |
- |
|
| 43 |
-// Prevent possible XSS attacks via $_GET. |
|
| 44 |
-foreach ($_GET as $v) {
|
|
| 45 |
- if(preg_match('@<script[^>]*?>.*?</script>@si', $v) ||
|
|
| 46 |
- preg_match("'@<iframe[^>]*?>.*?</script>@si'", $v) ||
|
|
| 47 |
- preg_match("'@<applet[^>]*?>.*?</script>@si'", $v) ||
|
|
| 48 |
- preg_match("'@<meta[^>]*?>.*?</script>@si'", $v) ||
|
|
| 49 |
- preg_match('@<[\/\!]*?[^<>]*?>@si', $v) ||
|
|
| 50 |
- preg_match('@<style[^>]*?>.*?</style>@siU', $v) ||
|
|
| 51 |
- preg_match('@<![\s\S]*?--[ \t\n\r]*>@', $v)) {
|
|
| 52 |
- include("languages/en.php"); // no language set yet, so default to English.
|
|
| 53 |
- die (_POSSIBLEHACK); |
|
| 54 |
- } |
|
| 55 |
-} |
|
| 56 |
-unset($v); |
|
| 57 |
- |
|
| 58 |
-if(!isset($_SESSION)) session_start(); |
|
| 59 |
-// clear the global variables if register globals is on. |
|
| 60 |
-if(ini_get('register_globals')) {
|
|
| 61 |
- $arrayList = array_merge($_SESSION, $_GET, $_POST, $_COOKIE); |
|
| 62 |
- foreach($arrayList as $k => $v) {
|
|
| 63 |
- unset($GLOBALS[$k]); |
|
| 64 |
- } |
|
| 65 |
-} |
|
| 66 |
- |
|
| 67 |
-Header('Cache-Control: private, no-cache, must-revalidate, max_age=0, post-check=0, pre-check=0');
|
|
| 68 |
-header ("Pragma: no-cache");
|
|
| 69 |
-header ("Expires: 0");
|
|
| 70 |
-header("Content-Type: text/html; charset="._CHARSET);
|
|
| 71 |
- |
|
| 72 |
-// Locate config.php and set the basedir path |
|
| 73 |
-$folder_level = ""; |
|
| 74 |
-while (!file_exists($folder_level."header.php")) { $folder_level .= "../"; }
|
|
| 75 |
-if(!defined("_BASEDIR")) define("_BASEDIR", $folder_level);
|
|
| 76 |
- |
|
| 77 |
-@ include_once(_BASEDIR."config.php"); |
|
| 78 |
-if(empty($sitekey)) {
|
|
| 79 |
- header("Location: install/install.php");
|
|
| 80 |
- exit( ); |
|
| 81 |
-} |
|
| 82 |
-if(isset($skin)) $globalskin = $skin; |
|
| 83 |
-$settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".$sitekey."'");
|
|
| 84 |
-$settings = dbassoc($settingsresults); |
|
| 85 |
-if(!defined("SITEKEY")) define("SITEKEY", $settings['sitekey']);
|
|
| 86 |
-unset($settings['sitekey']); |
|
| 87 |
-if(!defined("TABLEPREFIX")) define("TABLEPREFIX", $settings['tableprefix']);
|
|
| 88 |
-unset($settings['tableprefix']); |
|
| 89 |
-define("STORIESPATH", $settings['storiespath']);
|
|
| 90 |
-unset($settings['storiespath']); |
|
| 91 |
-foreach($settings as $var => $val) {
|
|
| 92 |
- $$var = stripslashes($val); |
|
| 93 |
- $settings[$var] = htmlspecialchars($val); |
|
| 94 |
-} |
|
| 95 |
- |
|
| 96 |
-if(isset($_GET['debug'])) $debug = 1; |
|
| 97 |
-if(!$displaycolumns) $displaycolumns = 1; // shouldn't happen, but just in case. |
|
| 98 |
-if($words) $words = explode(", ", $words);
|
|
| 99 |
-else $words = array( ); |
|
| 100 |
-// Fix for sites with 2.0 or 1.1 running as well as 3.0 with register_globals on. |
|
| 101 |
-$defaultskin = $skin; |
|
| 102 |
- |
|
| 103 |
-if(isset($globalskin)) $skin = $globalskin; |
|
| 104 |
- |
|
| 105 |
-if(isset($_GET['action'])) $action = strip_tags($_GET['action']); |
|
| 106 |
-else $action = false; |
|
| 107 |
- |
|
| 108 |
-if(file_exists(_BASEDIR."languages/{$language}.php")) include (_BASEDIR."languages/{$language}.php");
|
|
| 109 |
-else include (_BASEDIR."languages/en.php"); |
|
| 110 |
- |
|
| 111 |
-include_once(_BASEDIR."includes/queries.php"); |
|
| 112 |
-include_once(_BASEDIR."includes/corefunctions.php"); |
|
| 113 |
- |
|
| 114 |
-// Check and/or set some variables used at various points throughout the script |
|
| 115 |
-if(isset($_GET['offset'])) $offset = $_GET['offset']; |
|
| 116 |
-if(!isset($offset) || !isNumber($offset)) $offset = 0; |
|
| 117 |
-if(isset($_REQUEST["sid"])) $sid = $_REQUEST["sid"]; |
|
| 118 |
-if(isset($sid) && !isNumber($sid)) unset($sid); |
|
| 119 |
-if(isset($_REQUEST['seriesid'])) $seriesid = $_REQUEST["seriesid"]; |
|
| 120 |
-if(isset($seriesid) && !isNumber($seriesid)) unset($seriesid); |
|
| 121 |
-if(isset($_REQUEST['uid'])) $uid = $_REQUEST["uid"]; |
|
| 122 |
-if(isset($uid) && !isNumber($uid)) unset($uid); |
|
| 123 |
-if(isset($_REQUEST['chapid'])) $chapid = $_REQUEST["chapid"]; |
|
| 124 |
-if(isset($chapid) && !isNumber($chapid)) unset($chapid); |
|
| 125 |
-$let = false; |
|
| 126 |
-if(isset($_GET['let'])) $let = $_GET['let']; |
|
| 127 |
-if(isset($let) && !in_array($let, $alphabet)) $let = false; |
|
| 128 |
-$output = ""; |
|
| 129 |
- |
|
| 130 |
-// Cleans these two variables of possible XSS attacks. |
|
| 131 |
-if(isset($_SERVER['PHP_SELF'])) $_SERVER['PHP_SELF'] = htmlspecialchars(descript($_SERVER['PHP_SELF']), ENT_QUOTES); |
|
| 132 |
-if(isset($PHP_SELF)) $PHP_SELF = htmlspecialchars(descript($PHP_SELF), ENT_QUOTES); |
|
| 133 |
- |
|
| 134 |
-// Set these variables to start. |
|
| 135 |
-$agecontsent = false; $viewed = false; |
|
| 136 |
- |
|
| 137 |
-require_once("includes/get_session_vars.php");
|
|
| 138 |
- |
|
| 139 |
-if(isset($_GET['skin'])) {
|
|
| 140 |
- $siteskin = $_GET['skin']; |
|
| 141 |
- $_SESSION[SITEKEY."_skin"] = $siteskin; |
|
| 142 |
-} |
|
| 143 |
- |
|
| 144 |
-$v = explode(".", $version);
|
|
| 145 |
-include("version.php");
|
|
| 146 |
-$newV = explode(".", $version);
|
|
| 147 |
-//if($v[0] == $newV[0] && ($v[1] < $newV[1] || (isset($newV[2]) && $v[2] < $newV[2]))) {
|
|
| 148 |
-foreach($newV AS $k => $l) {
|
|
| 149 |
- if($newV[$k] > $v[$k] || (!empty($newV[$k]) && empty($v[$k]))) {
|
|
| 150 |
- if(isADMIN && basename($_SERVER['PHP_SELF']) != "update.php") {
|
|
| 151 |
- header("Location: update.php");
|
|
| 152 |
- exit( ); |
|
| 153 |
- } |
|
| 154 |
- else if(!isADMIN && basename($_SERVER['PHP_SELF']) != "maintenance.php" && !(isset($_GET['action']) && $_GET['action'] == "login")) {
|
|
| 155 |
- header("Location: maintenance.php");
|
|
| 156 |
- exit( ); |
|
| 157 |
- } |
|
| 158 |
- } |
|
| 159 |
-} |
|
| 160 |
- |
|
| 161 |
-if(!empty($_SESSION[SITEKEY."_skin"])) $siteskin = $_SESSION[SITEKEY."_skin"]; |
|
| 162 |
-if($maintenance && !isADMIN && basename($_SERVER['PHP_SELF']) != "maintenance.php" && !(isset($_GET['action']) && $_GET['action'] == "login")) {
|
|
| 163 |
- header("Location: maintenance.php");
|
|
| 164 |
- exit( ); |
|
| 165 |
-} |
|
| 166 |
- |
|
| 167 |
-$blockquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_blocks");
|
|
| 168 |
-while($block = dbassoc($blockquery)) {
|
|
| 169 |
- $blocks[$block['block_name']] = unserialize($block['block_variables']); |
|
| 170 |
- $blocks[$block['block_name']]['title'] = $block['block_title']; |
|
| 171 |
- $blocks[$block['block_name']]['file'] = $block['block_file']; |
|
| 172 |
- $blocks[$block['block_name']]['status'] = $block['block_status']; |
|
| 173 |
-} |
|
| 174 |
- |
|
| 175 |
-// This session variable is used to track the story views |
|
| 176 |
-if(isset($_SESSION[SITEKEY."_viewed"])) $viewed = $_SESSION[SITEKEY."_viewed"]; |
|
| 177 |
- |
|
| 178 |
-if(isset($_GET['ageconsent'])) $_SESSION[SITEKEY."_ageconsent"] = 1; |
|
| 179 |
-if(isset($_GET['warning'])) $_SESSION[SITEKEY."_warned"][$_GET['warning']] = 1; |
|
| 180 |
- |
|
| 181 |
-if(file_exists("languages/{$language}.php")) require_once ("languages/{$language}.php");
|
|
| 182 |
-else require_once ("languages/en.php");
|
|
| 183 |
-if(is_dir(_BASEDIR."skins/$siteskin")) $skindir = _BASEDIR."skins/$siteskin"; |
|
| 184 |
-else if(is_dir(_BASEDIR."skins/".$settings['skin'])) $skindir = _BASEDIR."skins/".$defaultskin; |
|
| 185 |
-else $skindir = _BASEDIR."default_tpls"; |
|
| 186 |
-if(USERUID) {
|
|
| 187 |
- $prefs = dbquery("SELECT sortby, storyindex, tinyMCE FROM ".TABLEPREFIX."fanfiction_authorprefs WHERE uid = '".USERUID."'");
|
|
| 188 |
- if(dbnumrows($prefs)) list($defaultsort, $displayindex, $tinyMCE) = dbrow($prefs); |
|
| 189 |
-} |
|
| 190 |
-if(isset($_REQUEST['sort'])) $defaultsort = $_REQUEST['sort'] == "update" ? 1 : 0; |
|
| 191 |
-define("_ORDERBY", " ORDER BY ".($defaultsort == 1 ? "updated DESC" : "stories.title ASC"));
|
|
| 192 |
-if($current == "viewstory"){
|
|
| 193 |
- if(isset($chapid)) {
|
|
| 194 |
- $squery = dbquery("SELECT sid, inorder FROM ".TABLEPREFIX."fanfiction_chapters WHERE chapid = ".$chapid." LIMIT 1");
|
|
| 195 |
- list($sid, $chapter) = dbrow($squery); |
|
| 196 |
- } |
|
| 197 |
- $titlequery = dbquery("SELECT story.title, story.coauthors, "._PENNAMEFIELD." as penname, story.summary FROM ".TABLEPREFIX."fanfiction_stories as story, "._AUTHORTABLE." WHERE sid = '$sid' AND "._UIDFIELD." = story.uid LIMIT 1");
|
|
| 198 |
- if($story = dbassoc($titlequery)) {
|
|
| 199 |
- $authlink[] = $story['penname']; |
|
| 200 |
- if($story['coauthors']) {
|
|
| 201 |
- $coquery = dbquery("SELECT "._PENNAMEFIELD." as penname FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_coauthors as ca ON "._UIDFIELD." = ca.uid WHERE ca.sid = '$sid'");
|
|
| 202 |
- while($co = dbassoc($coquery)) {
|
|
| 203 |
- $authlink[] = $co['penname']; |
|
| 204 |
- } |
|
| 205 |
- } |
|
| 206 |
- $titleinfo = stripslashes($story['title'])." "._BY." ".implode(", ", $authlink);
|
|
| 207 |
- $metaDesc = htmlspecialchars(stripslashes($story['summary'])); |
|
| 208 |
- $filename = basename($titleinfo.".html"); |
|
| 209 |
- $ie = strpos("msie", strtolower($_SERVER['HTTP_USER_AGENT'])) !== false ? true : false;
|
|
| 210 |
- if ($ie) $filename = rawurlencode($filename); |
|
| 211 |
- //header("Content-Disposition: inline; filename=\"".$titleinfo."\"");
|
|
| 212 |
- } |
|
| 213 |
-} |
|
| 214 |
-if($current == "viewuser" && isNumber($uid)) {
|
|
| 215 |
- $author = dbquery("SELECT "._PENNAMEFIELD." as penname FROM "._AUTHORTABLE." WHERE "._UIDFIELD." = '".$uid."'");
|
|
| 216 |
- list($penname) = dbrow($author); |
|
| 217 |
- $titleinfo = "$sitename :: $penname"; |
|
| 218 |
-} |
|
| 219 |
-echo _DOCTYPE."<html><head>"; |
|
| 220 |
-echo "<meta charset='utf-8' />"; |
|
| 221 |
-if(!isset($titleinfo)) $titleinfo = "$sitename :: $slogan"; |
|
| 222 |
-if(isset($metaDesc)) echo "<meta name='description' content='$metaDesc'>"; |
|
| 223 |
-echo "<title>$titleinfo</title>"; |
|
| 224 |
- |
|
| 225 |
-// ---------- Favicon --------- |
|
| 226 |
-if (file_exists($skindir."/images/favicon.ico")) |
|
| 227 |
-{
|
|
| 228 |
- echo "<link rel='icon' href='".THEME_ABS."favicon.ico' type='image/x-icon' />\n<link rel='shortcut icon' href='".THEME_ABS."favicon.ico' type='image/xicon' />\n"; |
|
| 229 |
-} |
|
| 230 |
-elseif (file_exists(_BASEDIR."favicon.ico")) |
|
| 231 |
-{
|
|
| 232 |
- echo "<link rel='icon' href='"._BASEDIR."favicon.ico' type='image/x-icon' />\n<link rel='shortcut icon' href='"._BASEDIR."favicon.ico' type='image/xicon' />\n"; |
|
| 233 |
-} |
|
| 234 |
- |
|
| 235 |
- |
|
| 236 |
-echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset="._CHARSET."\">"; |
|
| 237 |
-if(!isset($_GET['action']) || $_GET['action'] != "printable") {
|
|
| 238 |
-echo "<script language=\"javascript\" type=\"text/javascript\" src=\""._BASEDIR."includes/javascript.js\"></script> |
|
| 239 |
-<link rel=\"alternate\" type=\"application/rss+xml\" title=\"$sitename RSS Feed\" href=\""._BASEDIR."rss.php\">"; |
|
| 240 |
-if(!empty($tinyMCE)) {
|
|
| 241 |
- echo "<script language=\"javascript\" type=\"text/javascript\" src=\""._BASEDIR."tinymce/js/tinymce/tinymce.min.js\"></script> |
|
| 242 |
- <script language=\"javascript\" type=\"text/javascript\"><!--"; |
|
| 243 |
- $tinymessage = dbquery("SELECT message_text FROM ".TABLEPREFIX."fanfiction_messages WHERE message_name = 'tinyMCE' LIMIT 1");
|
|
| 244 |
- list($tinysettings) = dbrow($tinymessage); |
|
| 245 |
- if(!empty($tinysettings) && $current != "adminarea") {
|
|
| 246 |
- echo $tinysettings; |
|
| 247 |
- } |
|
| 248 |
- else {
|
|
| 249 |
- echo " |
|
| 250 |
- tinymce.init({
|
|
| 251 |
- selector: 'textarea:not(.mceNoEditor)', |
|
| 252 |
- menubar: false, |
|
| 253 |
- language: '$language', |
|
| 254 |
- theme: 'modern', |
|
| 255 |
- skin: 'lightgray', |
|
| 256 |
- min_height: 200, |
|
| 257 |
- plugins: [ |
|
| 258 |
- 'autolink lists link image charmap paste preview hr anchor pagebreak', |
|
| 259 |
- 'searchreplace wordcount visualblocks visualchars code fullscreen', |
|
| 260 |
- 'insertdatetime media nonbreaking save table contextmenu directionality', |
|
| 261 |
- 'emoticons template textcolor colorpicker textpattern imagetools toc textcolor table' |
|
| 262 |
- ], |
|
| 263 |
- paste_word_valid_elements: 'b,strong,i,em,h1,h2,u,p,ol,ul,li,a[href],span,color,font-size,font-color,font-family,mark,table,tr,td', |
|
| 264 |
- paste_retain_style_properties : 'all', |
|
| 265 |
- paste_strip_class_attributes: 'none', |
|
| 266 |
- toolbar1: 'undo redo | insert styleselect | bold italic underline strikethrough | link image | alignleft aligncenter alignright alignjustify', |
|
| 267 |
- toolbar2: 'preview | bullist numlist | forecolor backcolor emoticons | fontselect | fontsizeselect wordcount', |
|
| 268 |
- image_advtab: true, |
|
| 269 |
- templates: [ |
|
| 270 |
- { title: 'Test template 1', content: 'Test 1' },
|
|
| 271 |
- { title: 'Test template 2', content: 'Test 2' }
|
|
| 272 |
- ], |
|
| 273 |
- content_css: [ |
|
| 274 |
- '//fonts.googleapis.com/css?family=Lato:300,300i,400,400i', |
|
| 275 |
- '//www.tinymce.com/css/codepen.min.css' |
|
| 276 |
- ],"; |
|
| 277 |
- if(USERUID) |
|
| 278 |
- echo " external_image_list_url : '".STORIESPATH."/".USERUID."/images/imagelist.js',"; |
|
| 279 |
- echo " |
|
| 280 |
- theme_modern_resizing: true,".($current == "adminarea" ? "\n\t\tentity_encoding: 'raw'" : "\n\t\tinvalid_elements: 'script,object,applet,iframe'")." |
|
| 281 |
- }); |
|
| 282 |
- |
|
| 283 |
-"; |
|
| 284 |
- } |
|
| 285 |
- echo " |
|
| 286 |
-var tinyMCEmode = true; |
|
| 287 |
- function toogleEditorMode(id) {
|
|
| 288 |
- var elm = document.getElementById(id); |
|
| 289 |
- |
|
| 290 |
- if (tinyMCE.getInstanceById(id) == null) |
|
| 291 |
- tinyMCE.execCommand('mceAddControl', false, id);
|
|
| 292 |
- else |
|
| 293 |
- tinyMCE.execCommand('mceRemoveControl', false, id);
|
|
| 294 |
- } |
|
| 295 |
-"; |
|
| 296 |
-/*echo " |
|
| 297 |
-var tinyMCEmode = true; |
|
| 298 |
- function toogleEditorMode(id) {
|
|
| 299 |
- var elm = document.getElementById(id); |
|
| 300 |
- |
|
| 301 |
- if (tinyMCE.get(id) == null) |
|
| 302 |
- tinyMCE.execCommand('mceAddControl', false, id);
|
|
| 303 |
- else |
|
| 304 |
- tinyMCE.execCommand('mceRemoveControl', false, id);
|
|
| 305 |
- } |
|
| 306 |
-";*/ |
|
| 307 |
-echo " --></script>"; |
|
| 308 |
-} |
|
| 309 |
-} |
|
| 310 |
-if(isset($displayform) && $displayform == 1) {
|
|
| 311 |
-echo "<script language=\"javascript\" type=\"text/javascript\" src=\""._BASEDIR."includes/xmlhttp.js\"></script>"; |
|
| 312 |
-echo "<script language=\"javascript\" type=\"text/javascript\"> |
|
| 313 |
-lang = new Array( ); |
|
| 314 |
- |
|
| 315 |
-lang['Back2Cats'] = '"._BACK2CATS."'; |
|
| 316 |
-lang['ChooseCat'] = '"._CHOOSECAT."'; |
|
| 317 |
-lang['Categories'] = '"._CATEGORIES."'; |
|
| 318 |
-lang['Characters'] = '"._CHARACTERS."'; |
|
| 319 |
-lang['MoveTop'] = '"._MOVETOP."'; |
|
| 320 |
-lang['TopLevel'] = '"._TOPLEVEL."'; |
|
| 321 |
-lang['CatLocked'] = '"._CATLOCKED."'; |
|
| 322 |
-basedir = '"._BASEDIR."'; |
|
| 323 |
- |
|
| 324 |
-categories = new Array( ); |
|
| 325 |
-characters = new Array( ); |
|
| 326 |
-\n"; |
|
| 327 |
-/* |
|
| 328 |
- $result = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_categories ORDER BY leveldown, displayorder");
|
|
| 329 |
-$x = 0; |
|
| 330 |
- while($category = dbassoc($result)) {
|
|
| 331 |
- echo "categories[$x] = new category(".$category['parentcatid'].", ".$category['catid'].", \"". str_replace('"', '\"', stripslashes($category['category']))."\", ".$category['locked'].", ".$category['displayorder'].");\r\n";
|
|
| 332 |
- $catlist[$category['catid']] = array("name" => stripslashes($category['category']), "pid" => $category['parentcatid'], "locked" => (isADMIN ? 0 : $category['locked']), "order" => $category['displayorder'], "leveldown" => $category['leveldown']);
|
|
| 333 |
- $x++; |
|
| 334 |
- } |
|
| 335 |
-$x = 0; |
|
| 336 |
- $result = dbquery("SELECT charname, catid, charid FROM ".TABLEPREFIX."fanfiction_characters ORDER BY charname");
|
|
| 337 |
- while($char = dbassoc($result)) {
|
|
| 338 |
- echo "characters[$x] = new character(".$char['charid'].", ".$char['catid'].", \"".str_replace('"', '\"', stripslashes($char['charname']))."\");\r\n";
|
|
| 339 |
- $charlist[$char['charid']] = array("name" => stripslashes($char['charname']), "catid" => $char['catid']);
|
|
| 340 |
- $x++; |
|
| 341 |
- } |
|
| 342 |
-*/ |
|
| 343 |
-echo "</script>"; |
|
| 344 |
-} |
|
| 345 |
-if(file_exists("extra_header.php")) include_once("extra_header.php");
|
|
| 346 |
-if(file_exists("$skindir/extra_header.php")) include_once("$skindir/extra_header.php");
|
|
| 347 |
-if(!$displaycolumns) $displaycolumns = 1; |
|
| 348 |
-$colwidth = floor(100/$displaycolumns); |
|
| 349 |
-if(!empty($_GET['action']) && $_GET['action'] == "printable") {
|
|
| 350 |
- if(file_exists("$skindir/printable.css")) echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$skindir/printable.css\">";
|
|
| 351 |
- else echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"default_tpls/printable.css\">"; |
|
| 352 |
- echo "<script type='text/javascript'> |
|
| 353 |
-<!-- |
|
| 354 |
-if (window.print) {
|
|
| 355 |
- window.print() ; |
|
| 356 |
-} else {
|
|
| 357 |
- var WebBrowser = '<OBJECT ID=\"WebBrowser1\" WIDTH=0 HEIGHT=0 CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>'; |
|
| 358 |
-document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
|
|
| 359 |
- WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = \"\"; |
|
| 360 |
-} |
|
| 361 |
-</script>"; |
|
| 362 |
-} |
|
| 363 |
-else {
|
|
| 364 |
-echo "<style type=\"text/css\"> |
|
| 365 |
-#columncontainer { margin: 1em auto; width: auto; padding: 5%;}
|
|
| 366 |
-#browseblock, #memberblock { width: 100%; padding: 0; margin: 0; float: left; border: 0px solid transparent; }
|
|
| 367 |
-.column { float: left; width: ".($colwidth - 1)."%; }
|
|
| 368 |
-html>body .column { width: $colwidth%; }
|
|
| 369 |
-.cleaner { clear: both; height: 1px; font-size: 1px; margin: 0; padding: 0; background: transparent; }
|
|
| 370 |
-#settingsform { margin: 0; padding: 0; border: none; }
|
|
| 371 |
-#settingsform FORM { width: 100%; margin: 0 10%; }
|
|
| 372 |
-#settingsform LABEL { float: left; display: block; width: 30%; text-align: right; padding-right: 10px; clear: left; }
|
|
| 373 |
-#settingsform DIV { clear: both;}
|
|
| 374 |
-#settingsform .fieldset SPAN { float: left; display: block; width: 30%; text-align: right; padding-right: 10px; clear: left;}
|
|
| 375 |
-#settingsform .fieldset LABEL { float: none; width: auto; display: inline; text-align: left; clear: none; }
|
|
| 376 |
-#settingsform { float: left; margin: 1ex 10%; }
|
|
| 377 |
-#settingsform .tinytoggle { text-align: center; }
|
|
| 378 |
-#settingsform .tinytoggle LABEL { float: none; display: inline; width: auto; text-align: center; padding: 0; clear: none; }
|
|
| 379 |
-#settingsform #submitdiv { text-align: center; width: 100%;clear: both; height: 3em; }
|
|
| 380 |
-#settingsform #submitdiv #submit { position: absolute; z-index: 10001; margin: 1em; }
|
|
| 381 |
-a.pophelp{
|
|
| 382 |
- position: relative; /* this is the key*/ |
|
| 383 |
- vertical-align: super; |
|
| 384 |
-} |
|
| 385 |
- |
|
| 386 |
-a.pophelp:hover{z-index:100; border: none; text-decoration: none;}
|
|
| 387 |
- |
|
| 388 |
-a.pophelp span{display: none; position: absolute; top: -25em; left: 20em; }
|
|
| 389 |
- |
|
| 390 |
-a.pophelp:hover span{ /*the span will display just on :hover state*/
|
|
| 391 |
- display:block; |
|
| 392 |
- position: absolute; |
|
| 393 |
- top: -3em; left: 8em; width: 225px; |
|
| 394 |
- border:1px solid #000; |
|
| 395 |
- background-color:#CCC; color:#000; |
|
| 396 |
- text-decoration: none; |
|
| 397 |
- text-align: left; |
|
| 398 |
- padding: 5px; |
|
| 399 |
- font-weight: normal; |
|
| 400 |
- visibility: visible; |
|
| 401 |
-} |
|
| 402 |
-.required { color: red; }
|
|
| 403 |
-.shim {
|
|
| 404 |
- position: absolute; |
|
| 405 |
- display: none; |
|
| 406 |
- height: 0; |
|
| 407 |
- width:0; |
|
| 408 |
- margin: 0; |
|
| 409 |
- padding: 0; |
|
| 410 |
- z-index: 100; |
|
| 411 |
-} |
|
| 412 |
- |
|
| 413 |
-.ajaxOptList {
|
|
| 414 |
- background: #CCC; |
|
| 415 |
- border: 1px solid #000; |
|
| 416 |
- margin: 0; |
|
| 417 |
- position: absolute; |
|
| 418 |
- padding: 0; |
|
| 419 |
- z-index: 1000; |
|
| 420 |
- text-align: left; |
|
| 421 |
-} |
|
| 422 |
-.ajaxListOptOver {
|
|
| 423 |
- padding: 4px; |
|
| 424 |
- background: #CCC; |
|
| 425 |
- margin: 0; |
|
| 426 |
-} |
|
| 427 |
-.ajaxListOpt {
|
|
| 428 |
- background: #EEE; |
|
| 429 |
- padding: 4px; |
|
| 430 |
- margin: 0; |
|
| 431 |
-} |
|
| 432 |
-.multiSelect {
|
|
| 433 |
- width: 300px; |
|
| 434 |
-} |
|
| 435 |
- |
|
| 436 |
-</style> |
|
| 437 |
-<link rel='stylesheet' type='text/css' href='$skindir/style.css' /> \n |
|
| 438 |
-<meta name='viewport' content='width=device-width, initial-scale=1.0' /> |
|
| 439 |
-"; |
|
| 440 |
-} |
|
| 441 |
-echo "</head>"; |
|
| 442 |
-$headerSent = true; |
|
| 443 |
-include (_BASEDIR."includes/class.TemplatePower.inc.php"); |
|
| 444 |
-if($debug == 1) {
|
|
| 445 |
- @ error_reporting(E_ALL); |
|
| 446 |
- echo "\n<!-- \$_SESSION \n"; print_r($_SESSION); echo " -->"; |
|
| 447 |
- echo "\n<!-- \$_COOKIE \n"; print_r($_COOKIE); echo " -->"; |
|
| 448 |
- echo "\n<!-- \$_POST \n"; print_r($_POST); echo " -->"; |
|
| 449 |
-} |
|
| 450 |
-?> |
|
| 1 |
+<?php |
|
| 2 |
+// ---------------------------------------------------------------------- |
|
| 3 |
+// Copyright (c) 2007 by Tammy Keefer |
|
| 4 |
+// Based on eFiction 1.1 |
|
| 5 |
+// Copyright (C) 2003 by Rebecca Smallwood. |
|
| 6 |
+// http://efiction.sourceforge.net/ |
|
| 7 |
+// ---------------------------------------------------------------------- |
|
| 8 |
+// LICENSE |
|
| 9 |
+// |
|
| 10 |
+// This program is free software; you can redistribute it and/or |
|
| 11 |
+// modify it under the terms of the GNU General Public License (GPL) |
|
| 12 |
+// as published by the Free Software Foundation; either version 2 |
|
| 13 |
+// of the License, or (at your option) any later version. |
|
| 14 |
+// |
|
| 15 |
+// This program is distributed in the hope that it will be useful, |
|
| 16 |
+// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 17 |
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 18 |
+// GNU General Public License for more details. |
|
| 19 |
+// |
|
| 20 |
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html |
|
| 21 |
+// ---------------------------------------------------------------------- |
|
| 22 |
+ |
|
| 23 |
+// Force the argument separator to be standards compliant |
|
| 24 |
+@ ini_set('arg_separator.output','&');
|
|
| 25 |
+if(isset($_GET['debug'])) @ error_reporting(E_ALL); |
|
| 26 |
+if(isset($_GET['benchmark'])) {
|
|
| 27 |
+ list($usec, $sec) = explode(" ", microtime());
|
|
| 28 |
+ $start = ((float)$usec + (float)$sec); |
|
| 29 |
+} |
|
| 30 |
+$headerSent = false; |
|
| 31 |
+ |
|
| 32 |
+// Defines the character set for your language/location |
|
| 33 |
+define ("_CHARSET", "utf-8");
|
|
| 34 |
+ |
|
| 35 |
+// Prevent possible XSS attacks via $_GET. |
|
| 36 |
+foreach ($_GET as $v) {
|
|
| 37 |
+ if(preg_match('@<script[^>]*?>.*?</script>@si', $v) ||
|
|
| 38 |
+ preg_match("'@<iframe[^>]*?>.*?</script>@si'", $v) ||
|
|
| 39 |
+ preg_match("'@<applet[^>]*?>.*?</script>@si'", $v) ||
|
|
| 40 |
+ preg_match("'@<meta[^>]*?>.*?</script>@si'", $v) ||
|
|
| 41 |
+ preg_match('@<[\/\!]*?[^<>]*?>@si', $v) ||
|
|
| 42 |
+ preg_match('@<style[^>]*?>.*?</style>@siU', $v) ||
|
|
| 43 |
+ preg_match('@<![\s\S]*?--[ \t\n\r]*>@', $v)) {
|
|
| 44 |
+ include("languages/en.php"); // no language set yet, so default to English.
|
|
| 45 |
+ die (_POSSIBLEHACK); |
|
| 46 |
+ } |
|
| 47 |
+} |
|
| 48 |
+unset($v); |
|
| 49 |
+ |
|
| 50 |
+if(!isset($_SESSION)) session_start(); |
|
| 51 |
+// clear the global variables if register globals is on. |
|
| 52 |
+if(ini_get('register_globals')) {
|
|
| 53 |
+ $arrayList = array_merge($_SESSION, $_GET, $_POST, $_COOKIE); |
|
| 54 |
+ foreach($arrayList as $k => $v) {
|
|
| 55 |
+ unset($GLOBALS[$k]); |
|
| 56 |
+ } |
|
| 57 |
+} |
|
| 58 |
+ |
|
| 59 |
+Header('Cache-Control: private, no-cache, must-revalidate, max_age=0, post-check=0, pre-check=0');
|
|
| 60 |
+header ("Pragma: no-cache");
|
|
| 61 |
+header ("Expires: 0");
|
|
| 62 |
+header("Content-Type: text/html; charset="._CHARSET);
|
|
| 63 |
+ |
|
| 64 |
+// Locate config.php and set the basedir path |
|
| 65 |
+$folder_level = ""; |
|
| 66 |
+while (!file_exists($folder_level."header.php")) { $folder_level .= "../"; }
|
|
| 67 |
+if(!defined("_BASEDIR")) define("_BASEDIR", $folder_level);
|
|
| 68 |
+ |
|
| 69 |
+@ include_once(_BASEDIR."config.php"); |
|
| 70 |
+if(empty($sitekey)) {
|
|
| 71 |
+ header("Location: install/install.php");
|
|
| 72 |
+ exit( ); |
|
| 73 |
+} |
|
| 74 |
+if(isset($skin)) $globalskin = $skin; |
|
| 75 |
+$settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".$sitekey."'");
|
|
| 76 |
+$settings = dbassoc($settingsresults); |
|
| 77 |
+if(!defined("SITEKEY")) define("SITEKEY", $settings['sitekey']);
|
|
| 78 |
+unset($settings['sitekey']); |
|
| 79 |
+if(!defined("TABLEPREFIX")) define("TABLEPREFIX", $settings['tableprefix']);
|
|
| 80 |
+unset($settings['tableprefix']); |
|
| 81 |
+define("STORIESPATH", $settings['storiespath']);
|
|
| 82 |
+unset($settings['storiespath']); |
|
| 83 |
+foreach($settings as $var => $val) {
|
|
| 84 |
+ $$var = stripslashes($val); |
|
| 85 |
+ $settings[$var] = htmlspecialchars($val); |
|
| 86 |
+} |
|
| 87 |
+ |
|
| 88 |
+if(isset($_GET['debug'])) $debug = 1; |
|
| 89 |
+if(!$displaycolumns) $displaycolumns = 1; // shouldn't happen, but just in case. |
|
| 90 |
+if($words) $words = explode(", ", $words);
|
|
| 91 |
+else $words = array( ); |
|
| 92 |
+// Fix for sites with 2.0 or 1.1 running as well as 3.0 with register_globals on. |
|
| 93 |
+$defaultskin = $skin; |
|
| 94 |
+ |
|
| 95 |
+if(isset($globalskin)) $skin = $globalskin; |
|
| 96 |
+ |
|
| 97 |
+if(isset($_GET['action'])) $action = strip_tags($_GET['action']); |
|
| 98 |
+else $action = false; |
|
| 99 |
+ |
|
| 100 |
+if(file_exists(_BASEDIR."languages/{$language}.php")) include (_BASEDIR."languages/{$language}.php");
|
|
| 101 |
+else include (_BASEDIR."languages/en.php"); |
|
| 102 |
+ |
|
| 103 |
+include_once(_BASEDIR."includes/queries.php"); |
|
| 104 |
+include_once(_BASEDIR."includes/corefunctions.php"); |
|
| 105 |
+ |
|
| 106 |
+// Check and/or set some variables used at various points throughout the script |
|
| 107 |
+if(isset($_GET['offset'])) $offset = $_GET['offset']; |
|
| 108 |
+if(!isset($offset) || !isNumber($offset)) $offset = 0; |
|
| 109 |
+if(isset($_REQUEST["sid"])) $sid = $_REQUEST["sid"]; |
|
| 110 |
+if(isset($sid) && !isNumber($sid)) unset($sid); |
|
| 111 |
+if(isset($_REQUEST['seriesid'])) $seriesid = $_REQUEST["seriesid"]; |
|
| 112 |
+if(isset($seriesid) && !isNumber($seriesid)) unset($seriesid); |
|
| 113 |
+if(isset($_REQUEST['uid'])) $uid = $_REQUEST["uid"]; |
|
| 114 |
+if(isset($uid) && !isNumber($uid)) unset($uid); |
|
| 115 |
+if(isset($_REQUEST['chapid'])) $chapid = $_REQUEST["chapid"]; |
|
| 116 |
+if(isset($chapid) && !isNumber($chapid)) unset($chapid); |
|
| 117 |
+$let = false; |
|
| 118 |
+if(isset($_GET['let'])) $let = $_GET['let']; |
|
| 119 |
+if(isset($let) && !in_array($let, $alphabet)) $let = false; |
|
| 120 |
+$output = ""; |
|
| 121 |
+ |
|
| 122 |
+// Cleans these two variables of possible XSS attacks. |
|
| 123 |
+if(isset($_SERVER['PHP_SELF'])) $_SERVER['PHP_SELF'] = htmlspecialchars(descript($_SERVER['PHP_SELF']), ENT_QUOTES); |
|
| 124 |
+if(isset($PHP_SELF)) $PHP_SELF = htmlspecialchars(descript($PHP_SELF), ENT_QUOTES); |
|
| 125 |
+ |
|
| 126 |
+// Set these variables to start. |
|
| 127 |
+$agecontsent = false; $viewed = false; |
|
| 128 |
+ |
|
| 129 |
+require_once("includes/get_session_vars.php");
|
|
| 130 |
+ |
|
| 131 |
+if(isset($_GET['skin'])) {
|
|
| 132 |
+ $siteskin = $_GET['skin']; |
|
| 133 |
+ $_SESSION[SITEKEY."_skin"] = $siteskin; |
|
| 134 |
+} |
|
| 135 |
+ |
|
| 136 |
+$v = explode(".", $version);
|
|
| 137 |
+include("version.php");
|
|
| 138 |
+$newV = explode(".", $version);
|
|
| 139 |
+//if($v[0] == $newV[0] && ($v[1] < $newV[1] || (isset($newV[2]) && $v[2] < $newV[2]))) {
|
|
| 140 |
+foreach($newV AS $k => $l) {
|
|
| 141 |
+ if($newV[$k] > $v[$k] || (!empty($newV[$k]) && empty($v[$k]))) {
|
|
| 142 |
+ if(isADMIN && basename($_SERVER['PHP_SELF']) != "update.php") {
|
|
| 143 |
+ header("Location: update.php");
|
|
| 144 |
+ exit( ); |
|
| 145 |
+ } |
|
| 146 |
+ else if(!isADMIN && basename($_SERVER['PHP_SELF']) != "maintenance.php" && !(isset($_GET['action']) && $_GET['action'] == "login")) {
|
|
| 147 |
+ header("Location: maintenance.php");
|
|
| 148 |
+ exit( ); |
|
| 149 |
+ } |
|
| 150 |
+ } |
|
| 151 |
+} |
|
| 152 |
+ |
|
| 153 |
+if(!empty($_SESSION[SITEKEY."_skin"])) $siteskin = $_SESSION[SITEKEY."_skin"]; |
|
| 154 |
+if($maintenance && !isADMIN && basename($_SERVER['PHP_SELF']) != "maintenance.php" && !(isset($_GET['action']) && $_GET['action'] == "login")) {
|
|
| 155 |
+ header("Location: maintenance.php");
|
|
| 156 |
+ exit( ); |
|
| 157 |
+} |
|
| 158 |
+ |
|
| 159 |
+$blockquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_blocks");
|
|
| 160 |
+while($block = dbassoc($blockquery)) {
|
|
| 161 |
+ $blocks[$block['block_name']] = unserialize($block['block_variables']); |
|
| 162 |
+ $blocks[$block['block_name']]['title'] = $block['block_title']; |
|
| 163 |
+ $blocks[$block['block_name']]['file'] = $block['block_file']; |
|
| 164 |
+ $blocks[$block['block_name']]['status'] = $block['block_status']; |
|
| 165 |
+} |
|
| 166 |
+ |
|
| 167 |
+// This session variable is used to track the story views |
|
| 168 |
+if(isset($_SESSION[SITEKEY."_viewed"])) $viewed = $_SESSION[SITEKEY."_viewed"]; |
|
| 169 |
+ |
|
| 170 |
+if(isset($_GET['ageconsent'])) $_SESSION[SITEKEY."_ageconsent"] = 1; |
|
| 171 |
+if(isset($_GET['warning'])) $_SESSION[SITEKEY."_warned"][$_GET['warning']] = 1; |
|
| 172 |
+ |
|
| 173 |
+if(file_exists("languages/{$language}.php")) require_once ("languages/{$language}.php");
|
|
| 174 |
+else require_once ("languages/en.php");
|
|
| 175 |
+if(is_dir(_BASEDIR."skins/$siteskin")) $skindir = _BASEDIR."skins/$siteskin"; |
|
| 176 |
+else if(is_dir(_BASEDIR."skins/".$settings['skin'])) $skindir = _BASEDIR."skins/".$defaultskin; |
|
| 177 |
+else $skindir = _BASEDIR."default_tpls"; |
|
| 178 |
+if(USERUID) {
|
|
| 179 |
+ $prefs = dbquery("SELECT sortby, storyindex, tinyMCE FROM ".TABLEPREFIX."fanfiction_authorprefs WHERE uid = '".USERUID."'");
|
|
| 180 |
+ if(dbnumrows($prefs)) list($defaultsort, $displayindex, $tinyMCE) = dbrow($prefs); |
|
| 181 |
+} |
|
| 182 |
+if(isset($_REQUEST['sort'])) $defaultsort = $_REQUEST['sort'] == "update" ? 1 : 0; |
|
| 183 |
+define("_ORDERBY", " ORDER BY ".($defaultsort == 1 ? "updated DESC" : "stories.title ASC"));
|
|
| 184 |
+if($current == "viewstory"){
|
|
| 185 |
+ if(isset($chapid)) {
|
|
| 186 |
+ $squery = dbquery("SELECT sid, inorder FROM ".TABLEPREFIX."fanfiction_chapters WHERE chapid = ".$chapid." LIMIT 1");
|
|
| 187 |
+ list($sid, $chapter) = dbrow($squery); |
|
| 188 |
+ } |
|
| 189 |
+ $titlequery = dbquery("SELECT story.title, story.coauthors, "._PENNAMEFIELD." as penname, story.summary FROM ".TABLEPREFIX."fanfiction_stories as story, "._AUTHORTABLE." WHERE sid = '$sid' AND "._UIDFIELD." = story.uid LIMIT 1");
|
|
| 190 |
+ if($story = dbassoc($titlequery)) {
|
|
| 191 |
+ $authlink[] = $story['penname']; |
|
| 192 |
+ if($story['coauthors']) {
|
|
| 193 |
+ $coquery = dbquery("SELECT "._PENNAMEFIELD." as penname FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_coauthors as ca ON "._UIDFIELD." = ca.uid WHERE ca.sid = '$sid'");
|
|
| 194 |
+ while($co = dbassoc($coquery)) {
|
|
| 195 |
+ $authlink[] = $co['penname']; |
|
| 196 |
+ } |
|
| 197 |
+ } |
|
| 198 |
+ $titleinfo = stripslashes($story['title'])." "._BY." ".implode(", ", $authlink);
|
|
| 199 |
+ $metaDesc = htmlspecialchars(stripslashes($story['summary'])); |
|
| 200 |
+ $filename = basename($titleinfo.".html"); |
|
| 201 |
+ $ie = strpos("msie", strtolower($_SERVER['HTTP_USER_AGENT'])) !== false ? true : false;
|
|
| 202 |
+ if ($ie) $filename = rawurlencode($filename); |
|
| 203 |
+ //header("Content-Disposition: inline; filename=\"".$titleinfo."\"");
|
|
| 204 |
+ } |
|
| 205 |
+} |
|
| 206 |
+if($current == "viewuser" && isNumber($uid)) {
|
|
| 207 |
+ $author = dbquery("SELECT "._PENNAMEFIELD." as penname FROM "._AUTHORTABLE." WHERE "._UIDFIELD." = '".$uid."'");
|
|
| 208 |
+ list($penname) = dbrow($author); |
|
| 209 |
+ $titleinfo = "$sitename :: $penname"; |
|
| 210 |
+} |
|
| 211 |
+echo _DOCTYPE."<html><head>"; |
|
| 212 |
+echo "<meta charset='utf-8' />"; |
|
| 213 |
+if(!isset($titleinfo)) $titleinfo = "$sitename :: $slogan"; |
|
| 214 |
+if(isset($metaDesc)) echo "<meta name='description' content='$metaDesc'>"; |
|
| 215 |
+echo "<title>$titleinfo</title>"; |
|
| 216 |
+ |
|
| 217 |
+// ---------- Favicon --------- |
|
| 218 |
+if (file_exists($skindir."/images/favicon.ico")) |
|
| 219 |
+{
|
|
| 220 |
+ echo "<link rel='icon' href='".THEME_ABS."favicon.ico' type='image/x-icon' />\n<link rel='shortcut icon' href='".THEME_ABS."favicon.ico' type='image/xicon' />\n"; |
|
| 221 |
+} |
|
| 222 |
+elseif (file_exists(_BASEDIR."favicon.ico")) |
|
| 223 |
+{
|
|
| 224 |
+ echo "<link rel='icon' href='"._BASEDIR."favicon.ico' type='image/x-icon' />\n<link rel='shortcut icon' href='"._BASEDIR."favicon.ico' type='image/xicon' />\n"; |
|
| 225 |
+} |
|
| 226 |
+ |
|
| 227 |
+ |
|
| 228 |
+echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset="._CHARSET."\">"; |
|
| 229 |
+if(!isset($_GET['action']) || $_GET['action'] != "printable") {
|
|
| 230 |
+echo "<script language=\"javascript\" type=\"text/javascript\" src=\""._BASEDIR."includes/javascript.js\"></script> |
|
| 231 |
+<link rel=\"alternate\" type=\"application/rss+xml\" title=\"$sitename RSS Feed\" href=\""._BASEDIR."rss.php\">"; |
|
| 232 |
+if(!empty($tinyMCE)) {
|
|
| 233 |
+ echo "<script language=\"javascript\" type=\"text/javascript\" src=\""._BASEDIR."tinymce/js/tinymce/tinymce.min.js\"></script> |
|
| 234 |
+ <script language=\"javascript\" type=\"text/javascript\"><!--"; |
|
| 235 |
+ $tinymessage = dbquery("SELECT message_text FROM ".TABLEPREFIX."fanfiction_messages WHERE message_name = 'tinyMCE' LIMIT 1");
|
|
| 236 |
+ list($tinysettings) = dbrow($tinymessage); |
|
| 237 |
+ if(!empty($tinysettings) && $current != "adminarea") {
|
|
| 238 |
+ echo $tinysettings; |
|
| 239 |
+ } |
|
| 240 |
+ else {
|
|
| 241 |
+ echo " |
|
| 242 |
+ tinymce.init({
|
|
| 243 |
+ selector: 'textarea:not(.mceNoEditor)', |
|
| 244 |
+ menubar: false, |
|
| 245 |
+ language: '$language', |
|
| 246 |
+ theme: 'modern', |
|
| 247 |
+ skin: 'lightgray', |
|
| 248 |
+ min_height: 200, |
|
| 249 |
+ plugins: [ |
|
| 250 |
+ 'autolink lists link image charmap paste preview hr anchor pagebreak', |
|
| 251 |
+ 'searchreplace wordcount visualblocks visualchars code fullscreen', |
|
| 252 |
+ 'insertdatetime media nonbreaking save table contextmenu directionality', |
|
| 253 |
+ 'emoticons template textcolor colorpicker textpattern imagetools toc textcolor table' |
|
| 254 |
+ ], |
|
| 255 |
+ paste_word_valid_elements: 'b,strong,i,em,h1,h2,u,p,ol,ul,li,a[href],span,color,font-size,font-color,font-family,mark,table,tr,td', |
|
| 256 |
+ paste_retain_style_properties : 'all', |
|
| 257 |
+ paste_strip_class_attributes: 'none', |
|
| 258 |
+ toolbar1: 'undo redo | insert styleselect | bold italic underline strikethrough | link image | alignleft aligncenter alignright alignjustify', |
|
| 259 |
+ toolbar2: 'preview | bullist numlist | forecolor backcolor emoticons | fontselect | fontsizeselect wordcount', |
|
| 260 |
+ image_advtab: true, |
|
| 261 |
+ templates: [ |
|
| 262 |
+ { title: 'Test template 1', content: 'Test 1' },
|
|
| 263 |
+ { title: 'Test template 2', content: 'Test 2' }
|
|
| 264 |
+ ], |
|
| 265 |
+ content_css: [ |
|
| 266 |
+ '//fonts.googleapis.com/css?family=Lato:300,300i,400,400i', |
|
| 267 |
+ '//www.tinymce.com/css/codepen.min.css' |
|
| 268 |
+ ],"; |
|
| 269 |
+ if(USERUID) |
|
| 270 |
+ echo " external_image_list_url : '".STORIESPATH."/".USERUID."/images/imagelist.js',"; |
|
| 271 |
+ echo " |
|
| 272 |
+ theme_modern_resizing: true,".($current == "adminarea" ? "\n\t\tentity_encoding: 'raw'" : "\n\t\tinvalid_elements: 'script,object,applet,iframe'")." |
|
| 273 |
+ }); |
|
| 274 |
+ |
|
| 275 |
+"; |
|
| 276 |
+ } |
|
| 277 |
+ echo " |
|
| 278 |
+var tinyMCEmode = true; |
|
| 279 |
+ function toogleEditorMode(id) {
|
|
| 280 |
+ var elm = document.getElementById(id); |
|
| 281 |
+ |
|
| 282 |
+ if (tinyMCE.getInstanceById(id) == null) |
|
| 283 |
+ tinyMCE.execCommand('mceAddControl', false, id);
|
|
| 284 |
+ else |
|
| 285 |
+ tinyMCE.execCommand('mceRemoveControl', false, id);
|
|
| 286 |
+ } |
|
| 287 |
+"; |
|
| 288 |
+/*echo " |
|
| 289 |
+var tinyMCEmode = true; |
|
| 290 |
+ function toogleEditorMode(id) {
|
|
| 291 |
+ var elm = document.getElementById(id); |
|
| 292 |
+ |
|
| 293 |
+ if (tinyMCE.get(id) == null) |
|
| 294 |
+ tinyMCE.execCommand('mceAddControl', false, id);
|
|
| 295 |
+ else |
|
| 296 |
+ tinyMCE.execCommand('mceRemoveControl', false, id);
|
|
| 297 |
+ } |
|
| 298 |
+";*/ |
|
| 299 |
+echo " --></script>"; |
|
| 300 |
+} |
|
| 301 |
+} |
|
| 302 |
+if(isset($displayform) && $displayform == 1) {
|
|
| 303 |
+echo "<script language=\"javascript\" type=\"text/javascript\" src=\""._BASEDIR."includes/xmlhttp.js\"></script>"; |
|
| 304 |
+echo "<script language=\"javascript\" type=\"text/javascript\"> |
|
| 305 |
+lang = new Array( ); |
|
| 306 |
+ |
|
| 307 |
+lang['Back2Cats'] = '"._BACK2CATS."'; |
|
| 308 |
+lang['ChooseCat'] = '"._CHOOSECAT."'; |
|
| 309 |
+lang['Categories'] = '"._CATEGORIES."'; |
|
| 310 |
+lang['Characters'] = '"._CHARACTERS."'; |
|
| 311 |
+lang['MoveTop'] = '"._MOVETOP."'; |
|
| 312 |
+lang['TopLevel'] = '"._TOPLEVEL."'; |
|
| 313 |
+lang['CatLocked'] = '"._CATLOCKED."'; |
|
| 314 |
+basedir = '"._BASEDIR."'; |
|
| 315 |
+ |
|
| 316 |
+categories = new Array( ); |
|
| 317 |
+characters = new Array( ); |
|
| 318 |
+\n"; |
|
| 319 |
+/* |
|
| 320 |
+ $result = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_categories ORDER BY leveldown, displayorder");
|
|
| 321 |
+$x = 0; |
|
| 322 |
+ while($category = dbassoc($result)) {
|
|
| 323 |
+ echo "categories[$x] = new category(".$category['parentcatid'].", ".$category['catid'].", \"". str_replace('"', '\"', stripslashes($category['category']))."\", ".$category['locked'].", ".$category['displayorder'].");\r\n";
|
|
| 324 |
+ $catlist[$category['catid']] = array("name" => stripslashes($category['category']), "pid" => $category['parentcatid'], "locked" => (isADMIN ? 0 : $category['locked']), "order" => $category['displayorder'], "leveldown" => $category['leveldown']);
|
|
| 325 |
+ $x++; |
|
| 326 |
+ } |
|
| 327 |
+$x = 0; |
|
| 328 |
+ $result = dbquery("SELECT charname, catid, charid FROM ".TABLEPREFIX."fanfiction_characters ORDER BY charname");
|
|
| 329 |
+ while($char = dbassoc($result)) {
|
|
| 330 |
+ echo "characters[$x] = new character(".$char['charid'].", ".$char['catid'].", \"".str_replace('"', '\"', stripslashes($char['charname']))."\");\r\n";
|
|
| 331 |
+ $charlist[$char['charid']] = array("name" => stripslashes($char['charname']), "catid" => $char['catid']);
|
|
| 332 |
+ $x++; |
|
| 333 |
+ } |
|
| 334 |
+*/ |
|
| 335 |
+echo "</script>"; |
|
| 336 |
+} |
|
| 337 |
+if(file_exists("extra_header.php")) include_once("extra_header.php");
|
|
| 338 |
+if(file_exists("$skindir/extra_header.php")) include_once("$skindir/extra_header.php");
|
|
| 339 |
+if(!$displaycolumns) $displaycolumns = 1; |
|
| 340 |
+$colwidth = floor(100/$displaycolumns); |
|
| 341 |
+if(!empty($_GET['action']) && $_GET['action'] == "printable") {
|
|
| 342 |
+ if(file_exists("$skindir/printable.css")) echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$skindir/printable.css\">";
|
|
| 343 |
+ else echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"default_tpls/printable.css\">"; |
|
| 344 |
+ echo "<script type='text/javascript'> |
|
| 345 |
+<!-- |
|
| 346 |
+if (window.print) {
|
|
| 347 |
+ window.print() ; |
|
| 348 |
+} else {
|
|
| 349 |
+ var WebBrowser = '<OBJECT ID=\"WebBrowser1\" WIDTH=0 HEIGHT=0 CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>'; |
|
| 350 |
+document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
|
|
| 351 |
+ WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = \"\"; |
|
| 352 |
+} |
|
| 353 |
+--> |
|
| 354 |
+</script>"; |
|
| 355 |
+} |
|
| 356 |
+else {
|
|
| 357 |
+echo "<style type=\"text/css\"> |
|
| 358 |
+#columncontainer { margin: 1em auto; width: auto; padding: 5%;}
|
|
| 359 |
+#browseblock, #memberblock { width: 100%; padding: 0; margin: 0; float: left; border: 0px solid transparent; }
|
|
| 360 |
+.column { float: left; width: ".($colwidth - 1)."%; }
|
|
| 361 |
+html>body .column { width: $colwidth%; }
|
|
| 362 |
+.cleaner { clear: both; height: 1px; font-size: 1px; margin: 0; padding: 0; background: transparent; }
|
|
| 363 |
+#settingsform { margin: 0; padding: 0; border: none; }
|
|
| 364 |
+#settingsform FORM { width: 100%; margin: 0 10%; }
|
|
| 365 |
+#settingsform LABEL { float: left; display: block; width: 30%; text-align: right; padding-right: 10px; clear: left; }
|
|
| 366 |
+#settingsform DIV { clear: both;}
|
|
| 367 |
+#settingsform .fieldset SPAN { float: left; display: block; width: 30%; text-align: right; padding-right: 10px; clear: left;}
|
|
| 368 |
+#settingsform .fieldset LABEL { float: none; width: auto; display: inline; text-align: left; clear: none; }
|
|
| 369 |
+#settingsform { float: left; margin: 1ex 10%; }
|
|
| 370 |
+#settingsform .tinytoggle { text-align: center; }
|
|
| 371 |
+#settingsform .tinytoggle LABEL { float: none; display: inline; width: auto; text-align: center; padding: 0; clear: none; }
|
|
| 372 |
+#settingsform #submitdiv { text-align: center; width: 100%;clear: both; height: 3em; }
|
|
| 373 |
+#settingsform #submitdiv #submit { position: absolute; z-index: 10001; margin: 1em; }
|
|
| 374 |
+a.pophelp{
|
|
| 375 |
+ position: relative; /* this is the key*/ |
|
| 376 |
+ vertical-align: super; |
|
| 377 |
+} |
|
| 378 |
+ |
|
| 379 |
+a.pophelp:hover{z-index:100; border: none; text-decoration: none;}
|
|
| 380 |
+ |
|
| 381 |
+a.pophelp span{display: none; position: absolute; top: -25em; left: 20em; }
|
|
| 382 |
+ |
|
| 383 |
+a.pophelp:hover span{ /*the span will display just on :hover state*/
|
|
| 384 |
+ display:block; |
|
| 385 |
+ position: absolute; |
|
| 386 |
+ top: -3em; left: 8em; width: 225px; |
|
| 387 |
+ border:1px solid #000; |
|
| 388 |
+ background-color:#CCC; color:#000; |
|
| 389 |
+ text-decoration: none; |
|
| 390 |
+ text-align: left; |
|
| 391 |
+ padding: 5px; |
|
| 392 |
+ font-weight: normal; |
|
| 393 |
+ visibility: visible; |
|
| 394 |
+} |
|
| 395 |
+.required { color: red; }
|
|
| 396 |
+.shim {
|
|
| 397 |
+ position: absolute; |
|
| 398 |
+ display: none; |
|
| 399 |
+ height: 0; |
|
| 400 |
+ width:0; |
|
| 401 |
+ margin: 0; |
|
| 402 |
+ padding: 0; |
|
| 403 |
+ z-index: 100; |
|
| 404 |
+} |
|
| 405 |
+ |
|
| 406 |
+.ajaxOptList {
|
|
| 407 |
+ background: #CCC; |
|
| 408 |
+ border: 1px solid #000; |
|
| 409 |
+ margin: 0; |
|
| 410 |
+ position: absolute; |
|
| 411 |
+ padding: 0; |
|
| 412 |
+ z-index: 1000; |
|
| 413 |
+ text-align: left; |
|
| 414 |
+} |
|
| 415 |
+.ajaxListOptOver {
|
|
| 416 |
+ padding: 4px; |
|
| 417 |
+ background: #CCC; |
|
| 418 |
+ margin: 0; |
|
| 419 |
+} |
|
| 420 |
+.ajaxListOpt {
|
|
| 421 |
+ background: #EEE; |
|
| 422 |
+ padding: 4px; |
|
| 423 |
+ margin: 0; |
|
| 424 |
+} |
|
| 425 |
+.multiSelect {
|
|
| 426 |
+ width: 300px; |
|
| 427 |
+} |
|
| 428 |
+ |
|
| 429 |
+</style> |
|
| 430 |
+<link rel='stylesheet' type='text/css' href='$skindir/style.css' /> \n |
|
| 431 |
+<meta name='viewport' content='width=device-width, initial-scale=1.0' /> |
|
| 432 |
+"; |
|
| 433 |
+} |
|
| 434 |
+echo "</head>"; |
|
| 435 |
+$headerSent = true; |
|
| 436 |
+include (_BASEDIR."includes/class.TemplatePower.inc.php"); |
|
| 437 |
+if($debug == 1) {
|
|
| 438 |
+ @ error_reporting(E_ALL); |
|
| 439 |
+ echo "\n<!-- \$_SESSION \n"; print_r($_SESSION); echo " -->"; |
|
| 440 |
+ echo "\n<!-- \$_COOKIE \n"; print_r($_COOKIE); echo " -->"; |
|
| 441 |
+ echo "\n<!-- \$_POST \n"; print_r($_POST); echo " -->"; |
|
| 442 |
+} |
|
| 443 |
+?> |
| ... | ... |
@@ -1,571 +1,571 @@ |
| 1 |
-<?php |
|
| 2 |
-// ---------------------------------------------------------------------- |
|
| 3 |
-// Copyright (c) 2007 by Tammy Keefer |
|
| 4 |
-// Based on eFiction 1.1 |
|
| 5 |
-// Copyright (C) 2003 by Rebecca Smallwood. |
|
| 6 |
-// http://efiction.sourceforge.net/ |
|
| 7 |
-// ---------------------------------------------------------------------- |
|
| 8 |
-// LICENSE |
|
| 9 |
-// |
|
| 10 |
-// This program is free software; you can redistribute it and/or |
|
| 11 |
-// modify it under the terms of the GNU General Public License (GPL) |
|
| 12 |
-// as published by the Free Software Foundation; either version 2 |
|
| 13 |
-// of the License, or (at your option) any later version. |
|
| 14 |
-// |
|
| 15 |
-// This program is distributed in the hope that it will be useful, |
|
| 16 |
-// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 17 |
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 18 |
-// GNU General Public License for more details. |
|
| 19 |
-// |
|
| 20 |
-// To read the license please visit http://www.gnu.org/copyleft/gpl.html |
|
| 21 |
-// ---------------------------------------------------------------------- |
|
| 22 |
- |
|
| 23 |
-if(!defined("_CHARSET")) exit( );
|
|
| 24 |
- |
|
| 25 |
-// Validates emails |
|
| 26 |
-function validEmail($str) {
|
|
| 27 |
- return (bool) preg_match('/^[-_a-z0-9\'+*$^&%=~!?{}]++(?:\.[-_a-z0-9\'+*$^&%=~!?{}]+)*@(?:(?![-.])[-a-z0=9.]+(?<![-.])\.[a-z]{2,6}|\d{1,3}(?:\.\d{1,3}){3})(?::\d++)?$/iD', $str);
|
|
| 28 |
-} |
|
| 29 |
- |
|
| 30 |
-// Function used to add and remove stories from category counts |
|
| 31 |
-function categoryitems($catid, $value) |
|
| 32 |
-{
|
|
| 33 |
- //add or subtract one to the current categories |
|
| 34 |
- //find out current category's parent |
|
| 35 |
- if(is_array($catid)) $cats = $catid; |
|
| 36 |
- else $cats = array($catid); |
|
| 37 |
- $cats = array_filter($cats, "isNumber"); |
|
| 38 |
- $catquery = dbquery("SELECT catid, parentcatid, leveldown FROM ".TABLEPREFIX."fanfiction_categories WHERE FIND_IN_SET(catid, '$catid') GROUP BY catid");
|
|
| 39 |
- while(isset($catquery)) {
|
|
| 40 |
- while($cat = dbassoc($catquery)) {
|
|
| 41 |
- $pcats = array(); |
|
| 42 |
- if($cat['leveldown'] > 0) $pcats[] = $cat['parentcatid']; |
|
| 43 |
- if(!in_array($cat['catid'], $cats)) $cats[] = $cat['catid']; |
|
| 44 |
- } |
|
| 45 |
- if(count($pcats) > 0) $catquery = dbquery("SELECT catid, parentcatid, leveldown FROM ".TABLEPREFIX."fanfiction_categories WHERE FIND_IN_SET(catid, '".implode($pcats)."') GROUP BY catid");
|
|
| 46 |
- else unset($catquery); |
|
| 47 |
- } |
|
| 48 |
- dbquery("UPDATE ".TABLEPREFIX."fanfiction_categories SET numitems = (numitems + $value) WHERE FIND_IN_SET(catid, '".implode(",", $cats)."')");
|
|
| 49 |
-} |
|
| 50 |
- |
|
| 51 |
-// Function to recurse through categories to build a list of the category and all it's sub-categories. |
|
| 52 |
-function recurseCategories($catid) {
|
|
| 53 |
- global $catlist; |
|
| 54 |
- $$catid = $catlist; |
|
| 55 |
- $categorylist[] = $catid; |
|
| 56 |
- foreach($$catid as $cat => $info) {
|
|
| 57 |
- if($info['pid'] == $catid) {
|
|
| 58 |
- $categorylist = array_merge($categorylist, recurseCategories($cat)); |
|
| 59 |
- } |
|
| 60 |
- } |
|
| 61 |
- return $categorylist; |
|
| 62 |
-} |
|
| 63 |
- |
|
| 64 |
-// Captcha script validation |
|
| 65 |
-function captcha_confirm() {
|
|
| 66 |
- if(empty($_SESSION[SITEKEY.'_digit'])) return false; |
|
| 67 |
- $digit = $_SESSION[SITEKEY.'_digit']; |
|
| 68 |
- $userdigit = $_POST['userdigit']; |
|
| 69 |
- unset($_SESSION[SITEKEY.'_digit']); |
|
| 70 |
- if($digit == md5(SITEKEY.$userdigit) && $userdigit > 1) return true; |
|
| 71 |
- return false; |
|
| 72 |
-} |
|
| 73 |
- |
|
| 74 |
-// Sanitizes user input to help prevent XSS attacks |
|
| 75 |
-function descript($text) {
|
|
| 76 |
- // Convert problematic ascii characters to their true values |
|
| 77 |
- $search = array("40","41","58","65","66","67","68","69","70",
|
|
| 78 |
- "71","72","73","74","75","76","77","78","79","80","81", |
|
| 79 |
- "82","83","84","85","86","87","88","89","90","97","98", |
|
| 80 |
- "99","100","101","102","103","104","105","106","107", |
|
| 81 |
- "108","109","110","111","112","113","114","115","116", |
|
| 82 |
- "117","118","119","120","121","122"); |
|
| 83 |
- |
|
| 84 |
- $replace = array("(",")",":","a","b","c","d","e","f","g","h",
|
|
| 85 |
- "i","j","k","l","m","n","o","p","q","r","s","t","u", |
|
| 86 |
- "v","w","x","y","z","a","b","c","d","e","f","g","h", |
|
| 87 |
- "i","j","k","l","m","n","o","p","q","r","s","t","u", |
|
| 88 |
- "v","w","x","y","z"); |
|
| 89 |
- |
|
| 90 |
- $entities = count($search); |
|
| 91 |
- |
|
| 92 |
- for ($i=0;$i < $entities;$i++) $text = preg_replace("#(&\#)(0*".$search[$i]."+);*#si", $replace[$i], $text);
|
|
| 93 |
- |
|
| 94 |
- // the following is based on code from bitflux (http://blog.bitflux.ch/wiki/) |
|
| 95 |
- // Kill hexadecimal characters completely |
|
| 96 |
- $text = preg_replace('#(&\#x)([0-9A-F]+);*#si', "", $text);
|
|
| 97 |
- |
|
| 98 |
- // remove any attribute starting with "on" or xmlns |
|
| 99 |
- |
|
| 100 |
- $text = preg_replace('#(<[^>]+[\\"\'\s])(onmouseover|onmousedown|onmouseup|onmouseout|onmousemove|onclick|ondblclick|onload|xmlns)[^>]*>#iU', ">", $text);
|
|
| 101 |
- |
|
| 102 |
- // remove javascript: and vbscript: protocol |
|
| 103 |
- |
|
| 104 |
- $text = preg_replace('#([a-z]*)=([\`\'\"]*)script:#iU', '$1=$2nojscript...', $text);
|
|
| 105 |
- $text = preg_replace('#([a-z]*)=([\`\'\"]*)javascript:#iU', '$1=$2nojavascript...', $text);
|
|
| 106 |
- $text = preg_replace('#([a-z]*)=([\'\"]*)vbscript:#iU', '$1=$2novbscript...', $text);
|
|
| 107 |
- |
|
| 108 |
- //<span style="width: expression(alert('Ping!'));"></span> (only affects ie...)
|
|
| 109 |
- $text = preg_replace('#(<[^>]+)style=([\`\'\"]*).*expression\([^>]*>#iU', "$1>", $text);
|
|
| 110 |
- $text = preg_replace('#(<[^>]+)style=([\`\'\"]*).*behaviour\([^>]*>#iU', "$1>", $text);
|
|
| 111 |
- return $text; |
|
| 112 |
-} |
|
| 113 |
- |
|
| 114 |
-// Call this function when the user tries to do something they shouldn't have access to. |
|
| 115 |
-function accessDenied($str = ""){
|
|
| 116 |
- global $tpl, $output; |
|
| 117 |
- |
|
| 118 |
- if(!empty($str)) $output = write_error($str); |
|
| 119 |
- else $output = write_error(_NOTAUTHORIZED); |
|
| 120 |
- if(!empty($tpl)) {
|
|
| 121 |
- $tpl->assign("output", $output);
|
|
| 122 |
- $tpl->printToScreen( ); |
|
| 123 |
- dbclose( ); |
|
| 124 |
- } |
|
| 125 |
- else echo $output; |
|
| 126 |
- exit( ); |
|
| 127 |
-} |
|
| 128 |
- |
|
| 129 |
-// Call this function when something causes an error and the script has to die. |
|
| 130 |
-function errorExit( $msg = ""){
|
|
| 131 |
- global $tpl, $output; |
|
| 132 |
- |
|
| 133 |
- $output .= write_error(_ERROR.(!empty($msg) ? " " : "").$msg); |
|
| 134 |
- $tpl->assign("output", $output);
|
|
| 135 |
- $tpl->printToScreen( ); |
|
| 136 |
- dbclose( ); |
|
| 137 |
- exit( ); |
|
| 138 |
-} |
|
| 139 |
-// The next three functions are used to calculate the series reviews and rating |
|
| 140 |
- |
|
| 141 |
-function storiesInSeries($thisseries) {
|
|
| 142 |
- $storylist = array( ); |
|
| 143 |
- if(!isNumber($thisseries)) return $storylist; |
|
| 144 |
- $serieslist = array( ); |
|
| 145 |
- $stinseries = dbquery("SELECT sid, subseriesid FROM ".TABLEPREFIX."fanfiction_inseries WHERE seriesid = '$thisseries'");
|
|
| 146 |
- while($st = dbassoc($stinseries)) {
|
|
| 147 |
- if(!empty($st['sid'])) $storylist[] = $st['sid']; |
|
| 148 |
- else if(!empty($st['subseriesid'])) $serieslist[] = $st['subseriesid']; |
|
| 149 |
- } |
|
| 150 |
- if($serieslist) {
|
|
| 151 |
- foreach($serieslist as $s) {
|
|
| 152 |
- $storylist = array_merge($storylist, storiesInSeries($s)); |
|
| 153 |
- } |
|
| 154 |
- } |
|
| 155 |
- return $storylist; |
|
| 156 |
-} |
|
| 157 |
-function subseriesList($thisseries) {
|
|
| 158 |
- $serieslist = array( ); |
|
| 159 |
- if(!isNumber($thisseries)) return $serieslist; |
|
| 160 |
- $stinseries = dbquery("SELECT subseriesid FROM ".TABLEPREFIX."fanfiction_inseries WHERE seriesid = '$thisseries'");
|
|
| 161 |
- while($st = dbassoc($stinseries)) {
|
|
| 162 |
- $serieslist[] = $st['subseriesid']; |
|
| 163 |
- $serieslist = array_merge($serieslist, subseriesList($st['subseriesid'])); |
|
| 164 |
- } |
|
| 165 |
- return $serieslist; |
|
| 166 |
-} |
|
| 167 |
- |
|
| 168 |
-function seriesreview($thisseries) {
|
|
| 169 |
- |
|
| 170 |
- if(!isNumber($thisseries)) return; |
|
| 171 |
- $storylist = storiesInSeries($thisseries); |
|
| 172 |
- $serieslist = subseriesList($thisseries); |
|
| 173 |
-$newrating = dbquery("SELECT AVG(rating) as totalreviews FROM ".TABLEPREFIX."fanfiction_reviews
|
|
| 174 |
- WHERE ((item = '$thisseries' AND type = 'SE')". |
|
| 175 |
- (count($storylist) > 0 ? " OR (FIND_IN_SET(item, '".(implode(",", $storylist))."') > 0 AND type = 'ST')" : "").
|
|
| 176 |
- (count($serieslist) > 0 ? " OR (FIND_IN_SET(item, '".(implode(",", $serieslist))."') > 0 AND type = 'SE')" : "").
|
|
| 177 |
- ") AND rating != '-1'"); |
|
| 178 |
-list($totalreviews) = dbrow($newrating); |
|
| 179 |
-$newcount = dbquery("SELECT count(reviewid) as totalcount FROM ".TABLEPREFIX."fanfiction_reviews
|
|
| 180 |
- WHERE ((item = '$thisseries' AND type = 'SE')". |
|
| 181 |
- (count($storylist) > 0 ? " OR (FIND_IN_SET(item, '".(implode(",", $storylist))."') > 0 AND type = 'ST')" : "").
|
|
| 182 |
- (count($serieslist) > 0 ? " OR (FIND_IN_SET(item, '".(implode(",", $serieslist))."') > 0 AND type = 'SE')" : "").
|
|
| 183 |
- ") AND review != 'No Review'"); |
|
| 184 |
-list($totalcount) = dbrow($newcount); |
|
| 185 |
-if($totalcount) $update = dbquery("UPDATE ".TABLEPREFIX."fanfiction_series SET rating = '".round($totalreviews)."', reviews = '$totalcount' WHERE seriesid = '$thisseries'");
|
|
| 186 |
-$parentq = dbquery("SELECT seriesid FROM ".TABLEPREFIX."fanfiction_inseries WHERE subseriesid = '$thisseries' AND seriesid != '$thisseries'");
|
|
| 187 |
-while($parent2 = dbassoc($parentq)) { seriesreview($parent2['seriesid']); }
|
|
| 188 |
- |
|
| 189 |
-} |
|
| 190 |
- |
|
| 191 |
-// Per a suggestion from jrabbit, we'll use this function to optimize some queries |
|
| 192 |
-function findclause($field,$set) {
|
|
| 193 |
- if (empty($set)) {
|
|
| 194 |
- return "1 = 0"; |
|
| 195 |
- } |
|
| 196 |
- if(is_array($set)) $set = implode(",", $set);
|
|
| 197 |
- if (strpos($set,',')>0) {
|
|
| 198 |
- return "FIND_IN_SET($field,'$set') > 0"; |
|
| 199 |
- } |
|
| 200 |
- return "$field='$set'"; |
|
| 201 |
-} |
|
| 202 |
- |
|
| 203 |
-// Added 3.3 |
|
| 204 |
-function nl2br2($string) {
|
|
| 205 |
- $string = str_replace(array("\r\n", "\r", "\n"), "<br />", $string);
|
|
| 206 |
- return $string; |
|
| 207 |
-} |
|
| 208 |
- |
|
| 209 |
-// Formats the text of the story when displayed on screen. |
|
| 210 |
-function format_story($text) {
|
|
| 211 |
- $text = trim($text); |
|
| 212 |
- if(strpos($text, "<br>") === false && strpos($text, "<p>") === false && strpos($text, "<br />") === false) $text = nl2br2($text); |
|
| 213 |
- if(_CHARSET != "ISO-8859-1" && _CHARSET != "US-ASCII") return stripslashes($text); |
|
| 214 |
- $badwordchars = array(chr(212), chr(213), chr(210), chr(211), chr(209), chr(208), chr(201), chr(145), chr(146), chr(147), chr(148), chr(151), chr(150), chr(133)); |
|
| 215 |
- $fixedwordchars = array('‘', '’', '“', '”', '—', '–', '…', '‘', '’', '“', '”', '—', '–', '…' );
|
|
| 216 |
- $text = str_replace($badwordchars,$fixedwordchars,stripslashes($text)); |
|
| 217 |
- return $text; |
|
| 218 |
-} |
|
| 219 |
- |
|
| 220 |
-// Function to Spam-protect emails. Is called for the IM fields in the user's profile. |
|
| 221 |
-function format_email($text) {
|
|
| 222 |
- $search = array('@', '.');
|
|
| 223 |
- $replace = array(" [AT] ", " [DOT] ");
|
|
| 224 |
- return str_replace($search, $replace, $text); |
|
| 225 |
-} |
|
| 226 |
- |
|
| 227 |
-// Function to format a URL into a clickable link |
|
| 228 |
-function format_link($text, $title = "", $target = 0) {
|
|
| 229 |
- if(empty($title)) $title = $text; |
|
| 230 |
- if(strpos($text, "http://") === false) $text = "http://".$text; |
|
| 231 |
- $text = "<a href='$text'".($target ? " target='_blank'" : "").">$title</a>"; |
|
| 232 |
- return $text; |
|
| 233 |
-} |
|
| 234 |
- |
|
| 235 |
-// Because this is used in places other than the listings of stories, we're setting it up as a function to be called as needed. |
|
| 236 |
-function title_link($stories) {
|
|
| 237 |
- global $ratingslist, $ageconsent, $disablepopups; |
|
| 238 |
- |
|
| 239 |
- $rating = $stories['rid']; |
|
| 240 |
- $warningtext = !empty($ratingslist[$rating]['warningtext']) ? addslashes(strip_tags($ratingslist[$rating]['warningtext'])) : ""; |
|
| 241 |
- if(empty($ratingslist[$rating]['ratingwarning'])) |
|
| 242 |
- $title = "<a href=\""._BASEDIR."viewstory.php?sid=".$stories['sid']."\">".$stories['title']."</a>"; |
|
| 243 |
- else {
|
|
| 244 |
- $warning = ""; |
|
| 245 |
- $warninglevel = sprintf("%03b", $ratingslist[$rating]['ratingwarning']);
|
|
| 246 |
- if($warninglevel[2] && !isset($_SESSION[SITEKEY."_warned"][$rating])) {
|
|
| 247 |
- $location = "viewstory.php?sid=".$stories['sid']."&warning=$rating"; |
|
| 248 |
- $warning = $warningtext; |
|
| 249 |
- } |
|
| 250 |
- if($warninglevel[1] && !$ageconsent && empty($_SESSION[SITEKEY.'_ageconsent'])) {
|
|
| 251 |
- $location = "viewstory.php?sid=".$stories['sid']."&ageconsent=ok&warning=$rating"; |
|
| 252 |
- $warning = _AGECHECK." - "._AGECONSENT." ".$warningtext." -- 1"; |
|
| 253 |
- } |
|
| 254 |
- if($warninglevel[0] && !isMEMBER) {
|
|
| 255 |
- $location = "user.php?action=login&sid=".$stories['sid']; |
|
| 256 |
- $warning = _RUSERSONLY." - $warningtext"; |
|
| 257 |
- } |
|
| 258 |
- if(!empty($warning)) {
|
|
| 259 |
- $warning = preg_replace("@'@", "\'", $warning);
|
|
| 260 |
- $title = "<a href=\"javascript:if(confirm('".$warning."')) location = '"._BASEDIR."$location'\">".$stories['title']."</a>";
|
|
| 261 |
- } |
|
| 262 |
- else $title = "<a href=\""._BASEDIR."viewstory.php?sid=".$stories['sid']."\">".$stories['title']."</a>"; |
|
| 263 |
- } |
|
| 264 |
- return $title; |
|
| 265 |
-} |
|
| 266 |
- |
|
| 267 |
-// Same with the author list |
|
| 268 |
-function author_link($stories) {
|
|
| 269 |
- if(is_array($stories['coauthors'])) {
|
|
| 270 |
- $authlink[] = "<a href=\""._BASEDIR."viewuser.php?uid=".$stories['uid']."\">".$stories['penname']."</a>"; |
|
| 271 |
- $coauth = dbquery("SELECT "._PENNAMEFIELD." as penname, co.uid FROM ".TABLEPREFIX."fanfiction_coauthors AS co LEFT JOIN "._AUTHORTABLE." ON co.uid = "._UIDFIELD." WHERE co.sid = '".$stories['sid']."'");
|
|
| 272 |
- foreach($stories['coauthors'] AS $k => $v) {
|
|
| 273 |
- $authlink[] = "<a href=\""._BASEDIR."viewuser.php?uid=".$k."\">".$v."</a>"; |
|
| 274 |
- } |
|
| 275 |
- } |
|
| 276 |
- return isset($authlink) ? implode(", ", $authlink) : "<a href=\""._BASEDIR."viewuser.php?uid=".$stories['uid']."\">".$stories['penname']."</a>";
|
|
| 277 |
-} |
|
| 278 |
- |
|
| 279 |
-// Used to truncate text (summaries in blocks for example) to a set length. An improvement on the old version as this keeps words intact |
|
| 280 |
-function truncate_text($str, $n = 75, $delim='...') {
|
|
| 281 |
- $len = strlen($str); |
|
| 282 |
- if($len > $n) {
|
|
| 283 |
- $pos = strpos($str, " ", $n); |
|
| 284 |
- if($pos) $str = trim(substr($str, 0, $pos), "\n\t\.,"). $delim; |
|
| 285 |
- } |
|
| 286 |
- return closetags($str); |
|
| 287 |
-} |
|
| 288 |
- |
|
| 289 |
-// A helper function for the truncate_text function. This will close all open tags |
|
| 290 |
-function closetags($html){
|
|
| 291 |
- |
|
| 292 |
- $donotclose=array('br','img','input', 'hr');
|
|
| 293 |
- preg_match_all("#<([a-z]+)( .*)?(?!/)>#iU",$html,$result);
|
|
| 294 |
- $openedtags=$result[1]; |
|
| 295 |
- |
|
| 296 |
- preg_match_all("#</([a-z]+)>#iU",$html,$result);
|
|
| 297 |
- $closedtags=$result[1]; |
|
| 298 |
- $len_opened = count($openedtags); |
|
| 299 |
- if(count($closedtags) == $len_opened){
|
|
| 300 |
- return $html; |
|
| 301 |
- } |
|
| 302 |
- |
|
| 303 |
- $openedtags = array_reverse($openedtags); |
|
| 304 |
- |
|
| 305 |
- for($i=0;$i < $len_opened;$i++) {
|
|
| 306 |
- |
|
| 307 |
- if (!in_array($openedtags[$i],$closedtags) && !in_array($openedtags[$i], $donotclose)){
|
|
| 308 |
- $html .= '</'.$openedtags[$i].'>'; |
|
| 309 |
- } |
|
| 310 |
- else {
|
|
| 311 |
- unset($closedtags[array_search($openedtags[$i],$closedtags)]); |
|
| 312 |
- } |
|
| 313 |
- } |
|
| 314 |
- return $html; |
|
| 315 |
-} |
|
| 316 |
- |
|
| 317 |
-// Builds the naughty word list for the site's censor |
|
| 318 |
-function build_word($myword) {
|
|
| 319 |
- $letters =preg_split('//',$myword, -1, PREG_SPLIT_NO_EMPTY);
|
|
| 320 |
- $word = ""; |
|
| 321 |
- foreach($letters as $letter) {
|
|
| 322 |
- if($word != "") $word .= "\W+"; |
|
| 323 |
- $word .= $letter; |
|
| 324 |
- } |
|
| 325 |
- return $word; |
|
| 326 |
- |
|
| 327 |
-} |
|
| 328 |
- |
|
| 329 |
-// Finds forbidden words in text. Returns true if a forbidden word is found |
|
| 330 |
-function find_naughty($text) {
|
|
| 331 |
- global $words; |
|
| 332 |
- if(!count($words)) return false; |
|
| 333 |
- $naughty = 0; |
|
| 334 |
- for($i = 0; $i < sizeof($words); $i++) {
|
|
| 335 |
- if(strpos($words[$i], "*") === false) {
|
|
| 336 |
- // check for whole word |
|
| 337 |
- if(preg_match('/(\s|^)+(('.$words[$i].')|('.build_word($words[$i]).')+(s|es)?)+(\W|$)+/i', $text, $match)) {
|
|
| 338 |
- echo $words[$i] ." 0=".$match[0]; |
|
| 339 |
- $naughty = 1; |
|
| 340 |
- } |
|
| 341 |
- } |
|
| 342 |
- if(strpos($words[$i], "*") !== false && strpos($words[$i], "*") == 0 && !$naughty) {
|
|
| 343 |
- // remove the * from the beginning of the word |
|
| 344 |
- $word = substr($words[$i], 1, strlen($words[$i])); |
|
| 345 |
- if(strrpos($word, "*") == strlen($word) - 1) $word = substr($word, 0, strlen($word) - 1); |
|
| 346 |
- // check for whole word plus word as suffix |
|
| 347 |
- if(preg_match('/[\s|^]+\w*('.$word.'|\W'.build_word($word).')+(s|es)?(\W|$)/i', $text, $match)) $naughty = 1;
|
|
| 348 |
- } |
|
| 349 |
- if(strrpos($words[$i], "*") == strlen($words[$i]) - 1 && !$naughty) {
|
|
| 350 |
- // remove the * from the end of the word |
|
| 351 |
- $word = substr($words[$i], 0, strlen($words[$i]) - 1); |
|
| 352 |
- if(strpos($word, "*") !== false && strpos($word, "*") == 0) $word = substr($word, 1, strlen($word)); |
|
| 353 |
- // check for whole word plus word as prefix |
|
| 354 |
- if(preg_match('/(\s|^)('.$word.'|'.build_word($word).'\W)+\w*(s|es)?(\W|$)/i', $text, $match)) $naughty = 1;
|
|
| 355 |
- } |
|
| 356 |
- if($naughty) break; // no sense continuing down the list and this will make it run faster |
|
| 357 |
- } |
|
| 358 |
- return $naughty; |
|
| 359 |
-} |
|
| 360 |
- |
|
| 361 |
-// Replaces forbidden words in text. The forbidden word is replaced with the first letter and trailing *** |
|
| 362 |
-function replace_naughty($text) {
|
|
| 363 |
- global $words; |
|
| 364 |
- |
|
| 365 |
- if(!count($words)) return $text; |
|
| 366 |
- $i = 0; |
|
| 367 |
- for($j = 0; $j < sizeof($words); $j++) {
|
|
| 368 |
- if(strpos($words[$j], "*") === false) {
|
|
| 369 |
- $replace[$i] = str_pad($words[$j]{0}, strlen($words[$j]), "*");
|
|
| 370 |
- $naughtywords[$i] = '/\b('.$words[$j].'\b)|('.build_word($words[$j]).')\b/i';
|
|
| 371 |
- $i++; |
|
| 372 |
- } |
|
| 373 |
- |
|
| 374 |
- if(strpos($words[$j], "*") !== false && strpos($words[$j], "*") == 0) {
|
|
| 375 |
- $word = substr($words[$j], 1, strlen($words[$j])); |
|
| 376 |
- if(strrpos($word, "*") == strlen($word) - 1) $word = substr($word, 0, strlen($word) - 1); |
|
| 377 |
- $naughtywords[$i] = '/(\s|^)+(\w*)+('.$word.'|'.build_word($word).')/i';
|
|
| 378 |
- $replace[$i] = "$1$2".str_pad(substr($word, 0, 1), strlen($word), "*"); |
|
| 379 |
- $i++; |
|
| 380 |
- } |
|
| 381 |
- if(strrpos($words[$j], "*") == strlen($words[$j]) - 1) {
|
|
| 382 |
- $word = substr($words[$j], 0, strlen($words[$j]) - 1); |
|
| 383 |
- if(strpos($word, "*") !== false && strpos($word, "*") == 0) $word = substr($word, 1, strlen($word)); |
|
| 384 |
- $replace[$i] = '$1'.str_pad(substr($word, 0, 1), strlen($word), "*").'$3'; |
|
| 385 |
- $naughtywords[$i] = '/(.*)('.$word.'|'.build_word($word).')(\s|\w)/i';
|
|
| 386 |
- $i++; |
|
| 387 |
- } |
|
| 388 |
- } |
|
| 389 |
- $text = preg_replace($naughtywords, $replace, $text); |
|
| 390 |
- return $text; |
|
| 391 |
-} |
|
| 392 |
- |
|
| 393 |
-// Format for messages sent back from various forms and actions |
|
| 394 |
-function write_message($str) {
|
|
| 395 |
- return "<div style='text-align: center; margin: 1em;'>$str</div>"; |
|
| 396 |
-} |
|
| 397 |
- |
|
| 398 |
-// Formats error messages sent back from various forms and actions |
|
| 399 |
-function write_error($str) {
|
|
| 400 |
- return "<div style='text-align: center; margin: 1em;' class='errortext'>$str</div>"; |
|
| 401 |
-} |
|
| 402 |
- |
|
| 403 |
-// Checks that the given $num is actually a number. Used to help prevent XSS attacks. |
|
| 404 |
-function isNumber($num) {
|
|
| 405 |
- if(empty($num)) return false; |
|
| 406 |
- if(!is_string($num)) return false; |
|
| 407 |
- return preg_match("/^[0-9]+$/", $num);
|
|
| 408 |
-} |
|
| 409 |
- |
|
| 410 |
-// May be needed for sites that have bridged the authors table |
|
| 411 |
-function check_prefs($uid) {
|
|
| 412 |
- $test = dbquery("SELECT uid FROM ".TABLEPREFIX."fanfiction_authorprefs WHERE uid = '$uid'");
|
|
| 413 |
- if(dbnumrows($test)) return true; |
|
| 414 |
- else return false; |
|
| 415 |
-} |
|
| 416 |
- |
|
| 417 |
-// Function builds the alphabet links on various pages. |
|
| 418 |
-function build_alphalinks($url, $let) {
|
|
| 419 |
- global $alphabet; |
|
| 420 |
- |
|
| 421 |
- $alpha = "<div id=\"alphabet\">"; |
|
| 422 |
- foreach( $alphabet as $link ) {
|
|
| 423 |
- // Build a link that calls a function with ($link and 1 (page number) ) |
|
| 424 |
- $alpha .= "<a href=\"{$url}let=$link\"".($let == $link ? " id='currentletter'" : "").">$link</a> \n";
|
|
| 425 |
- } |
|
| 426 |
- $alpha .= "</div>"; |
|
| 427 |
- return $alpha; |
|
| 428 |
-} |
|
| 429 |
- |
|
| 430 |
-// Function builds the pagination links |
|
| 431 |
-function build_pagelinks($url, $total, $offset = 0, $columns = 1) {
|
|
| 432 |
- global $itemsperpage, $linkstyle, $linkrange; |
|
| 433 |
- $pages = ""; |
|
| 434 |
- $itemsperpage = $itemsperpage * $columns; |
|
| 435 |
- |
|
| 436 |
- if($itemsperpage >= $total) return; |
|
| 437 |
- |
|
| 438 |
- if(empty($linkrange)) $linkrange = 4; |
|
| 439 |
- |
|
| 440 |
- $totpages = floor($total/$itemsperpage) + ($total % $itemsperpage ? 1 : 0); |
|
| 441 |
- $curpage = floor($offset/$itemsperpage) + 1; |
|
| 442 |
- if(!$linkstyle) $startrange = $curpage; |
|
| 443 |
- else {
|
|
| 444 |
- if($totpages <= $linkrange || $curpage == 1) $startrange = 1; |
|
| 445 |
- else if($curpage >= $totpages - floor($linkrange / 2) + 1) $startrange = $totpages - $linkrange; |
|
| 446 |
- else $startrange = $curpage - floor($linkrange / 2) > 0 ? $curpage - floor($linkrange / 2) : 1; |
|
| 447 |
- } |
|
| 448 |
- if($startrange >= $totpages - $linkrange ) $startrange = $totpages - $linkrange > 0 ? $totpages - $linkrange : 1; |
|
| 449 |
- $stoprange = $totpages > $startrange + $linkrange ? $startrange + $linkrange : $totpages + 1; |
|
| 450 |
- if($curpage > 1 && $linkstyle != 1) $pages .= "<a href='".$url."offset=".( $offset - $itemsperpage)."' id='plprev'>["._PREVIOUS."]</a> "; |
|
| 451 |
- if($startrange > 1 && $linkstyle > 0) $pages .= "<a href='".$url."offset=0'>1</a><span class='ellipses'>...</span>"; |
|
| 452 |
- for($x = $startrange; $x < $stoprange; $x++) {
|
|
| 453 |
- $pages .= "<a href='".$url."offset=".(($x - 1) * $itemsperpage)."'".($x == $curpage ? "id='currentpage'" : "").">".$x."</a> \n"; |
|
| 454 |
- } |
|
| 455 |
- if($stoprange < $totpages && $linkstyle > 0) $pages .= "<span class='ellipses'>...</span> <a href='".$url."offset=".(($totpages - 1) * $itemsperpage)."'>$totpages</a>\n"; |
|
| 456 |
- if ($curpage < $totpages && $linkstyle != 1) $pages .= " <a href='".$url."offset=".($offset+$itemsperpage)."' id='plnext'>["._NEXT."]</a>"; |
|
| 457 |
- return "<div id=\"pagelinks\">$pages</div>"; |
|
| 458 |
-} |
|
| 459 |
- |
|
| 460 |
-// Function that returns the ratings picks |
|
| 461 |
-function ratingpics($rating) {
|
|
| 462 |
- global $ratings, $like, $dislike, $star, $halfstar; |
|
| 463 |
- $ratingpics = ""; |
|
| 464 |
- if($ratings == "2") {
|
|
| 465 |
- if($rating >= 0.5) |
|
| 466 |
- $ratingpics = ($like ? $like : "<img src=\""._BASEDIR."images/like.gif\" alt=\""._LIKED."\">"); |
|
| 467 |
- else if(($rating < 0.5) && ($rating > 0)) |
|
| 468 |
- $ratingpics = ($dislike ? $dislike :"<img src=\""._BASEDIR."images/dislike.gif\" alt=\""._DISLIKED."\">"); |
|
| 469 |
- else $ratingpics = ""; |
|
| 470 |
- } |
|
| 471 |
- if($ratings == "1") {
|
|
| 472 |
- global $star, $halfstar; |
|
| 473 |
- if($rating > 0) {
|
|
| 474 |
- for($x = 0; $x < ($rating / 2) - .5; $x++) {
|
|
| 475 |
- $ratingpics .= ($star ? $star : "<img src=\""._BASEDIR."images/star.gif\" alt=\"star\">"); |
|
| 476 |
- } |
|
| 477 |
- if($rating % 2 != 0) $ratingpics .= ($halfstar ? $halfstar : "<img src=\""._BASEDIR."images/starhalf.gif\" alt=\"half-star\">"); |
|
| 478 |
- } |
|
| 479 |
- else $ratingpics = ""; |
|
| 480 |
- } |
|
| 481 |
- if(!empty($ratingpics)) return "<span style='white-space: nowrap;'>$ratingpics</span>"; // the no-wrap style will keep the stars together |
|
| 482 |
- else return; |
|
| 483 |
-} |
|
| 484 |
- |
|
| 485 |
-// This function builds the list of category links (including the breadcrumb depending on settings) |
|
| 486 |
-function catlist($catid) {
|
|
| 487 |
- global $extendcats, $catlist, $action; |
|
| 488 |
- |
|
| 489 |
- if(!is_array($catid)) $catid = explode(",", $catid);
|
|
| 490 |
- $categorylinks = array(); |
|
| 491 |
- foreach($catid as $cat) {
|
|
| 492 |
- if(empty($catlist[$cat])) continue; |
|
| 493 |
- if($extendcats) {
|
|
| 494 |
- unset($link); |
|
| 495 |
- $thiscat = $cat; |
|
| 496 |
- while(isset($thiscat)) {
|
|
| 497 |
- if(isset($link)) $link = " > ".$link; |
|
| 498 |
- else $link = ""; |
|
| 499 |
- if($action != "printable") $link = "<a href='"._BASEDIR."browse.php?type=categories&catid=$thiscat'>".$catlist[$thiscat]['name']."</a>".$link; |
|
| 500 |
- else $link = $catlist[$thiscat]['name'].$link; |
|
| 501 |
- if($catlist[$thiscat]['pid'] == -1) unset($thiscat); |
|
| 502 |
- else $thiscat = $catlist[$thiscat]['pid']; |
|
| 503 |
- } |
|
| 504 |
- $categorylinks[] = $link; |
|
| 505 |
- } |
|
| 506 |
- else $categorylinks[] = "<a href='"._BASEDIR."browse.php?type=categories&catid=$cat'>".$catlist[$cat]['name']."</a>"; |
|
| 507 |
- } |
|
| 508 |
- return implode(", ", $categorylinks);
|
|
| 509 |
-} |
|
| 510 |
- |
|
| 511 |
-// This function builds the list of character links |
|
| 512 |
-function charlist($characters) {
|
|
| 513 |
- global $charlist, $action; |
|
| 514 |
- |
|
| 515 |
- if(!is_array($characters)) $characters = explode(",", $characters);
|
|
| 516 |
- $charlinks = array( ); |
|
| 517 |
- foreach($characters as $c) {
|
|
| 518 |
- if(empty($charlist[$c]['name'])) continue; |
|
| 519 |
- if($action != "printable") $charlinks[] = "<a href='"._BASEDIR."browse.php?type=characters&charid=$c'>".$charlist[$c]['name']."</a>"; |
|
| 520 |
- else $charlinks[] = $charlist[$c]['name']; |
|
| 521 |
- } |
|
| 522 |
- return implode(", ", $charlinks);
|
|
| 523 |
-} |
|
| 524 |
- |
|
| 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) {
|
|
| 527 |
- global $tpl, $new, $ratingslist, $itemsperpage, $reviewsallowed, $output, $dateformat, $current, $featured, $favorites, $retired, $ageconsent, $classtypelist, $classlist, $offset, $recentdays; |
|
| 528 |
- |
|
| 529 |
- $count = dbquery($countquery); |
|
| 530 |
- list($numrows) = dbrow($count); |
|
| 531 |
- if($numrows) {
|
|
| 532 |
- $tpl->assign("output", ($pagetitle ? "<div id=\"pagetitle\">$pagetitle</div>" : ""));
|
|
| 533 |
- $tpl->newBlock("listings");
|
|
| 534 |
- if(!$ratingslist) {
|
|
| 535 |
- $ratlist = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_ratings");
|
|
| 536 |
- while($rate = dbassoc($ratlist)) {
|
|
| 537 |
- $ratings[$rate['rid']] = array("rating" => $rate['rating'], "ratingwarning" => $rate['ratingwarning'], "warningtext" => $rate['warningtext']);
|
|
| 538 |
- } |
|
| 539 |
- } |
|
| 540 |
- $tpl->newBlock("listings");
|
|
| 541 |
- $tpl->gotoBlock("listings");
|
|
| 542 |
- $tpl->assign("stories", "<div class=\"sectionheader\">"._STORIES."</div>");
|
|
| 543 |
- $storyquery .= " LIMIT $offset, $itemsperpage"; |
|
| 544 |
- $result3 = dbquery($storyquery); |
|
| 545 |
- $count = 0; |
|
| 546 |
- while($stories = dbassoc($result3)) {
|
|
| 547 |
- $tpl->newBlock("storyblock");
|
|
| 548 |
- include(_BASEDIR."includes/storyblock.php"); |
|
| 549 |
- } |
|
| 550 |
- $tpl->gotoBlock("_ROOT");
|
|
| 551 |
- } |
|
| 552 |
- else {
|
|
| 553 |
- $tpl->newBlock("listings");
|
|
| 554 |
- $tpl->assign("pagelinks", write_message(_NORESULTS));
|
|
| 555 |
- } |
|
| 556 |
- if($numrows > $itemsperpage) {
|
|
| 557 |
- $termArray = array_merge($_GET, $_POST); |
|
| 558 |
- $terms = array(); |
|
| 559 |
- foreach($termArray as $term => $value) {
|
|
| 560 |
- if($term == "submit" || $term == "go" || $term == "offset" || ($term != "complete" &&empty($value))) continue; |
|
| 561 |
- $terms[] = "$term=".(is_array($value) ? implode(",", $value) : $value);
|
|
| 562 |
- } |
|
| 563 |
- $terms = implode("&", $terms);
|
|
| 564 |
- $terms .= "&"; |
|
| 565 |
- $tpl->gotoBlock("listings");
|
|
| 566 |
- $tpl->assign( "pagelinks", build_pagelinks($pagelink.$terms, $numrows, $offset)); |
|
| 567 |
- } |
|
| 568 |
- $tpl->gotoBlock("_ROOT");
|
|
| 569 |
- return $numrows; |
|
| 570 |
-} |
|
| 1 |
+<?php |
|
| 2 |
+// ---------------------------------------------------------------------- |
|
| 3 |
+// Copyright (c) 2007 by Tammy Keefer |
|
| 4 |
+// Based on eFiction 1.1 |
|
| 5 |
+// Copyright (C) 2003 by Rebecca Smallwood. |
|
| 6 |
+// http://efiction.sourceforge.net/ |
|
| 7 |
+// ---------------------------------------------------------------------- |
|
| 8 |
+// LICENSE |
|
| 9 |
+// |
|
| 10 |
+// This program is free software; you can redistribute it and/or |
|
| 11 |
+// modify it under the terms of the GNU General Public License (GPL) |
|
| 12 |
+// as published by the Free Software Foundation; either version 2 |
|
| 13 |
+// of the License, or (at your option) any later version. |
|
| 14 |
+// |
|
| 15 |
+// This program is distributed in the hope that it will be useful, |
|
| 16 |
+// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 17 |
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 18 |
+// GNU General Public License for more details. |
|
| 19 |
+// |
|
| 20 |
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html |
|
| 21 |
+// ---------------------------------------------------------------------- |
|
| 22 |
+ |
|
| 23 |
+if(!defined("_CHARSET")) exit( );
|
|
| 24 |
+ |
|
| 25 |
+// Validates emails |
|
| 26 |
+function validEmail($str) {
|
|
| 27 |
+ return (bool) preg_match('/^[-_a-z0-9\'+*$^&%=~!?{}]++(?:\.[-_a-z0-9\'+*$^&%=~!?{}]+)*@(?:(?![-.])[-a-z0=9.]+(?<![-.])\.[a-z]{2,6}|\d{1,3}(?:\.\d{1,3}){3})(?::\d++)?$/iD', $str);
|
|
| 28 |
+} |
|
| 29 |
+ |
|
| 30 |
+// Function used to add and remove stories from category counts |
|
| 31 |
+function categoryitems($catid, $value) |
|
| 32 |
+{
|
|
| 33 |
+ //add or subtract one to the current categories |
|
| 34 |
+ //find out current category's parent |
|
| 35 |
+ if(is_array($catid)) $cats = $catid; |
|
| 36 |
+ else $cats = array($catid); |
|
| 37 |
+ $cats = array_filter($cats, "isNumber"); |
|
| 38 |
+ $catquery = dbquery("SELECT catid, parentcatid, leveldown FROM ".TABLEPREFIX."fanfiction_categories WHERE FIND_IN_SET(catid, '$catid') GROUP BY catid");
|
|
| 39 |
+ while(isset($catquery)) {
|
|
| 40 |
+ while($cat = dbassoc($catquery)) {
|
|
| 41 |
+ $pcats = array(); |
|
| 42 |
+ if($cat['leveldown'] > 0) $pcats[] = $cat['parentcatid']; |
|
| 43 |
+ if(!in_array($cat['catid'], $cats)) $cats[] = $cat['catid']; |
|
| 44 |
+ } |
|
| 45 |
+ if(count($pcats) > 0) $catquery = dbquery("SELECT catid, parentcatid, leveldown FROM ".TABLEPREFIX."fanfiction_categories WHERE FIND_IN_SET(catid, '".implode($pcats)."') GROUP BY catid");
|
|
| 46 |
+ else unset($catquery); |
|
| 47 |
+ } |
|
| 48 |
+ dbquery("UPDATE ".TABLEPREFIX."fanfiction_categories SET numitems = (numitems + $value) WHERE FIND_IN_SET(catid, '".implode(",", $cats)."')");
|
|
| 49 |
+} |
|
| 50 |
+ |
|
| 51 |
+// Function to recurse through categories to build a list of the category and all it's sub-categories. |
|
| 52 |
+function recurseCategories($catid) {
|
|
| 53 |
+ global $catlist; |
|
| 54 |
+ $$catid = $catlist; |
|
| 55 |
+ $categorylist[] = $catid; |
|
| 56 |
+ foreach($$catid as $cat => $info) {
|
|
| 57 |
+ if($info['pid'] == $catid) {
|
|
| 58 |
+ $categorylist = array_merge($categorylist, recurseCategories($cat)); |
|
| 59 |
+ } |
|
| 60 |
+ } |
|
| 61 |
+ return $categorylist; |
|
| 62 |
+} |
|
| 63 |
+ |
|
| 64 |
+// Captcha script validation |
|
| 65 |
+function captcha_confirm() {
|
|
| 66 |
+ if(empty($_SESSION[SITEKEY.'_digit'])) return false; |
|
| 67 |
+ $digit = $_SESSION[SITEKEY.'_digit']; |
|
| 68 |
+ $userdigit = $_POST['userdigit']; |
|
| 69 |
+ unset($_SESSION[SITEKEY.'_digit']); |
|
| 70 |
+ if($digit == md5(SITEKEY.$userdigit) && $userdigit > 1) return true; |
|
| 71 |
+ return false; |
|
| 72 |
+} |
|
| 73 |
+ |
|
| 74 |
+// Sanitizes user input to help prevent XSS attacks |
|
| 75 |
+function descript($text) {
|
|
| 76 |
+ // Convert problematic ascii characters to their true values |
|
| 77 |
+ $search = array("40","41","58","65","66","67","68","69","70",
|
|
| 78 |
+ "71","72","73","74","75","76","77","78","79","80","81", |
|
| 79 |
+ "82","83","84","85","86","87","88","89","90","97","98", |
|
| 80 |
+ "99","100","101","102","103","104","105","106","107", |
|
| 81 |
+ "108","109","110","111","112","113","114","115","116", |
|
| 82 |
+ "117","118","119","120","121","122"); |
|
| 83 |
+ |
|
| 84 |
+ $replace = array("(",")",":","a","b","c","d","e","f","g","h",
|
|
| 85 |
+ "i","j","k","l","m","n","o","p","q","r","s","t","u", |
|
| 86 |
+ "v","w","x","y","z","a","b","c","d","e","f","g","h", |
|
| 87 |
+ "i","j","k","l","m","n","o","p","q","r","s","t","u", |
|
| 88 |
+ "v","w","x","y","z"); |
|
| 89 |
+ |
|
| 90 |
+ $entities = count($search); |
|
| 91 |
+ |
|
| 92 |
+ for ($i=0;$i < $entities;$i++) $text = preg_replace("#(&\#)(0*".$search[$i]."+);*#si", $replace[$i], $text);
|
|
| 93 |
+ |
|
| 94 |
+ // the following is based on code from bitflux (http://blog.bitflux.ch/wiki/) |
|
| 95 |
+ // Kill hexadecimal characters completely |
|
| 96 |
+ $text = preg_replace('#(&\#x)([0-9A-F]+);*#si', "", $text);
|
|
| 97 |
+ |
|
| 98 |
+ // remove any attribute starting with "on" or xmlns |
|
| 99 |
+ |
|
| 100 |
+ $text = preg_replace('#(<[^>]+[\\"\'\s])(onmouseover|onmousedown|onmouseup|onmouseout|onmousemove|onclick|ondblclick|onload|xmlns)[^>]*>#iU', ">", $text);
|
|
| 101 |
+ |
|
| 102 |
+ // remove javascript: and vbscript: protocol |
|
| 103 |
+ |
|
| 104 |
+ $text = preg_replace('#([a-z]*)=([\`\'\"]*)script:#iU', '$1=$2nojscript...', $text);
|
|
| 105 |
+ $text = preg_replace('#([a-z]*)=([\`\'\"]*)javascript:#iU', '$1=$2nojavascript...', $text);
|
|
| 106 |
+ $text = preg_replace('#([a-z]*)=([\'\"]*)vbscript:#iU', '$1=$2novbscript...', $text);
|
|
| 107 |
+ |
|
| 108 |
+ //<span style="width: expression(alert('Ping!'));"></span> (only affects ie...)
|
|
| 109 |
+ $text = preg_replace('#(<[^>]+)style=([\`\'\"]*).*expression\([^>]*>#iU', "$1>", $text);
|
|
| 110 |
+ $text = preg_replace('#(<[^>]+)style=([\`\'\"]*).*behaviour\([^>]*>#iU', "$1>", $text);
|
|
| 111 |
+ return $text; |
|
| 112 |
+} |
|
| 113 |
+ |
|
| 114 |
+// Call this function when the user tries to do something they shouldn't have access to. |
|
| 115 |
+function accessDenied($str = ""){
|
|
| 116 |
+ global $tpl, $output; |
|
| 117 |
+ |
|
| 118 |
+ if(!empty($str)) $output = write_error($str); |
|
| 119 |
+ else $output = write_error(_NOTAUTHORIZED); |
|
| 120 |
+ if(!empty($tpl)) {
|
|
| 121 |
+ $tpl->assign("output", $output);
|
|
| 122 |
+ $tpl->printToScreen( ); |
|
| 123 |
+ dbclose( ); |
|
| 124 |
+ } |
|
| 125 |
+ else echo $output; |
|
| 126 |
+ exit( ); |
|
| 127 |
+} |
|
| 128 |
+ |
|
| 129 |
+// Call this function when something causes an error and the script has to die. |
|
| 130 |
+function errorExit( $msg = ""){
|
|
| 131 |
+ global $tpl, $output; |
|
| 132 |
+ |
|
| 133 |
+ $output .= write_error(_ERROR.(!empty($msg) ? " " : "").$msg); |
|
| 134 |
+ $tpl->assign("output", $output);
|
|
| 135 |
+ $tpl->printToScreen( ); |
|
| 136 |
+ dbclose( ); |
|
| 137 |
+ exit( ); |
|
| 138 |
+} |
|
| 139 |
+// The next three functions are used to calculate the series reviews and rating |
|
| 140 |
+ |
|
| 141 |
+function storiesInSeries($thisseries) {
|
|
| 142 |
+ $storylist = array( ); |
|
| 143 |
+ if(!isNumber($thisseries)) return $storylist; |
|
| 144 |
+ $serieslist = array( ); |
|
| 145 |
+ $stinseries = dbquery("SELECT sid, subseriesid FROM ".TABLEPREFIX."fanfiction_inseries WHERE seriesid = '$thisseries'");
|
|
| 146 |
+ while($st = dbassoc($stinseries)) {
|
|
| 147 |
+ if(!empty($st['sid'])) $storylist[] = $st['sid']; |
|
| 148 |
+ else if(!empty($st['subseriesid'])) $serieslist[] = $st['subseriesid']; |
|
| 149 |
+ } |
|
| 150 |
+ if($serieslist) {
|
|
| 151 |
+ foreach($serieslist as $s) {
|
|
| 152 |
+ $storylist = array_merge($storylist, storiesInSeries($s)); |
|
| 153 |
+ } |
|
| 154 |
+ } |
|
| 155 |
+ return $storylist; |
|
| 156 |
+} |
|
| 157 |
+function subseriesList($thisseries) {
|
|
| 158 |
+ $serieslist = array( ); |
|
| 159 |
+ if(!isNumber($thisseries)) return $serieslist; |
|
| 160 |
+ $stinseries = dbquery("SELECT subseriesid FROM ".TABLEPREFIX."fanfiction_inseries WHERE seriesid = '$thisseries'");
|
|
| 161 |
+ while($st = dbassoc($stinseries)) {
|
|
| 162 |
+ $serieslist[] = $st['subseriesid']; |
|
| 163 |
+ $serieslist = array_merge($serieslist, subseriesList($st['subseriesid'])); |
|
| 164 |
+ } |
|
| 165 |
+ return $serieslist; |
|
| 166 |
+} |
|
| 167 |
+ |
|
| 168 |
+function seriesreview($thisseries) {
|
|
| 169 |
+ |
|
| 170 |
+ if(!isNumber($thisseries)) return; |
|
| 171 |
+ $storylist = storiesInSeries($thisseries); |
|
| 172 |
+ $serieslist = subseriesList($thisseries); |
|
| 173 |
+$newrating = dbquery("SELECT AVG(rating) as totalreviews FROM ".TABLEPREFIX."fanfiction_reviews
|
|
| 174 |
+ WHERE ((item = '$thisseries' AND type = 'SE')". |
|
| 175 |
+ (count($storylist) > 0 ? " OR (FIND_IN_SET(item, '".(implode(",", $storylist))."') > 0 AND type = 'ST')" : "").
|
|
| 176 |
+ (count($serieslist) > 0 ? " OR (FIND_IN_SET(item, '".(implode(",", $serieslist))."') > 0 AND type = 'SE')" : "").
|
|
| 177 |
+ ") AND rating != '-1'"); |
|
| 178 |
+list($totalreviews) = dbrow($newrating); |
|
| 179 |
+$newcount = dbquery("SELECT count(reviewid) as totalcount FROM ".TABLEPREFIX."fanfiction_reviews
|
|
| 180 |
+ WHERE ((item = '$thisseries' AND type = 'SE')". |
|
| 181 |
+ (count($storylist) > 0 ? " OR (FIND_IN_SET(item, '".(implode(",", $storylist))."') > 0 AND type = 'ST')" : "").
|
|
| 182 |
+ (count($serieslist) > 0 ? " OR (FIND_IN_SET(item, '".(implode(",", $serieslist))."') > 0 AND type = 'SE')" : "").
|
|
| 183 |
+ ") AND review != 'No Review'"); |
|
| 184 |
+list($totalcount) = dbrow($newcount); |
|
| 185 |
+if($totalcount) $update = dbquery("UPDATE ".TABLEPREFIX."fanfiction_series SET rating = '".round($totalreviews)."', reviews = '$totalcount' WHERE seriesid = '$thisseries'");
|
|
| 186 |
+$parentq = dbquery("SELECT seriesid FROM ".TABLEPREFIX."fanfiction_inseries WHERE subseriesid = '$thisseries' AND seriesid != '$thisseries'");
|
|
| 187 |
+while($parent2 = dbassoc($parentq)) { seriesreview($parent2['seriesid']); }
|
|
| 188 |
+ |
|
| 189 |
+} |
|
| 190 |
+ |
|
| 191 |
+// Per a suggestion from jrabbit, we'll use this function to optimize some queries |
|
| 192 |
+function findclause($field,$set) {
|
|
| 193 |
+ if (empty($set)) {
|
|
| 194 |
+ return "1 = 0"; |
|
| 195 |
+ } |
|
| 196 |
+ if(is_array($set)) $set = implode(",", $set);
|
|
| 197 |
+ if (strpos($set,',')>0) {
|
|
| 198 |
+ return "FIND_IN_SET($field,'$set') > 0"; |
|
| 199 |
+ } |
|
| 200 |
+ return "$field='$set'"; |
|
| 201 |
+} |
|
| 202 |
+ |
|
| 203 |
+// Added 3.3 |
|
| 204 |
+function nl2br2($string) {
|
|
| 205 |
+ $string = str_replace(array("\r\n", "\r", "\n"), "<br />", $string);
|
|
| 206 |
+ return $string; |
|
| 207 |
+} |
|
| 208 |
+ |
|
| 209 |
+// Formats the text of the story when displayed on screen. |
|
| 210 |
+function format_story($text) {
|
|
| 211 |
+ $text = trim($text); |
|
| 212 |
+ if(strpos($text, "<br>") === false && strpos($text, "<p>") === false && strpos($text, "<br />") === false) $text = nl2br2($text); |
|
| 213 |
+ if(_CHARSET != "ISO-8859-1" && _CHARSET != "US-ASCII") return stripslashes($text); |
|
| 214 |
+ $badwordchars = array(chr(212), chr(213), chr(210), chr(211), chr(209), chr(208), chr(201), chr(145), chr(146), chr(147), chr(148), chr(151), chr(150), chr(133)); |
|
| 215 |
+ $fixedwordchars = array('‘', '’', '“', '”', '—', '–', '…', '‘', '’', '“', '”', '—', '–', '…' );
|
|
| 216 |
+ $text = str_replace($badwordchars,$fixedwordchars,stripslashes($text)); |
|
| 217 |
+ return $text; |
|
| 218 |
+} |
|
| 219 |
+ |
|
| 220 |
+// Function to Spam-protect emails. Is called for the IM fields in the user's profile. |
|
| 221 |
+function format_email($text) {
|
|
| 222 |
+ $search = array('@', '.');
|
|
| 223 |
+ $replace = array(" [AT] ", " [DOT] ");
|
|
| 224 |
+ return str_replace($search, $replace, $text); |
|
| 225 |
+} |
|
| 226 |
+ |
|
| 227 |
+// Function to format a URL into a clickable link |
|
| 228 |
+function format_link($text, $title = "", $target = 0) {
|
|
| 229 |
+ if(empty($title)) $title = $text; |
|
| 230 |
+ if(strpos($text, "http://") === false) $text = "http://".$text; |
|
| 231 |
+ $text = "<a href='$text'".($target ? " target='_blank'" : "").">$title</a>"; |
|
| 232 |
+ return $text; |
|
| 233 |
+} |
|
| 234 |
+ |
|
| 235 |
+// Because this is used in places other than the listings of stories, we're setting it up as a function to be called as needed. |
|
| 236 |
+function title_link($stories) {
|
|
| 237 |
+ global $ratingslist, $ageconsent, $disablepopups; |
|
| 238 |
+ |
|
| 239 |
+ $rating = $stories['rid']; |
|
| 240 |
+ $warningtext = !empty($ratingslist[$rating]['warningtext']) ? addslashes(strip_tags($ratingslist[$rating]['warningtext'])) : ""; |
|
| 241 |
+ if(empty($ratingslist[$rating]['ratingwarning'])) |
|
| 242 |
+ $title = "<a href=\""._BASEDIR."viewstory.php?sid=".$stories['sid']."\">".$stories['title']."</a>"; |
|
| 243 |
+ else {
|
|
| 244 |
+ $warning = ""; |
|
| 245 |
+ $warninglevel = sprintf("%03b", $ratingslist[$rating]['ratingwarning']);
|
|
| 246 |
+ if($warninglevel[2] && !isset($_SESSION[SITEKEY."_warned"][$rating])) {
|
|
| 247 |
+ $location = "viewstory.php?sid=".$stories['sid']."&warning=$rating"; |
|
| 248 |
+ $warning = $warningtext; |
|
| 249 |
+ } |
|
| 250 |
+ if($warninglevel[1] && !$ageconsent && empty($_SESSION[SITEKEY.'_ageconsent'])) {
|
|
| 251 |
+ $location = "viewstory.php?sid=".$stories['sid']."&ageconsent=ok&warning=$rating"; |
|
| 252 |
+ $warning = _AGECHECK." - "._AGECONSENT." ".$warningtext." -- 1"; |
|
| 253 |
+ } |
|
| 254 |
+ if($warninglevel[0] && !isMEMBER) {
|
|
| 255 |
+ $location = "user.php?action=login&sid=".$stories['sid']; |
|
| 256 |
+ $warning = _RUSERSONLY." - $warningtext"; |
|
| 257 |
+ } |
|
| 258 |
+ if(!empty($warning)) {
|
|
| 259 |
+ $warning = preg_replace("@'@", "\'", $warning);
|
|
| 260 |
+ $title = "<a href=\"javascript:if(confirm('".$warning."')) location = '"._BASEDIR."$location'\">".$stories['title']."</a>";
|
|
| 261 |
+ } |
|
| 262 |
+ else $title = "<a href=\""._BASEDIR."viewstory.php?sid=".$stories['sid']."\">".$stories['title']."</a>"; |
|
| 263 |
+ } |
|
| 264 |
+ return $title; |
|
| 265 |
+} |
|
| 266 |
+ |
|
| 267 |
+// Same with the author list |
|
| 268 |
+function author_link($stories) {
|
|
| 269 |
+ if(is_array($stories['coauthors'])) {
|
|
| 270 |
+ $authlink[] = "<a href=\""._BASEDIR."viewuser.php?uid=".$stories['uid']."\">".$stories['penname']."</a>"; |
|
| 271 |
+ $coauth = dbquery("SELECT "._PENNAMEFIELD." as penname, co.uid FROM ".TABLEPREFIX."fanfiction_coauthors AS co LEFT JOIN "._AUTHORTABLE." ON co.uid = "._UIDFIELD." WHERE co.sid = '".$stories['sid']."'");
|
|
| 272 |
+ foreach($stories['coauthors'] AS $k => $v) {
|
|
| 273 |
+ $authlink[] = "<a href=\""._BASEDIR."viewuser.php?uid=".$k."\">".$v."</a>"; |
|
| 274 |
+ } |
|
| 275 |
+ } |
|
| 276 |
+ return isset($authlink) ? implode(", ", $authlink) : "<a href=\""._BASEDIR."viewuser.php?uid=".$stories['uid']."\">".$stories['penname']."</a>";
|
|
| 277 |
+} |
|
| 278 |
+ |
|
| 279 |
+// Used to truncate text (summaries in blocks for example) to a set length. An improvement on the old version as this keeps words intact |
|
| 280 |
+function truncate_text($str, $n = 75, $delim='...') {
|
|
| 281 |
+ $len = strlen($str); |
|
| 282 |
+ if($len > $n) {
|
|
| 283 |
+ $pos = strpos($str, " ", $n); |
|
| 284 |
+ if($pos) $str = trim(substr($str, 0, $pos), "\n\t\.,"). $delim; |
|
| 285 |
+ } |
|
| 286 |
+ return closetags($str); |
|
| 287 |
+} |
|
| 288 |
+ |
|
| 289 |
+// A helper function for the truncate_text function. This will close all open tags |
|
| 290 |
+function closetags($html){
|
|
| 291 |
+ |
|
| 292 |
+ $donotclose=array('br','img','input', 'hr');
|
|
| 293 |
+ preg_match_all("#<([a-z]+)( .*)?(?!/)>#iU",$html,$result);
|
|
| 294 |
+ $openedtags=$result[1]; |
|
| 295 |
+ |
|
| 296 |
+ preg_match_all("#</([a-z]+)>#iU",$html,$result);
|
|
| 297 |
+ $closedtags=$result[1]; |
|
| 298 |
+ $len_opened = count($openedtags); |
|
| 299 |
+ if(count($closedtags) == $len_opened){
|
|
| 300 |
+ return $html; |
|
| 301 |
+ } |
|
| 302 |
+ |
|
| 303 |
+ $openedtags = array_reverse($openedtags); |
|
| 304 |
+ |
|
| 305 |
+ for($i=0;$i < $len_opened;$i++) {
|
|
| 306 |
+ |
|
| 307 |
+ if (!in_array($openedtags[$i],$closedtags) && !in_array($openedtags[$i], $donotclose)){
|
|
| 308 |
+ $html .= '</'.$openedtags[$i].'>'; |
|
| 309 |
+ } |
|
| 310 |
+ else {
|
|
| 311 |
+ unset($closedtags[array_search($openedtags[$i],$closedtags)]); |
|
| 312 |
+ } |
|
| 313 |
+ } |
|
| 314 |
+ return $html; |
|
| 315 |
+} |
|
| 316 |
+ |
|
| 317 |
+// Builds the naughty word list for the site's censor |
|
| 318 |
+function build_word($myword) {
|
|
| 319 |
+ $letters =preg_split('//',$myword, -1, PREG_SPLIT_NO_EMPTY);
|
|
| 320 |
+ $word = ""; |
|
| 321 |
+ foreach($letters as $letter) {
|
|
| 322 |
+ if($word != "") $word .= "\W+"; |
|
| 323 |
+ $word .= $letter; |
|
| 324 |
+ } |
|
| 325 |
+ return $word; |
|
| 326 |
+ |
|
| 327 |
+} |
|
| 328 |
+ |
|
| 329 |
+// Finds forbidden words in text. Returns true if a forbidden word is found |
|
| 330 |
+function find_naughty($text) {
|
|
| 331 |
+ global $words; |
|
| 332 |
+ if(!count($words)) return false; |
|
| 333 |
+ $naughty = 0; |
|
| 334 |
+ for($i = 0; $i < sizeof($words); $i++) {
|
|
| 335 |
+ if(strpos($words[$i], "*") === false) {
|
|
| 336 |
+ // check for whole word |
|
| 337 |
+ if(preg_match('/(\s|^)+(('.$words[$i].')|('.build_word($words[$i]).')+(s|es)?)+(\W|$)+/i', $text, $match)) {
|
|
| 338 |
+ echo $words[$i] ." 0=".$match[0]; |
|
| 339 |
+ $naughty = 1; |
|
| 340 |
+ } |
|
| 341 |
+ } |
|
| 342 |
+ if(strpos($words[$i], "*") !== false && strpos($words[$i], "*") == 0 && !$naughty) {
|
|
| 343 |
+ // remove the * from the beginning of the word |
|
| 344 |
+ $word = substr($words[$i], 1, strlen($words[$i])); |
|
| 345 |
+ if(strrpos($word, "*") == strlen($word) - 1) $word = substr($word, 0, strlen($word) - 1); |
|
| 346 |
+ // check for whole word plus word as suffix |
|
| 347 |
+ if(preg_match('/[\s|^]+\w*('.$word.'|\W'.build_word($word).')+(s|es)?(\W|$)/i', $text, $match)) $naughty = 1;
|
|
| 348 |
+ } |
|
| 349 |
+ if(strrpos($words[$i], "*") == strlen($words[$i]) - 1 && !$naughty) {
|
|
| 350 |
+ // remove the * from the end of the word |
|
| 351 |
+ $word = substr($words[$i], 0, strlen($words[$i]) - 1); |
|
| 352 |
+ if(strpos($word, "*") !== false && strpos($word, "*") == 0) $word = substr($word, 1, strlen($word)); |
|
| 353 |
+ // check for whole word plus word as prefix |
|
| 354 |
+ if(preg_match('/(\s|^)('.$word.'|'.build_word($word).'\W)+\w*(s|es)?(\W|$)/i', $text, $match)) $naughty = 1;
|
|
| 355 |
+ } |
|
| 356 |
+ if($naughty) break; // no sense continuing down the list and this will make it run faster |
|
| 357 |
+ } |
|
| 358 |
+ return $naughty; |
|
| 359 |
+} |
|
| 360 |
+ |
|
| 361 |
+// Replaces forbidden words in text. The forbidden word is replaced with the first letter and trailing *** |
|
| 362 |
+function replace_naughty($text) {
|
|
| 363 |
+ global $words; |
|
| 364 |
+ |
|
| 365 |
+ if(!count($words)) return $text; |
|
| 366 |
+ $i = 0; |
|
| 367 |
+ for($j = 0; $j < sizeof($words); $j++) {
|
|
| 368 |
+ if(strpos($words[$j], "*") === false) {
|
|
| 369 |
+ $replace[$i] = str_pad($words[$j][0], strlen($words[$j]), "*"); |
|
| 370 |
+ $naughtywords[$i] = '/\b('.$words[$j].'\b)|('.build_word($words[$j]).')\b/i';
|
|
| 371 |
+ $i++; |
|
| 372 |
+ } |
|
| 373 |
+ |
|
| 374 |
+ if(strpos($words[$j], "*") !== false && strpos($words[$j], "*") == 0) {
|
|
| 375 |
+ $word = substr($words[$j], 1, strlen($words[$j])); |
|
| 376 |
+ if(strrpos($word, "*") == strlen($word) - 1) $word = substr($word, 0, strlen($word) - 1); |
|
| 377 |
+ $naughtywords[$i] = '/(\s|^)+(\w*)+('.$word.'|'.build_word($word).')/i';
|
|
| 378 |
+ $replace[$i] = "$1$2".str_pad(substr($word, 0, 1), strlen($word), "*"); |
|
| 379 |
+ $i++; |
|
| 380 |
+ } |
|
| 381 |
+ if(strrpos($words[$j], "*") == strlen($words[$j]) - 1) {
|
|
| 382 |
+ $word = substr($words[$j], 0, strlen($words[$j]) - 1); |
|
| 383 |
+ if(strpos($word, "*") !== false && strpos($word, "*") == 0) $word = substr($word, 1, strlen($word)); |
|
| 384 |
+ $replace[$i] = '$1'.str_pad(substr($word, 0, 1), strlen($word), "*").'$3'; |
|
| 385 |
+ $naughtywords[$i] = '/(.*)('.$word.'|'.build_word($word).')(\s|\w)/i';
|
|
| 386 |
+ $i++; |
|
| 387 |
+ } |
|
| 388 |
+ } |
|
| 389 |
+ $text = preg_replace($naughtywords, $replace, $text); |
|
| 390 |
+ return $text; |
|
| 391 |
+} |
|
| 392 |
+ |
|
| 393 |
+// Format for messages sent back from various forms and actions |
|
| 394 |
+function write_message($str) {
|
|
| 395 |
+ return "<div style='text-align: center; margin: 1em;'>$str</div>"; |
|
| 396 |
+} |
|
| 397 |
+ |
|
| 398 |
+// Formats error messages sent back from various forms and actions |
|
| 399 |
+function write_error($str) {
|
|
| 400 |
+ return "<div style='text-align: center; margin: 1em;' class='errortext'>$str</div>"; |
|
| 401 |
+} |
|
| 402 |
+ |
|
| 403 |
+// Checks that the given $num is actually a number. Used to help prevent XSS attacks. |
|
| 404 |
+function isNumber($num) {
|
|
| 405 |
+ if(empty($num)) return false; |
|
| 406 |
+ if(!is_string($num)) return false; |
|
| 407 |
+ return preg_match("/^[0-9]+$/", $num);
|
|
| 408 |
+} |
|
| 409 |
+ |
|
| 410 |
+// May be needed for sites that have bridged the authors table |
|
| 411 |
+function check_prefs($uid) {
|
|
| 412 |
+ $test = dbquery("SELECT uid FROM ".TABLEPREFIX."fanfiction_authorprefs WHERE uid = '$uid'");
|
|
| 413 |
+ if(dbnumrows($test)) return true; |
|
| 414 |
+ else return false; |
|
| 415 |
+} |
|
| 416 |
+ |
|
| 417 |
+// Function builds the alphabet links on various pages. |
|
| 418 |
+function build_alphalinks($url, $let) {
|
|
| 419 |
+ global $alphabet; |
|
| 420 |
+ |
|
| 421 |
+ $alpha = "<div id=\"alphabet\">"; |
|
| 422 |
+ foreach( $alphabet as $link ) {
|
|
| 423 |
+ // Build a link that calls a function with ($link and 1 (page number) ) |
|
| 424 |
+ $alpha .= "<a href=\"{$url}let=$link\"".($let == $link ? " id='currentletter'" : "").">$link</a> \n";
|
|
| 425 |
+ } |
|
| 426 |
+ $alpha .= "</div>"; |
|
| 427 |
+ return $alpha; |
|
| 428 |
+} |
|
| 429 |
+ |
|
| 430 |
+// Function builds the pagination links |
|
| 431 |
+function build_pagelinks($url, $total, $offset = 0, $columns = 1) {
|
|
| 432 |
+ global $itemsperpage, $linkstyle, $linkrange; |
|
| 433 |
+ $pages = ""; |
|
| 434 |
+ $itemsperpage = $itemsperpage * $columns; |
|
| 435 |
+ |
|
| 436 |
+ if($itemsperpage >= $total) return; |
|
| 437 |
+ |
|
| 438 |
+ if(empty($linkrange)) $linkrange = 4; |
|
| 439 |
+ |
|
| 440 |
+ $totpages = floor($total/$itemsperpage) + ($total % $itemsperpage ? 1 : 0); |
|
| 441 |
+ $curpage = floor($offset/$itemsperpage) + 1; |
|
| 442 |
+ if(!$linkstyle) $startrange = $curpage; |
|
| 443 |
+ else {
|
|
| 444 |
+ if($totpages <= $linkrange || $curpage == 1) $startrange = 1; |
|
| 445 |
+ else if($curpage >= $totpages - floor($linkrange / 2) + 1) $startrange = $totpages - $linkrange; |
|
| 446 |
+ else $startrange = $curpage - floor($linkrange / 2) > 0 ? $curpage - floor($linkrange / 2) : 1; |
|
| 447 |
+ } |
|
| 448 |
+ if($startrange >= $totpages - $linkrange ) $startrange = $totpages - $linkrange > 0 ? $totpages - $linkrange : 1; |
|
| 449 |
+ $stoprange = $totpages > $startrange + $linkrange ? $startrange + $linkrange : $totpages + 1; |
|
| 450 |
+ if($curpage > 1 && $linkstyle != 1) $pages .= "<a href='".$url."offset=".( $offset - $itemsperpage)."' id='plprev'>["._PREVIOUS."]</a> "; |
|
| 451 |
+ if($startrange > 1 && $linkstyle > 0) $pages .= "<a href='".$url."offset=0'>1</a><span class='ellipses'>...</span>"; |
|
| 452 |
+ for($x = $startrange; $x < $stoprange; $x++) {
|
|
| 453 |
+ $pages .= "<a href='".$url."offset=".(($x - 1) * $itemsperpage)."'".($x == $curpage ? "id='currentpage'" : "").">".$x."</a> \n"; |
|
| 454 |
+ } |
|
| 455 |
+ if($stoprange < $totpages && $linkstyle > 0) $pages .= "<span class='ellipses'>...</span> <a href='".$url."offset=".(($totpages - 1) * $itemsperpage)."'>$totpages</a>\n"; |
|
| 456 |
+ if ($curpage < $totpages && $linkstyle != 1) $pages .= " <a href='".$url."offset=".($offset+$itemsperpage)."' id='plnext'>["._NEXT."]</a>"; |
|
| 457 |
+ return "<div id=\"pagelinks\">$pages</div>"; |
|
| 458 |
+} |
|
| 459 |
+ |
|
| 460 |
+// Function that returns the ratings picks |
|
| 461 |
+function ratingpics($rating) {
|
|
| 462 |
+ global $ratings, $like, $dislike, $star, $halfstar; |
|
| 463 |
+ $ratingpics = ""; |
|
| 464 |
+ if($ratings == "2") {
|
|
| 465 |
+ if($rating >= 0.5) |
|
| 466 |
+ $ratingpics = ($like ? $like : "<img src=\""._BASEDIR."images/like.gif\" alt=\""._LIKED."\">"); |
|
| 467 |
+ else if(($rating < 0.5) && ($rating > 0)) |
|
| 468 |
+ $ratingpics = ($dislike ? $dislike :"<img src=\""._BASEDIR."images/dislike.gif\" alt=\""._DISLIKED."\">"); |
|
| 469 |
+ else $ratingpics = ""; |
|
| 470 |
+ } |
|
| 471 |
+ if($ratings == "1") {
|
|
| 472 |
+ global $star, $halfstar; |
|
| 473 |
+ if($rating > 0) {
|
|
| 474 |
+ for($x = 0; $x < ($rating / 2) - .5; $x++) {
|
|
| 475 |
+ $ratingpics .= ($star ? $star : "<img src=\""._BASEDIR."images/star.gif\" alt=\"star\">"); |
|
| 476 |
+ } |
|
| 477 |
+ if($rating % 2 != 0) $ratingpics .= ($halfstar ? $halfstar : "<img src=\""._BASEDIR."images/starhalf.gif\" alt=\"half-star\">"); |
|
| 478 |
+ } |
|
| 479 |
+ else $ratingpics = ""; |
|
| 480 |
+ } |
|
| 481 |
+ if(!empty($ratingpics)) return "<span style='white-space: nowrap;'>$ratingpics</span>"; // the no-wrap style will keep the stars together |
|
| 482 |
+ else return; |
|
| 483 |
+} |
|
| 484 |
+ |
|
| 485 |
+// This function builds the list of category links (including the breadcrumb depending on settings) |
|
| 486 |
+function catlist($catid) {
|
|
| 487 |
+ global $extendcats, $catlist, $action; |
|
| 488 |
+ |
|
| 489 |
+ if(!is_array($catid)) $catid = explode(",", $catid);
|
|
| 490 |
+ $categorylinks = array(); |
|
| 491 |
+ foreach($catid as $cat) {
|
|
| 492 |
+ if(empty($catlist[$cat])) continue; |
|
| 493 |
+ if($extendcats) {
|
|
| 494 |
+ unset($link); |
|
| 495 |
+ $thiscat = $cat; |
|
| 496 |
+ while(isset($thiscat)) {
|
|
| 497 |
+ if(isset($link)) $link = " > ".$link; |
|
| 498 |
+ else $link = ""; |
|
| 499 |
+ if($action != "printable") $link = "<a href='"._BASEDIR."browse.php?type=categories&catid=$thiscat'>".$catlist[$thiscat]['name']."</a>".$link; |
|
| 500 |
+ else $link = $catlist[$thiscat]['name'].$link; |
|
| 501 |
+ if($catlist[$thiscat]['pid'] == -1) unset($thiscat); |
|
| 502 |
+ else $thiscat = $catlist[$thiscat]['pid']; |
|
| 503 |
+ } |
|
| 504 |
+ $categorylinks[] = $link; |
|
| 505 |
+ } |
|
| 506 |
+ else $categorylinks[] = "<a href='"._BASEDIR."browse.php?type=categories&catid=$cat'>".$catlist[$cat]['name']."</a>"; |
|
| 507 |
+ } |
|
| 508 |
+ return implode(", ", $categorylinks);
|
|
| 509 |
+} |
|
| 510 |
+ |
|
| 511 |
+// This function builds the list of character links |
|
| 512 |
+function charlist($characters) {
|
|
| 513 |
+ global $charlist, $action; |
|
| 514 |
+ |
|
| 515 |
+ if(!is_array($characters)) $characters = explode(",", $characters);
|
|
| 516 |
+ $charlinks = array( ); |
|
| 517 |
+ foreach($characters as $c) {
|
|
| 518 |
+ if(empty($charlist[$c]['name'])) continue; |
|
| 519 |
+ if($action != "printable") $charlinks[] = "<a href='"._BASEDIR."browse.php?type=characters&charid=$c'>".$charlist[$c]['name']."</a>"; |
|
| 520 |
+ else $charlinks[] = $charlist[$c]['name']; |
|
| 521 |
+ } |
|
| 522 |
+ return implode(", ", $charlinks);
|
|
| 523 |
+} |
|
| 524 |
+ |
|
| 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) {
|
|
| 527 |
+ global $tpl, $new, $ratingslist, $itemsperpage, $reviewsallowed, $output, $dateformat, $current, $featured, $favorites, $retired, $ageconsent, $classtypelist, $classlist, $offset, $recentdays; |
|
| 528 |
+ |
|
| 529 |
+ $count = dbquery($countquery); |
|
| 530 |
+ list($numrows) = dbrow($count); |
|
| 531 |
+ if($numrows) {
|
|
| 532 |
+ $tpl->assign("output", ($pagetitle ? "<div id=\"pagetitle\">$pagetitle</div>" : ""));
|
|
| 533 |
+ $tpl->newBlock("listings");
|
|
| 534 |
+ if(!$ratingslist) {
|
|
| 535 |
+ $ratlist = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_ratings");
|
|
| 536 |
+ while($rate = dbassoc($ratlist)) {
|
|
| 537 |
+ $ratings[$rate['rid']] = array("rating" => $rate['rating'], "ratingwarning" => $rate['ratingwarning'], "warningtext" => $rate['warningtext']);
|
|
| 538 |
+ } |
|
| 539 |
+ } |
|
| 540 |
+ $tpl->newBlock("listings");
|
|
| 541 |
+ $tpl->gotoBlock("listings");
|
|
| 542 |
+ $tpl->assign("stories", "<div class=\"sectionheader\">"._STORIES."</div>");
|
|
| 543 |
+ $storyquery .= " LIMIT $offset, $itemsperpage"; |
|
| 544 |
+ $result3 = dbquery($storyquery); |
|
| 545 |
+ $count = 0; |
|
| 546 |
+ while($stories = dbassoc($result3)) {
|
|
| 547 |
+ $tpl->newBlock("storyblock");
|
|
| 548 |
+ include(_BASEDIR."includes/storyblock.php"); |
|
| 549 |
+ } |
|
| 550 |
+ $tpl->gotoBlock("_ROOT");
|
|
| 551 |
+ } |
|
| 552 |
+ else {
|
|
| 553 |
+ $tpl->newBlock("listings");
|
|
| 554 |
+ $tpl->assign("pagelinks", write_message(_NORESULTS));
|
|
| 555 |
+ } |
|
| 556 |
+ if($numrows > $itemsperpage) {
|
|
| 557 |
+ $termArray = array_merge($_GET, $_POST); |
|
| 558 |
+ $terms = array(); |
|
| 559 |
+ foreach($termArray as $term => $value) {
|
|
| 560 |
+ if($term == "submit" || $term == "go" || $term == "offset" || ($term != "complete" &&empty($value))) continue; |
|
| 561 |
+ $terms[] = "$term=".(is_array($value) ? implode(",", $value) : $value);
|
|
| 562 |
+ } |
|
| 563 |
+ $terms = implode("&", $terms);
|
|
| 564 |
+ $terms .= "&"; |
|
| 565 |
+ $tpl->gotoBlock("listings");
|
|
| 566 |
+ $tpl->assign( "pagelinks", build_pagelinks($pagelink.$terms, $numrows, $offset)); |
|
| 567 |
+ } |
|
| 568 |
+ $tpl->gotoBlock("_ROOT");
|
|
| 569 |
+ return $numrows; |
|
| 570 |
+} |
|
| 571 | 571 |
?> |
| 572 | 572 |
\ No newline at end of file |
| ... | ... |
@@ -1,976 +1,978 @@ |
| 1 |
-<?php |
|
| 2 |
-// ---------------------------------------------------------------------- |
|
| 3 |
-// Updated June 2014 |
|
| 4 |
-// Copyright (c) 2007 by Tammy Keefer |
|
| 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 |
-function random_char($string) |
|
| 26 |
-{
|
|
| 27 |
- $length = strlen($string); |
|
| 28 |
- $position = mt_rand(0, $length - 1); |
|
| 29 |
- return $string[$position]; |
|
| 30 |
-} |
|
| 31 |
- |
|
| 32 |
-function random_string ($charset_string, $length) |
|
| 33 |
-{
|
|
| 34 |
- $return_string = random_char($charset_string); |
|
| 35 |
- for ($x = 1; $x < $length; $x++) |
|
| 36 |
- $return_string .= random_char($charset_string); |
|
| 37 |
- return $return_string; |
|
| 38 |
-} |
|
| 39 |
- |
|
| 40 |
-$randomcharset = '23456789' . 'abcdefghijkmnpqrstuvwxyz' . 'ABCDEFGHJKLMNPQRSTUVWXYZ'; |
|
| 41 |
- |
|
| 42 |
- |
|
| 43 |
-// Strip out slashes if magic quotes isn't on. |
|
| 44 |
-if(ini_get("magic_quotes_gpc")) {
|
|
| 45 |
- foreach($_POST as $var => $val) {
|
|
| 46 |
- $val = is_array( $val ) ? array_map( 'stripslashes', $val ) : stripslashes( $val ); |
|
| 47 |
- } |
|
| 48 |
- foreach($_GET as $var => $val) {
|
|
| 49 |
- $val = is_array( $val ) ? array_map( 'stripslashes', $val ) : stripslashes( $val ); |
|
| 50 |
- } |
|
| 51 |
- foreach($_COOKIE as $var => $val) {
|
|
| 52 |
- $val = is_array( $val ) ? array_map( 'stripslashes', $val ) : stripslashes( $val ); |
|
| 53 |
- } |
|
| 54 |
-} |
|
| 55 |
- |
|
| 56 |
-define("_BASEDIR", "../");
|
|
| 57 |
-define("_CHARSET", "utf-8");
|
|
| 58 |
-Header('Cache-Control: private, no-cache, must-revalidate, max_age=0, post-check=0, pre-check=0');
|
|
| 59 |
-header ("Pragma: no-cache");
|
|
| 60 |
-header ("Expires: 0");
|
|
| 61 |
- |
|
| 62 |
-$output = ""; |
|
| 63 |
- |
|
| 64 |
-include ("../includes/class.TemplatePower.inc.php");
|
|
| 65 |
- |
|
| 66 |
-if(!isset($_GET['step']) || $_GET['step'] == 2) {
|
|
| 67 |
- include ("../languages/en.php");
|
|
| 68 |
- include ("../languages/en_admin.php");
|
|
| 69 |
- include ("languages/en.php");
|
|
| 70 |
-} |
|
| 71 |
-else if(isset($_REQUEST['language'])) {
|
|
| 72 |
- $language = $_REQUEST['language']; |
|
| 73 |
- if(file_exists("../languages/".$language.".php")) include ("../languages/".$language.".php");
|
|
| 74 |
- else include ("../languages/en.php");
|
|
| 75 |
- if(file_exists("../languages/".$language."_admin.php")) include("../languages/".$language."_admin.php");
|
|
| 76 |
- else include ("../languages/en_admin.php");
|
|
| 77 |
- if(file_exists("languages/".$language.".php")) include("languages/".$language.".php");
|
|
| 78 |
- else include ("languages/en.php");
|
|
| 79 |
-} |
|
| 80 |
-else {
|
|
| 81 |
-include("../config.php");
|
|
| 82 |
-$dbconnect = dbconnect($dbhost, $dbuser, $dbpass, $dbname ); |
|
| 83 |
-$settings = dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".$sitekey."'");
|
|
| 84 |
-list($tableprefix, $language) = dbrow($settings); |
|
| 85 |
-define("TABLEPREFIX", $tableprefix);
|
|
| 86 |
-define("SITEKEY", $sitekey);
|
|
| 87 |
-if(file_exists("../languages/".$language.".php")) include ("../languages/".$language.".php");
|
|
| 88 |
-else include ("../languages/en.php");
|
|
| 89 |
-if(file_exists("../languages/".$language."_admin.php")) include("../languages/".$language."_admin.php");
|
|
| 90 |
-else include ("../languages/en_admin.php");
|
|
| 91 |
-if(file_exists("languages/".$language.".php")) include("languages/".$language.".php");
|
|
| 92 |
-else include ("languages/en.php");
|
|
| 93 |
-} |
|
| 94 |
-include(_BASEDIR."includes/corefunctions.php"); |
|
| 95 |
- |
|
| 96 |
-// So I don't have to keep updating the version number in 3 different files. |
|
| 97 |
-include("../version.php");
|
|
| 98 |
- |
|
| 99 |
-//make a new TemplatePower object |
|
| 100 |
-echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"> |
|
| 101 |
-<html><head><title>eFiction {$version} Install</title>
|
|
| 102 |
-<style> |
|
| 103 |
-LABEL { float: left; display: block; width: 45%; text-align: right; padding-right: 10px; clear: left;}
|
|
| 104 |
-.row { float: left; width: 99%; }
|
|
| 105 |
-#settingsform FORM { width: 80%; margin; 0 auto; }
|
|
| 106 |
-#settingsform LABEL { float: left; display: block; width: 30%; text-align: right; padding-right: 10px; clear: left; }
|
|
| 107 |
-#settingsform .fieldset SPAN { float: left; display: block; width: 30%; text-align: right; padding-right: 10px; clear: left;}
|
|
| 108 |
-#settingsform .fieldset LABEL { float: none; width: auto; display: inline; text-align: left; clear: none; }
|
|
| 109 |
-#settingsform .tinytoggle { text-align: center; }
|
|
| 110 |
-#settingsform .tinytoggle LABEL { float: none; display: inline; width: auto; text-align: center; padding: 0; clear: none; }
|
|
| 111 |
-#settingsform #submit { display: block; margin: 1ex auto; }
|
|
| 112 |
-a.pophelp{
|
|
| 113 |
- position: relative; /* this is the key*/ |
|
| 114 |
- z-index:24; |
|
| 115 |
- vertical-align: super; |
|
| 116 |
- text-decoration: none; |
|
| 117 |
-} |
|
| 118 |
- |
|
| 119 |
-a.pophelp:hover{z-index:100; border: none; text-decoration: none;}
|
|
| 120 |
- |
|
| 121 |
-a.pophelp span{display: none; position: absolute; text-decoration: none;}
|
|
| 122 |
- |
|
| 123 |
-a.pophelp:hover span{ /*the span will display just on :hover state*/
|
|
| 124 |
- display:block; |
|
| 125 |
- position: absolute; |
|
| 126 |
- top: 0; left: 8em; width: 225px; |
|
| 127 |
- border:1px solid #000; |
|
| 128 |
- background-color:#CCC; color:#000; |
|
| 129 |
- text-decoration: none; |
|
| 130 |
- text-align: left; |
|
| 131 |
- padding: 5px; |
|
| 132 |
- font-weight: normal; |
|
| 133 |
-} |
|
| 134 |
-.required { color: red; }
|
|
| 135 |
-</style> |
|
| 136 |
-<link rel=\"stylesheet\" type=\"text/css\" href='../default_tpls/style.css'></head>"; |
|
| 137 |
- |
|
| 138 |
-$tpl = new TemplatePower( "../default_tpls/default.tpl" ); |
|
| 139 |
-$tpl->assignInclude( "header", "./../default_tpls/header.tpl" ); |
|
| 140 |
-$tpl->assignInclude( "footer", "./../default_tpls/footer.tpl" ); |
|
| 141 |
-$tpl->prepare( ); |
|
| 142 |
-$tpl->newBlock("header");
|
|
| 143 |
-$tpl->assign("sitename", "eFiction $version Install");
|
|
| 144 |
-$tpl->gotoBlock( "_ROOT" ); |
|
| 145 |
-$tpl->newBlock("footer");
|
|
| 146 |
-$tpl->assign( "footer", "eFiction $version © 2007. <a href='http://efiction.org/'>http://efiction.org/</a>"); |
|
| 147 |
-$tpl->gotoBlock( "_ROOT" ); |
|
| 148 |
- |
|
| 149 |
-switch($_GET['step']) {
|
|
| 150 |
- case "9": |
|
| 151 |
- if(isset($_POST['submit'])) {
|
|
| 152 |
- $penname = descript($_POST['newpenname']); |
|
| 153 |
- if((!$_POST['email']) && !isADMIN) $fail .= "<div style='text-align: center;'>"._EMAILREQUIRED." "._TRYAGAIN."</div>"; |
|
| 154 |
- if($penname && !preg_match("!^[a-z0-9_ ]{3,30}$!i", $penname)) $fail = "<div style='text-align: center;'>"._BADUSERNAME." "._TRYAGAIN."</div>";
|
|
| 155 |
- if(!preg_match("/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+$/", $_POST[email])) $fail = "<div style='text-align: center;'>"._INVALIDEMAIL." "._TRYAGAIN."</div>";
|
|
| 156 |
- if($_POST['password'] == $_POST['password2']) $encryptpassword = md5($_POST[password]); |
|
| 157 |
- else $fail = write_message(_PASSWORDTWICE); |
|
| 158 |
- if(!isset($fail)) {
|
|
| 159 |
- $result = dbquery("INSERT INTO ".$tableprefix."fanfiction_authors(`penname`, `email`, `password`, `date`) VALUES('$penname', '".$_POST['email']."', '$encryptpassword', now( ))");
|
|
| 160 |
- define("USERUID", dbinsertid( ));
|
|
| 161 |
- $skinquery = dbquery("SELECT skin FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".SITEKEY."'");
|
|
| 162 |
- list($skin) = dbrow($skinquery); |
|
| 163 |
- $result2 = dbquery("INSERT INTO ".$tableprefix."fanfiction_authorprefs(`uid`, `userskin`, `level`) VALUES('".USERUID."', '$skin', '1')");
|
|
| 164 |
- if($result && $result2) $output .= write_message(_ACTIONSUCCESSFUL."<br /><br />Installation complete! <a href='../user.php?action=login'>Log in</a> to your site and go to the Admin area to configure your archive. <strong>Note:</strong> Please delete the install/ folder!"); |
|
| 165 |
- } |
|
| 166 |
- else $output .= $fail; |
|
| 167 |
- } |
|
| 168 |
- else {
|
|
| 169 |
- $output .= "<div id='pagetitle'>"._ADMINACCT."</div><form method=\"POST\" class='tblborder' style='margin: 1em auto; width: 400px;' enctype=\"multipart/form-data\" action=\"install.php?step=9\"> |
|
| 170 |
- <div class='row'><label for='newpenname'>"._PENNAME.":</label> <INPUT name=\"newpenname\" type=\"text\" class=\"textbox\" maxlength=\"200\" value=\"$user[penname]\"></div> |
|
| 171 |
- <div class='row'><label for='email'>"._EMAIL.":</label> <INPUT type=\"text\" class=\"textbox=\" name=\"email\" value=\"$user[email]\" maxlength=\"200\"></div> |
|
| 172 |
- <div class='row'><label for='password'>"._PASSWORD.":</label> <INPUT name=\"password\" class=\"textbox\" value=\"\" type=\"password\"></div> |
|
| 173 |
- <div class='row'><label for='password2'>"._PASSWORD2.":</label> <INPUT name=\"password2\" class=\"textbox=\" value=\"\" type=\"password\"></div> |
|
| 174 |
- <div style='text-align: center;'><INPUT type=\"submit\"class=\"button\" name=\"submit\" value=\"submit\"></div></form>"; |
|
| 175 |
- } |
|
| 176 |
- break; |
|
| 177 |
- |
|
| 178 |
- case "8": |
|
| 179 |
- $output .= "<div id='pagetitle'>"._AUTHORFIELDS."</div>"; |
|
| 180 |
- if(isset($_GET['install'])) {
|
|
| 181 |
- if($_GET['install'] == "automatic") {
|
|
| 182 |
- $fields[] = array('4','lj','Live Journal','http://{info}.livejournal.com','','','0');
|
|
| 183 |
- $fields[] = array('1','website','Web Site','','','','1');
|
|
| 184 |
- $fields[] = array('5','AOL','AIM','','$output .= "<div><label for=\'AOL\'>".$field[\'field_title\'].":</label><INPUT type=\'text\' class=\'textbox\' name=\'af_".$field[\'field_name\']."\' maxlength=\'40\' value=\'".(!empty($user[\'af_\'.$field[\'field_id\']]) ? $user[\'af_\'.$field[\'field_id\']] : "")."\' size=\'20\'></div>";','$thisfield = "<img src=\"http://big.oscar.aol.com/".$field[\'info\']."?on_url=$url/images/aim.gif&off_url=$url/images/aim.gif\"> <a href=\"aim:goim?{aol}ScreenName=".$field[\'info\']."\">".format_email($field[\'info\'])."</a>";','1');
|
|
| 185 |
- $fields[] = array('5','ICQ','ICQ','','$output .= "<div><label for=\'AOL\'>".$field[\'field_title\'].":</label><INPUT type=\'text\' class=\'textbox\' name=\'af_".$field[\'field_name\']."\' maxlength=\'40\' value=\'".(!empty($user[\'af_\'.$field[\'field_id\']]) ? $user[\'af_\'.$field[\'field_id\']] : "")."\' size=\'20\'></div>";','$thisfield = "<img src=\"http://status.icq.com/online.gif?icq=".$field[\'info\']."&img=5\"> ".$field[\'info\'];','1');
|
|
| 186 |
- $fields[] = array('5','MSN','MSN IM','','$output .= "<div><label for=\'AOL\'>".$field[\'field_title\'].":</label><INPUT type=\'text\' class=\'textbox\' name=\'af_".$field[\'field_name\']."\' maxlength=\'40\' value=\'".(!empty($user[\'af_\'.$field[\'field_id\']]) ? $user[\'af_\'.$field[\'field_id\']] : "")."\' size=\'20\'></div>";','$thisfield = "<img src=\"images/msntalk.gif\" alt=\""._MSN."\"> ".format_email($field[\'info\']);','1');
|
|
| 187 |
- $fields[] = array('5','Yahoo','Yahoo IM','','$output .= "<div><label for=\'AOL\'>".$field[\'field_title\'].":</label><INPUT type=\'text\' class=\'textbox\' name=\'af_".$field[\'field_name\']."\' maxlength=\'40\' value=\'".(!empty($user[\'af_\'.$field[\'field_id\']]) ? $user[\'af_\'.$field[\'field_id\']] : "")."\' size=\'20\'></div>";','$thisfield = "<a href=\"http://edit.yahoo.com/config/send_webmesg?.target=".$field[\'info\']."&.src=pg\"><img border=\'0\' src=\"http://opi.yahoo.com/online?u=".$field[\'info\']."&m=g&t=1\"> ".format_email($field[\'info\'])."</a>";','1');
|
|
| 188 |
- $fields[] = array('4','da','Deviant Art','http://{info}.deviantart.com','','','0');
|
|
| 189 |
- $fields[] = array('3','betareader','Beta-reader','','','','1');
|
|
| 190 |
- $fields[] = array('4','dj','DeadJournal','http://{info}.deadjournal.com/','','','0');
|
|
| 191 |
- $fields[] = array('4','xanga','Xanga','http://www.xanga.com/{info}','','','0');
|
|
| 192 |
- $fields[] = array('2', 'gender', 'Gender', 'male|#|female|#|undisclosed', '', '', 0);
|
|
| 193 |
- $fields[] = array('4','myspace','MySpace','http://www.myspace.com/{info}','','','0');
|
|
| 194 |
- |
|
| 195 |
- $output .= "<table class='tblborder' style='margin: 1em auto; padding: 1em;' cellpadding='5'><tr><th>"._FIELD."</th><th>"._RESULT."</th></tr>"; |
|
| 196 |
- foreach($fields as $field) {
|
|
| 197 |
- $f = dbquery("INSERT INTO `".$tableprefix."fanfiction_authorfields` (`field_type`, `field_name`, `field_title`, `field_options`, `field_code_in`, `field_code_out`, `field_on`) VALUES('".$field[0]."', '".$field[1]."','".$field[2]."','".escapestring($field[3])."','".escapestring($field[4])."','".escapestring($field[5])."','".$field[6]."');");
|
|
| 198 |
- $output .= "<tr><td>".$field[2]."</td><td align='center'>" . ($f ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 199 |
- } |
|
| 200 |
- $output .= "</table>"; |
|
| 201 |
- $output .= write_message(_FIELDAUTOFAIL."<br /><br /> <a href='install.php?step=9'>"._CONTINUE."</a>"); |
|
| 202 |
- } |
|
| 203 |
- else {
|
|
| 204 |
- $output .= write_message(_FIELDMANUAL."<br /><br /><a href='install.php?step=9'>"._CONTINUE."</a>"); |
|
| 205 |
- } |
|
| 206 |
- } |
|
| 207 |
- else $output .= write_message(_FIELDDATAINFO."<br /><br /><a href='install.php?step=8&install=automatic'>"._AUTO."</a> "._OR." <a href='install.php?step=8&install=manual'>"._MANUAL2."</a>"); |
|
| 208 |
- break; |
|
| 209 |
- case "7": |
|
| 210 |
- $output .= "<div id='pagetitle'>"._MESSAGEDATA."</div>"; |
|
| 211 |
- if(isset($_GET['install'])) {
|
|
| 212 |
- if($_GET['install'] == "automatic") {
|
|
| 213 |
- $output .= "<table class='tblborder' style='margin: 1em auto; padding: 1em;' cellpadding='5'><tr><th>"._MESSAGE."</th><th>"._RESULT."</th></tr>"; |
|
| 214 |
- $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (1, 'welcome', '', 'This is your welcome message. It appears on the index page. Include it in your .tpl files with {welcome}.');");
|
|
| 215 |
- $output .= "<tr><td>Welcome</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 216 |
- $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (2, 'copyright', '', 'This is your sample copyright footer. Include it in your footer.tpl with <b>{footer}</b><br />\r\n<u>Disclaimer:</u> All publicly recognizable characters, settings, etc. are the property of their respective owners. The original characters and plot are the property of the author. No money is being made from this work. No copyright infringement is intended.\r\n');");
|
|
| 217 |
- $output .= "<tr><td>Copyright</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 218 |
- $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (3, 'help', 'Help', '<h3>FAQ</h3><p><strong>I forgot my password! What do I do now?</strong></p><p>To recover a lost password, <a href=\"user.php?action=lostpassword\">click here</a> and enter the e-mail address with which you registered. Your password will be sent to you shortly.</p><p><strong>What kinds of stories are allowed?</strong></p><p>See our <a href=\"submission.php\">Submission Rules.</a></p><p><strong>How do I contact the site administrators?</strong></p><p>You can e-mail us via our <a href=\"contact.php\">contact form.</a></p><p><strong>How do I submit stories?</strong></p><p>If you have not already done so, please <a href=\"user.php?action=newaccount\">register for an account</a>. Once you\'ve logged in, click on <a href=\"user.php\">Account Information</a> and choose <a href=\"stories.php?action=newstory\">Add Story</a>. The form presented there will allow you to submit your story.</p><p><strong>What are the ratings used on the site?</strong></p><p>We use the ratings system from <a href=\"http://www.fictionratings.com/\">www.fictionratings.com</a>.</p><p><strong>What are the story classifications?</strong></p><p>Stories are classified by categories, genres, and warnings.</p>');");
|
|
| 219 |
- $output .= "<tr><td>Help</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 220 |
- $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (4, 'nothankyou', 'Submission Rejection', 'Your recent submission of \"{storytitle} : {chaptertitle}\" to {sitename} did not meet our requirements for submission. Please review our {rules}.<br /><br />\r\n\r\n{adminname}');");
|
|
| 221 |
- $output .= "<tr><td>Rejection Letter</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 222 |
- $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (5, 'printercopyright', '', '<u>Disclaimer:</u> All publicly recognizable characters and settings are the property of their respective owners. The original characters and plot are the property of the author. No money is being made from this work. No copyright infringement is intended.');");
|
|
| 223 |
- $output .= "<tr><td>Printable Copyright</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 224 |
- $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (6, 'rules', 'Submission Rules', '<p align=\"center\"><strong>Submission Rules</strong></p>\r\n<ol>\r\n <li>All submissions must be accompanied by a complete disclaimer. If a \r\n suitable disclaimer is not included, the site administrators reserve the right \r\n to add a disclaimer. Repeat offenders may be subject to further action \r\n up to and including removal of stories and account.\r\n<div class=\"tblborder\" style=\"width: 400px; margin: 1em auto;\">\r\n<div style=\"background: #000; color: #FFF; padding: 5px; text-align: center; font-weight: bold;\">Sample Disclaimer</div>\r\n<div class=\"tblborder\" style=\"padding: 5px;\"><span style=\"text-decoration: underline;\">Disclaimer:</span> All publicly recognizable characters, settings, etc. are the property of their respective owners. The original characters and plot are the property of the author. \r\n The author is in no way associated with the owners, creators, or producers of any media franchise. No copyright infringement is intended.</div>\r\n </div>\r\n </li>\r\n <li>Stories must be submitted to the proper category. If there is an appropriate sub-category, <strong>DO NOT</strong> add your story to the main category. The submission \r\n form allows you to choose multiple categories for your story, and we worked very hard to add that functionality for you. <u><strong>So please \r\n do NOT add your story multiple times!</strong></u></li>\r\n <li>Titles and summaries must be kid friendly. No exceptions. </li>\r\n <li>"Please read", "Untitled", etc. are not acceptable titles or summaries.</li>\r\n <li>A number of authors have requested that fans refrain from writing fan \r\n fiction based on their work. Therefore submissions will not be \r\n accepted based on the works of P.N. Elrod, Raymond Feist, Terry Goodkind, \r\n Laurell K. Hamilton, Anne McCaffrey, Robin McKinley, Irene Radford, Anne Rice, \r\n and Nora Roberts/J.D. Robb. </li>\r\n <li>Actor/actress stories are not permitted...not even if they\'re visiting an \r\n alternate reality.</li>\r\n <li>Correct grammar and spelling are expected of all stories submitted to this \r\n site. The site administrators are not grammar Nazis. However, the \r\n site administrators reserve the right to request corrections in submissions \r\n with a multitude of grammar and/or spelling errors. If such a request is \r\n ignored, the story will be deleted.</li>\r\n <li>All stories must be rated correctly and have the appropriate warnings. \r\n All adult rated stories are expected to have warnings. After all, they \r\n wouldn\'t have that rating if there wasn\'t something to be warned about! The site administrators recognize \r\n that there is an audience for these stories, but please respect those who do \r\n not wish to read them by labeling them appropriately. \r\n <u><strong>Please note: Stories containing adults having sex with minors are strictly forbidden.</strong></u> </li>\r\n <li>Stories with multiple chapters should be archived as such and <span style=\"font-weight: bold; text-decoration: underline;\">NEVER</span> as \r\n separate stories. Upload the first chapter of your story, then go to <a href=\"stories.php?action=viewstories\">Manage Stories</a> in \r\nyour account to add additional chapters. If you have trouble with this, please contact the site administrator or ask a \r\n friend to help you.</li>\r\n <li>As much as possible, spoiler warnings are expected on all stories. For categories with serialized content, such as series of books or television series, \r\n spoilers are <strong>mandatory</strong> for the current season and/or most recent part. An appropriate spoiler warning to place in your summary would be: Spoilers for <u>Star Trek II: The Wrath of Khan.</u> \r\n <strong>DO NOT</strong> do anything like this: <u>Spoilers for the one where Spock dies.</u></li>\r\n</ol>\r\n <p>Submissions found to be in violation of these rules may be removed and the \r\n author\'s account suspended at the discretion of the site administrators and/or \r\n moderators. The site administrators reserve the right to modify these \r\n rules as needed.</p>');");
|
|
| 225 |
- $output .= "<tr><td>Submission Rules</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 226 |
- $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (7, 'thankyou', '{sitename} Submission Acceptance', 'Thanks for your submission.');");
|
|
| 227 |
- $output .= "<tr><td>Acceptance Letter</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 228 |
- $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (8, 'tos', 'Terms of Service', 'This is the Terms of Service for your site. It will be displayed when a new member registers to the site.');");
|
|
| 229 |
- $output .= "<tr><td>Terms of Service</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 230 |
- $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (9, 'maintenance', 'Site Maintenance', '<p style=\"text-align: center;\">This site is currently undergoing maintenance. Please check back soon. Thank you.</p>');");
|
|
| 231 |
- $output .= "<tr><td>Site Maintenance</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 232 |
- $output .= "</table>"; |
|
| 233 |
- $output .= write_message(_MESSAGEAUTOFAILUPGRADE."<br /><br /> <a href='install.php?step=8'>"._CONTINUE."</a>"); |
|
| 234 |
- } |
|
| 235 |
- else {
|
|
| 236 |
- $output .= write_message(_MESSAGEMANUAL."<br /><br /><a href='install.php?step=8'>"._CONTINUE."</a>"); |
|
| 237 |
- } |
|
| 238 |
- } |
|
| 239 |
- else $output .= write_message(_MESSAGEDATANEW."<br /><br /><a href='install.php?step=7&install=automatic'>"._AUTO."</a> "._OR." <a href='install.php?step=7&install=manual'>"._MANUAL2."</a>"); |
|
| 240 |
- |
|
| 241 |
- break; |
|
| 242 |
- case "6": |
|
| 243 |
- $output .= "<div id='pagetitle'>"._BLOCKDATA."</div>"; |
|
| 244 |
- if(isset($_GET['install'])) {
|
|
| 245 |
- if($_GET['install'] == "automatic") {
|
|
| 246 |
- $blocklist = array( |
|
| 247 |
- array("categories","Categories","categories/categories.php","1",""),
|
|
| 248 |
- array("featured","Featured Stories","featured/featured.php","1",""),
|
|
| 249 |
- array("info","Site Info","info/info.php","2",""),
|
|
| 250 |
- array("login","Log In","login/login.php","1",""),
|
|
| 251 |
- array("menu","Main Menu","menu/menu.php","1",""),
|
|
| 252 |
- array("random","Random Story","random/random.php","2",""),
|
|
| 253 |
- array("recent","Most Recent","recent/recent.php","2","a:1:{s:3:\"num\";s:1:\"1\";}"),
|
|
| 254 |
- array("skinchange","Skin Change","skinchange/skinchange.php","1",""),
|
|
| 255 |
- array("news","Site News","news/news.php","1","a:1:{s:3:\"num\";s:1:\"1\";}")
|
|
| 256 |
- ); |
|
| 257 |
- $output .= "<table class='tblborder' style='margin: 1em auto; padding: 1em;' cellpadding='5'><tr><th>"._BLOCK."</th><th>"._RESULT."</th></tr>"; |
|
| 258 |
- foreach($blocklist as $block) {
|
|
| 259 |
- $b = dbquery("INSERT INTO `".$tableprefix."fanfiction_blocks` (`block_name`, `block_title`, `block_file`, `block_status`, `block_variables`) VALUES('".$block[0]."', '".$block[1]."', '".$block[2]."', '".$block[3]."', '".escapestring($block[4])."');");
|
|
| 260 |
- $output .= "<tr><td>".$block[1]."</td><td align='center'>" . ($b ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 261 |
- } |
|
| 262 |
- $output .= "</table>"; |
|
| 263 |
- $output .= write_message(_BLOCKDATAFAILUPGRADE."<br /><br /><a href='install.php?step=7'>"._CONTINUE."</a>"); |
|
| 264 |
- } |
|
| 265 |
- else {
|
|
| 266 |
- $output .= write_message(_BLOCKDATAMANUAL."<br /><br /><a href='install.php?step=6'>"._CONTINUE."</a>"); |
|
| 267 |
- } |
|
| 268 |
- } |
|
| 269 |
- else $output .= write_message(_BLOCKDATANEW."<br /><br /><a href='install.php?step=6&install=automatic'>"._AUTO."</a> "._OR." <a href='install.php?step=6&install=manual'>"._MANUAL2."</a>"); |
|
| 270 |
- break; |
|
| 271 |
- case "5": |
|
| 272 |
- $output .= "<div id='pagetitle'>"._LINKDATA."</div>"; |
|
| 273 |
- if(isset($_GET['install'])) {
|
|
| 274 |
- if($_GET['install'] == "automatic") {
|
|
| 275 |
- $pagelist = array( |
|
| 276 |
- array("home","Home","index.php","0","0"),
|
|
| 277 |
- array("recent","Most Recent","browse.php?type=recent","0","0"),
|
|
| 278 |
- array("login","Login","user.php?action=login","0","0"),
|
|
| 279 |
- array("adminarea","Admin","admin.php","0","2"),
|
|
| 280 |
- array("logout","Logout","user.php?action=logout","0","1"),
|
|
| 281 |
- array("featured","Featured Stories","browse.php?type=featured","0","0"),
|
|
| 282 |
- array("catslink","Categories","browse.php?type=categories","0","0"),
|
|
| 283 |
- array("members","Members","authors.php?action=list","0","0"),
|
|
| 284 |
- array("authors","Authors","authors.php?list=authors","0","0"),
|
|
| 285 |
- array("help","Help","viewpage.php?page=help","0","0"),
|
|
| 286 |
- array("search","Search","search.php","0","0"),
|
|
| 287 |
- array("series","Series","browse.php?type=series","0","0"),
|
|
| 288 |
- array("tens","Top Tens","toplists.php","0","0"),
|
|
| 289 |
- array("challenges","Challenges","modules/challenges/challenges.php","0","0"),
|
|
| 290 |
- array("contactus","Contact Us","contact.php","0","0"),
|
|
| 291 |
- array("rules","Rules","viewpage.php?page=rules","0","0"),
|
|
| 292 |
- array("tos","Terms of Service","viewpage.php?page=tos","0","0"),
|
|
| 293 |
- array("rss","<img src=\'images/xml.gif\' alt=\'RSS\' border=\'0\'>","rss.php","0","0"),
|
|
| 294 |
- array("login","Account Info","user.php","0","1"),
|
|
| 295 |
- array("titles","Titles","browse.php?type=titles","0","0"),
|
|
| 296 |
- array("register","Register","user.php?action=register","0","0"),
|
|
| 297 |
- array("lostpassword","Lost Password","user.php?action=lostpassword","0","0"),
|
|
| 298 |
- array("newsarchive","News Archive","news.php","0","0"),
|
|
| 299 |
- array("browse","Browse","browse.php","0","0"),
|
|
| 300 |
- array("charslink", "Characters", "browse.php?type=characters","0","0"),
|
|
| 301 |
- array("ratings", "Ratings", "browse.php?type=ratings", "0", "0"),
|
|
| 302 |
- ); |
|
| 303 |
- $output .= "<table class='tblborder' style='margin: 1em auto; padding: 1em;' cellpadding='5'><tr><th>"._PAGE."</th><th>"._RESULT."</th></tr>"; |
|
| 304 |
- foreach($pagelist as $page) {
|
|
| 305 |
- $pages = dbquery("INSERT INTO `".$tableprefix."fanfiction_pagelinks` (`link_name`, `link_text`, `link_url`, `link_target`, `link_access`) VALUES ('".$page[0]."', '".$page[1]."', '".$page[2]."', '".$page[3]."', '".$page[4]."');");
|
|
| 306 |
- $output .= "<tr><td>".stripslashes($page[1])."</td><td align='center'>" . ($pages ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 307 |
- } |
|
| 308 |
- |
|
| 309 |
- $output .= "</table>"; |
|
| 310 |
- $output .= write_message(_LINKAUTOFAIL."<br /><br /> <a href='install.php?step=6'>"._CONTINUE."</a>"); |
|
| 311 |
- } |
|
| 312 |
- else {
|
|
| 313 |
- $output .= write_message(_LINKMANUAL."<br /><br /><a href='install.php?step=5'>"._CONTINUE."</a>"); |
|
| 314 |
- } |
|
| 315 |
- } |
|
| 316 |
- else $output .= write_message(_LINKDATAINFO."<br /><br />"._LINKSETUP." <a href='install.php?step=5&install=automatic'>"._AUTO."</a> "._OR." <a href='install.php?step=5&install=manual'>"._MANUAL2."</a>"); |
|
| 317 |
- break; |
|
| 318 |
- case "4": |
|
| 319 |
- $output .= "<div id='pagetitle'>"._PANELDATA."</div>"; |
|
| 320 |
- if(isset($_GET['install'])){
|
|
| 321 |
- if($_GET['install'] == "automatic") {
|
|
| 322 |
- |
|
| 323 |
- $panellist = array( |
|
| 324 |
- array("submitted","Submissions", "","3","5","0","A"),
|
|
| 325 |
- array("versioncheck", "Version Check", "", "3", "7", "0", "A"),
|
|
| 326 |
- array("newstory","Add New Story","stories.php?action=newstory&admin=1","3","3","0","A"),
|
|
| 327 |
- array("addseries","Add New Series","series.php?action=add","3","3","0","A"),
|
|
| 328 |
- array("news","News","","3","5","0","A"),
|
|
| 329 |
- array("featured","Featured Stories","","3","5","0","A"),
|
|
| 330 |
- array("characters","Characters","","2","2","0","A"),
|
|
| 331 |
- array("ratings","Ratings","","2","3","0","A"),
|
|
| 332 |
- array("members","Members","","2","5","0","A"),
|
|
| 333 |
- array("mailusers","Mail Users","","2","6","0","A"),
|
|
| 334 |
- array("settings","Settings","","1","2","0","A"),
|
|
| 335 |
- array("blocks","Blocks","","1","3","0","A"),
|
|
| 336 |
- array("censor","Censor","","1","0","1","A"),
|
|
| 337 |
- array("admins","Admins","","1","6","0","A"),
|
|
| 338 |
- array("classifications","Classifications","","2","4","0","A"),
|
|
| 339 |
- array("categories","Categories","","2","1","0","A"),
|
|
| 340 |
- array("custpages","Custom Pages","","1","4","0","A"),
|
|
| 341 |
- array("validate","Validate Submission","","3","0","1","A"),
|
|
| 342 |
- array("yesletter","Validation Letter","","3","0","1","A"),
|
|
| 343 |
- array("noletter","Rejection Letter","","3","0","1","A"),
|
|
| 344 |
- array("links","Page Links","","1","5","0","A"),
|
|
| 345 |
- array("messages","Message Settings","","2","0","1","A"),
|
|
| 346 |
- array("login","Login","","0","0","1","U"),
|
|
| 347 |
- array("logout","Logout","","1","5","0","U"),
|
|
| 348 |
- array("revreceived","Reviews Received","","1","0","1","U"),
|
|
| 349 |
- array("editprefs","Edit Preferences","","1","2","0","U"),
|
|
| 350 |
- array("lostpassword","Lost Password","","0","0","1","U"),
|
|
| 351 |
- array("editbio","Edit Bio","","1","1","0","U"),
|
|
| 352 |
- array("register","Register","","0","0","1","U"),
|
|
| 353 |
- array("manageimages","Manage Images","","1","5","0","S"),
|
|
| 354 |
- array("revres","Review Response","","1","0","1","U"),
|
|
| 355 |
- array("stats","View Your Statistics","","1","3","0","U"),
|
|
| 356 |
- array("newstory","Add New Story","stories.php?action=newstory","1","1","0","S"),
|
|
| 357 |
- array("newseries","Add New Series","series.php?action=add","1","3","0","S"),
|
|
| 358 |
- array("managestories","Manage Stories","stories.php?action=viewstories","1","2","0","S"),
|
|
| 359 |
- array("manageseries","Manage Series","series.php?action=manage","1","4","0","S"),
|
|
| 360 |
- array("reviewsby","Your Reviews","","1","0","1","U"),
|
|
| 361 |
- array("storiesby","Stories by {author}","","0","1","0","P"),
|
|
| 362 |
- array("seriesby","Series by {author}","","0","2","0","P"),
|
|
| 363 |
- array("reviewsby","Reviews by {author}","","0","3","0","P"),
|
|
| 364 |
- array("categories","Categories","","0","1","0","B"),
|
|
| 365 |
- array("characters","Characters","","0","2","0","B"),
|
|
| 366 |
- array("ratings","Ratings","","0","3","0","B"),
|
|
| 367 |
- array("titles","Titles","","0","5","0","B"),
|
|
| 368 |
- array("class","Classes","","0","0","1","B"),
|
|
| 369 |
- array("recent","Most Recent","","0","0","1","B"),
|
|
| 370 |
- array("featured","Featured Stories","","0","0","1","B"),
|
|
| 371 |
- array("panels","Panels","","1","1","0","A"),
|
|
| 372 |
- array("phpinfo","PHP Info","","1","7","0","A"),
|
|
| 373 |
- array("contact","Contact","","0","0","1","P"),
|
|
| 374 |
- array("series", "Series", "", "0", "4", "0", "B"),
|
|
| 375 |
- array("viewlog", "Action Log", "", "1", "8", "0", "A"),
|
|
| 376 |
- array("shortstories","10 Shortest Stories","toplists/default.php","0","6","0","L"),
|
|
| 377 |
- array("longstories","10 Longest Stories","toplists/default.php","0","5","0","L"),
|
|
| 378 |
- array("largeseries","10 Largest Series","toplists/default.php","0","1","0","L"),
|
|
| 379 |
- array("smallseries","10 Smallest Series","toplists/default.php","0","2","0","L"),
|
|
| 380 |
- array("reviewedseries","10 Most Reviewed Series","toplists/default.php","0","4","0","L"),
|
|
| 381 |
- array("prolificauthors","10 Most Prolific Authors","toplists/default.php","0","10","0","L"),
|
|
| 382 |
- array("prolificreviewers","10 Most Prolific Reviewers","toplists/default.php","0","12","0","L"),
|
|
| 383 |
- array("reviewedstories","10 Most Reviewed Stories","toplists/default.php","0","8","0","L"),
|
|
| 384 |
- array("readstories","10 Most Read Stories","toplists/default.php","0","9","0","L"),
|
|
| 385 |
- array("manfavs","Manage Favorites","","1","2","0","F"),
|
|
| 386 |
- array("favstories","10 Most Favorite Stories","toplists/default.php","0","7","0","L"),
|
|
| 387 |
- array("favauthors","10 Most Favorite Authors","toplists/default.php","0","11","0","L"),
|
|
| 388 |
- array("favseries","10 Most Favorite Series","toplists/default.php","0","3","0","L"),
|
|
| 389 |
- array("favst","Favorite Stories","","0","0","1","F"),
|
|
| 390 |
- array("favse","Favorite Series","","0","0","1","F"),
|
|
| 391 |
- array("favau","Favorite Authors","","0","0","1","F"),
|
|
| 392 |
- array("favst","Favorite Stories","","0","0","1","U"),
|
|
| 393 |
- array("favse","Favorite Series","","0","0","1","U"),
|
|
| 394 |
- array("favau","Favorite Authors","","0","0","1","U"),
|
|
| 395 |
- array("favlist","{author}\'s Favorites","viewuser.php?action=manfavs","0","5","0","F"),
|
|
| 396 |
- array("skins", "Skins", "", "3", "6", "0", "A"),
|
|
| 397 |
- array("authorfields", "Profile Information", "", "1", "9", "0", "A"),
|
|
| 398 |
- array("maintenance", "Archive Maintenance", "", "1", "10", "0", "A"),
|
|
| 399 |
- array("manual", "Admin Manual", "", "3", "6", "0", "A"),
|
|
| 400 |
- array('modules', 'Modules', '', 1, "11", 0, 'A')
|
|
| 401 |
- ); |
|
| 402 |
- $output .= "<table class='tblborder' style='margin: 1em auto; padding: 1em;' cellpadding='5'><tr><th>Panel</th><th>"._RESULT."</th></tr>"; |
|
| 403 |
- foreach($panellist as $panel) {
|
|
| 404 |
- unset($panels); |
|
| 405 |
- $panels = dbquery("INSERT INTO `".$tableprefix."fanfiction_panels` (`panel_name`, `panel_title`, `panel_url`, `panel_level`, `panel_order`, `panel_hidden`, `panel_type`) VALUES ('".$panel[0]."', '".$panel[1]."', '".$panel[2]."', '".$panel[3]."', '".$panel[4]."', '".$panel[5]."', '".$panel[6]."');");
|
|
| 406 |
- $output .= "<tr><td>".stripslashes($panel[1])."</td><td align='center'>" . ($panels ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 407 |
- } |
|
| 408 |
- $output .= "</table>"; |
|
| 409 |
- $output .= write_message(_PANELAUTOFAIL."<br /><br /><a href='install.php?step=5'>"._CONTINUE."</a>"); |
|
| 410 |
- } |
|
| 411 |
- else {
|
|
| 412 |
- $output .= write_message(_PANELMANUAL."<br /><br /><a href='install.php?step=5'>"._CONTINUE."</a>"); |
|
| 413 |
- } |
|
| 414 |
- } |
|
| 415 |
- else $output .= write_message(_PANELDATAINFO."<br /><br />"._PANELSETUP." <a href='install.php?step=4&install=automatic'>"._AUTO."</a> "._OR." <a href='install.php?step=4&install=manual'>"._MANUAL2."</a>"); |
|
| 416 |
- break; |
|
| 417 |
- case "3": |
|
| 418 |
- $output .= "<div id='pagetitle'>"._INSTALLTABLES."</div>"; |
|
| 419 |
- if(isset($_GET['install'])) {
|
|
| 420 |
- if($_GET['install'] == "automatic") {
|
|
| 421 |
- $output .= "<table class='tblborder' style='margin: 1em auto; padding: 1em;' cellpadding='5'><tr><th>Table</th><th>"._RESULT."</th></tr>"; |
|
| 422 |
- $authorfields = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_authorfields` (
|
|
| 423 |
- `field_id` int(11) NOT NULL AUTO_INCREMENT, |
|
| 424 |
- `field_type` tinyint(4) NOT NULL default '0', |
|
| 425 |
- `field_name` varchar(30) NOT NULL default ' ', |
|
| 426 |
- `field_title` varchar(255) NOT NULL default ' ', |
|
| 427 |
- `field_options` text, |
|
| 428 |
- `field_code_in` text, |
|
| 429 |
- `field_code_out` text, |
|
| 430 |
- `field_on` tinyint(1) NOT NULL default '0', |
|
| 431 |
- PRIMARY KEY (`field_id`) |
|
| 432 |
-) ENGINE=MyISAM;"); |
|
| 433 |
-$output .= "<tr><td>".$tableprefix."fanfiction_authorfields</td><td align='center'>" . ($authorfields ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 434 |
- $authorinfo = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_authorinfo` (
|
|
| 435 |
- `uid` int(11) NOT NULL default '0', |
|
| 436 |
- `field` int(11) NOT NULL default '0', |
|
| 437 |
- `info` varchar(255) NOT NULL default ' ', |
|
| 438 |
- PRIMARY KEY (`uid`,`field`), |
|
| 439 |
- KEY `uid` (`uid`)) ENGINE=MyISAM;"); |
|
| 440 |
-$output .= "<tr><td>".$tableprefix."fanfiction_authorinfo</td><td align='center'>" . ($authorinfo ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 441 |
- $authorprefs = dbquery("
|
|
| 442 |
-CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_authorprefs` ( |
|
| 443 |
- `uid` int(11) NOT NULL default '0', |
|
| 444 |
- `newreviews` tinyint(1) NOT NULL default '0', |
|
| 445 |
- `newrespond` tinyint(1) NOT NULL default '0', |
|
| 446 |
- `ageconsent` tinyint(1) NOT NULL default '0', |
|
| 447 |
- `alertson` tinyint(1) NOT NULL default '0', |
|
| 448 |
- `tinyMCE` tinyint(1) NOT NULL default '0', |
|
| 449 |
- `sortby` tinyint(1) NOT NULL default '0', |
|
| 450 |
- `storyindex` tinyint(1) NOT NULL default '0', |
|
| 451 |
- `validated` tinyint(1) NOT NULL default '0', |
|
| 452 |
- `userskin` varchar(60) NOT NULL default 'default', |
|
| 453 |
- `level` tinyint(1) NOT NULL default '0', |
|
| 454 |
- `categories` varchar(200) NOT NULL default '0', |
|
| 455 |
- `contact` tinyint(1) NOT NULL default '0', |
|
| 456 |
- `stories` int(11) NOT NULL default '0', |
|
| 457 |
- PRIMARY KEY (`uid`) |
|
| 458 |
-) ENGINE=MyISAM;"); |
|
| 459 |
-$output .= "<tr><td>".$tableprefix."fanfiction_authorprefs</td><td align='center'>" . ($authorprefs ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 460 |
- $authors = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_authors` (
|
|
| 461 |
- `uid` int(11) NOT NULL auto_increment, |
|
| 462 |
- `penname` varchar(200) NOT NULL default '', |
|
| 463 |
- `realname` varchar(200) NOT NULL default '', |
|
| 464 |
- `email` varchar(200) NOT NULL default '', |
|
| 465 |
- `bio` text NULL, |
|
| 466 |
- `image` varchar(200) NOT NULL default '', |
|
| 467 |
- `date` datetime NOT NULL default '0000-00-00 00:00:00', |
|
| 468 |
- `admincreated` char(1) NOT NULL default '0', |
|
| 469 |
- `password` varchar(40) NOT NULL default '0', |
|
| 470 |
- PRIMARY KEY (`uid`), |
|
| 471 |
- KEY `penname` (`penname`), |
|
| 472 |
- KEY `admincreated` (`admincreated`) |
|
| 473 |
-) ENGINE=MyISAM;"); |
|
| 474 |
-$output .= "<tr><td>".$tableprefix."fanfiction_authors</td><td align='center'>" . ($authors ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 475 |
- $blocks = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_blocks` (
|
|
| 476 |
- `block_id` int(11) NOT NULL auto_increment, |
|
| 477 |
- `block_name` varchar(30) NOT NULL default '', |
|
| 478 |
- `block_title` varchar(150) NOT NULL default '', |
|
| 479 |
- `block_file` varchar(200) NOT NULL default '', |
|
| 480 |
- `block_status` tinyint(1) NOT NULL default '0', |
|
| 481 |
- `block_variables` text NOT NULL, |
|
| 482 |
- PRIMARY KEY (`block_id`), |
|
| 483 |
- KEY `block_name` (`block_name`) |
|
| 484 |
-) ENGINE=MyISAM;"); |
|
| 485 |
-$output .= "<tr><td>".$tableprefix."fanfiction_blocks</td><td align='center'>" . ($blocks ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 486 |
- $categories = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_categories` (
|
|
| 487 |
- `catid` int(11) NOT NULL auto_increment, |
|
| 488 |
- `parentcatid` int(11) NOT NULL default '-1', |
|
| 489 |
- `category` varchar(60) NOT NULL default '', |
|
| 490 |
- `description` text NOT NULL, |
|
| 491 |
- `image` varchar(100) NOT NULL default '', |
|
| 492 |
- `locked` char(1) NOT NULL default '0', |
|
| 493 |
- `leveldown` tinyint(4) NOT NULL default '0', |
|
| 494 |
- `displayorder` int(11) NOT NULL default '0', |
|
| 495 |
- `numitems` int(11) NOT NULL default '0', |
|
| 496 |
- PRIMARY KEY (`catid`), |
|
| 497 |
- KEY `byparent` (`parentcatid`,`displayorder`) |
|
| 498 |
-) ENGINE=MyISAM;"); |
|
| 499 |
-$output .= "<tr><td>".$tableprefix."fanfiction_categories</td><td align='center'>" . ($categories ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 500 |
- $chapters = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_chapters` (
|
|
| 501 |
- `chapid` int(11) NOT NULL auto_increment, |
|
| 502 |
- `title` varchar(250) NOT NULL default '', |
|
| 503 |
- `inorder` int(11) NOT NULL default '0', |
|
| 504 |
- `notes` text NULL, |
|
| 505 |
- `storytext` text NULL, |
|
| 506 |
- `endnotes` text NULL, |
|
| 507 |
- `validated` char(1) NOT NULL default '0', |
|
| 508 |
- `wordcount` int(11) NOT NULL default '0', |
|
| 509 |
- `rating` tinyint(4) NOT NULL default '0', |
|
| 510 |
- `reviews` smallint(6) NOT NULL default '0', |
|
| 511 |
- `sid` int(11) NOT NULL default '0', |
|
| 512 |
- `uid` int(11) NOT NULL default '0', |
|
| 513 |
- `count` int(11) NOT NULL default '0', |
|
| 514 |
- PRIMARY KEY (`chapid`), |
|
| 515 |
- KEY `sid` (`sid`), |
|
| 516 |
- KEY `uid` (`uid`), |
|
| 517 |
- KEY `inorder` (`inorder`), |
|
| 518 |
- KEY `title` (`title`), |
|
| 519 |
- KEY `validated` (`validated`), |
|
| 520 |
- KEY `forstoryblock` (`sid`,`validated`) |
|
| 521 |
-) ENGINE=MyISAM;"); |
|
| 522 |
-$output .= "<tr><td>".$tableprefix."fanfiction_chapters</td><td align='center'>" . ($chapters ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 523 |
- $characters = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_characters` (
|
|
| 524 |
- `charid` int(11) NOT NULL auto_increment, |
|
| 525 |
- `catid` int(11) NOT NULL default '0', |
|
| 526 |
- `charname` varchar(60) NOT NULL default '', |
|
| 527 |
- `bio` text NOT NULL, |
|
| 528 |
- `image` varchar(200) NOT NULL default '', |
|
| 529 |
- PRIMARY KEY (`charid`), |
|
| 530 |
- KEY `catid` (`catid`), |
|
| 531 |
- KEY `charname` (`charname`) |
|
| 532 |
-) ENGINE=MyISAM;"); |
|
| 533 |
-$output .= "<tr><td>".$tableprefix."fanfiction_characters</td><td align='center'>" . ($characters ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 534 |
- $classes = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_classes` (
|
|
| 535 |
- `class_id` int(11) NOT NULL auto_increment, |
|
| 536 |
- `class_type` int(11) NOT NULL default '0', |
|
| 537 |
- `class_name` varchar(100) NOT NULL default '', |
|
| 538 |
- PRIMARY KEY (`class_id`), |
|
| 539 |
- KEY `byname` (`class_type`,`class_name`,`class_id`) |
|
| 540 |
-) ENGINE=MyISAM;"); |
|
| 541 |
-$output .= "<tr><td>".$tableprefix."fanfiction_classes</td><td align='center'>" . ($classes ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 542 |
- $classtypes = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_classtypes` (
|
|
| 543 |
- `classtype_id` int(11) NOT NULL auto_increment, |
|
| 544 |
- `classtype_name` varchar(50) NOT NULL default '', |
|
| 545 |
- `classtype_title` varchar(50) NOT NULL default '', |
|
| 546 |
- PRIMARY KEY (`classtype_id`), |
|
| 547 |
- UNIQUE KEY `classtype_name` (`classtype_name`) |
|
| 548 |
-) ENGINE=MyISAM;"); |
|
| 549 |
-$output .= "<tr><td>".$tableprefix."fanfiction_classtypes</td><td align='center'>" . ($classtypes ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 550 |
-$coauthors = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_coauthors` (
|
|
| 551 |
- `sid` int(11) NOT NULL default '0', |
|
| 552 |
- `uid` int(11) NOT NULL default '0', |
|
| 553 |
- PRIMARY KEY (`sid`,`uid`) |
|
| 554 |
-) ENGINE=MyISAM;"); |
|
| 555 |
-$output .= "<tr><td>".$tableprefix."fanfiction_coauthors</td><td align='center'>" . ($coauthors ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 556 |
- $codeblocks = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_codeblocks` (
|
|
| 557 |
- `code_id` int(11) NOT NULL auto_increment, |
|
| 558 |
- `code_text` text NOT NULL, |
|
| 559 |
- `code_type` varchar(20) default NULL, |
|
| 560 |
- `code_module` varchar(60) default NULL, |
|
| 561 |
- PRIMARY KEY (`code_id`), |
|
| 562 |
- KEY `code_type` (`code_type`) |
|
| 563 |
-) ENGINE=MyISAM;"); |
|
| 564 |
-$output .= "<tr><td>".$tableprefix."fanfiction_codeblocks</td><td align='center'>" . ($codeblocks ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 565 |
- $comments = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_comments` (
|
|
| 566 |
- `cid` int(11) NOT NULL auto_increment, |
|
| 567 |
- `nid` int(11) NOT NULL default '0', |
|
| 568 |
- `uid` int(11) NOT NULL default '0', |
|
| 569 |
- `comment` text NOT NULL, |
|
| 570 |
- `time` datetime NOT NULL default '0000-00-00 00:00:00', |
|
| 571 |
- PRIMARY KEY (`cid`), |
|
| 572 |
- KEY `commentlist` (`nid`,`time`) |
|
| 573 |
-) ENGINE=MyISAM;"); |
|
| 574 |
-$output .= "<tr><td>".$tableprefix."fanfiction_comments</td><td align='center'>" . ($comments ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 575 |
- $favorites = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_favorites` (
|
|
| 576 |
- `uid` int(11) NOT NULL default '0', |
|
| 577 |
- `item` int(11) NOT NULL default '0', |
|
| 578 |
- `type` char(2) NOT NULL default '', |
|
| 579 |
- `comments` text NOT NULL, |
|
| 580 |
- UNIQUE KEY `byitem` (`item`,`type`,`uid`), |
|
| 581 |
- UNIQUE KEY `byuid` (`uid`,`type`,`item`) |
|
| 582 |
-) ENGINE=MyISAM;"); |
|
| 583 |
-$output .= "<tr><td>".$tableprefix."fanfiction_favorites</td><td align='center'>" . ($favorites ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 584 |
- $inseries = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_inseries` (
|
|
| 585 |
- `seriesid` int(11) NOT NULL default '0', |
|
| 586 |
- `sid` int(11) NOT NULL default '0', |
|
| 587 |
- `subseriesid` int(11) NOT NULL default '0', |
|
| 588 |
- `confirmed` int(11) NOT NULL default '0', |
|
| 589 |
- `inorder` int(11) NOT NULL default '0', |
|
| 590 |
- PRIMARY KEY (`sid`,`seriesid`, `subseriesid`), |
|
| 591 |
- KEY `seriesid` (`seriesid`,`inorder`) |
|
| 592 |
-) ENGINE=MyISAM;"); |
|
| 593 |
-$output .= "<tr><td>".$tableprefix."fanfiction_inseries</td><td align='center'>" . ($inseries ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 594 |
- $logs = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_log` (
|
|
| 595 |
- `log_id` int(11) NOT NULL auto_increment, |
|
| 596 |
- `log_action` varchar(255) default NULL, |
|
| 597 |
- `log_uid` int(11) NOT NULL, |
|
| 598 |
- `log_ip` int(11) UNSIGNED default NULL, |
|
| 599 |
- `log_timestamp` timestamp NOT NULL, |
|
| 600 |
- `log_type` varchar(2) NOT NULL, |
|
| 601 |
- PRIMARY KEY (`log_id`) |
|
| 602 |
-) ENGINE=MyISAM"); |
|
| 603 |
-$output .= "<tr><td>".$tableprefix."fanfiction_log</td><td align='center'>" . ($logs ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 604 |
- $messages = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_messages` (
|
|
| 605 |
- `message_id` int(11) NOT NULL auto_increment, |
|
| 606 |
- `message_name` varchar(50) NOT NULL default '', |
|
| 607 |
- `message_title` varchar(200) NOT NULL default '', |
|
| 608 |
- `message_text` text NOT NULL, |
|
| 609 |
- PRIMARY KEY (`message_id`), |
|
| 610 |
- KEY `message_name` (`message_name`) |
|
| 611 |
-) ENGINE=MyISAM;"); |
|
| 612 |
-$output .= "<tr><td>".$tableprefix."fanfiction_messages</td><td align='center'>" . ($messages ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 613 |
- $modules = dbquery("
|
|
| 614 |
-CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_modules` ( |
|
| 615 |
- `id` int(11) NOT NULL auto_increment, |
|
| 616 |
- `name` varchar(100) NOT NULL default 'Test Module', |
|
| 617 |
- `version` varchar(10) NOT NULL default '1.0', |
|
| 618 |
- PRIMARY KEY (`id`), |
|
| 619 |
- KEY `name_version` (`name`,`version`) |
|
| 620 |
-)"); |
|
| 621 |
-$output .= "<tr><td>".$tableprefix."fanfiction_modules</td><td align='center'>" . ($modules ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 622 |
- $news = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_news` (
|
|
| 623 |
- `nid` int(11) NOT NULL auto_increment, |
|
| 624 |
- `author` varchar(60) NOT NULL default '', |
|
| 625 |
- `title` varchar(255) NOT NULL default '', |
|
| 626 |
- `story` text NOT NULL, |
|
| 627 |
- `time` datetime default NULL, |
|
| 628 |
- `comments` INT NOT NULL DEFAULT '0', |
|
| 629 |
- PRIMARY KEY (`nid`) |
|
| 630 |
-) ENGINE=MyISAM;"); |
|
| 631 |
-$output .= "<tr><td>".$tableprefix."fanfiction_news</td><td align='center'>" . ($news ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 632 |
- $pagelinks = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_pagelinks` (
|
|
| 633 |
- `link_id` int(11) NOT NULL auto_increment, |
|
| 634 |
- `link_name` varchar(50) NOT NULL default '', |
|
| 635 |
- `link_text` varchar(100) NOT NULL default '', |
|
| 636 |
- `link_key` CHAR( 1 ) NULL, |
|
| 637 |
- `link_url` varchar(250) NOT NULL default '', |
|
| 638 |
- `link_target` char(1) NOT NULL default '0', |
|
| 639 |
- `link_access` tinyint(4) NOT NULL default '0', |
|
| 640 |
- PRIMARY KEY (`link_id`), |
|
| 641 |
- KEY `link_name` (`link_name`) |
|
| 642 |
-) ENGINE=MyISAM;"); |
|
| 643 |
-$output .= "<tr><td>".$tableprefix."fanfiction_pagelinks</td><td align='center'>" . ($pagelinks ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 644 |
- $panels = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_panels` (
|
|
| 645 |
- `panel_id` int(11) NOT NULL auto_increment, |
|
| 646 |
- `panel_name` varchar(50) NOT NULL default 'unknown', |
|
| 647 |
- `panel_title` varchar(100) NOT NULL default 'Unnamed Panel', |
|
| 648 |
- `panel_url` varchar(100) default NULL, |
|
| 649 |
- `panel_level` tinyint(4) NOT NULL default '3', |
|
| 650 |
- `panel_order` tinyint(4) NOT NULL default '0', |
|
| 651 |
- `panel_hidden` tinyint(1) NOT NULL default '0', |
|
| 652 |
- `panel_type` varchar(20) NOT NULL default 'A', |
|
| 653 |
- PRIMARY KEY (`panel_id`), |
|
| 654 |
- KEY `panel_type` (`panel_type`,`panel_name`) |
|
| 655 |
-) ENGINE=MyISAM;"); |
|
| 656 |
-$output .= "<tr><td>".$tableprefix."fanfiction_panels</td><td align='center'>" . ($panels ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 657 |
- $ratings = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_ratings` (
|
|
| 658 |
- `rid` int(11) NOT NULL auto_increment, |
|
| 659 |
- `rating` varchar(60) NOT NULL default '', |
|
| 660 |
- `ratingwarning` char(1) NOT NULL default '0', |
|
| 661 |
- `warningtext` text NOT NULL, |
|
| 662 |
- PRIMARY KEY (`rid`), |
|
| 663 |
- KEY `rating` (`rating`) |
|
| 664 |
-) ENGINE=MyISAM;"); |
|
| 665 |
-$output .= "<tr><td>".$tableprefix."fanfiction_ratings</td><td align='center'>" . ($ratings ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 666 |
- $reviews = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_reviews` (
|
|
| 667 |
- `reviewid` int(11) NOT NULL auto_increment, |
|
| 668 |
- `item` int(11) NOT NULL default '0', |
|
| 669 |
- `chapid` int(11) NOT NULL default '0', |
|
| 670 |
- `reviewer` varchar(60) NOT NULL default '0', |
|
| 671 |
- `uid` int(11) NOT NULL default '0', |
|
| 672 |
- `review` text NOT NULL, |
|
| 673 |
- `date` datetime NOT NULL default '0000-00-00 00:00:00', |
|
| 674 |
- `rating` int(11) NOT NULL default '0', |
|
| 675 |
- `respond` char(1) NOT NULL default '0', |
|
| 676 |
- `type` char(2) NOT NULL default '', |
|
| 677 |
- PRIMARY KEY (`reviewid`), |
|
| 678 |
- KEY `chapid` (`chapid`), |
|
| 679 |
- KEY `rating` (`rating`), |
|
| 680 |
- KEY `respond` (`respond`), |
|
| 681 |
- KEY `avgrating` (`type`,`item`,`rating`), |
|
| 682 |
- KEY `bychapter` (`chapid`,`rating`), |
|
| 683 |
- KEY `byuid` (`uid`,`item`,`type`) |
|
| 684 |
-) ENGINE=MyISAM;"); |
|
| 685 |
-$output .= "<tr><td>".$tableprefix."fanfiction_reviews</td><td align='center'>" . ($reviews ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 686 |
- $series = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_series` (
|
|
| 687 |
- `seriesid` int(11) NOT NULL auto_increment, |
|
| 688 |
- `title` varchar(200) NOT NULL default '', |
|
| 689 |
- `summary` text NOT NULL, |
|
| 690 |
- `uid` int(11) NOT NULL default '0', |
|
| 691 |
- `isopen` tinyint(4) NOT NULL default '0', |
|
| 692 |
- `catid` varchar(200) NOT NULL default '0', |
|
| 693 |
- `rating` tinyint(4) NOT NULL default '0', |
|
| 694 |
- `classes` varchar(200) NOT NULL default '', |
|
| 695 |
- `characters` varchar(250) NOT NULL default '', |
|
| 696 |
- `reviews` smallint(6) NOT NULL default '0', |
|
| 697 |
- `numstories` INT NOT NULL DEFAULT '0', |
|
| 698 |
- `challenges` varchar(200) NOT NULL default '', |
|
| 699 |
- PRIMARY KEY (`seriesid`), |
|
| 700 |
- KEY `catid` (`catid`), |
|
| 701 |
- KEY `characters` (`characters`), |
|
| 702 |
- KEY `classes` (`classes`), |
|
| 703 |
- KEY `owner` (`uid`,`title`) |
|
| 704 |
-) ENGINE=MyISAM;"); |
|
| 705 |
-$output .= "<tr><td>".$tableprefix."fanfiction_series</td><td align='center'>" . ($series ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 706 |
- $stats = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_stats` (
|
|
| 707 |
- `sitekey` varchar(50) NOT NULL default '0', |
|
| 708 |
- `stories` int(11) NOT NULL default '0', |
|
| 709 |
- `chapters` int(11) NOT NULL default '0', |
|
| 710 |
- `series` int(11) NOT NULL default '0', |
|
| 711 |
- `reviews` int(11) NOT NULL default '0', |
|
| 712 |
- `wordcount` int(11) NOT NULL default '0', |
|
| 713 |
- `authors` int(11) NOT NULL default '0', |
|
| 714 |
- `members` int(11) NOT NULL default '0', |
|
| 715 |
- `reviewers` int(11) NOT NULL default '0', |
|
| 716 |
- `newestmember` int(11) NOT NULL default '0' |
|
| 717 |
-) ENGINE=MyISAM"); |
|
| 718 |
- dbquery("INSERT INTO ".$tableprefix."fanfiction_stats(`sitekey`, `newestmember`) VALUES('".SITEKEY."', '1')");
|
|
| 719 |
-$output .= "<tr><td>".$tableprefix."fanfiction_stats</td><td align='center'>" . ($stats ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 720 |
- $stories = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_stories` (
|
|
| 721 |
- `sid` int(11) NOT NULL auto_increment, |
|
| 722 |
- `title` varchar(200) NOT NULL default 'Untitled', |
|
| 723 |
- `summary` text NULL, |
|
| 724 |
- `storynotes` text NULL, |
|
| 725 |
- `catid` varchar(100) NOT NULL default '0', |
|
| 726 |
- `classes` varchar(200) NOT NULL default '0', |
|
| 727 |
- `charid` varchar(250) NOT NULL default '0', |
|
| 728 |
- `rid` varchar(25) NOT NULL default '0', |
|
| 729 |
- `date` datetime default NULL, |
|
| 730 |
- `updated` datetime NOT NULL default '0000-00-00 00:00:00', |
|
| 731 |
- `uid` int(11) NOT NULL default '0', |
|
| 732 |
- `coauthors` varchar(50) NOT NULL default '0', |
|
| 733 |
- `featured` char(1) NOT NULL default '0', |
|
| 734 |
- `validated` char(1) NOT NULL default '0', |
|
| 735 |
- `completed` char(1) NOT NULL default '0', |
|
| 736 |
- `rr` char(1) NOT NULL default '0', |
|
| 737 |
- `wordcount` int(11) NOT NULL default '0', |
|
| 738 |
- `rating` tinyint(4) NOT NULL default '0', |
|
| 739 |
- `reviews` smallint(6) NOT NULL default '0', |
|
| 740 |
- `count` int(11) NOT NULL default '0', |
|
| 741 |
- PRIMARY KEY (`sid`), |
|
| 742 |
- KEY `title` (`title`), |
|
| 743 |
- KEY `catid` (`catid`), |
|
| 744 |
- KEY `charid` (`charid`), |
|
| 745 |
- KEY `rid` (`rid`), |
|
| 746 |
- KEY `uid` (`uid`), |
|
| 747 |
- KEY `featured` (`featured`), |
|
| 748 |
- KEY `completed` (`completed`), |
|
| 749 |
- KEY `rr` (`rr`), |
|
| 750 |
- KEY `validateduid` (`validated`,`uid`), |
|
| 751 |
- KEY `recent` (`updated`,`validated`) |
|
| 752 |
-) ENGINE=MyISAM;"); |
|
| 753 |
-$output .= "<tr><td>".$tableprefix."fanfiction_stories</td><td align='center'>" . ($stories ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 754 |
-$output .= "</table>"; |
|
| 755 |
-$output .= write_message(_TABLEFAILED."<br /><br /><a href='install.php?step=4'>"._CONTINUE."</a>"); |
|
| 756 |
- |
|
| 757 |
- } |
|
| 758 |
- else if($_GET['install'] == "manual") {
|
|
| 759 |
- $output .= write_message(_TABLESMANUAL."<br /><br /><a href='install.php?step=3'>"._CONTINUE."</a>"); |
|
| 760 |
- } |
|
| 761 |
- |
|
| 762 |
- } |
|
| 763 |
- else {
|
|
| 764 |
- |
|
| 765 |
- $output .= write_message(_TABLESINSTALL."<br /><br /><a href='install.php?step=3&install=automatic'>"._AUTO."</a> "._OR." <a href='install.php?step=3&install=manual'>"._MANUAL2."</a>"); |
|
| 766 |
- } |
|
| 767 |
- |
|
| 768 |
- break; |
|
| 769 |
- |
|
| 770 |
- case "2"; |
|
| 771 |
- include("../config.php");
|
|
| 772 |
- if(dbnumrows(dbquery("SHOW TABLES LIKE '".$settingsprefix."fanfiction_settings'"))) {
|
|
| 773 |
- include("../config.php");
|
|
| 774 |
- $dbconnect = dbconnect($dbhost, $dbuser, $dbpass, $dbname ); |
|
| 775 |
- $settings = dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".$sitekey."'");
|
|
| 776 |
- list($tableprefix, $language) = dbrow($settings); |
|
| 777 |
- define("TABLEPREFIX", $tableprefix);
|
|
| 778 |
- define("SITEKEY", $sitekey);
|
|
| 779 |
- |
|
| 780 |
- $sect = isset($_GET['sect']) ? $_GET['sect'] : "main"; |
|
| 781 |
- $settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".SITEKEY."'");
|
|
| 782 |
- if(dbnumrows($settingsresults) == 0) {
|
|
| 783 |
- dbquery("INSERT INTO ".$settingsprefix."fanfiction_settings (`sitekey`) VALUES('".SITEKEY."');");
|
|
| 784 |
- $settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".SITEKEY."'");
|
|
| 785 |
- } |
|
| 786 |
- $settings = dbassoc($settingsresults); |
|
| 787 |
- define("_BASEDIR", "../");
|
|
| 788 |
- foreach($settings as $var => $val) {
|
|
| 789 |
- $$var = $val; |
|
| 790 |
- } |
|
| 791 |
- if($sect == "submissions") {
|
|
| 792 |
- if(isset($_POST['submit'])) {
|
|
| 793 |
- $storiespath = descript($_POST['newstoriespath']); |
|
| 794 |
- if(!file_exists($storiespath) && !file_exists("../".$storiespath)) {
|
|
| 795 |
- if(!strrchr($storiespath, "/") && !strrchr($storiespath, "\\")) $storiespath = "../$storiespath"; |
|
| 796 |
- mkdir("$storiespath", 0755);
|
|
| 797 |
- @chmod("$storiespath", 0777);
|
|
| 798 |
- if(substr(sprintf('%o', @fileperms("../".$storiespath)), -4) != "0777") $output .= write_message(_STORIESPATHNOTWRITABLE);
|
|
| 799 |
- } |
|
| 800 |
- } |
|
| 801 |
- } |
|
| 802 |
- if($sect == "email" && isset($_POST['submit'])) {
|
|
| 803 |
- $output .= "<div id=\"pagetitle\">"._SETTINGS."</div>"; |
|
| 804 |
- $smtp_host = $_POST['newsmtp_host']; |
|
| 805 |
- $smtp_username = $_POST['newsmtp_username']; |
|
| 806 |
- $smtp_password = $_POST['newsmtp_password']; |
|
| 807 |
- $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET smtp_host = '$smtp_host', smtp_username = '$smtp_username', smtp_password = '$smtp_password' WHERE sitekey = '".SITEKEY."'");
|
|
| 808 |
- if($result) {
|
|
| 809 |
- $output .= write_message(_ACTIONSUCCESSFUL); |
|
| 810 |
- $output .= write_message("<a href='install.php?step=3'>"._CONTINUE."</a>");
|
|
| 811 |
- } |
|
| 812 |
- else include("../admin/settings.php");
|
|
| 813 |
- } |
|
| 814 |
- else include("../admin/settings.php");
|
|
| 815 |
- } |
|
| 816 |
- else {
|
|
| 817 |
- if($_GET['install']) {
|
|
| 818 |
- if($_GET['install'] == "automatic") {
|
|
| 819 |
- |
|
| 820 |
- $settings = dbquery("CREATE TABLE IF NOT EXISTS `".$settingsprefix."fanfiction_settings` (
|
|
| 821 |
- `sitekey` varchar(50) NOT NULL default '1', |
|
| 822 |
- `sitename` varchar(200) NOT NULL default 'Your Site', |
|
| 823 |
- `slogan` varchar(200) NOT NULL default 'It''s a cool site!', |
|
| 824 |
- `url` varchar(200) NOT NULL default 'http://www.yoursite.com', |
|
| 825 |
- `siteemail` varchar(200) NOT NULL default 'you@yoursite.com', |
|
| 826 |
- `tableprefix` varchar(50) NOT NULL default '', |
|
| 827 |
- `skin` varchar(50) NOT NULL default 'default', |
|
| 828 |
- `hiddenskins` varchar(255) default '', |
|
| 829 |
- `language` varchar(10) NOT NULL default 'en', |
|
| 830 |
- `submissionsoff` tinyint(1) NOT NULL default '0', |
|
| 831 |
- `storiespath` varchar(20) NOT NULL default 'stories', |
|
| 832 |
- `store` varchar(5) NOT NULL default 'files', |
|
| 833 |
- `autovalidate` tinyint(1) NOT NULL default '0', |
|
| 834 |
- `coauthallowed` int(1) NOT NULL default '0', |
|
| 835 |
- `maxwords` int(11) NOT NULL default '0', |
|
| 836 |
- `minwords` int(11) NOT NULL default '0', |
|
| 837 |
- `imageupload` tinyint(1) NOT NULL default '0', |
|
| 838 |
- `imageheight` int(11) NOT NULL default '200', |
|
| 839 |
- `imagewidth` int(11) NOT NULL default '200', |
|
| 840 |
- `roundrobins` tinyint(1) NOT NULL default '0', |
|
| 841 |
- `allowseries` tinyint(4) NOT NULL default '2', |
|
| 842 |
- `tinyMCE` tinyint(1) NOT NULL default '0', |
|
| 843 |
- `allowed_tags` varchar(200) NOT NULL default '<b><i><u><center><hr><p><br /><br><blockquote><ol><ul><li><img><strong><em>', |
|
| 844 |
- `favorites` tinyint(1) NOT NULL default '0', |
|
| 845 |
- `multiplecats` tinyint(1) NOT NULL default '0', |
|
| 846 |
- `newscomments` tinyint(1) NOT NULL default '0', |
|
| 847 |
- `logging` tinyint(1) NOT NULL default '0', |
|
| 848 |
- `maintenance` tinyint(1) NOT NULL default '0', |
|
| 849 |
- `debug` tinyint(1) NOT NULL default '0', |
|
| 850 |
- `captcha` tinyint(1) NOT NULL default '0', |
|
| 851 |
- `dateformat` varchar(20) NOT NULL default 'd/m/y', |
|
| 852 |
- `timeformat` varchar(20) NOT NULL default '- h:i a', |
|
| 853 |
- `recentdays` tinyint(2) NOT NULL default '7', |
|
| 854 |
- `displaycolumns` tinyint(1) NOT NULL default '1', |
|
| 855 |
- `itemsperpage` tinyint(2) NOT NULL default '25', |
|
| 856 |
- `extendcats` tinyint(1) NOT NULL default '0', |
|
| 857 |
- `displayindex` tinyint(1) NOT NULL default '0', |
|
| 858 |
- `defaultsort` tinyint(1) NOT NULL default '0', |
|
| 859 |
- `displayprofile` tinyint(1) NOT NULL default '0', |
|
| 860 |
- `linkstyle` tinyint(1) NOT NULL default '0', |
|
| 861 |
- `linkrange` tinyint(2) NOT NULL default '5', |
|
| 862 |
- `reviewsallowed` tinyint(1) NOT NULL default '0', |
|
| 863 |
- `ratings` tinyint(1) NOT NULL default '0', |
|
| 864 |
- `anonreviews` tinyint(1) NOT NULL default '0', |
|
| 865 |
- `revdelete` tinyint(1) NOT NULL default '0', |
|
| 866 |
- `rateonly` tinyint(1) NOT NULL default '0', |
|
| 867 |
- `pwdsetting` tinyint(1) NOT NULL default '0', |
|
| 868 |
- `alertson` tinyint(1) NOT NULL default '0', |
|
| 869 |
- `disablepopups` tinyint(1) NOT NULL default '0', |
|
| 870 |
- `agestatement` tinyint(1) NOT NULL default '0', |
|
| 871 |
- `words` text, |
|
| 872 |
- `version` varchar(10) NOT NULL default '".$version."', |
|
| 873 |
- `smtp_host` varchar(200) default NULL, |
|
| 874 |
- `smtp_username` varchar(50) default NULL, |
|
| 875 |
- `smtp_password` varchar(50) default NULL, |
|
| 876 |
- PRIMARY KEY (`sitekey`) |
|
| 877 |
-) ENGINE=MyISAM;"); |
|
| 878 |
-if($settings) $output .= write_message("<img src=\"../images/check.gif\"> "._SETTINGSTABLESUCCESS." <br /><a href='install.php?step=2'>"._CONTINUE."</a>");
|
|
| 879 |
-else $output .= write_message(_SETTINGSTABLEAUTOFAIL."<br /><br /> <a href='install.php?step=2'>"._CONTINUE."</a>"); |
|
| 880 |
- } |
|
| 881 |
- else {
|
|
| 882 |
- $output .= write_message(_SETTINGSTABLEMANUAL."<br /><br /><a href='install.php?step=2'>"._CONTINUE."</a>"); |
|
| 883 |
- } |
|
| 884 |
- } |
|
| 885 |
- else {
|
|
| 886 |
- |
|
| 887 |
- $test = dbquery("SHOW TABLES");
|
|
| 888 |
- if(!$test) $output .= write_message(_CONFIGFAILED); |
|
| 889 |
- else $output .= write_message(_SETTINGSTABLESETUP." <a href='install.php?step=2&install=automatic'>"._AUTO."</a> "._OR." <a href='install.php?step=2&install=manual'>"._MANUAL2."</a>"); |
|
| 890 |
- } |
|
| 891 |
- } |
|
| 892 |
- break; |
|
| 893 |
- default: |
|
| 894 |
- $output .= "<div id='pagetitle'>"._CONFIGDATA."</div>"; |
|
| 895 |
- if(isset($_POST['submit'])) {
|
|
| 896 |
- $dbhost = descript($_POST['dbhost']); |
|
| 897 |
- $dbname = descript($_POST['dbname']); |
|
| 898 |
- $dbuser = descript($_POST['dbuser']); |
|
| 899 |
- $dbpass = descript($_POST['dbpass']); |
|
| 900 |
- $language = $_POST['language']; |
|
| 901 |
- $sitekey = descript($_POST['sitekey']); |
|
| 902 |
- $settingsprefix = descript($_POST['settingsprefix']); |
|
| 903 |
- $mysql_access = mysqli_connect($dbhost, $dbuser, $dbpass); |
|
| 904 |
- if(!$mysql_access) {
|
|
| 905 |
- $output .= write_message(_CONFIGFAILED); |
|
| 906 |
- } |
|
| 907 |
- } |
|
| 908 |
- if(isset($_POST['submit']) && $mysql_access) {
|
|
| 909 |
- $handle = fopen("../config.php", 'w');
|
|
| 910 |
- if(!$handle) {
|
|
| 911 |
- @chmod("../config.php", 0666);
|
|
| 912 |
- $handle = fopen("../config.php", 'w');
|
|
| 913 |
- } |
|
| 914 |
- if($handle) {
|
|
| 915 |
- $dbhost = descript($_POST['dbhost']); |
|
| 916 |
- $dbname = descript($_POST['dbname']); |
|
| 917 |
- $dbuser = descript($_POST['dbuser']); |
|
| 918 |
- $dbpass = descript($_POST['dbpass']); |
|
| 919 |
- $sitekey = descript($_POST['sitekey']); |
|
| 920 |
- if(empty($sitekey)) $sitekey = random_string($randomcharset, 10); |
|
| 921 |
- $language = $_POST['language']; |
|
| 922 |
- $settingsprefix = descript($_POST['settingsprefix']); |
|
| 923 |
- $text = "<?php |
|
| 924 |
-\$dbhost = \"$dbhost\"; |
|
| 925 |
-\$dbname = \"$dbname\"; |
|
| 926 |
-\$dbuser= \"$dbuser\"; |
|
| 927 |
-\$dbpass = \"$dbpass\"; |
|
| 928 |
-\$sitekey = \"$sitekey\"; |
|
| 929 |
-\$settingsprefix = \"$settingsprefix\"; |
|
| 930 |
- |
|
| 931 |
-include_once(\"includes/dbfunctions.php\"); |
|
| 932 |
-if(!empty(\$sitekey)) \$dbconnect = dbconnect(\$dbhost, \$dbuser,\$dbpass, \$dbname); |
|
| 933 |
- |
|
| 934 |
-?>"; |
|
| 935 |
- fwrite($handle, $text); |
|
| 936 |
- fclose($handle); |
|
| 937 |
- @chmod("../config.php", 0644);
|
|
| 938 |
- $output .= write_message(_CONFIGSUCCESS."<br /><br /><a href='install.php?step=2&language=$language'>"._CONTINUE."</a>"); |
|
| 939 |
- } |
|
| 940 |
- else $output .= write_message(_ERROR_CONFIGWRITE); |
|
| 941 |
- |
|
| 942 |
- } |
|
| 943 |
- else {
|
|
| 944 |
- if(file_exists("../config.php") && !isset($mysql_access)) include("../config.php");
|
|
| 945 |
- if(isset($tinyMCE)) $output .= write_message(_CONFIG2DETECTED); |
|
| 946 |
- else if(isset($sitename)) $output .= write_message(_CONFIG1DETECTED); |
|
| 947 |
- else {
|
|
| 948 |
- $output .= |
|
| 949 |
- "<form method='POST' enctype='multipart/form-data' action='install.php?step=1' class='tblborder' style='width: 350px; margin: 1em auto;'> |
|
| 950 |
- <div><label for='dbhost'>"._DBHOST."</label><input type='text' name='dbhost' id='dbhost'".(!empty($dbhost) ? "value='$dbhost'" : "value='localhost'")."> <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_DBHOST."</span></A></div> |
|
| 951 |
- <div><label for='dbname'>"._DBNAME."</label><input type='text' name='dbname' id='dbname'".(!empty($dbname) ? "value='$dbname'" : "")."> <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_DBNAME."</span></A></div> |
|
| 952 |
- <div><label for='dbuser'>"._DBUSER."</label><input type='text' name='dbuser' id='dbuser'".(!empty($dbuser) ? "value='$dbuser'" : "")."> <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_DBUSER."</span></A></div> |
|
| 953 |
- <div><label for='dbpass'>"._DBPASS."</label><input type='password' name='dbpass' id='dbpass'".(!empty($dbpass) ? "value='$dbpass'" : "")."> <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_DBPASS."</span></A></div> |
|
| 954 |
- <div><label for='sitekey'>"._SITEKEY."</label><input type='text' name='sitekey' value='".(!empty($sitekey) ? $sitekey : random_string($randomcharset, 10))."' id='sitekey'> <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_INSTALL_SITEKEY."</span></A></div> |
|
| 955 |
- <div><label for=\"language\">"._LANGUAGE.":</label> <select name=\"language\">"; |
|
| 956 |
- $directory = opendir("../languages");
|
|
| 957 |
- while($filename = readdir($directory)) {
|
|
| 958 |
- if($filename=="." || $filename==".." || substr($filename, 2) == "_admin.php") continue; |
|
| 959 |
- $output .= "<option value=\"".substr($filename, 0, 2)."\"". |
|
| 960 |
- ($language == substr($filename, 0, strpos($filename, ".php")) ? " selected" : "")."> |
|
| 961 |
- ".substr($filename, 0, strpos($filename, ".php"))."</option>"; |
|
| 962 |
- } |
|
| 963 |
- closedir($directory); |
|
| 964 |
- $output .= |
|
| 965 |
- "</select> <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_LANGUAGE."</span></A></div> |
|
| 966 |
- <label for='settingsprefix'>"._SETTINGSPREFIX."</label><input type='text' name='settingsprefix' id='settingsprefix'".(isset($settingsprefix) ? "value='$settingsprefix'" : "")."> <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_SETTINGSPREFIX."</span></A><br /> |
|
| 967 |
- <div style='text-align: center; margin: 1em;'><INPUT type=\"submit\"class=\"button\" name=\"submit\" value=\"submit\"></div> |
|
| 968 |
- </form>"; |
|
| 969 |
- } |
|
| 970 |
- } |
|
| 971 |
-} |
|
| 972 |
-$tpl->assign("output", $output);
|
|
| 973 |
- |
|
| 974 |
-$tpl->printToScreen(); |
|
| 975 |
-if(isset($_GET['step']) && $_GET['step'] > 2) dbclose( ); |
|
| 1 |
+<?php |
|
| 2 |
+// ---------------------------------------------------------------------- |
|
| 3 |
+// Updated June 2014 |
|
| 4 |
+// Copyright (c) 2007 by Tammy Keefer |
|
| 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 |
+function random_char($string) |
|
| 26 |
+{
|
|
| 27 |
+ $length = strlen($string); |
|
| 28 |
+ $position = mt_rand(0, $length - 1); |
|
| 29 |
+ return $string[$position]; |
|
| 30 |
+} |
|
| 31 |
+ |
|
| 32 |
+function random_string ($charset_string, $length) |
|
| 33 |
+{
|
|
| 34 |
+ $return_string = random_char($charset_string); |
|
| 35 |
+ for ($x = 1; $x < $length; $x++) |
|
| 36 |
+ $return_string .= random_char($charset_string); |
|
| 37 |
+ return $return_string; |
|
| 38 |
+} |
|
| 39 |
+ |
|
| 40 |
+$randomcharset = '23456789' . 'abcdefghijkmnpqrstuvwxyz' . 'ABCDEFGHJKLMNPQRSTUVWXYZ'; |
|
| 41 |
+ |
|
| 42 |
+ |
|
| 43 |
+// Strip out slashes if magic quotes isn't on. |
|
| 44 |
+if(ini_get("magic_quotes_gpc")) {
|
|
| 45 |
+ foreach($_POST as $var => $val) {
|
|
| 46 |
+ $val = is_array( $val ) ? array_map( 'stripslashes', $val ) : stripslashes( $val ); |
|
| 47 |
+ } |
|
| 48 |
+ foreach($_GET as $var => $val) {
|
|
| 49 |
+ $val = is_array( $val ) ? array_map( 'stripslashes', $val ) : stripslashes( $val ); |
|
| 50 |
+ } |
|
| 51 |
+ foreach($_COOKIE as $var => $val) {
|
|
| 52 |
+ $val = is_array( $val ) ? array_map( 'stripslashes', $val ) : stripslashes( $val ); |
|
| 53 |
+ } |
|
| 54 |
+} |
|
| 55 |
+ |
|
| 56 |
+define("_BASEDIR", "../");
|
|
| 57 |
+define("_CHARSET", "utf-8");
|
|
| 58 |
+Header('Cache-Control: private, no-cache, must-revalidate, max_age=0, post-check=0, pre-check=0');
|
|
| 59 |
+header ("Pragma: no-cache");
|
|
| 60 |
+header ("Expires: 0");
|
|
| 61 |
+ |
|
| 62 |
+$output = ""; |
|
| 63 |
+$language = ""; |
|
| 64 |
+ |
|
| 65 |
+include ("../includes/class.TemplatePower.inc.php");
|
|
| 66 |
+ |
|
| 67 |
+if(!isset($_GET['step']) || $_GET['step'] == 2) {
|
|
| 68 |
+ //include ("../languages/en.php");
|
|
| 69 |
+ //include ("../languages/en_admin.php");
|
|
| 70 |
+ include ("languages/en.php");
|
|
| 71 |
+} |
|
| 72 |
+else if(isset($_REQUEST['language'])) {
|
|
| 73 |
+ $language = $_REQUEST['language']; |
|
| 74 |
+ //if(file_exists("../languages/".$language.".php")) include ("../languages/".$language.".php");
|
|
| 75 |
+ //else include ("../languages/en.php");
|
|
| 76 |
+ //if(file_exists("../languages/".$language."_admin.php")) include("../languages/".$language."_admin.php");
|
|
| 77 |
+ //else include ("../languages/en_admin.php");
|
|
| 78 |
+ if(file_exists("languages/".$language.".php")) include("languages/".$language.".php");
|
|
| 79 |
+ else include ("languages/en.php");
|
|
| 80 |
+} |
|
| 81 |
+else {
|
|
| 82 |
+include("../config.php");
|
|
| 83 |
+$dbconnect = dbconnect($dbhost, $dbuser, $dbpass, $dbname ); |
|
| 84 |
+$settings = dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".$sitekey."'");
|
|
| 85 |
+list($tableprefix, $language) = dbrow($settings); |
|
| 86 |
+define("TABLEPREFIX", $tableprefix);
|
|
| 87 |
+define("SITEKEY", $sitekey);
|
|
| 88 |
+if(file_exists("../languages/".$language.".php")) include ("../languages/".$language.".php");
|
|
| 89 |
+else include ("../languages/en.php");
|
|
| 90 |
+if(file_exists("../languages/".$language."_admin.php")) include("../languages/".$language."_admin.php");
|
|
| 91 |
+else include ("../languages/en_admin.php");
|
|
| 92 |
+if(file_exists("languages/".$language.".php")) include("languages/".$language.".php");
|
|
| 93 |
+else include ("languages/en.php");
|
|
| 94 |
+} |
|
| 95 |
+include(_BASEDIR."includes/corefunctions.php"); |
|
| 96 |
+ |
|
| 97 |
+// So I don't have to keep updating the version number in 3 different files. |
|
| 98 |
+include("../version.php");
|
|
| 99 |
+ |
|
| 100 |
+//make a new TemplatePower object |
|
| 101 |
+echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"> |
|
| 102 |
+<html><head><title>eFiction {$version} Install</title>
|
|
| 103 |
+<style> |
|
| 104 |
+LABEL { float: left; display: block; width: 45%; text-align: right; padding-right: 10px; clear: left;}
|
|
| 105 |
+.row { float: left; width: 99%; }
|
|
| 106 |
+#settingsform FORM { width: 80%; margin; 0 auto; }
|
|
| 107 |
+#settingsform LABEL { float: left; display: block; width: 30%; text-align: right; padding-right: 10px; clear: left; }
|
|
| 108 |
+#settingsform .fieldset SPAN { float: left; display: block; width: 30%; text-align: right; padding-right: 10px; clear: left;}
|
|
| 109 |
+#settingsform .fieldset LABEL { float: none; width: auto; display: inline; text-align: left; clear: none; }
|
|
| 110 |
+#settingsform .tinytoggle { text-align: center; }
|
|
| 111 |
+#settingsform .tinytoggle LABEL { float: none; display: inline; width: auto; text-align: center; padding: 0; clear: none; }
|
|
| 112 |
+#settingsform #submit { display: block; margin: 1ex auto; }
|
|
| 113 |
+a.pophelp{
|
|
| 114 |
+ position: relative; /* this is the key*/ |
|
| 115 |
+ z-index:24; |
|
| 116 |
+ vertical-align: super; |
|
| 117 |
+ text-decoration: none; |
|
| 118 |
+} |
|
| 119 |
+ |
|
| 120 |
+a.pophelp:hover{z-index:100; border: none; text-decoration: none;}
|
|
| 121 |
+ |
|
| 122 |
+a.pophelp span{display: none; position: absolute; text-decoration: none;}
|
|
| 123 |
+ |
|
| 124 |
+a.pophelp:hover span{ /*the span will display just on :hover state*/
|
|
| 125 |
+ display:block; |
|
| 126 |
+ position: absolute; |
|
| 127 |
+ top: 0; left: 8em; width: 225px; |
|
| 128 |
+ border:1px solid #000; |
|
| 129 |
+ background-color:#CCC; color:#000; |
|
| 130 |
+ text-decoration: none; |
|
| 131 |
+ text-align: left; |
|
| 132 |
+ padding: 5px; |
|
| 133 |
+ font-weight: normal; |
|
| 134 |
+} |
|
| 135 |
+.required { color: red; }
|
|
| 136 |
+</style> |
|
| 137 |
+<link rel=\"stylesheet\" type=\"text/css\" href='../default_tpls/style.css'></head>"; |
|
| 138 |
+ |
|
| 139 |
+$tpl = new TemplatePower( "../default_tpls/default.tpl" ); |
|
| 140 |
+$tpl->assignInclude( "header", "./../default_tpls/header.tpl" ); |
|
| 141 |
+$tpl->assignInclude( "footer", "./../default_tpls/footer.tpl" ); |
|
| 142 |
+$tpl->prepare( ); |
|
| 143 |
+$tpl->newBlock("header");
|
|
| 144 |
+$tpl->assign("sitename", "eFiction $version Install");
|
|
| 145 |
+$tpl->gotoBlock( "_ROOT" ); |
|
| 146 |
+$tpl->newBlock("footer");
|
|
| 147 |
+$tpl->assign( "footer", "eFiction $version © 2007. <a href='http://efiction.org/'>http://efiction.org/</a>"); |
|
| 148 |
+$tpl->gotoBlock( "_ROOT" ); |
|
| 149 |
+ |
|
| 150 |
+if(!isset($_GET['step'])) $_GET['step'] = 0; |
|
| 151 |
+switch($_GET['step']) {
|
|
| 152 |
+ case "9": |
|
| 153 |
+ if(isset($_POST['submit'])) {
|
|
| 154 |
+ $penname = descript($_POST['newpenname']); |
|
| 155 |
+ if((!$_POST['email']) && !isADMIN) $fail .= "<div style='text-align: center;'>"._EMAILREQUIRED." "._TRYAGAIN."</div>"; |
|
| 156 |
+ if($penname && !preg_match("!^[a-z0-9_ ]{3,30}$!i", $penname)) $fail = "<div style='text-align: center;'>"._BADUSERNAME." "._TRYAGAIN."</div>";
|
|
| 157 |
+ if(!preg_match("/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+$/", $_POST['email'])) $fail = "<div style='text-align: center;'>"._INVALIDEMAIL." "._TRYAGAIN."</div>";
|
|
| 158 |
+ if($_POST['password'] == $_POST['password2']) $encryptpassword = md5($_POST['password']); |
|
| 159 |
+ else $fail = write_message(_PASSWORDTWICE); |
|
| 160 |
+ if(!isset($fail)) {
|
|
| 161 |
+ $result = dbquery("INSERT INTO ".$tableprefix."fanfiction_authors(`penname`, `email`, `password`, `date`) VALUES('$penname', '".$_POST['email']."', '$encryptpassword', now( ))");
|
|
| 162 |
+ define("USERUID", dbinsertid( ));
|
|
| 163 |
+ $skinquery = dbquery("SELECT skin FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".SITEKEY."'");
|
|
| 164 |
+ list($skin) = dbrow($skinquery); |
|
| 165 |
+ $result2 = dbquery("INSERT INTO ".$tableprefix."fanfiction_authorprefs(`uid`, `userskin`, `level`) VALUES('".USERUID."', '$skin', '1')");
|
|
| 166 |
+ if($result && $result2) $output .= write_message(_ACTIONSUCCESSFUL."<br /><br />Installation complete! <a href='../user.php?action=login'>Log in</a> to your site and go to the Admin area to configure your archive. <strong>Note:</strong> Please delete the install/ folder!"); |
|
| 167 |
+ } |
|
| 168 |
+ else $output .= $fail; |
|
| 169 |
+ } |
|
| 170 |
+ else {
|
|
| 171 |
+ $output .= "<div id='pagetitle'>"._ADMINACCT."</div><form method=\"POST\" class='tblborder' style='margin: 1em auto; width: 400px;' enctype=\"multipart/form-data\" action=\"install.php?step=9\"> |
|
| 172 |
+ <div class='row'><label for='newpenname'>"._PENNAME.":</label> <INPUT name=\"newpenname\" type=\"text\" class=\"textbox\" maxlength=\"200\" value=\"$user[penname]\"></div> |
|
| 173 |
+ <div class='row'><label for='email'>"._EMAIL.":</label> <INPUT type=\"text\" class=\"textbox=\" name=\"email\" value=\"$user[email]\" maxlength=\"200\"></div> |
|
| 174 |
+ <div class='row'><label for='password'>"._PASSWORD.":</label> <INPUT name=\"password\" class=\"textbox\" value=\"\" type=\"password\"></div> |
|
| 175 |
+ <div class='row'><label for='password2'>"._PASSWORD2.":</label> <INPUT name=\"password2\" class=\"textbox=\" value=\"\" type=\"password\"></div> |
|
| 176 |
+ <div style='text-align: center;'><INPUT type=\"submit\"class=\"button\" name=\"submit\" value=\"submit\"></div></form>"; |
|
| 177 |
+ } |
|
| 178 |
+ break; |
|
| 179 |
+ |
|
| 180 |
+ case "8": |
|
| 181 |
+ $output .= "<div id='pagetitle'>"._AUTHORFIELDS."</div>"; |
|
| 182 |
+ if(isset($_GET['install'])) {
|
|
| 183 |
+ if($_GET['install'] == "automatic") {
|
|
| 184 |
+ $fields[] = array('4','lj','Live Journal','http://{info}.livejournal.com','','','0');
|
|
| 185 |
+ $fields[] = array('1','website','Web Site','','','','1');
|
|
| 186 |
+ $fields[] = array('5','AOL','AIM','','$output .= "<div><label for=\'AOL\'>".$field[\'field_title\'].":</label><INPUT type=\'text\' class=\'textbox\' name=\'af_".$field[\'field_name\']."\' maxlength=\'40\' value=\'".(!empty($user[\'af_\'.$field[\'field_id\']]) ? $user[\'af_\'.$field[\'field_id\']] : "")."\' size=\'20\'></div>";','$thisfield = "<img src=\"http://big.oscar.aol.com/".$field[\'info\']."?on_url=$url/images/aim.gif&off_url=$url/images/aim.gif\"> <a href=\"aim:goim?{aol}ScreenName=".$field[\'info\']."\">".format_email($field[\'info\'])."</a>";','1');
|
|
| 187 |
+ $fields[] = array('5','ICQ','ICQ','','$output .= "<div><label for=\'AOL\'>".$field[\'field_title\'].":</label><INPUT type=\'text\' class=\'textbox\' name=\'af_".$field[\'field_name\']."\' maxlength=\'40\' value=\'".(!empty($user[\'af_\'.$field[\'field_id\']]) ? $user[\'af_\'.$field[\'field_id\']] : "")."\' size=\'20\'></div>";','$thisfield = "<img src=\"http://status.icq.com/online.gif?icq=".$field[\'info\']."&img=5\"> ".$field[\'info\'];','1');
|
|
| 188 |
+ $fields[] = array('5','MSN','MSN IM','','$output .= "<div><label for=\'AOL\'>".$field[\'field_title\'].":</label><INPUT type=\'text\' class=\'textbox\' name=\'af_".$field[\'field_name\']."\' maxlength=\'40\' value=\'".(!empty($user[\'af_\'.$field[\'field_id\']]) ? $user[\'af_\'.$field[\'field_id\']] : "")."\' size=\'20\'></div>";','$thisfield = "<img src=\"images/msntalk.gif\" alt=\""._MSN."\"> ".format_email($field[\'info\']);','1');
|
|
| 189 |
+ $fields[] = array('5','Yahoo','Yahoo IM','','$output .= "<div><label for=\'AOL\'>".$field[\'field_title\'].":</label><INPUT type=\'text\' class=\'textbox\' name=\'af_".$field[\'field_name\']."\' maxlength=\'40\' value=\'".(!empty($user[\'af_\'.$field[\'field_id\']]) ? $user[\'af_\'.$field[\'field_id\']] : "")."\' size=\'20\'></div>";','$thisfield = "<a href=\"http://edit.yahoo.com/config/send_webmesg?.target=".$field[\'info\']."&.src=pg\"><img border=\'0\' src=\"http://opi.yahoo.com/online?u=".$field[\'info\']."&m=g&t=1\"> ".format_email($field[\'info\'])."</a>";','1');
|
|
| 190 |
+ $fields[] = array('4','da','Deviant Art','http://{info}.deviantart.com','','','0');
|
|
| 191 |
+ $fields[] = array('3','betareader','Beta-reader','','','','1');
|
|
| 192 |
+ $fields[] = array('4','dj','DeadJournal','http://{info}.deadjournal.com/','','','0');
|
|
| 193 |
+ $fields[] = array('4','xanga','Xanga','http://www.xanga.com/{info}','','','0');
|
|
| 194 |
+ $fields[] = array('2', 'gender', 'Gender', 'male|#|female|#|undisclosed', '', '', 0);
|
|
| 195 |
+ $fields[] = array('4','myspace','MySpace','http://www.myspace.com/{info}','','','0');
|
|
| 196 |
+ |
|
| 197 |
+ $output .= "<table class='tblborder' style='margin: 1em auto; padding: 1em;' cellpadding='5'><tr><th>"._FIELD."</th><th>"._RESULT."</th></tr>"; |
|
| 198 |
+ foreach($fields as $field) {
|
|
| 199 |
+ $f = dbquery("INSERT INTO `".$tableprefix."fanfiction_authorfields` (`field_type`, `field_name`, `field_title`, `field_options`, `field_code_in`, `field_code_out`, `field_on`) VALUES('".$field[0]."', '".$field[1]."','".$field[2]."','".escapestring($field[3])."','".escapestring($field[4])."','".escapestring($field[5])."','".$field[6]."');");
|
|
| 200 |
+ $output .= "<tr><td>".$field[2]."</td><td align='center'>" . ($f ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 201 |
+ } |
|
| 202 |
+ $output .= "</table>"; |
|
| 203 |
+ $output .= write_message(_FIELDAUTOFAIL."<br /><br /> <a href='install.php?step=9'>"._CONTINUE."</a>"); |
|
| 204 |
+ } |
|
| 205 |
+ else {
|
|
| 206 |
+ $output .= write_message(_FIELDMANUAL."<br /><br /><a href='install.php?step=9'>"._CONTINUE."</a>"); |
|
| 207 |
+ } |
|
| 208 |
+ } |
|
| 209 |
+ else $output .= write_message(_FIELDDATAINFO."<br /><br /><a href='install.php?step=8&install=automatic'>"._AUTO."</a> "._OR." <a href='install.php?step=8&install=manual'>"._MANUAL2."</a>"); |
|
| 210 |
+ break; |
|
| 211 |
+ case "7": |
|
| 212 |
+ $output .= "<div id='pagetitle'>"._MESSAGEDATA."</div>"; |
|
| 213 |
+ if(isset($_GET['install'])) {
|
|
| 214 |
+ if($_GET['install'] == "automatic") {
|
|
| 215 |
+ $output .= "<table class='tblborder' style='margin: 1em auto; padding: 1em;' cellpadding='5'><tr><th>"._MESSAGE."</th><th>"._RESULT."</th></tr>"; |
|
| 216 |
+ $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (1, 'welcome', '', 'This is your welcome message. It appears on the index page. Include it in your .tpl files with {welcome}.');");
|
|
| 217 |
+ $output .= "<tr><td>Welcome</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 218 |
+ $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (2, 'copyright', '', 'This is your sample copyright footer. Include it in your footer.tpl with <b>{footer}</b><br />\r\n<u>Disclaimer:</u> All publicly recognizable characters, settings, etc. are the property of their respective owners. The original characters and plot are the property of the author. No money is being made from this work. No copyright infringement is intended.\r\n');");
|
|
| 219 |
+ $output .= "<tr><td>Copyright</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 220 |
+ $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (3, 'help', 'Help', '<h3>FAQ</h3><p><strong>I forgot my password! What do I do now?</strong></p><p>To recover a lost password, <a href=\"user.php?action=lostpassword\">click here</a> and enter the e-mail address with which you registered. Your password will be sent to you shortly.</p><p><strong>What kinds of stories are allowed?</strong></p><p>See our <a href=\"submission.php\">Submission Rules.</a></p><p><strong>How do I contact the site administrators?</strong></p><p>You can e-mail us via our <a href=\"contact.php\">contact form.</a></p><p><strong>How do I submit stories?</strong></p><p>If you have not already done so, please <a href=\"user.php?action=newaccount\">register for an account</a>. Once you\'ve logged in, click on <a href=\"user.php\">Account Information</a> and choose <a href=\"stories.php?action=newstory\">Add Story</a>. The form presented there will allow you to submit your story.</p><p><strong>What are the ratings used on the site?</strong></p><p>We use the ratings system from <a href=\"http://www.fictionratings.com/\">www.fictionratings.com</a>.</p><p><strong>What are the story classifications?</strong></p><p>Stories are classified by categories, genres, and warnings.</p>');");
|
|
| 221 |
+ $output .= "<tr><td>Help</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 222 |
+ $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (4, 'nothankyou', 'Submission Rejection', 'Your recent submission of \"{storytitle} : {chaptertitle}\" to {sitename} did not meet our requirements for submission. Please review our {rules}.<br /><br />\r\n\r\n{adminname}');");
|
|
| 223 |
+ $output .= "<tr><td>Rejection Letter</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 224 |
+ $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (5, 'printercopyright', '', '<u>Disclaimer:</u> All publicly recognizable characters and settings are the property of their respective owners. The original characters and plot are the property of the author. No money is being made from this work. No copyright infringement is intended.');");
|
|
| 225 |
+ $output .= "<tr><td>Printable Copyright</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 226 |
+ $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (6, 'rules', 'Submission Rules', '<p align=\"center\"><strong>Submission Rules</strong></p>\r\n<ol>\r\n <li>All submissions must be accompanied by a complete disclaimer. If a \r\n suitable disclaimer is not included, the site administrators reserve the right \r\n to add a disclaimer. Repeat offenders may be subject to further action \r\n up to and including removal of stories and account.\r\n<div class=\"tblborder\" style=\"width: 400px; margin: 1em auto;\">\r\n<div style=\"background: #000; color: #FFF; padding: 5px; text-align: center; font-weight: bold;\">Sample Disclaimer</div>\r\n<div class=\"tblborder\" style=\"padding: 5px;\"><span style=\"text-decoration: underline;\">Disclaimer:</span> All publicly recognizable characters, settings, etc. are the property of their respective owners. The original characters and plot are the property of the author. \r\n The author is in no way associated with the owners, creators, or producers of any media franchise. No copyright infringement is intended.</div>\r\n </div>\r\n </li>\r\n <li>Stories must be submitted to the proper category. If there is an appropriate sub-category, <strong>DO NOT</strong> add your story to the main category. The submission \r\n form allows you to choose multiple categories for your story, and we worked very hard to add that functionality for you. <u><strong>So please \r\n do NOT add your story multiple times!</strong></u></li>\r\n <li>Titles and summaries must be kid friendly. No exceptions. </li>\r\n <li>"Please read", "Untitled", etc. are not acceptable titles or summaries.</li>\r\n <li>A number of authors have requested that fans refrain from writing fan \r\n fiction based on their work. Therefore submissions will not be \r\n accepted based on the works of P.N. Elrod, Raymond Feist, Terry Goodkind, \r\n Laurell K. Hamilton, Anne McCaffrey, Robin McKinley, Irene Radford, Anne Rice, \r\n and Nora Roberts/J.D. Robb. </li>\r\n <li>Actor/actress stories are not permitted...not even if they\'re visiting an \r\n alternate reality.</li>\r\n <li>Correct grammar and spelling are expected of all stories submitted to this \r\n site. The site administrators are not grammar Nazis. However, the \r\n site administrators reserve the right to request corrections in submissions \r\n with a multitude of grammar and/or spelling errors. If such a request is \r\n ignored, the story will be deleted.</li>\r\n <li>All stories must be rated correctly and have the appropriate warnings. \r\n All adult rated stories are expected to have warnings. After all, they \r\n wouldn\'t have that rating if there wasn\'t something to be warned about! The site administrators recognize \r\n that there is an audience for these stories, but please respect those who do \r\n not wish to read them by labeling them appropriately. \r\n <u><strong>Please note: Stories containing adults having sex with minors are strictly forbidden.</strong></u> </li>\r\n <li>Stories with multiple chapters should be archived as such and <span style=\"font-weight: bold; text-decoration: underline;\">NEVER</span> as \r\n separate stories. Upload the first chapter of your story, then go to <a href=\"stories.php?action=viewstories\">Manage Stories</a> in \r\nyour account to add additional chapters. If you have trouble with this, please contact the site administrator or ask a \r\n friend to help you.</li>\r\n <li>As much as possible, spoiler warnings are expected on all stories. For categories with serialized content, such as series of books or television series, \r\n spoilers are <strong>mandatory</strong> for the current season and/or most recent part. An appropriate spoiler warning to place in your summary would be: Spoilers for <u>Star Trek II: The Wrath of Khan.</u> \r\n <strong>DO NOT</strong> do anything like this: <u>Spoilers for the one where Spock dies.</u></li>\r\n</ol>\r\n <p>Submissions found to be in violation of these rules may be removed and the \r\n author\'s account suspended at the discretion of the site administrators and/or \r\n moderators. The site administrators reserve the right to modify these \r\n rules as needed.</p>');");
|
|
| 227 |
+ $output .= "<tr><td>Submission Rules</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 228 |
+ $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (7, 'thankyou', '{sitename} Submission Acceptance', 'Thanks for your submission.');");
|
|
| 229 |
+ $output .= "<tr><td>Acceptance Letter</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 230 |
+ $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (8, 'tos', 'Terms of Service', 'This is the Terms of Service for your site. It will be displayed when a new member registers to the site.');");
|
|
| 231 |
+ $output .= "<tr><td>Terms of Service</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 232 |
+ $msg = dbquery("INSERT INTO `".$tableprefix."fanfiction_messages` VALUES (9, 'maintenance', 'Site Maintenance', '<p style=\"text-align: center;\">This site is currently undergoing maintenance. Please check back soon. Thank you.</p>');");
|
|
| 233 |
+ $output .= "<tr><td>Site Maintenance</td><td align='center'>" . ($msg ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 234 |
+ $output .= "</table>"; |
|
| 235 |
+ $output .= write_message(_MESSAGEAUTOFAILUPGRADE."<br /><br /> <a href='install.php?step=8'>"._CONTINUE."</a>"); |
|
| 236 |
+ } |
|
| 237 |
+ else {
|
|
| 238 |
+ $output .= write_message(_MESSAGEMANUAL."<br /><br /><a href='install.php?step=8'>"._CONTINUE."</a>"); |
|
| 239 |
+ } |
|
| 240 |
+ } |
|
| 241 |
+ else $output .= write_message(_MESSAGEDATANEW."<br /><br /><a href='install.php?step=7&install=automatic'>"._AUTO."</a> "._OR." <a href='install.php?step=7&install=manual'>"._MANUAL2."</a>"); |
|
| 242 |
+ |
|
| 243 |
+ break; |
|
| 244 |
+ case "6": |
|
| 245 |
+ $output .= "<div id='pagetitle'>"._BLOCKDATA."</div>"; |
|
| 246 |
+ if(isset($_GET['install'])) {
|
|
| 247 |
+ if($_GET['install'] == "automatic") {
|
|
| 248 |
+ $blocklist = array( |
|
| 249 |
+ array("categories","Categories","categories/categories.php","1",""),
|
|
| 250 |
+ array("featured","Featured Stories","featured/featured.php","1",""),
|
|
| 251 |
+ array("info","Site Info","info/info.php","2",""),
|
|
| 252 |
+ array("login","Log In","login/login.php","1",""),
|
|
| 253 |
+ array("menu","Main Menu","menu/menu.php","1",""),
|
|
| 254 |
+ array("random","Random Story","random/random.php","2",""),
|
|
| 255 |
+ array("recent","Most Recent","recent/recent.php","2","a:1:{s:3:\"num\";s:1:\"1\";}"),
|
|
| 256 |
+ array("skinchange","Skin Change","skinchange/skinchange.php","1",""),
|
|
| 257 |
+ array("news","Site News","news/news.php","1","a:1:{s:3:\"num\";s:1:\"1\";}")
|
|
| 258 |
+ ); |
|
| 259 |
+ $output .= "<table class='tblborder' style='margin: 1em auto; padding: 1em;' cellpadding='5'><tr><th>"._BLOCK."</th><th>"._RESULT."</th></tr>"; |
|
| 260 |
+ foreach($blocklist as $block) {
|
|
| 261 |
+ $b = dbquery("INSERT INTO `".$tableprefix."fanfiction_blocks` (`block_name`, `block_title`, `block_file`, `block_status`, `block_variables`) VALUES('".$block[0]."', '".$block[1]."', '".$block[2]."', '".$block[3]."', '".escapestring($block[4])."');");
|
|
| 262 |
+ $output .= "<tr><td>".$block[1]."</td><td align='center'>" . ($b ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 263 |
+ } |
|
| 264 |
+ $output .= "</table>"; |
|
| 265 |
+ $output .= write_message(_BLOCKDATAFAILUPGRADE."<br /><br /><a href='install.php?step=7'>"._CONTINUE."</a>"); |
|
| 266 |
+ } |
|
| 267 |
+ else {
|
|
| 268 |
+ $output .= write_message(_BLOCKDATAMANUAL."<br /><br /><a href='install.php?step=6'>"._CONTINUE."</a>"); |
|
| 269 |
+ } |
|
| 270 |
+ } |
|
| 271 |
+ else $output .= write_message(_BLOCKDATANEW."<br /><br /><a href='install.php?step=6&install=automatic'>"._AUTO."</a> "._OR." <a href='install.php?step=6&install=manual'>"._MANUAL2."</a>"); |
|
| 272 |
+ break; |
|
| 273 |
+ case "5": |
|
| 274 |
+ $output .= "<div id='pagetitle'>"._LINKDATA."</div>"; |
|
| 275 |
+ if(isset($_GET['install'])) {
|
|
| 276 |
+ if($_GET['install'] == "automatic") {
|
|
| 277 |
+ $pagelist = array( |
|
| 278 |
+ array("home","Home","index.php","0","0"),
|
|
| 279 |
+ array("recent","Most Recent","browse.php?type=recent","0","0"),
|
|
| 280 |
+ array("login","Login","user.php?action=login","0","0"),
|
|
| 281 |
+ array("adminarea","Admin","admin.php","0","2"),
|
|
| 282 |
+ array("logout","Logout","user.php?action=logout","0","1"),
|
|
| 283 |
+ array("featured","Featured Stories","browse.php?type=featured","0","0"),
|
|
| 284 |
+ array("catslink","Categories","browse.php?type=categories","0","0"),
|
|
| 285 |
+ array("members","Members","authors.php?action=list","0","0"),
|
|
| 286 |
+ array("authors","Authors","authors.php?list=authors","0","0"),
|
|
| 287 |
+ array("help","Help","viewpage.php?page=help","0","0"),
|
|
| 288 |
+ array("search","Search","search.php","0","0"),
|
|
| 289 |
+ array("series","Series","browse.php?type=series","0","0"),
|
|
| 290 |
+ array("tens","Top Tens","toplists.php","0","0"),
|
|
| 291 |
+ array("challenges","Challenges","modules/challenges/challenges.php","0","0"),
|
|
| 292 |
+ array("contactus","Contact Us","contact.php","0","0"),
|
|
| 293 |
+ array("rules","Rules","viewpage.php?page=rules","0","0"),
|
|
| 294 |
+ array("tos","Terms of Service","viewpage.php?page=tos","0","0"),
|
|
| 295 |
+ array("rss","<img src=\'images/xml.gif\' alt=\'RSS\' border=\'0\'>","rss.php","0","0"),
|
|
| 296 |
+ array("login","Account Info","user.php","0","1"),
|
|
| 297 |
+ array("titles","Titles","browse.php?type=titles","0","0"),
|
|
| 298 |
+ array("register","Register","user.php?action=register","0","0"),
|
|
| 299 |
+ array("lostpassword","Lost Password","user.php?action=lostpassword","0","0"),
|
|
| 300 |
+ array("newsarchive","News Archive","news.php","0","0"),
|
|
| 301 |
+ array("browse","Browse","browse.php","0","0"),
|
|
| 302 |
+ array("charslink", "Characters", "browse.php?type=characters","0","0"),
|
|
| 303 |
+ array("ratings", "Ratings", "browse.php?type=ratings", "0", "0"),
|
|
| 304 |
+ ); |
|
| 305 |
+ $output .= "<table class='tblborder' style='margin: 1em auto; padding: 1em;' cellpadding='5'><tr><th>"._PAGE."</th><th>"._RESULT."</th></tr>"; |
|
| 306 |
+ foreach($pagelist as $page) {
|
|
| 307 |
+ $pages = dbquery("INSERT INTO `".$tableprefix."fanfiction_pagelinks` (`link_name`, `link_text`, `link_url`, `link_target`, `link_access`) VALUES ('".$page[0]."', '".$page[1]."', '".$page[2]."', '".$page[3]."', '".$page[4]."');");
|
|
| 308 |
+ $output .= "<tr><td>".stripslashes($page[1])."</td><td align='center'>" . ($pages ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 309 |
+ } |
|
| 310 |
+ |
|
| 311 |
+ $output .= "</table>"; |
|
| 312 |
+ $output .= write_message(_LINKAUTOFAIL."<br /><br /> <a href='install.php?step=6'>"._CONTINUE."</a>"); |
|
| 313 |
+ } |
|
| 314 |
+ else {
|
|
| 315 |
+ $output .= write_message(_LINKMANUAL."<br /><br /><a href='install.php?step=5'>"._CONTINUE."</a>"); |
|
| 316 |
+ } |
|
| 317 |
+ } |
|
| 318 |
+ else $output .= write_message(_LINKDATAINFO."<br /><br />"._LINKSETUP." <a href='install.php?step=5&install=automatic'>"._AUTO."</a> "._OR." <a href='install.php?step=5&install=manual'>"._MANUAL2."</a>"); |
|
| 319 |
+ break; |
|
| 320 |
+ case "4": |
|
| 321 |
+ $output .= "<div id='pagetitle'>"._PANELDATA."</div>"; |
|
| 322 |
+ if(isset($_GET['install'])){
|
|
| 323 |
+ if($_GET['install'] == "automatic") {
|
|
| 324 |
+ |
|
| 325 |
+ $panellist = array( |
|
| 326 |
+ array("submitted","Submissions", "","3","5","0","A"),
|
|
| 327 |
+ array("versioncheck", "Version Check", "", "3", "7", "0", "A"),
|
|
| 328 |
+ array("newstory","Add New Story","stories.php?action=newstory&admin=1","3","3","0","A"),
|
|
| 329 |
+ array("addseries","Add New Series","series.php?action=add","3","3","0","A"),
|
|
| 330 |
+ array("news","News","","3","5","0","A"),
|
|
| 331 |
+ array("featured","Featured Stories","","3","5","0","A"),
|
|
| 332 |
+ array("characters","Characters","","2","2","0","A"),
|
|
| 333 |
+ array("ratings","Ratings","","2","3","0","A"),
|
|
| 334 |
+ array("members","Members","","2","5","0","A"),
|
|
| 335 |
+ array("mailusers","Mail Users","","2","6","0","A"),
|
|
| 336 |
+ array("settings","Settings","","1","2","0","A"),
|
|
| 337 |
+ array("blocks","Blocks","","1","3","0","A"),
|
|
| 338 |
+ array("censor","Censor","","1","0","1","A"),
|
|
| 339 |
+ array("admins","Admins","","1","6","0","A"),
|
|
| 340 |
+ array("classifications","Classifications","","2","4","0","A"),
|
|
| 341 |
+ array("categories","Categories","","2","1","0","A"),
|
|
| 342 |
+ array("custpages","Custom Pages","","1","4","0","A"),
|
|
| 343 |
+ array("validate","Validate Submission","","3","0","1","A"),
|
|
| 344 |
+ array("yesletter","Validation Letter","","3","0","1","A"),
|
|
| 345 |
+ array("noletter","Rejection Letter","","3","0","1","A"),
|
|
| 346 |
+ array("links","Page Links","","1","5","0","A"),
|
|
| 347 |
+ array("messages","Message Settings","","2","0","1","A"),
|
|
| 348 |
+ array("login","Login","","0","0","1","U"),
|
|
| 349 |
+ array("logout","Logout","","1","5","0","U"),
|
|
| 350 |
+ array("revreceived","Reviews Received","","1","0","1","U"),
|
|
| 351 |
+ array("editprefs","Edit Preferences","","1","2","0","U"),
|
|
| 352 |
+ array("lostpassword","Lost Password","","0","0","1","U"),
|
|
| 353 |
+ array("editbio","Edit Bio","","1","1","0","U"),
|
|
| 354 |
+ array("register","Register","","0","0","1","U"),
|
|
| 355 |
+ array("manageimages","Manage Images","","1","5","0","S"),
|
|
| 356 |
+ array("revres","Review Response","","1","0","1","U"),
|
|
| 357 |
+ array("stats","View Your Statistics","","1","3","0","U"),
|
|
| 358 |
+ array("newstory","Add New Story","stories.php?action=newstory","1","1","0","S"),
|
|
| 359 |
+ array("newseries","Add New Series","series.php?action=add","1","3","0","S"),
|
|
| 360 |
+ array("managestories","Manage Stories","stories.php?action=viewstories","1","2","0","S"),
|
|
| 361 |
+ array("manageseries","Manage Series","series.php?action=manage","1","4","0","S"),
|
|
| 362 |
+ array("reviewsby","Your Reviews","","1","0","1","U"),
|
|
| 363 |
+ array("storiesby","Stories by {author}","","0","1","0","P"),
|
|
| 364 |
+ array("seriesby","Series by {author}","","0","2","0","P"),
|
|
| 365 |
+ array("reviewsby","Reviews by {author}","","0","3","0","P"),
|
|
| 366 |
+ array("categories","Categories","","0","1","0","B"),
|
|
| 367 |
+ array("characters","Characters","","0","2","0","B"),
|
|
| 368 |
+ array("ratings","Ratings","","0","3","0","B"),
|
|
| 369 |
+ array("titles","Titles","","0","5","0","B"),
|
|
| 370 |
+ array("class","Classes","","0","0","1","B"),
|
|
| 371 |
+ array("recent","Most Recent","","0","0","1","B"),
|
|
| 372 |
+ array("featured","Featured Stories","","0","0","1","B"),
|
|
| 373 |
+ array("panels","Panels","","1","1","0","A"),
|
|
| 374 |
+ array("phpinfo","PHP Info","","1","7","0","A"),
|
|
| 375 |
+ array("contact","Contact","","0","0","1","P"),
|
|
| 376 |
+ array("series", "Series", "", "0", "4", "0", "B"),
|
|
| 377 |
+ array("viewlog", "Action Log", "", "1", "8", "0", "A"),
|
|
| 378 |
+ array("shortstories","10 Shortest Stories","toplists/default.php","0","6","0","L"),
|
|
| 379 |
+ array("longstories","10 Longest Stories","toplists/default.php","0","5","0","L"),
|
|
| 380 |
+ array("largeseries","10 Largest Series","toplists/default.php","0","1","0","L"),
|
|
| 381 |
+ array("smallseries","10 Smallest Series","toplists/default.php","0","2","0","L"),
|
|
| 382 |
+ array("reviewedseries","10 Most Reviewed Series","toplists/default.php","0","4","0","L"),
|
|
| 383 |
+ array("prolificauthors","10 Most Prolific Authors","toplists/default.php","0","10","0","L"),
|
|
| 384 |
+ array("prolificreviewers","10 Most Prolific Reviewers","toplists/default.php","0","12","0","L"),
|
|
| 385 |
+ array("reviewedstories","10 Most Reviewed Stories","toplists/default.php","0","8","0","L"),
|
|
| 386 |
+ array("readstories","10 Most Read Stories","toplists/default.php","0","9","0","L"),
|
|
| 387 |
+ array("manfavs","Manage Favorites","","1","2","0","F"),
|
|
| 388 |
+ array("favstories","10 Most Favorite Stories","toplists/default.php","0","7","0","L"),
|
|
| 389 |
+ array("favauthors","10 Most Favorite Authors","toplists/default.php","0","11","0","L"),
|
|
| 390 |
+ array("favseries","10 Most Favorite Series","toplists/default.php","0","3","0","L"),
|
|
| 391 |
+ array("favst","Favorite Stories","","0","0","1","F"),
|
|
| 392 |
+ array("favse","Favorite Series","","0","0","1","F"),
|
|
| 393 |
+ array("favau","Favorite Authors","","0","0","1","F"),
|
|
| 394 |
+ array("favst","Favorite Stories","","0","0","1","U"),
|
|
| 395 |
+ array("favse","Favorite Series","","0","0","1","U"),
|
|
| 396 |
+ array("favau","Favorite Authors","","0","0","1","U"),
|
|
| 397 |
+ array("favlist","{author}\'s Favorites","viewuser.php?action=manfavs","0","5","0","F"),
|
|
| 398 |
+ array("skins", "Skins", "", "3", "6", "0", "A"),
|
|
| 399 |
+ array("authorfields", "Profile Information", "", "1", "9", "0", "A"),
|
|
| 400 |
+ array("maintenance", "Archive Maintenance", "", "1", "10", "0", "A"),
|
|
| 401 |
+ array("manual", "Admin Manual", "", "3", "6", "0", "A"),
|
|
| 402 |
+ array('modules', 'Modules', '', 1, "11", 0, 'A')
|
|
| 403 |
+ ); |
|
| 404 |
+ $output .= "<table class='tblborder' style='margin: 1em auto; padding: 1em;' cellpadding='5'><tr><th>Panel</th><th>"._RESULT."</th></tr>"; |
|
| 405 |
+ foreach($panellist as $panel) {
|
|
| 406 |
+ unset($panels); |
|
| 407 |
+ $panels = dbquery("INSERT INTO `".$tableprefix."fanfiction_panels` (`panel_name`, `panel_title`, `panel_url`, `panel_level`, `panel_order`, `panel_hidden`, `panel_type`) VALUES ('".$panel[0]."', '".$panel[1]."', '".$panel[2]."', '".$panel[3]."', '".$panel[4]."', '".$panel[5]."', '".$panel[6]."');");
|
|
| 408 |
+ $output .= "<tr><td>".stripslashes($panel[1])."</td><td align='center'>" . ($panels ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 409 |
+ } |
|
| 410 |
+ $output .= "</table>"; |
|
| 411 |
+ $output .= write_message(_PANELAUTOFAIL."<br /><br /><a href='install.php?step=5'>"._CONTINUE."</a>"); |
|
| 412 |
+ } |
|
| 413 |
+ else {
|
|
| 414 |
+ $output .= write_message(_PANELMANUAL."<br /><br /><a href='install.php?step=5'>"._CONTINUE."</a>"); |
|
| 415 |
+ } |
|
| 416 |
+ } |
|
| 417 |
+ else $output .= write_message(_PANELDATAINFO."<br /><br />"._PANELSETUP." <a href='install.php?step=4&install=automatic'>"._AUTO."</a> "._OR." <a href='install.php?step=4&install=manual'>"._MANUAL2."</a>"); |
|
| 418 |
+ break; |
|
| 419 |
+ case "3": |
|
| 420 |
+ $output .= "<div id='pagetitle'>"._INSTALLTABLES."</div>"; |
|
| 421 |
+ if(isset($_GET['install'])) {
|
|
| 422 |
+ if($_GET['install'] == "automatic") {
|
|
| 423 |
+ $output .= "<table class='tblborder' style='margin: 1em auto; padding: 1em;' cellpadding='5'><tr><th>Table</th><th>"._RESULT."</th></tr>"; |
|
| 424 |
+ $authorfields = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_authorfields` (
|
|
| 425 |
+ `field_id` int(11) NOT NULL AUTO_INCREMENT, |
|
| 426 |
+ `field_type` tinyint(4) NOT NULL default '0', |
|
| 427 |
+ `field_name` varchar(30) NOT NULL default ' ', |
|
| 428 |
+ `field_title` varchar(255) NOT NULL default ' ', |
|
| 429 |
+ `field_options` text, |
|
| 430 |
+ `field_code_in` text, |
|
| 431 |
+ `field_code_out` text, |
|
| 432 |
+ `field_on` tinyint(1) NOT NULL default '0', |
|
| 433 |
+ PRIMARY KEY (`field_id`) |
|
| 434 |
+) ENGINE=MyISAM;"); |
|
| 435 |
+$output .= "<tr><td>".$tableprefix."fanfiction_authorfields</td><td align='center'>" . ($authorfields ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 436 |
+ $authorinfo = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_authorinfo` (
|
|
| 437 |
+ `uid` int(11) NOT NULL default '0', |
|
| 438 |
+ `field` int(11) NOT NULL default '0', |
|
| 439 |
+ `info` varchar(255) NOT NULL default ' ', |
|
| 440 |
+ PRIMARY KEY (`uid`,`field`), |
|
| 441 |
+ KEY `uid` (`uid`)) ENGINE=MyISAM;"); |
|
| 442 |
+$output .= "<tr><td>".$tableprefix."fanfiction_authorinfo</td><td align='center'>" . ($authorinfo ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 443 |
+ $authorprefs = dbquery("
|
|
| 444 |
+CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_authorprefs` ( |
|
| 445 |
+ `uid` int(11) NOT NULL default '0', |
|
| 446 |
+ `newreviews` tinyint(1) NOT NULL default '0', |
|
| 447 |
+ `newrespond` tinyint(1) NOT NULL default '0', |
|
| 448 |
+ `ageconsent` tinyint(1) NOT NULL default '0', |
|
| 449 |
+ `alertson` tinyint(1) NOT NULL default '0', |
|
| 450 |
+ `tinyMCE` tinyint(1) NOT NULL default '0', |
|
| 451 |
+ `sortby` tinyint(1) NOT NULL default '0', |
|
| 452 |
+ `storyindex` tinyint(1) NOT NULL default '0', |
|
| 453 |
+ `validated` tinyint(1) NOT NULL default '0', |
|
| 454 |
+ `userskin` varchar(60) NOT NULL default 'default', |
|
| 455 |
+ `level` tinyint(1) NOT NULL default '0', |
|
| 456 |
+ `categories` varchar(200) NOT NULL default '0', |
|
| 457 |
+ `contact` tinyint(1) NOT NULL default '0', |
|
| 458 |
+ `stories` int(11) NOT NULL default '0', |
|
| 459 |
+ PRIMARY KEY (`uid`) |
|
| 460 |
+) ENGINE=MyISAM;"); |
|
| 461 |
+$output .= "<tr><td>".$tableprefix."fanfiction_authorprefs</td><td align='center'>" . ($authorprefs ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 462 |
+ $authors = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_authors` (
|
|
| 463 |
+ `uid` int(11) NOT NULL auto_increment, |
|
| 464 |
+ `penname` varchar(200) NOT NULL default '', |
|
| 465 |
+ `realname` varchar(200) NOT NULL default '', |
|
| 466 |
+ `email` varchar(200) NOT NULL default '', |
|
| 467 |
+ `bio` text NULL, |
|
| 468 |
+ `image` varchar(200) NOT NULL default '', |
|
| 469 |
+ `date` datetime NOT NULL default '0000-00-00 00:00:00', |
|
| 470 |
+ `admincreated` char(1) NOT NULL default '0', |
|
| 471 |
+ `password` varchar(40) NOT NULL default '0', |
|
| 472 |
+ PRIMARY KEY (`uid`), |
|
| 473 |
+ KEY `penname` (`penname`), |
|
| 474 |
+ KEY `admincreated` (`admincreated`) |
|
| 475 |
+) ENGINE=MyISAM;"); |
|
| 476 |
+$output .= "<tr><td>".$tableprefix."fanfiction_authors</td><td align='center'>" . ($authors ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 477 |
+ $blocks = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_blocks` (
|
|
| 478 |
+ `block_id` int(11) NOT NULL auto_increment, |
|
| 479 |
+ `block_name` varchar(30) NOT NULL default '', |
|
| 480 |
+ `block_title` varchar(150) NOT NULL default '', |
|
| 481 |
+ `block_file` varchar(200) NOT NULL default '', |
|
| 482 |
+ `block_status` tinyint(1) NOT NULL default '0', |
|
| 483 |
+ `block_variables` text NOT NULL, |
|
| 484 |
+ PRIMARY KEY (`block_id`), |
|
| 485 |
+ KEY `block_name` (`block_name`) |
|
| 486 |
+) ENGINE=MyISAM;"); |
|
| 487 |
+$output .= "<tr><td>".$tableprefix."fanfiction_blocks</td><td align='center'>" . ($blocks ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 488 |
+ $categories = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_categories` (
|
|
| 489 |
+ `catid` int(11) NOT NULL auto_increment, |
|
| 490 |
+ `parentcatid` int(11) NOT NULL default '-1', |
|
| 491 |
+ `category` varchar(60) NOT NULL default '', |
|
| 492 |
+ `description` text NOT NULL, |
|
| 493 |
+ `image` varchar(100) NOT NULL default '', |
|
| 494 |
+ `locked` char(1) NOT NULL default '0', |
|
| 495 |
+ `leveldown` tinyint(4) NOT NULL default '0', |
|
| 496 |
+ `displayorder` int(11) NOT NULL default '0', |
|
| 497 |
+ `numitems` int(11) NOT NULL default '0', |
|
| 498 |
+ PRIMARY KEY (`catid`), |
|
| 499 |
+ KEY `byparent` (`parentcatid`,`displayorder`) |
|
| 500 |
+) ENGINE=MyISAM;"); |
|
| 501 |
+$output .= "<tr><td>".$tableprefix."fanfiction_categories</td><td align='center'>" . ($categories ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 502 |
+ $chapters = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_chapters` (
|
|
| 503 |
+ `chapid` int(11) NOT NULL auto_increment, |
|
| 504 |
+ `title` varchar(250) NOT NULL default '', |
|
| 505 |
+ `inorder` int(11) NOT NULL default '0', |
|
| 506 |
+ `notes` text NULL, |
|
| 507 |
+ `storytext` text NULL, |
|
| 508 |
+ `endnotes` text NULL, |
|
| 509 |
+ `validated` char(1) NOT NULL default '0', |
|
| 510 |
+ `wordcount` int(11) NOT NULL default '0', |
|
| 511 |
+ `rating` tinyint(4) NOT NULL default '0', |
|
| 512 |
+ `reviews` smallint(6) NOT NULL default '0', |
|
| 513 |
+ `sid` int(11) NOT NULL default '0', |
|
| 514 |
+ `uid` int(11) NOT NULL default '0', |
|
| 515 |
+ `count` int(11) NOT NULL default '0', |
|
| 516 |
+ PRIMARY KEY (`chapid`), |
|
| 517 |
+ KEY `sid` (`sid`), |
|
| 518 |
+ KEY `uid` (`uid`), |
|
| 519 |
+ KEY `inorder` (`inorder`), |
|
| 520 |
+ KEY `title` (`title`), |
|
| 521 |
+ KEY `validated` (`validated`), |
|
| 522 |
+ KEY `forstoryblock` (`sid`,`validated`) |
|
| 523 |
+) ENGINE=MyISAM;"); |
|
| 524 |
+$output .= "<tr><td>".$tableprefix."fanfiction_chapters</td><td align='center'>" . ($chapters ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 525 |
+ $characters = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_characters` (
|
|
| 526 |
+ `charid` int(11) NOT NULL auto_increment, |
|
| 527 |
+ `catid` int(11) NOT NULL default '0', |
|
| 528 |
+ `charname` varchar(60) NOT NULL default '', |
|
| 529 |
+ `bio` text NOT NULL, |
|
| 530 |
+ `image` varchar(200) NOT NULL default '', |
|
| 531 |
+ PRIMARY KEY (`charid`), |
|
| 532 |
+ KEY `catid` (`catid`), |
|
| 533 |
+ KEY `charname` (`charname`) |
|
| 534 |
+) ENGINE=MyISAM;"); |
|
| 535 |
+$output .= "<tr><td>".$tableprefix."fanfiction_characters</td><td align='center'>" . ($characters ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 536 |
+ $classes = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_classes` (
|
|
| 537 |
+ `class_id` int(11) NOT NULL auto_increment, |
|
| 538 |
+ `class_type` int(11) NOT NULL default '0', |
|
| 539 |
+ `class_name` varchar(100) NOT NULL default '', |
|
| 540 |
+ PRIMARY KEY (`class_id`), |
|
| 541 |
+ KEY `byname` (`class_type`,`class_name`,`class_id`) |
|
| 542 |
+) ENGINE=MyISAM;"); |
|
| 543 |
+$output .= "<tr><td>".$tableprefix."fanfiction_classes</td><td align='center'>" . ($classes ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 544 |
+ $classtypes = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_classtypes` (
|
|
| 545 |
+ `classtype_id` int(11) NOT NULL auto_increment, |
|
| 546 |
+ `classtype_name` varchar(50) NOT NULL default '', |
|
| 547 |
+ `classtype_title` varchar(50) NOT NULL default '', |
|
| 548 |
+ PRIMARY KEY (`classtype_id`), |
|
| 549 |
+ UNIQUE KEY `classtype_name` (`classtype_name`) |
|
| 550 |
+) ENGINE=MyISAM;"); |
|
| 551 |
+$output .= "<tr><td>".$tableprefix."fanfiction_classtypes</td><td align='center'>" . ($classtypes ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 552 |
+$coauthors = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_coauthors` (
|
|
| 553 |
+ `sid` int(11) NOT NULL default '0', |
|
| 554 |
+ `uid` int(11) NOT NULL default '0', |
|
| 555 |
+ PRIMARY KEY (`sid`,`uid`) |
|
| 556 |
+) ENGINE=MyISAM;"); |
|
| 557 |
+$output .= "<tr><td>".$tableprefix."fanfiction_coauthors</td><td align='center'>" . ($coauthors ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 558 |
+ $codeblocks = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_codeblocks` (
|
|
| 559 |
+ `code_id` int(11) NOT NULL auto_increment, |
|
| 560 |
+ `code_text` text NOT NULL, |
|
| 561 |
+ `code_type` varchar(20) default NULL, |
|
| 562 |
+ `code_module` varchar(60) default NULL, |
|
| 563 |
+ PRIMARY KEY (`code_id`), |
|
| 564 |
+ KEY `code_type` (`code_type`) |
|
| 565 |
+) ENGINE=MyISAM;"); |
|
| 566 |
+$output .= "<tr><td>".$tableprefix."fanfiction_codeblocks</td><td align='center'>" . ($codeblocks ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 567 |
+ $comments = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_comments` (
|
|
| 568 |
+ `cid` int(11) NOT NULL auto_increment, |
|
| 569 |
+ `nid` int(11) NOT NULL default '0', |
|
| 570 |
+ `uid` int(11) NOT NULL default '0', |
|
| 571 |
+ `comment` text NOT NULL, |
|
| 572 |
+ `time` datetime NOT NULL default '0000-00-00 00:00:00', |
|
| 573 |
+ PRIMARY KEY (`cid`), |
|
| 574 |
+ KEY `commentlist` (`nid`,`time`) |
|
| 575 |
+) ENGINE=MyISAM;"); |
|
| 576 |
+$output .= "<tr><td>".$tableprefix."fanfiction_comments</td><td align='center'>" . ($comments ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 577 |
+ $favorites = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_favorites` (
|
|
| 578 |
+ `uid` int(11) NOT NULL default '0', |
|
| 579 |
+ `item` int(11) NOT NULL default '0', |
|
| 580 |
+ `type` char(2) NOT NULL default '', |
|
| 581 |
+ `comments` text NOT NULL, |
|
| 582 |
+ UNIQUE KEY `byitem` (`item`,`type`,`uid`), |
|
| 583 |
+ UNIQUE KEY `byuid` (`uid`,`type`,`item`) |
|
| 584 |
+) ENGINE=MyISAM;"); |
|
| 585 |
+$output .= "<tr><td>".$tableprefix."fanfiction_favorites</td><td align='center'>" . ($favorites ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 586 |
+ $inseries = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_inseries` (
|
|
| 587 |
+ `seriesid` int(11) NOT NULL default '0', |
|
| 588 |
+ `sid` int(11) NOT NULL default '0', |
|
| 589 |
+ `subseriesid` int(11) NOT NULL default '0', |
|
| 590 |
+ `confirmed` int(11) NOT NULL default '0', |
|
| 591 |
+ `inorder` int(11) NOT NULL default '0', |
|
| 592 |
+ PRIMARY KEY (`sid`,`seriesid`, `subseriesid`), |
|
| 593 |
+ KEY `seriesid` (`seriesid`,`inorder`) |
|
| 594 |
+) ENGINE=MyISAM;"); |
|
| 595 |
+$output .= "<tr><td>".$tableprefix."fanfiction_inseries</td><td align='center'>" . ($inseries ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 596 |
+ $logs = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_log` (
|
|
| 597 |
+ `log_id` int(11) NOT NULL auto_increment, |
|
| 598 |
+ `log_action` varchar(255) default NULL, |
|
| 599 |
+ `log_uid` int(11) NOT NULL, |
|
| 600 |
+ `log_ip` int(11) UNSIGNED default NULL, |
|
| 601 |
+ `log_timestamp` timestamp NOT NULL, |
|
| 602 |
+ `log_type` varchar(2) NOT NULL, |
|
| 603 |
+ PRIMARY KEY (`log_id`) |
|
| 604 |
+) ENGINE=MyISAM"); |
|
| 605 |
+$output .= "<tr><td>".$tableprefix."fanfiction_log</td><td align='center'>" . ($logs ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 606 |
+ $messages = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_messages` (
|
|
| 607 |
+ `message_id` int(11) NOT NULL auto_increment, |
|
| 608 |
+ `message_name` varchar(50) NOT NULL default '', |
|
| 609 |
+ `message_title` varchar(200) NOT NULL default '', |
|
| 610 |
+ `message_text` text NOT NULL, |
|
| 611 |
+ PRIMARY KEY (`message_id`), |
|
| 612 |
+ KEY `message_name` (`message_name`) |
|
| 613 |
+) ENGINE=MyISAM;"); |
|
| 614 |
+$output .= "<tr><td>".$tableprefix."fanfiction_messages</td><td align='center'>" . ($messages ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 615 |
+ $modules = dbquery("
|
|
| 616 |
+CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_modules` ( |
|
| 617 |
+ `id` int(11) NOT NULL auto_increment, |
|
| 618 |
+ `name` varchar(100) NOT NULL default 'Test Module', |
|
| 619 |
+ `version` varchar(10) NOT NULL default '1.0', |
|
| 620 |
+ PRIMARY KEY (`id`), |
|
| 621 |
+ KEY `name_version` (`name`,`version`) |
|
| 622 |
+)"); |
|
| 623 |
+$output .= "<tr><td>".$tableprefix."fanfiction_modules</td><td align='center'>" . ($modules ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 624 |
+ $news = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_news` (
|
|
| 625 |
+ `nid` int(11) NOT NULL auto_increment, |
|
| 626 |
+ `author` varchar(60) NOT NULL default '', |
|
| 627 |
+ `title` varchar(255) NOT NULL default '', |
|
| 628 |
+ `story` text NOT NULL, |
|
| 629 |
+ `time` datetime default NULL, |
|
| 630 |
+ `comments` INT NOT NULL DEFAULT '0', |
|
| 631 |
+ PRIMARY KEY (`nid`) |
|
| 632 |
+) ENGINE=MyISAM;"); |
|
| 633 |
+$output .= "<tr><td>".$tableprefix."fanfiction_news</td><td align='center'>" . ($news ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 634 |
+ $pagelinks = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_pagelinks` (
|
|
| 635 |
+ `link_id` int(11) NOT NULL auto_increment, |
|
| 636 |
+ `link_name` varchar(50) NOT NULL default '', |
|
| 637 |
+ `link_text` varchar(100) NOT NULL default '', |
|
| 638 |
+ `link_key` CHAR( 1 ) NULL, |
|
| 639 |
+ `link_url` varchar(250) NOT NULL default '', |
|
| 640 |
+ `link_target` char(1) NOT NULL default '0', |
|
| 641 |
+ `link_access` tinyint(4) NOT NULL default '0', |
|
| 642 |
+ PRIMARY KEY (`link_id`), |
|
| 643 |
+ KEY `link_name` (`link_name`) |
|
| 644 |
+) ENGINE=MyISAM;"); |
|
| 645 |
+$output .= "<tr><td>".$tableprefix."fanfiction_pagelinks</td><td align='center'>" . ($pagelinks ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 646 |
+ $panels = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_panels` (
|
|
| 647 |
+ `panel_id` int(11) NOT NULL auto_increment, |
|
| 648 |
+ `panel_name` varchar(50) NOT NULL default 'unknown', |
|
| 649 |
+ `panel_title` varchar(100) NOT NULL default 'Unnamed Panel', |
|
| 650 |
+ `panel_url` varchar(100) default NULL, |
|
| 651 |
+ `panel_level` tinyint(4) NOT NULL default '3', |
|
| 652 |
+ `panel_order` tinyint(4) NOT NULL default '0', |
|
| 653 |
+ `panel_hidden` tinyint(1) NOT NULL default '0', |
|
| 654 |
+ `panel_type` varchar(20) NOT NULL default 'A', |
|
| 655 |
+ PRIMARY KEY (`panel_id`), |
|
| 656 |
+ KEY `panel_type` (`panel_type`,`panel_name`) |
|
| 657 |
+) ENGINE=MyISAM;"); |
|
| 658 |
+$output .= "<tr><td>".$tableprefix."fanfiction_panels</td><td align='center'>" . ($panels ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 659 |
+ $ratings = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_ratings` (
|
|
| 660 |
+ `rid` int(11) NOT NULL auto_increment, |
|
| 661 |
+ `rating` varchar(60) NOT NULL default '', |
|
| 662 |
+ `ratingwarning` char(1) NOT NULL default '0', |
|
| 663 |
+ `warningtext` text NOT NULL, |
|
| 664 |
+ PRIMARY KEY (`rid`), |
|
| 665 |
+ KEY `rating` (`rating`) |
|
| 666 |
+) ENGINE=MyISAM;"); |
|
| 667 |
+$output .= "<tr><td>".$tableprefix."fanfiction_ratings</td><td align='center'>" . ($ratings ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 668 |
+ $reviews = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_reviews` (
|
|
| 669 |
+ `reviewid` int(11) NOT NULL auto_increment, |
|
| 670 |
+ `item` int(11) NOT NULL default '0', |
|
| 671 |
+ `chapid` int(11) NOT NULL default '0', |
|
| 672 |
+ `reviewer` varchar(60) NOT NULL default '0', |
|
| 673 |
+ `uid` int(11) NOT NULL default '0', |
|
| 674 |
+ `review` text NOT NULL, |
|
| 675 |
+ `date` datetime NOT NULL default '0000-00-00 00:00:00', |
|
| 676 |
+ `rating` int(11) NOT NULL default '0', |
|
| 677 |
+ `respond` char(1) NOT NULL default '0', |
|
| 678 |
+ `type` char(2) NOT NULL default '', |
|
| 679 |
+ PRIMARY KEY (`reviewid`), |
|
| 680 |
+ KEY `chapid` (`chapid`), |
|
| 681 |
+ KEY `rating` (`rating`), |
|
| 682 |
+ KEY `respond` (`respond`), |
|
| 683 |
+ KEY `avgrating` (`type`,`item`,`rating`), |
|
| 684 |
+ KEY `bychapter` (`chapid`,`rating`), |
|
| 685 |
+ KEY `byuid` (`uid`,`item`,`type`) |
|
| 686 |
+) ENGINE=MyISAM;"); |
|
| 687 |
+$output .= "<tr><td>".$tableprefix."fanfiction_reviews</td><td align='center'>" . ($reviews ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 688 |
+ $series = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_series` (
|
|
| 689 |
+ `seriesid` int(11) NOT NULL auto_increment, |
|
| 690 |
+ `title` varchar(200) NOT NULL default '', |
|
| 691 |
+ `summary` text NOT NULL, |
|
| 692 |
+ `uid` int(11) NOT NULL default '0', |
|
| 693 |
+ `isopen` tinyint(4) NOT NULL default '0', |
|
| 694 |
+ `catid` varchar(200) NOT NULL default '0', |
|
| 695 |
+ `rating` tinyint(4) NOT NULL default '0', |
|
| 696 |
+ `classes` varchar(200) NOT NULL default '', |
|
| 697 |
+ `characters` varchar(250) NOT NULL default '', |
|
| 698 |
+ `reviews` smallint(6) NOT NULL default '0', |
|
| 699 |
+ `numstories` INT NOT NULL DEFAULT '0', |
|
| 700 |
+ `challenges` varchar(200) NOT NULL default '', |
|
| 701 |
+ PRIMARY KEY (`seriesid`), |
|
| 702 |
+ KEY `catid` (`catid`), |
|
| 703 |
+ KEY `characters` (`characters`), |
|
| 704 |
+ KEY `classes` (`classes`), |
|
| 705 |
+ KEY `owner` (`uid`,`title`) |
|
| 706 |
+) ENGINE=MyISAM;"); |
|
| 707 |
+$output .= "<tr><td>".$tableprefix."fanfiction_series</td><td align='center'>" . ($series ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 708 |
+ $stats = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_stats` (
|
|
| 709 |
+ `sitekey` varchar(50) NOT NULL default '0', |
|
| 710 |
+ `stories` int(11) NOT NULL default '0', |
|
| 711 |
+ `chapters` int(11) NOT NULL default '0', |
|
| 712 |
+ `series` int(11) NOT NULL default '0', |
|
| 713 |
+ `reviews` int(11) NOT NULL default '0', |
|
| 714 |
+ `wordcount` int(11) NOT NULL default '0', |
|
| 715 |
+ `authors` int(11) NOT NULL default '0', |
|
| 716 |
+ `members` int(11) NOT NULL default '0', |
|
| 717 |
+ `reviewers` int(11) NOT NULL default '0', |
|
| 718 |
+ `newestmember` int(11) NOT NULL default '0' |
|
| 719 |
+) ENGINE=MyISAM"); |
|
| 720 |
+ dbquery("INSERT INTO ".$tableprefix."fanfiction_stats(`sitekey`, `newestmember`) VALUES('".SITEKEY."', '1')");
|
|
| 721 |
+$output .= "<tr><td>".$tableprefix."fanfiction_stats</td><td align='center'>" . ($stats ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 722 |
+ $stories = dbquery("CREATE TABLE IF NOT EXISTS `".$tableprefix."fanfiction_stories` (
|
|
| 723 |
+ `sid` int(11) NOT NULL auto_increment, |
|
| 724 |
+ `title` varchar(200) NOT NULL default 'Untitled', |
|
| 725 |
+ `summary` text NULL, |
|
| 726 |
+ `storynotes` text NULL, |
|
| 727 |
+ `catid` varchar(100) NOT NULL default '0', |
|
| 728 |
+ `classes` varchar(200) NOT NULL default '0', |
|
| 729 |
+ `charid` varchar(250) NOT NULL default '0', |
|
| 730 |
+ `rid` varchar(25) NOT NULL default '0', |
|
| 731 |
+ `date` datetime default NULL, |
|
| 732 |
+ `updated` datetime NOT NULL default '0000-00-00 00:00:00', |
|
| 733 |
+ `uid` int(11) NOT NULL default '0', |
|
| 734 |
+ `coauthors` varchar(50) NOT NULL default '0', |
|
| 735 |
+ `featured` char(1) NOT NULL default '0', |
|
| 736 |
+ `validated` char(1) NOT NULL default '0', |
|
| 737 |
+ `completed` char(1) NOT NULL default '0', |
|
| 738 |
+ `rr` char(1) NOT NULL default '0', |
|
| 739 |
+ `wordcount` int(11) NOT NULL default '0', |
|
| 740 |
+ `rating` tinyint(4) NOT NULL default '0', |
|
| 741 |
+ `reviews` smallint(6) NOT NULL default '0', |
|
| 742 |
+ `count` int(11) NOT NULL default '0', |
|
| 743 |
+ PRIMARY KEY (`sid`), |
|
| 744 |
+ KEY `title` (`title`), |
|
| 745 |
+ KEY `catid` (`catid`), |
|
| 746 |
+ KEY `charid` (`charid`), |
|
| 747 |
+ KEY `rid` (`rid`), |
|
| 748 |
+ KEY `uid` (`uid`), |
|
| 749 |
+ KEY `featured` (`featured`), |
|
| 750 |
+ KEY `completed` (`completed`), |
|
| 751 |
+ KEY `rr` (`rr`), |
|
| 752 |
+ KEY `validateduid` (`validated`,`uid`), |
|
| 753 |
+ KEY `recent` (`updated`,`validated`) |
|
| 754 |
+) ENGINE=MyISAM;"); |
|
| 755 |
+$output .= "<tr><td>".$tableprefix."fanfiction_stories</td><td align='center'>" . ($stories ? "<img src=\"../images/check.gif\">" : "<img src=\"../images/X.gif\">") ."</td></tr>"; |
|
| 756 |
+$output .= "</table>"; |
|
| 757 |
+$output .= write_message(_TABLEFAILED."<br /><br /><a href='install.php?step=4'>"._CONTINUE."</a>"); |
|
| 758 |
+ |
|
| 759 |
+ } |
|
| 760 |
+ else if($_GET['install'] == "manual") {
|
|
| 761 |
+ $output .= write_message(_TABLESMANUAL."<br /><br /><a href='install.php?step=3'>"._CONTINUE."</a>"); |
|
| 762 |
+ } |
|
| 763 |
+ |
|
| 764 |
+ } |
|
| 765 |
+ else {
|
|
| 766 |
+ |
|
| 767 |
+ $output .= write_message(_TABLESINSTALL."<br /><br /><a href='install.php?step=3&install=automatic'>"._AUTO."</a> "._OR." <a href='install.php?step=3&install=manual'>"._MANUAL2."</a>"); |
|
| 768 |
+ } |
|
| 769 |
+ |
|
| 770 |
+ break; |
|
| 771 |
+ |
|
| 772 |
+ case "2"; |
|
| 773 |
+ include("../config.php");
|
|
| 774 |
+ if(dbnumrows(dbquery("SHOW TABLES LIKE '".$settingsprefix."fanfiction_settings'"))) {
|
|
| 775 |
+ include("../config.php");
|
|
| 776 |
+ $dbconnect = dbconnect($dbhost, $dbuser, $dbpass, $dbname ); |
|
| 777 |
+ $settings = dbquery("SELECT tableprefix, language FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".$sitekey."'");
|
|
| 778 |
+ list($tableprefix, $language) = dbrow($settings); |
|
| 779 |
+ define("TABLEPREFIX", $tableprefix);
|
|
| 780 |
+ define("SITEKEY", $sitekey);
|
|
| 781 |
+ |
|
| 782 |
+ $sect = isset($_GET['sect']) ? $_GET['sect'] : "main"; |
|
| 783 |
+ $settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".SITEKEY."'");
|
|
| 784 |
+ if(dbnumrows($settingsresults) == 0) {
|
|
| 785 |
+ dbquery("INSERT INTO ".$settingsprefix."fanfiction_settings (`sitekey`) VALUES('".SITEKEY."');");
|
|
| 786 |
+ $settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".SITEKEY."'");
|
|
| 787 |
+ } |
|
| 788 |
+ $settings = dbassoc($settingsresults); |
|
| 789 |
+ define("_BASEDIR", "../");
|
|
| 790 |
+ foreach($settings as $var => $val) {
|
|
| 791 |
+ $$var = $val; |
|
| 792 |
+ } |
|
| 793 |
+ if($sect == "submissions") {
|
|
| 794 |
+ if(isset($_POST['submit'])) {
|
|
| 795 |
+ $storiespath = descript($_POST['newstoriespath']); |
|
| 796 |
+ if(!file_exists($storiespath) && !file_exists("../".$storiespath)) {
|
|
| 797 |
+ if(!strrchr($storiespath, "/") && !strrchr($storiespath, "\\")) $storiespath = "../$storiespath"; |
|
| 798 |
+ mkdir("$storiespath", 0755);
|
|
| 799 |
+ @chmod("$storiespath", 0777);
|
|
| 800 |
+ if(substr(sprintf('%o', @fileperms("../".$storiespath)), -4) != "0777") $output .= write_message(_STORIESPATHNOTWRITABLE);
|
|
| 801 |
+ } |
|
| 802 |
+ } |
|
| 803 |
+ } |
|
| 804 |
+ if($sect == "email" && isset($_POST['submit'])) {
|
|
| 805 |
+ $output .= "<div id=\"pagetitle\">"._SETTINGS."</div>"; |
|
| 806 |
+ $smtp_host = $_POST['newsmtp_host']; |
|
| 807 |
+ $smtp_username = $_POST['newsmtp_username']; |
|
| 808 |
+ $smtp_password = $_POST['newsmtp_password']; |
|
| 809 |
+ $result = dbquery("UPDATE ".$settingsprefix."fanfiction_settings SET smtp_host = '$smtp_host', smtp_username = '$smtp_username', smtp_password = '$smtp_password' WHERE sitekey = '".SITEKEY."'");
|
|
| 810 |
+ if($result) {
|
|
| 811 |
+ $output .= write_message(_ACTIONSUCCESSFUL); |
|
| 812 |
+ $output .= write_message("<a href='install.php?step=3'>"._CONTINUE."</a>");
|
|
| 813 |
+ } |
|
| 814 |
+ else include("../admin/settings.php");
|
|
| 815 |
+ } |
|
| 816 |
+ else include("../admin/settings.php");
|
|
| 817 |
+ } |
|
| 818 |
+ else {
|
|
| 819 |
+ if($_GET['install']) {
|
|
| 820 |
+ if($_GET['install'] == "automatic") {
|
|
| 821 |
+ |
|
| 822 |
+ $settings = dbquery("CREATE TABLE IF NOT EXISTS `".$settingsprefix."fanfiction_settings` (
|
|
| 823 |
+ `sitekey` varchar(50) NOT NULL default '1', |
|
| 824 |
+ `sitename` varchar(200) NOT NULL default 'Your Site', |
|
| 825 |
+ `slogan` varchar(200) NOT NULL default 'It''s a cool site!', |
|
| 826 |
+ `url` varchar(200) NOT NULL default 'http://www.yoursite.com', |
|
| 827 |
+ `siteemail` varchar(200) NOT NULL default 'you@yoursite.com', |
|
| 828 |
+ `tableprefix` varchar(50) NOT NULL default '', |
|
| 829 |
+ `skin` varchar(50) NOT NULL default 'default', |
|
| 830 |
+ `hiddenskins` varchar(255) default '', |
|
| 831 |
+ `language` varchar(10) NOT NULL default 'en', |
|
| 832 |
+ `submissionsoff` tinyint(1) NOT NULL default '0', |
|
| 833 |
+ `storiespath` varchar(20) NOT NULL default 'stories', |
|
| 834 |
+ `store` varchar(5) NOT NULL default 'files', |
|
| 835 |
+ `autovalidate` tinyint(1) NOT NULL default '0', |
|
| 836 |
+ `coauthallowed` int(1) NOT NULL default '0', |
|
| 837 |
+ `maxwords` int(11) NOT NULL default '0', |
|
| 838 |
+ `minwords` int(11) NOT NULL default '0', |
|
| 839 |
+ `imageupload` tinyint(1) NOT NULL default '0', |
|
| 840 |
+ `imageheight` int(11) NOT NULL default '200', |
|
| 841 |
+ `imagewidth` int(11) NOT NULL default '200', |
|
| 842 |
+ `roundrobins` tinyint(1) NOT NULL default '0', |
|
| 843 |
+ `allowseries` tinyint(4) NOT NULL default '2', |
|
| 844 |
+ `tinyMCE` tinyint(1) NOT NULL default '0', |
|
| 845 |
+ `allowed_tags` varchar(200) NOT NULL default '<b><i><u><center><hr><p><br /><br><blockquote><ol><ul><li><img><strong><em>', |
|
| 846 |
+ `favorites` tinyint(1) NOT NULL default '0', |
|
| 847 |
+ `multiplecats` tinyint(1) NOT NULL default '0', |
|
| 848 |
+ `newscomments` tinyint(1) NOT NULL default '0', |
|
| 849 |
+ `logging` tinyint(1) NOT NULL default '0', |
|
| 850 |
+ `maintenance` tinyint(1) NOT NULL default '0', |
|
| 851 |
+ `debug` tinyint(1) NOT NULL default '0', |
|
| 852 |
+ `captcha` tinyint(1) NOT NULL default '0', |
|
| 853 |
+ `dateformat` varchar(20) NOT NULL default 'd/m/y', |
|
| 854 |
+ `timeformat` varchar(20) NOT NULL default '- h:i a', |
|
| 855 |
+ `recentdays` tinyint(2) NOT NULL default '7', |
|
| 856 |
+ `displaycolumns` tinyint(1) NOT NULL default '1', |
|
| 857 |
+ `itemsperpage` tinyint(2) NOT NULL default '25', |
|
| 858 |
+ `extendcats` tinyint(1) NOT NULL default '0', |
|
| 859 |
+ `displayindex` tinyint(1) NOT NULL default '0', |
|
| 860 |
+ `defaultsort` tinyint(1) NOT NULL default '0', |
|
| 861 |
+ `displayprofile` tinyint(1) NOT NULL default '0', |
|
| 862 |
+ `linkstyle` tinyint(1) NOT NULL default '0', |
|
| 863 |
+ `linkrange` tinyint(2) NOT NULL default '5', |
|
| 864 |
+ `reviewsallowed` tinyint(1) NOT NULL default '0', |
|
| 865 |
+ `ratings` tinyint(1) NOT NULL default '0', |
|
| 866 |
+ `anonreviews` tinyint(1) NOT NULL default '0', |
|
| 867 |
+ `revdelete` tinyint(1) NOT NULL default '0', |
|
| 868 |
+ `rateonly` tinyint(1) NOT NULL default '0', |
|
| 869 |
+ `pwdsetting` tinyint(1) NOT NULL default '0', |
|
| 870 |
+ `alertson` tinyint(1) NOT NULL default '0', |
|
| 871 |
+ `disablepopups` tinyint(1) NOT NULL default '0', |
|
| 872 |
+ `agestatement` tinyint(1) NOT NULL default '0', |
|
| 873 |
+ `words` text, |
|
| 874 |
+ `version` varchar(10) NOT NULL default '".$version."', |
|
| 875 |
+ `smtp_host` varchar(200) default NULL, |
|
| 876 |
+ `smtp_username` varchar(50) default NULL, |
|
| 877 |
+ `smtp_password` varchar(50) default NULL, |
|
| 878 |
+ PRIMARY KEY (`sitekey`) |
|
| 879 |
+) ENGINE=MyISAM;"); |
|
| 880 |
+if($settings) $output .= write_message("<img src=\"../images/check.gif\"> "._SETTINGSTABLESUCCESS." <br /><a href='install.php?step=2'>"._CONTINUE."</a>");
|
|
| 881 |
+else $output .= write_message(_SETTINGSTABLEAUTOFAIL."<br /><br /> <a href='install.php?step=2'>"._CONTINUE."</a>"); |
|
| 882 |
+ } |
|
| 883 |
+ else {
|
|
| 884 |
+ $output .= write_message(_SETTINGSTABLEMANUAL."<br /><br /><a href='install.php?step=2'>"._CONTINUE."</a>"); |
|
| 885 |
+ } |
|
| 886 |
+ } |
|
| 887 |
+ else {
|
|
| 888 |
+ |
|
| 889 |
+ $test = dbquery("SHOW TABLES");
|
|
| 890 |
+ if(!$test) $output .= write_message(_CONFIGFAILED); |
|
| 891 |
+ else $output .= write_message(_SETTINGSTABLESETUP." <a href='install.php?step=2&install=automatic'>"._AUTO."</a> "._OR." <a href='install.php?step=2&install=manual'>"._MANUAL2."</a>"); |
|
| 892 |
+ } |
|
| 893 |
+ } |
|
| 894 |
+ break; |
|
| 895 |
+ default: |
|
| 896 |
+ $output .= "<div id='pagetitle'>"._CONFIGDATA."</div>"; |
|
| 897 |
+ if(isset($_POST['submit'])) {
|
|
| 898 |
+ $dbhost = descript($_POST['dbhost']); |
|
| 899 |
+ $dbname = descript($_POST['dbname']); |
|
| 900 |
+ $dbuser = descript($_POST['dbuser']); |
|
| 901 |
+ $dbpass = descript($_POST['dbpass']); |
|
| 902 |
+ $language = $_POST['language']; |
|
| 903 |
+ $sitekey = descript($_POST['sitekey']); |
|
| 904 |
+ $settingsprefix = descript($_POST['settingsprefix']); |
|
| 905 |
+ $mysql_access = mysqli_connect($dbhost, $dbuser, $dbpass); |
|
| 906 |
+ if(!$mysql_access) {
|
|
| 907 |
+ $output .= write_message(_CONFIGFAILED); |
|
| 908 |
+ } |
|
| 909 |
+ } |
|
| 910 |
+ if(isset($_POST['submit']) && $mysql_access) {
|
|
| 911 |
+ $handle = fopen("../config.php", 'w');
|
|
| 912 |
+ if(!$handle) {
|
|
| 913 |
+ @chmod("../config.php", 0666);
|
|
| 914 |
+ $handle = fopen("../config.php", 'w');
|
|
| 915 |
+ } |
|
| 916 |
+ if($handle) {
|
|
| 917 |
+ $dbhost = descript($_POST['dbhost']); |
|
| 918 |
+ $dbname = descript($_POST['dbname']); |
|
| 919 |
+ $dbuser = descript($_POST['dbuser']); |
|
| 920 |
+ $dbpass = descript($_POST['dbpass']); |
|
| 921 |
+ $sitekey = descript($_POST['sitekey']); |
|
| 922 |
+ if(empty($sitekey)) $sitekey = random_string($randomcharset, 10); |
|
| 923 |
+ $language = $_POST['language']; |
|
| 924 |
+ $settingsprefix = descript($_POST['settingsprefix']); |
|
| 925 |
+ $text = "<?php |
|
| 926 |
+\$dbhost = \"$dbhost\"; |
|
| 927 |
+\$dbname = \"$dbname\"; |
|
| 928 |
+\$dbuser= \"$dbuser\"; |
|
| 929 |
+\$dbpass = \"$dbpass\"; |
|
| 930 |
+\$sitekey = \"$sitekey\"; |
|
| 931 |
+\$settingsprefix = \"$settingsprefix\"; |
|
| 932 |
+ |
|
| 933 |
+include_once(\"includes/dbfunctions.php\"); |
|
| 934 |
+if(!empty(\$sitekey)) \$dbconnect = dbconnect(\$dbhost, \$dbuser,\$dbpass, \$dbname); |
|
| 935 |
+ |
|
| 936 |
+?>"; |
|
| 937 |
+ fwrite($handle, $text); |
|
| 938 |
+ fclose($handle); |
|
| 939 |
+ @chmod("../config.php", 0644);
|
|
| 940 |
+ $output .= write_message(_CONFIGSUCCESS."<br /><br /><a href='install.php?step=2&language=$language'>"._CONTINUE."</a>"); |
|
| 941 |
+ } |
|
| 942 |
+ else $output .= write_message(_ERROR_CONFIGWRITE); |
|
| 943 |
+ |
|
| 944 |
+ } |
|
| 945 |
+ else {
|
|
| 946 |
+ if(file_exists("../config.php") && !isset($mysql_access)) include("../config.php");
|
|
| 947 |
+ if(isset($tinyMCE)) $output .= write_message(_CONFIG2DETECTED); |
|
| 948 |
+ else if(isset($sitename)) $output .= write_message(_CONFIG1DETECTED); |
|
| 949 |
+ else {
|
|
| 950 |
+ $output .= |
|
| 951 |
+ "<form method='POST' enctype='multipart/form-data' action='install.php?step=1' class='tblborder' style='width: 350px; margin: 1em auto;'> |
|
| 952 |
+ <div><label for='dbhost'>"._DBHOST."</label><input type='text' name='dbhost' id='dbhost'".(!empty($dbhost) ? "value='$dbhost'" : "value='localhost'")."> <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_DBHOST."</span></A></div> |
|
| 953 |
+ <div><label for='dbname'>"._DBNAME."</label><input type='text' name='dbname' id='dbname'".(!empty($dbname) ? "value='$dbname'" : "")."> <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_DBNAME."</span></A></div> |
|
| 954 |
+ <div><label for='dbuser'>"._DBUSER."</label><input type='text' name='dbuser' id='dbuser'".(!empty($dbuser) ? "value='$dbuser'" : "")."> <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_DBUSER."</span></A></div> |
|
| 955 |
+ <div><label for='dbpass'>"._DBPASS."</label><input type='password' name='dbpass' id='dbpass'".(!empty($dbpass) ? "value='$dbpass'" : "")."> <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_DBPASS."</span></A></div> |
|
| 956 |
+ <div><label for='sitekey'>"._SITEKEY."</label><input type='text' name='sitekey' value='".(!empty($sitekey) ? $sitekey : random_string($randomcharset, 10))."' id='sitekey'> <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_INSTALL_SITEKEY."</span></A></div> |
|
| 957 |
+ <div><label for=\"language\">"._LANGUAGE.":</label> <select name=\"language\">"; |
|
| 958 |
+ $directory = opendir("../languages");
|
|
| 959 |
+ while($filename = readdir($directory)) {
|
|
| 960 |
+ if($filename=="." || $filename==".." || substr($filename, 2) == "_admin.php") continue; |
|
| 961 |
+ $output .= "<option value=\"".substr($filename, 0, 2)."\"". |
|
| 962 |
+ ($language == substr($filename, 0, strpos($filename, ".php")) ? " selected" : "")."> |
|
| 963 |
+ ".substr($filename, 0, strpos($filename, ".php"))."</option>"; |
|
| 964 |
+ } |
|
| 965 |
+ closedir($directory); |
|
| 966 |
+ $output .= |
|
| 967 |
+ "</select> <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_LANGUAGE."</span></A></div> |
|
| 968 |
+ <label for='settingsprefix'>"._SETTINGSPREFIX."</label><input type='text' name='settingsprefix' id='settingsprefix'".(isset($settingsprefix) ? "value='$settingsprefix'" : "")."> <A HREF=\"#\" class=\"pophelp\">[?]<span>"._HELP_SETTINGSPREFIX."</span></A><br /> |
|
| 969 |
+ <div style='text-align: center; margin: 1em;'><INPUT type=\"submit\"class=\"button\" name=\"submit\" value=\"submit\"></div> |
|
| 970 |
+ </form>"; |
|
| 971 |
+ } |
|
| 972 |
+ } |
|
| 973 |
+} |
|
| 974 |
+$tpl->assign("output", $output);
|
|
| 975 |
+ |
|
| 976 |
+$tpl->printToScreen(); |
|
| 977 |
+if(isset($_GET['step']) && $_GET['step'] > 2) dbclose( ); |
|
| 976 | 978 |
?> |
| 977 | 979 |
\ No newline at end of file |
| ... | ... |
@@ -1,200 +1,209 @@ |
| 1 |
-<?php |
|
| 2 |
-include(_BASEDIR."version.php"); |
|
| 3 |
- |
|
| 4 |
-$defaulttitles = array("welcome" => "Welcome", "copyright" => "Copyright Footer", "printercopyright" => "Printer Friendly Copyright",
|
|
| 5 |
-"help" => "Help", "rules" => "{sitename} Submission Rules", "thankyou" => "{sitename} Acceptance Letter", "nothankyou" => "Rejection Letter",
|
|
| 6 |
-"tos" => "Terms of Service"); |
|
| 7 |
- |
|
| 8 |
-define("_ALTER11CHARACTERS", "Altering fanfiction_characters table");
|
|
| 9 |
-define("_ALTER11CATEGORIES", "Altering fanfiction_categories table");
|
|
| 10 |
-define("_ALTER11RATINGS", "Altering ratings table.");
|
|
| 11 |
-define("_DONE", "Done!");
|
|
| 12 |
-define("_ERROR_CONFIGWRITE", "ERROR! Could not open config.php for writing.");
|
|
| 13 |
-define("_CONFIG_WRITTEN", "Configuration file written.");
|
|
| 14 |
-define("_MANUAL2", "manual");
|
|
| 15 |
-define("_ADMINACCT", "Set-up Admin Account");
|
|
| 16 |
-define("_AUTO", "automatic");
|
|
| 17 |
-define("_PAGE", "Page");
|
|
| 18 |
-define("_BLOCK", "Block");
|
|
| 19 |
-define("_MESSAGE", "Message");
|
|
| 20 |
-define("_RESULT", "Result");
|
|
| 21 |
-define("_FIELD", "Field");
|
|
| 22 |
-define("_AUTHORFIELDS", "Install Author Profile Fields");
|
|
| 23 |
-define("_FIELDDATAINFO", "This step installs the default field options for the profile pages. You can add, edit, or delete fields from the admin panel.");
|
|
| 24 |
-define("_FIELDUPDATE", "If you have already added additional fields other than the ones listed above to your site, you may wish to manually add those fields to the database in the fanfiction_authorfields table before continuing. The next step will move the data from the authors table to the new format. Also make sure your name for the field and the name given by the update script match.");
|
|
| 25 |
-define("_FIELDMANUAL", "Manually install the default field data provided in authorfields.sql in the docs/ folder.");
|
|
| 26 |
-define("_FIELDAUTOFAIL", "If a field failed to install, please manually install it using the information in authorfields.sql in the docs/ folder now.");
|
|
| 27 |
-define("_AUTHORUPDATE", "Populate Author Preferences Table");
|
|
| 28 |
-define("_AUTHORUPDATEINFO", "This step populates the fanfiction_authorprefs and fanfiction_authorinfo tables with information from the authors table.");
|
|
| 29 |
-define("_AUTHORRESULT", "Author preferences moved.");
|
|
| 30 |
-define("_AUTHORDROPRESULT", "Columns dropped from authors table.");
|
|
| 31 |
-define("_BLOCKDATA", "Install Block Data");
|
|
| 32 |
-define("_BLOCKDATAUPGRADE", "This step will move your block data from 2.0 into the database. You may change these settings at any time
|
|
| 33 |
- using the Block admin interface in your admin area."); |
|
| 34 |
-define("_BLOCKDATANEW", "This step will install the default block data. You may change these settings at any time using the Block admin interface in your admin area.");
|
|
| 35 |
-define("_BLOCKDATAFAILUPGRADE", "If a block failed to install, please use the default data for blocks provided in the information in blocks.sql file in the docs/ folder to install it manually now.");
|
|
| 36 |
-define("_BLOCKDATAMANUAL", "Manually install the default data for the blocks provided in the information in tables.sql found in the docs/ folder now.");
|
|
| 37 |
-define("_CHALLENGESALTER", "Added column 'responses' to stories table.");
|
|
| 38 |
-define("_CHALLENGESETTING", "Added column 'anonchallenges' to settings table.");
|
|
| 39 |
-define("_CHALLENGEUPDATE", "Update Challenge Data");
|
|
| 40 |
-define("_CHALLENGEUPDATEINFO", "This step updates the challenges table to add a new column for responses, and updates the data to include a count of responses and switches the character info to the charid values.");
|
|
| 41 |
-define("_CHALLENGESEMPTY", "No challenges found. The new challenges module will not be installed. If you wish to use challenges in the future, install the module using the install.php file in the modules/challenges/ folder.");
|
|
| 42 |
-define("_CONFIG1DETECTED", "eFiction 1.1 config file detected.<br /><a href='upgrade11.php'>Continue with upgrade.</a>");
|
|
| 43 |
-define("_CONFIG2DETECTED", "eFiction 2.0 config file detected.<br /><a href='upgrade20.php'>Continue with upgrade.</a>");
|
|
| 44 |
-define("_CONFIGFAILED", "Cannot connect to the database. The information you supplied appears to be incorrect. Please try again.");
|
|
| 45 |
-define("_CONFIGDATA", "Configuration File Setup");
|
|
| 46 |
-define("_CONFIGSUCCESS", "Configuration file written.");
|
|
| 47 |
-define("_DBHOST", "Database Host:");
|
|
| 48 |
-define("_DBNAME", "Database Name:");
|
|
| 49 |
-define("_DBUSER", "Database User:");
|
|
| 50 |
-define("_DBPASS", "Database Password:");
|
|
| 51 |
-define("_DROPGENRES", "Drop genres table");
|
|
| 52 |
-define("_DROPWARNINGS", "Drop warnings table");
|
|
| 53 |
-define("_DROPGWSTORIES", "Dropped 'wid' and 'gid' from stories table.");
|
|
| 54 |
-define("_DROPGWSERIES", "Dropped 'wid' and 'gid' from series table.");
|
|
| 55 |
-define("_FAVUPDATE", "Update Favorites Table");
|
|
| 56 |
-define("_FAVUPDATEINFO", "This step moves the favorites information into the new favorites table and removes the old favstor, favseries, and favauth tables.");
|
|
| 57 |
-define("_FAVUPDATEINFO11", "This step moves the favorites information into the new favorites table and removes the old favstor and favauth tables.");
|
|
| 58 |
-define("_FAV1", "Favorite stories information moved.");
|
|
| 59 |
-define("_FAV2", "Favorite series information moved.");
|
|
| 60 |
-define("_FAV3", "Favorite authors information moved.");
|
|
| 61 |
-define("_FAV4", "Table favstor dropped.");
|
|
| 62 |
-define("_FAV5", "Table favseries dropped.");
|
|
| 63 |
-define("_FAV6", "Table favauth dropped.");
|
|
| 64 |
-define("_INSTALLTABLES", "Install Tables");
|
|
| 65 |
-define("_LINKDATA", "Install Navigation Link Data");
|
|
| 66 |
-define("_LINKDATAINFO", "This step will install the default navigation link data. You may change these settings at any time
|
|
| 67 |
- using the Page Links admin interface in your admin area."); |
|
| 68 |
-define("_LINKMANUAL", "Manually install the default data for the navigation links provided in the information in pagelinks.sql found in the docs/ folder now.");
|
|
| 69 |
-define("_LINKSETUP", "How do you want to install the page links data?");
|
|
| 70 |
-define("_LINKAUTOFAIL", "If a link failed to install, please use the default data for pagelinks provided in the information in pagelinks.sql file in the docs/ folder to install it manually now.");
|
|
| 71 |
-define("_MESSAGEDATA", "Message Data");
|
|
| 72 |
-define("_MESSAGEMANUAL", "Manually install the messages from the messages.sql file found in the docs/ folder now.");
|
|
| 73 |
-define("_MESSAGEDATAUPGRADE", "This step will move the default messages for your site into the database. You may change these texts at any time using the Settings admin interface in your admin area.");
|
|
| 74 |
-define("_MESSAGEDATANEW", "This step will install the default messages for your site. You may change these texts at any time using the Settings admin interface in your admin area.");
|
|
| 75 |
-define("_MESSAGEAUTOFAILUPGRADE", "If one of the default messages failed to install, you may use the default data for messages provided in the information in messages.sql file in the docs/ folder to install it manually now or add it through the admin panel later.");
|
|
| 76 |
-define("_MISCDBUPDATE", "Misc. Database Updates");
|
|
| 77 |
-define("_MISCDBUPDATEINFO", "This step will alter fields in several tables to keep the database smaller. How do you wish to proceed?");
|
|
| 78 |
-define("_MISCDBUPDATEMANUAL", "You may manually alter your database now using the information in docs/upgrade11_step18.sql.");
|
|
| 79 |
-define("_MOVECLASSES", "Move Genres and Warnings");
|
|
| 80 |
-define("_MOVECLASSESINFO", "This step moves your genres and warnings information into the the new classes tables.");
|
|
| 81 |
-define("_MOVECLASSFAIL", "If any of the genres or warnings failed to be moved, manually insert them now.");
|
|
| 82 |
-define("_NEWSUPDATE", "Update News Comments");
|
|
| 83 |
-define("_NEWSUPDATEINFO", "This step change the uname field in the comments table to be uid and populates it with the uid of the person rather than penname.");
|
|
| 84 |
-define("_NEWSUPDATERESULT", "News comments updated.");
|
|
| 85 |
-define("_NEWTABLESSETUP", "How do you want to install the new tables?");
|
|
| 86 |
-define("_NEWTABLESMANUAL", "Manually install the tables from the upgrade20_step4.sql file found in the docs/ folder now.");
|
|
| 87 |
-define("_NEWTABLEAUTOFAIL", "If a table failed to install, please use the upgrade20_step4.sql file in the docs/ folder to install it manually now.");
|
|
| 88 |
-define("_NEWTABLEAUTOFAIL11", "If a table failed to install, please use the upgrade11_step4.sql file in the docs/ folder to install it manually now.");
|
|
| 89 |
-define("_OPTIMIZEDB", "Optimize Database");
|
|
| 90 |
-define("_OPTIMIZEINFO", "This step will optimize the database through the removal of some indexes on the tables and the addition of a number of new ones. How do you want to optimize the database?");
|
|
| 91 |
-define("_OPTIMIZEMANUAL", "Manually optimize the database now using the optimize.sql found in the docs/ folder now.");
|
|
| 92 |
- |
|
| 93 |
-define("_PANELDATA", "Install Panel Data");
|
|
| 94 |
-define("_PANELDATAINFO", "This step will install the default configuration of panels for the admin area, user account area, top 10 lists
|
|
| 95 |
- and user profile page. You may change these settings at any time using the panels admin interface in your admin area."); |
|
| 96 |
-define("_PANELSETUP", "How do you want to install the panel data?");
|
|
| 97 |
-define("_PANELMANUAL", "Manually install the default data for panels provided in the information in panels.sql found in the docs/ folder now.");
|
|
| 98 |
-define("_PANELAUTOFAIL", "If a panel failed to install, please use the default data for panels provided in the information in panels.sql file in the docs/ folder to install it manually now.");
|
|
| 99 |
-define("_REVIEWUPDATE", "Update Reviews Table and Data");
|
|
| 100 |
-define("_REVIEWALTER1", "Column 'sid' changed to 'item'");
|
|
| 101 |
-define("_REVIEWALTER2", "Added column 'type'");
|
|
| 102 |
-define("_REVIEWALTER3", "Column 'member' changed to 'uid'");
|
|
| 103 |
-define("_REVIEWALTER4", "Drop column 'seriesid'");
|
|
| 104 |
-define("_REVIEWALTER5", "Add column 'respond'");
|
|
| 105 |
-define("_REVIEWALTER6", "Column 'sid' changed to 'chapid'");
|
|
| 106 |
-define("_REVIEWALTER7", "Column 'psid' changed to 'item'");
|
|
| 107 |
-define("_REVIEWUPDATE1", "Set type to 'ST' for all story reviews.");
|
|
| 108 |
-define("_REVIEWUPDATE2", "Set item to seriesid and type to 'SE' for all series reviews.");
|
|
| 109 |
-define("_REVIEWUPDATE3", "Mark all reviews with author's responses as responded to.");
|
|
| 110 |
-define("_REVIEWUPDATEINFO", "This step will alter the reviews table then convert all reviews in the table to the new format.");
|
|
| 111 |
-define("_SERIESREVIEWS", "Update Series Review");
|
|
| 112 |
-define("_SERIESREVIEWSINFO", "This step updates the series reviews and ratings to include the reviews and ratings of included stories and series.");
|
|
| 113 |
-define("_SETTINGSPREFIX", "Settings Table Prefix:");
|
|
| 114 |
-define("_SETTINGSTABLE", "Create Settings Table"); // Added 01/15/07
|
|
| 115 |
-define("_SETTINGSTABLEMANUAL", "Manually install the settings table from the tables.sql file found in the docs/ folder now.");
|
|
| 116 |
-define("_SETTINGSTABLEMANUALUP", "Manually install the settings table from the settingstable.sql file found in the docs/ folder now.");
|
|
| 117 |
-define("_SETTINGSTABLENOTE", "You may set a prefix for your settings table different from the other tables in your eFiction install. This will allow you to share the settings table between multiple installs of eFiction in the same database.");
|
|
| 118 |
-define("_SETTINGSTABLESETUP", "How do you want to install the settings table?");
|
|
| 119 |
-define("_SETTINGSTABLESUCCESS", "Settings table created successfully!");
|
|
| 120 |
-define("_SETTINGSTABLEAUTOFAIL", "Automatic creation of settings table failed! Please create this table manually.");
|
|
| 121 |
-define("_SITESETTINGSMOVED", "Site settings have been moved to settings table.");
|
|
| 122 |
-define("_SITEKEYNOTE", "You may use the randomly generated key or choose one of your own.");
|
|
| 123 |
-define("_SKINWARNING", "<strong>Note:</strong> eFiction ".$version." will require you to make some updates to your skins. You are <strong>highly</strong> encouraged to choose one of the skins included in the download as default until you can upgrade your skins.");
|
|
| 124 |
-define("_STORIESPATHNOTWRITABLE", "The folder in which you wish to store your stories may not be writable! You must CHMOD this folder to 777 (on some systems 755) to be able to write stories to the folder!");
|
|
| 125 |
-define("_STORIESUPDATED", "The stories have been updated.");
|
|
| 126 |
-define("_TABLESMANUAL", "Manually install the tables found in the docs/ folder now.");
|
|
| 127 |
-define("_TABLESINSTALL", "Install the database tables.");
|
|
| 128 |
-define("_TABLEFAILED", "If a table failed to install, please use the tables.sql file in the docs/ folder to install it manually now.");
|
|
| 129 |
-define("_UPDATECATORDER", "Update Categories Order");
|
|
| 130 |
-define("_UPDATECATORDERINFO", "<strong>Note:</strong> This will <u>NOT</u> affect how your categories are displayed on screen, merely how that information is stored in the database.");
|
|
| 131 |
-define("_UPDATESTORIES", "Update Story and Series Information");
|
|
| 132 |
-define("_UPDATESTORIES11", "Update Stories");
|
|
| 133 |
-define("_UPDATESTORIES11INFO", "This step will update the data for your stories and alter some of the fields in the table. This will be done in batches of 200 with the database alterations done at the end.");
|
|
| 134 |
-define("_UPDATESTORIESINFO", "This step will update the data for your stories converting the names of genres, warnings, characters, and ratings to id numbers. This will be done in batches of 200 stories.");
|
|
| 135 |
-define("_UPDATESTORIESTABLE", "Update Stories and Series Tables");
|
|
| 136 |
-define("_UPDATESTORIESTABLEINFO", "This step will create the classes column in your stories and series tables. How do you want to proceed?");
|
|
| 137 |
-define("_UPDATESTORIESTABLEMANUAL", "Manually update your stories table from the upgrade20_step10.sql file in the docs/ folder now.");
|
|
| 138 |
-define("_UPDATESTORIESTABLE11", "Update Stories Table");
|
|
| 139 |
-define("_UPDATESTORIESTABLEINFO11", "This step will modify the stories table to conform to eFiction ".$version.". How do you want to proceed?");
|
|
| 140 |
-define("UPDATESTORIESTABLEMANUAL11", "Manually update your stories table from the upgrade11_step12.sql file in the docs/ folder now.");
|
|
| 141 |
-define("_UPGRADEEND","You may now delete the following files and directories:<br />
|
|
| 142 |
-<ul style='text-align: left !important; width: 60%; margin: 1em auto;'> |
|
| 143 |
-<li>messages/ folder</li> |
|
| 144 |
-<li>your databasepath folder and dbconfig.php file</li> |
|
| 145 |
-<li>blocks_config.php</li> |
|
| 146 |
-<li>categories.php (handled through browse.php)</li> |
|
| 147 |
-<li>formselect.js</li> |
|
| 148 |
-<li>func.naughty.php</li> |
|
| 149 |
-<li>func.pagemenu.php</li> |
|
| 150 |
-<li>func.ratingpics.php</li> |
|
| 151 |
-<li>functions.php</li> |
|
| 152 |
-<li>func.reviewform.php</li> |
|
| 153 |
-<li>help.php (saved in the database now)</li> |
|
| 154 |
-<li>javascript.js (A new version has been placed in the includes/ folder)</li> |
|
| 155 |
-<li>lib/ folder</li> |
|
| 156 |
-<li>members_list.php (A new version has been placed in the includes/ folder)</li> |
|
| 157 |
-<li>naughtywords.php</li> |
|
| 158 |
-<li>seriesblock.php (A new version has been placed in the includes/ folder)</li> |
|
| 159 |
-<li>storyblock.php (A new version has been placed in the includes/ folder)</li> |
|
| 160 |
-<li>submission.php (saved in the database now)</li> |
|
| 161 |
-<li>timefunctions.php</li> |
|
| 162 |
-<li>titles.php (handled through browse.php)</li> |
|
| 163 |
-<li>tos.php (saved in the database now)</li> |
|
| 164 |
-<li><strong>install/ folder</strong></li> |
|
| 165 |
-</ul> |
|
| 166 |
-<p>You are also encouraged to CHMOD config.php to 644 as a security measure.</p> |
|
| 167 |
-<p><a href='../index.php'>Return to your Site.</a></p"); |
|
| 168 |
- |
|
| 169 |
-define("_UPGRADE11END", "You may now delete the following files and directories:<br />
|
|
| 170 |
-<ul style='text-align: left !important; width: 60%; margin: 1em auto;'> |
|
| 171 |
-<li>adminfunctions.php</li> |
|
| 172 |
-<li>adminheader.php</li> |
|
| 173 |
-<li>adminnews.php</li> |
|
| 174 |
-<li>adminstories.php</li> |
|
| 175 |
-<li>adminusers.php</li> |
|
| 176 |
-<li>blocks.php</li> |
|
| 177 |
-<li>categories.php (handled through browse.php)</li> |
|
| 178 |
-<li>functions.php</li> |
|
| 179 |
-<li>help.php (saved in the database now)</li> |
|
| 180 |
-<li>javascript.js (A new version has been placed in the includes/ folder)</li> |
|
| 181 |
-<li>langadmin.php</li> |
|
| 182 |
-<li>languser.php</li> |
|
| 183 |
-<li>lib/ folder</li> |
|
| 184 |
-<li>phpinfo.php <strong>(Poses a security risk!)</strong></li> |
|
| 185 |
-<li>storyblock.php (A new version has been placed in the includes/ folder)</li> |
|
| 186 |
-<li>timefunctions.php</li> |
|
| 187 |
-<li>titles.php (handled through browse.php)</li> |
|
| 188 |
-<li>install/ folder<strong>(Poses a security risk!)</strong></li> |
|
| 189 |
-<li>your databasepath folder and dbconfig.php file</li> |
|
| 190 |
-</ul><p><a href='../index.php'>Return to your Site.</a></p> |
|
| 191 |
-<p>You are also encouraged to CHMOD config.php to 644 as a security measure.</p> |
|
| 192 |
-<p><a href='../index.php'>Return to your Site.</a></p>"); |
|
| 193 |
-define("_HELP_DBHOST", "The host server for your mySQL database. Generally 'localhost' is the most likely setting unless your web host has informed you differently.");
|
|
| 194 |
-define("_HELP_DBNAME", "This should be the name of your database. You should have already created the database before starting this install. You will most likely create your database through your web host's control panel.");
|
|
| 195 |
-define("_HELP_DBUSER", "This is the user you (or your webhost) assigned to the database when it was created.");
|
|
| 196 |
-define("_HELP_DBPASS", "This is the password for the database user.");
|
|
| 197 |
-define("_HELP_INSTALL_SITEKEY", "The sitekey will be used to access the settings for your site. It is also used to prevent crossed member logins when two or more sites are installed on the same domain. You <strong>must</strong> have a <strong>unique</strong> sitekey for each eFiction site! If you leave this blank, the script will randomly generate another one for you.");
|
|
| 198 |
-define("_HELP_SETTINGSPREFIX", "This allows you to define a separate prefix for the settings table. This allows you to share the settings table among more than one eFiction site in the same database.");
|
|
| 199 |
- |
|
| 200 |
-?> |
|
| 201 | 1 |
\ No newline at end of file |
| 2 |
+<?php |
|
| 3 |
+include(_BASEDIR."version.php"); |
|
| 4 |
+ |
|
| 5 |
+$defaulttitles = array("welcome" => "Welcome", "copyright" => "Copyright Footer", "printercopyright" => "Printer Friendly Copyright",
|
|
| 6 |
+"help" => "Help", "rules" => "{sitename} Submission Rules", "thankyou" => "{sitename} Acceptance Letter", "nothankyou" => "Rejection Letter",
|
|
| 7 |
+"tos" => "Terms of Service"); |
|
| 8 |
+ |
|
| 9 |
+define("_ALTER11CHARACTERS", "Altering fanfiction_characters table");
|
|
| 10 |
+define("_ALTER11CATEGORIES", "Altering fanfiction_categories table");
|
|
| 11 |
+define("_ALTER11RATINGS", "Altering ratings table.");
|
|
| 12 |
+define("_DONE", "Done!");
|
|
| 13 |
+define("_ERROR_CONFIGWRITE", "ERROR! Could not open config.php for writing.");
|
|
| 14 |
+define("_CONFIG_WRITTEN", "Configuration file written.");
|
|
| 15 |
+define("_MANUAL2", "manual");
|
|
| 16 |
+define("_ADMINACCT", "Set-up Admin Account");
|
|
| 17 |
+define("_AUTO", "automatic");
|
|
| 18 |
+define("_PAGE", "Page");
|
|
| 19 |
+define("_BLOCK", "Block");
|
|
| 20 |
+define("_MESSAGE", "Message");
|
|
| 21 |
+define("_RESULT", "Result");
|
|
| 22 |
+define("_FIELD", "Field");
|
|
| 23 |
+define("_AUTHORFIELDS", "Install Author Profile Fields");
|
|
| 24 |
+define("_FIELDDATAINFO", "This step installs the default field options for the profile pages. You can add, edit, or delete fields from the admin panel.");
|
|
| 25 |
+define("_FIELDUPDATE", "If you have already added additional fields other than the ones listed above to your site, you may wish to manually add those fields to the database in the fanfiction_authorfields table before continuing. The next step will move the data from the authors table to the new format. Also make sure your name for the field and the name given by the update script match.");
|
|
| 26 |
+define("_FIELDMANUAL", "Manually install the default field data provided in authorfields.sql in the docs/ folder.");
|
|
| 27 |
+define("_FIELDAUTOFAIL", "If a field failed to install, please manually install it using the information in authorfields.sql in the docs/ folder now.");
|
|
| 28 |
+define("_AUTHORUPDATE", "Populate Author Preferences Table");
|
|
| 29 |
+define("_AUTHORUPDATEINFO", "This step populates the fanfiction_authorprefs and fanfiction_authorinfo tables with information from the authors table.");
|
|
| 30 |
+define("_AUTHORRESULT", "Author preferences moved.");
|
|
| 31 |
+define("_AUTHORDROPRESULT", "Columns dropped from authors table.");
|
|
| 32 |
+define("_BLOCKDATA", "Install Block Data");
|
|
| 33 |
+define("_BLOCKDATAUPGRADE", "This step will move your block data from 2.0 into the database. You may change these settings at any time
|
|
| 34 |
+ using the Block admin interface in your admin area."); |
|
| 35 |
+define("_BLOCKDATANEW", "This step will install the default block data. You may change these settings at any time using the Block admin interface in your admin area.");
|
|
| 36 |
+define("_BLOCKDATAFAILUPGRADE", "If a block failed to install, please use the default data for blocks provided in the information in blocks.sql file in the docs/ folder to install it manually now.");
|
|
| 37 |
+define("_BLOCKDATAMANUAL", "Manually install the default data for the blocks provided in the information in tables.sql found in the docs/ folder now.");
|
|
| 38 |
+define("_CHALLENGESALTER", "Added column 'responses' to stories table.");
|
|
| 39 |
+define("_CHALLENGESETTING", "Added column 'anonchallenges' to settings table.");
|
|
| 40 |
+define("_CHALLENGEUPDATE", "Update Challenge Data");
|
|
| 41 |
+define("_CHALLENGEUPDATEINFO", "This step updates the challenges table to add a new column for responses, and updates the data to include a count of responses and switches the character info to the charid values.");
|
|
| 42 |
+define("_CHALLENGESEMPTY", "No challenges found. The new challenges module will not be installed. If you wish to use challenges in the future, install the module using the install.php file in the modules/challenges/ folder.");
|
|
| 43 |
+define("_CONFIG1DETECTED", "eFiction 1.1 config file detected.<br /><a href='upgrade11.php'>Continue with upgrade.</a>");
|
|
| 44 |
+define("_CONFIG2DETECTED", "eFiction 2.0 config file detected.<br /><a href='upgrade20.php'>Continue with upgrade.</a>");
|
|
| 45 |
+define("_CONFIGFAILED", "Cannot connect to the database. The information you supplied appears to be incorrect. Please try again.");
|
|
| 46 |
+define("_CONFIGDATA", "Configuration File Setup");
|
|
| 47 |
+define("_CONFIGSUCCESS", "Configuration file written.");
|
|
| 48 |
+define("_DBHOST", "Database Host:");
|
|
| 49 |
+define("_DBNAME", "Database Name:");
|
|
| 50 |
+define("_DBUSER", "Database User:");
|
|
| 51 |
+define("_DBPASS", "Database Password:");
|
|
| 52 |
+define("_DROPGENRES", "Drop genres table");
|
|
| 53 |
+define("_DROPWARNINGS", "Drop warnings table");
|
|
| 54 |
+define("_DROPGWSTORIES", "Dropped 'wid' and 'gid' from stories table.");
|
|
| 55 |
+define("_DROPGWSERIES", "Dropped 'wid' and 'gid' from series table.");
|
|
| 56 |
+define("_FAVUPDATE", "Update Favorites Table");
|
|
| 57 |
+define("_FAVUPDATEINFO", "This step moves the favorites information into the new favorites table and removes the old favstor, favseries, and favauth tables.");
|
|
| 58 |
+define("_FAVUPDATEINFO11", "This step moves the favorites information into the new favorites table and removes the old favstor and favauth tables.");
|
|
| 59 |
+define("_FAV1", "Favorite stories information moved.");
|
|
| 60 |
+define("_FAV2", "Favorite series information moved.");
|
|
| 61 |
+define("_FAV3", "Favorite authors information moved.");
|
|
| 62 |
+define("_FAV4", "Table favstor dropped.");
|
|
| 63 |
+define("_FAV5", "Table favseries dropped.");
|
|
| 64 |
+define("_FAV6", "Table favauth dropped.");
|
|
| 65 |
+define("_INSTALLTABLES", "Install Tables");
|
|
| 66 |
+define("_LINKDATA", "Install Navigation Link Data");
|
|
| 67 |
+define("_LINKDATAINFO", "This step will install the default navigation link data. You may change these settings at any time
|
|
| 68 |
+ using the Page Links admin interface in your admin area."); |
|
| 69 |
+define("_LINKMANUAL", "Manually install the default data for the navigation links provided in the information in pagelinks.sql found in the docs/ folder now.");
|
|
| 70 |
+define("_LINKSETUP", "How do you want to install the page links data?");
|
|
| 71 |
+define("_LINKAUTOFAIL", "If a link failed to install, please use the default data for pagelinks provided in the information in pagelinks.sql file in the docs/ folder to install it manually now.");
|
|
| 72 |
+define("_MESSAGEDATA", "Message Data");
|
|
| 73 |
+define("_MESSAGEMANUAL", "Manually install the messages from the messages.sql file found in the docs/ folder now.");
|
|
| 74 |
+define("_MESSAGEDATAUPGRADE", "This step will move the default messages for your site into the database. You may change these texts at any time using the Settings admin interface in your admin area.");
|
|
| 75 |
+define("_MESSAGEDATANEW", "This step will install the default messages for your site. You may change these texts at any time using the Settings admin interface in your admin area.");
|
|
| 76 |
+define("_MESSAGEAUTOFAILUPGRADE", "If one of the default messages failed to install, you may use the default data for messages provided in the information in messages.sql file in the docs/ folder to install it manually now or add it through the admin panel later.");
|
|
| 77 |
+define("_MISCDBUPDATE", "Misc. Database Updates");
|
|
| 78 |
+define("_MISCDBUPDATEINFO", "This step will alter fields in several tables to keep the database smaller. How do you wish to proceed?");
|
|
| 79 |
+define("_MISCDBUPDATEMANUAL", "You may manually alter your database now using the information in docs/upgrade11_step18.sql.");
|
|
| 80 |
+define("_MOVECLASSES", "Move Genres and Warnings");
|
|
| 81 |
+define("_MOVECLASSESINFO", "This step moves your genres and warnings information into the the new classes tables.");
|
|
| 82 |
+define("_MOVECLASSFAIL", "If any of the genres or warnings failed to be moved, manually insert them now.");
|
|
| 83 |
+define("_NEWSUPDATE", "Update News Comments");
|
|
| 84 |
+define("_NEWSUPDATEINFO", "This step change the uname field in the comments table to be uid and populates it with the uid of the person rather than penname.");
|
|
| 85 |
+define("_NEWSUPDATERESULT", "News comments updated.");
|
|
| 86 |
+define("_NEWTABLESSETUP", "How do you want to install the new tables?");
|
|
| 87 |
+define("_NEWTABLESMANUAL", "Manually install the tables from the upgrade20_step4.sql file found in the docs/ folder now.");
|
|
| 88 |
+define("_NEWTABLEAUTOFAIL", "If a table failed to install, please use the upgrade20_step4.sql file in the docs/ folder to install it manually now.");
|
|
| 89 |
+define("_NEWTABLEAUTOFAIL11", "If a table failed to install, please use the upgrade11_step4.sql file in the docs/ folder to install it manually now.");
|
|
| 90 |
+define("_OPTIMIZEDB", "Optimize Database");
|
|
| 91 |
+define("_OPTIMIZEINFO", "This step will optimize the database through the removal of some indexes on the tables and the addition of a number of new ones. How do you want to optimize the database?");
|
|
| 92 |
+define("_OPTIMIZEMANUAL", "Manually optimize the database now using the optimize.sql found in the docs/ folder now.");
|
|
| 93 |
+ |
|
| 94 |
+define("_PANELDATA", "Install Panel Data");
|
|
| 95 |
+define("_PANELDATAINFO", "This step will install the default configuration of panels for the admin area, user account area, top 10 lists
|
|
| 96 |
+ and user profile page. You may change these settings at any time using the panels admin interface in your admin area."); |
|
| 97 |
+define("_PANELSETUP", "How do you want to install the panel data?");
|
|
| 98 |
+define("_PANELMANUAL", "Manually install the default data for panels provided in the information in panels.sql found in the docs/ folder now.");
|
|
| 99 |
+define("_PANELAUTOFAIL", "If a panel failed to install, please use the default data for panels provided in the information in panels.sql file in the docs/ folder to install it manually now.");
|
|
| 100 |
+define("_REVIEWUPDATE", "Update Reviews Table and Data");
|
|
| 101 |
+define("_REVIEWALTER1", "Column 'sid' changed to 'item'");
|
|
| 102 |
+define("_REVIEWALTER2", "Added column 'type'");
|
|
| 103 |
+define("_REVIEWALTER3", "Column 'member' changed to 'uid'");
|
|
| 104 |
+define("_REVIEWALTER4", "Drop column 'seriesid'");
|
|
| 105 |
+define("_REVIEWALTER5", "Add column 'respond'");
|
|
| 106 |
+define("_REVIEWALTER6", "Column 'sid' changed to 'chapid'");
|
|
| 107 |
+define("_REVIEWALTER7", "Column 'psid' changed to 'item'");
|
|
| 108 |
+define("_REVIEWUPDATE1", "Set type to 'ST' for all story reviews.");
|
|
| 109 |
+define("_REVIEWUPDATE2", "Set item to seriesid and type to 'SE' for all series reviews.");
|
|
| 110 |
+define("_REVIEWUPDATE3", "Mark all reviews with author's responses as responded to.");
|
|
| 111 |
+define("_REVIEWUPDATEINFO", "This step will alter the reviews table then convert all reviews in the table to the new format.");
|
|
| 112 |
+define("_SERIESREVIEWS", "Update Series Review");
|
|
| 113 |
+define("_SERIESREVIEWSINFO", "This step updates the series reviews and ratings to include the reviews and ratings of included stories and series.");
|
|
| 114 |
+define("_SETTINGSPREFIX", "Settings Table Prefix:");
|
|
| 115 |
+define("_SETTINGSTABLE", "Create Settings Table"); // Added 01/15/07
|
|
| 116 |
+define("_SETTINGSTABLEMANUAL", "Manually install the settings table from the tables.sql file found in the docs/ folder now.");
|
|
| 117 |
+define("_SETTINGSTABLEMANUALUP", "Manually install the settings table from the settingstable.sql file found in the docs/ folder now.");
|
|
| 118 |
+define("_SETTINGSTABLENOTE", "You may set a prefix for your settings table different from the other tables in your eFiction install. This will allow you to share the settings table between multiple installs of eFiction in the same database.");
|
|
| 119 |
+define("_SETTINGSTABLESETUP", "How do you want to install the settings table?");
|
|
| 120 |
+define("_SETTINGSTABLESUCCESS", "Settings table created successfully!");
|
|
| 121 |
+define("_SETTINGSTABLEAUTOFAIL", "Automatic creation of settings table failed! Please create this table manually.");
|
|
| 122 |
+define("_SITESETTINGSMOVED", "Site settings have been moved to settings table.");
|
|
| 123 |
+define("_SITEKEYNOTE", "You may use the randomly generated key or choose one of your own.");
|
|
| 124 |
+define("_SKINWARNING", "<strong>Note:</strong> eFiction ".$version." will require you to make some updates to your skins. You are <strong>highly</strong> encouraged to choose one of the skins included in the download as default until you can upgrade your skins.");
|
|
| 125 |
+define("_STORIESPATHNOTWRITABLE", "The folder in which you wish to store your stories may not be writable! You must CHMOD this folder to 777 (on some systems 755) to be able to write stories to the folder!");
|
|
| 126 |
+define("_STORIESUPDATED", "The stories have been updated.");
|
|
| 127 |
+define("_TABLESMANUAL", "Manually install the tables found in the docs/ folder now.");
|
|
| 128 |
+define("_TABLESINSTALL", "Install the database tables.");
|
|
| 129 |
+define("_TABLEFAILED", "If a table failed to install, please use the tables.sql file in the docs/ folder to install it manually now.");
|
|
| 130 |
+define("_UPDATECATORDER", "Update Categories Order");
|
|
| 131 |
+define("_UPDATECATORDERINFO", "<strong>Note:</strong> This will <u>NOT</u> affect how your categories are displayed on screen, merely how that information is stored in the database.");
|
|
| 132 |
+define("_UPDATESTORIES", "Update Story and Series Information");
|
|
| 133 |
+define("_UPDATESTORIES11", "Update Stories");
|
|
| 134 |
+define("_UPDATESTORIES11INFO", "This step will update the data for your stories and alter some of the fields in the table. This will be done in batches of 200 with the database alterations done at the end.");
|
|
| 135 |
+define("_UPDATESTORIESINFO", "This step will update the data for your stories converting the names of genres, warnings, characters, and ratings to id numbers. This will be done in batches of 200 stories.");
|
|
| 136 |
+define("_UPDATESTORIESTABLE", "Update Stories and Series Tables");
|
|
| 137 |
+define("_UPDATESTORIESTABLEINFO", "This step will create the classes column in your stories and series tables. How do you want to proceed?");
|
|
| 138 |
+define("_UPDATESTORIESTABLEMANUAL", "Manually update your stories table from the upgrade20_step10.sql file in the docs/ folder now.");
|
|
| 139 |
+define("_UPDATESTORIESTABLE11", "Update Stories Table");
|
|
| 140 |
+define("_UPDATESTORIESTABLEINFO11", "This step will modify the stories table to conform to eFiction ".$version.". How do you want to proceed?");
|
|
| 141 |
+define("UPDATESTORIESTABLEMANUAL11", "Manually update your stories table from the upgrade11_step12.sql file in the docs/ folder now.");
|
|
| 142 |
+define("_UPGRADEEND","You may now delete the following files and directories:<br />
|
|
| 143 |
+<ul style='text-align: left !important; width: 60%; margin: 1em auto;'> |
|
| 144 |
+<li>messages/ folder</li> |
|
| 145 |
+<li>your databasepath folder and dbconfig.php file</li> |
|
| 146 |
+<li>blocks_config.php</li> |
|
| 147 |
+<li>categories.php (handled through browse.php)</li> |
|
| 148 |
+<li>formselect.js</li> |
|
| 149 |
+<li>func.naughty.php</li> |
|
| 150 |
+<li>func.pagemenu.php</li> |
|
| 151 |
+<li>func.ratingpics.php</li> |
|
| 152 |
+<li>functions.php</li> |
|
| 153 |
+<li>func.reviewform.php</li> |
|
| 154 |
+<li>help.php (saved in the database now)</li> |
|
| 155 |
+<li>javascript.js (A new version has been placed in the includes/ folder)</li> |
|
| 156 |
+<li>lib/ folder</li> |
|
| 157 |
+<li>members_list.php (A new version has been placed in the includes/ folder)</li> |
|
| 158 |
+<li>naughtywords.php</li> |
|
| 159 |
+<li>seriesblock.php (A new version has been placed in the includes/ folder)</li> |
|
| 160 |
+<li>storyblock.php (A new version has been placed in the includes/ folder)</li> |
|
| 161 |
+<li>submission.php (saved in the database now)</li> |
|
| 162 |
+<li>timefunctions.php</li> |
|
| 163 |
+<li>titles.php (handled through browse.php)</li> |
|
| 164 |
+<li>tos.php (saved in the database now)</li> |
|
| 165 |
+<li><strong>install/ folder</strong></li> |
|
| 166 |
+</ul> |
|
| 167 |
+<p>You are also encouraged to CHMOD config.php to 644 as a security measure.</p> |
|
| 168 |
+<p><a href='../index.php'>Return to your Site.</a></p"); |
|
| 169 |
+ |
|
| 170 |
+define("_UPGRADE11END", "You may now delete the following files and directories:<br />
|
|
| 171 |
+<ul style='text-align: left !important; width: 60%; margin: 1em auto;'> |
|
| 172 |
+<li>adminfunctions.php</li> |
|
| 173 |
+<li>adminheader.php</li> |
|
| 174 |
+<li>adminnews.php</li> |
|
| 175 |
+<li>adminstories.php</li> |
|
| 176 |
+<li>adminusers.php</li> |
|
| 177 |
+<li>blocks.php</li> |
|
| 178 |
+<li>categories.php (handled through browse.php)</li> |
|
| 179 |
+<li>functions.php</li> |
|
| 180 |
+<li>help.php (saved in the database now)</li> |
|
| 181 |
+<li>javascript.js (A new version has been placed in the includes/ folder)</li> |
|
| 182 |
+<li>langadmin.php</li> |
|
| 183 |
+<li>languser.php</li> |
|
| 184 |
+<li>lib/ folder</li> |
|
| 185 |
+<li>phpinfo.php <strong>(Poses a security risk!)</strong></li> |
|
| 186 |
+<li>storyblock.php (A new version has been placed in the includes/ folder)</li> |
|
| 187 |
+<li>timefunctions.php</li> |
|
| 188 |
+<li>titles.php (handled through browse.php)</li> |
|
| 189 |
+<li>install/ folder<strong>(Poses a security risk!)</strong></li> |
|
| 190 |
+<li>your databasepath folder and dbconfig.php file</li> |
|
| 191 |
+</ul><p><a href='../index.php'>Return to your Site.</a></p> |
|
| 192 |
+<p>You are also encouraged to CHMOD config.php to 644 as a security measure.</p> |
|
| 193 |
+<p><a href='../index.php'>Return to your Site.</a></p>"); |
|
| 194 |
+define("_HELP_DBHOST", "The host server for your mySQL database. Generally 'localhost' is the most likely setting unless your web host has informed you differently.");
|
|
| 195 |
+define("_HELP_DBNAME", "This should be the name of your database. You should have already created the database before starting this install. You will most likely create your database through your web host's control panel.");
|
|
| 196 |
+define("_HELP_DBUSER", "This is the user you (or your webhost) assigned to the database when it was created.");
|
|
| 197 |
+define("_HELP_DBPASS", "This is the password for the database user.");
|
|
| 198 |
+define("_HELP_INSTALL_SITEKEY", "The sitekey will be used to access the settings for your site. It is also used to prevent crossed member logins when two or more sites are installed on the same domain. You <strong>must</strong> have a <strong>unique</strong> sitekey for each eFiction site! If you leave this blank, the script will randomly generate another one for you.");
|
|
| 199 |
+define("_HELP_SETTINGSPREFIX", "This allows you to define a separate prefix for the settings table. This allows you to share the settings table among more than one eFiction site in the same database.");
|
|
| 200 |
+ |
|
| 201 |
+/* LANs from en_admin.php needed in install.php - include all file is not good idea in PHP 8 */ |
|
| 202 |
+define("_SITEKEY", "Site Key");
|
|
| 203 |
+define("_LANGUAGE", "Language");
|
|
| 204 |
+define("_HELP_LANGUAGE", "The language the site will be displayed in. The language files are found in the languages/ folder. You may create your own translations through these files.");
|
|
| 205 |
+ |
|
| 206 |
+/* LANs from en.php needed in STEP 1 */ |
|
| 207 |
+define("_CONTINUE", "Continue");
|
|
| 208 |
+ |
|
| 209 |
+/* Missing LANs - fatal error */ |
|
| 210 |
+define("_EMAILREQUIRED", "Email is required");
|