| ... | ... |
@@ -81,6 +81,7 @@ unset($settings['tableprefix']); |
| 81 | 81 |
define("STORIESPATH", $settings['storiespath']);
|
| 82 | 82 |
unset($settings['storiespath']); |
| 83 | 83 |
foreach($settings as $var => $val) {
|
| 84 |
+ if (is_NULL($val)) $val = ''; |
|
| 84 | 85 |
$$var = stripslashes($val); |
| 85 | 86 |
$settings[$var] = htmlspecialchars($val); |
| 86 | 87 |
} |
| ... | ... |
@@ -158,7 +159,10 @@ if($maintenance && !isADMIN && basename($_SERVER['PHP_SELF']) != "maintenance.ph |
| 158 | 159 |
|
| 159 | 160 |
$blockquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_blocks");
|
| 160 | 161 |
while($block = dbassoc($blockquery)) {
|
| 161 |
- $blocks[$block['block_name']] = unserialize($block['block_variables']); |
|
| 162 |
+ if ($block['block_variables']) |
|
| 163 |
+ {
|
|
| 164 |
+ $blocks[$block['block_name']] = unserialize($block['block_variables']); |
|
| 165 |
+ } |
|
| 162 | 166 |
$blocks[$block['block_name']]['title'] = $block['block_title']; |
| 163 | 167 |
$blocks[$block['block_name']]['file'] = $block['block_file']; |
| 164 | 168 |
$blocks[$block['block_name']]['status'] = $block['block_status']; |
| ... | ... |
@@ -215,11 +219,7 @@ if(isset($metaDesc)) echo "<meta name='description' content='$metaDesc'>"; |
| 215 | 219 |
echo "<title>$titleinfo</title>"; |
| 216 | 220 |
|
| 217 | 221 |
// ---------- 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")) |
|
| 222 |
+if (file_exists(_BASEDIR."favicon.ico")) |
|
| 223 | 223 |
{
|
| 224 | 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 | 225 |
} |
| ... | ... |
@@ -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 |
+?> |
| ... | ... |
@@ -38,7 +38,7 @@ if(get_magic_quotes_gpc()){
|
| 38 | 38 |
} |
| 39 | 39 |
|
| 40 | 40 |
// Defines the character set for your language/location |
| 41 |
-define ("_CHARSET", "UTF-8");
|
|
| 41 |
+define ("_CHARSET", "utf-8");
|
|
| 42 | 42 |
|
| 43 | 43 |
// Prevent possible XSS attacks via $_GET. |
| 44 | 44 |
foreach ($_GET as $v) {
|
| ... | ... |
@@ -217,6 +217,7 @@ if($current == "viewuser" && isNumber($uid)) {
|
| 217 | 217 |
$titleinfo = "$sitename :: $penname"; |
| 218 | 218 |
} |
| 219 | 219 |
echo _DOCTYPE."<html><head>"; |
| 220 |
+echo "<meta charset='utf-8' />"; |
|
| 220 | 221 |
if(!isset($titleinfo)) $titleinfo = "$sitename :: $slogan"; |
| 221 | 222 |
if(isset($metaDesc)) echo "<meta name='description' content='$metaDesc'>"; |
| 222 | 223 |
echo "<title>$titleinfo</title>"; |
| ... | ... |
@@ -1,5 +1,4 @@ |
| 1 | 1 |
<?php |
| 2 |
-header('Content-type: text/html; charset=UTF-8');
|
|
| 3 | 2 |
// ---------------------------------------------------------------------- |
| 4 | 3 |
// Copyright (c) 2007 by Tammy Keefer |
| 5 | 4 |
// Based on eFiction 1.1 |
| ... | ... |
@@ -38,6 +37,9 @@ if(get_magic_quotes_gpc()){
|
| 38 | 37 |
} |
| 39 | 38 |
} |
| 40 | 39 |
|
| 40 |
+// Defines the character set for your language/location |
|
| 41 |
+define ("_CHARSET", "UTF-8");
|
|
| 42 |
+ |
|
| 41 | 43 |
// Prevent possible XSS attacks via $_GET. |
| 42 | 44 |
foreach ($_GET as $v) {
|
| 43 | 45 |
if(preg_match('@<script[^>]*?>.*?</script>@si', $v) ||
|
| ... | ... |
@@ -60,11 +62,12 @@ if(ini_get('register_globals')) {
|
| 60 | 62 |
foreach($arrayList as $k => $v) {
|
| 61 | 63 |
unset($GLOBALS[$k]); |
| 62 | 64 |
} |
| 63 |
-} |
|
| 64 |
- |
|
| 65 |
+} |
|
| 66 |
+ |
|
| 65 | 67 |
Header('Cache-Control: private, no-cache, must-revalidate, max_age=0, post-check=0, pre-check=0');
|
| 66 | 68 |
header ("Pragma: no-cache");
|
| 67 | 69 |
header ("Expires: 0");
|
| 70 |
+header("Content-Type: text/html; charset="._CHARSET);
|
|
| 68 | 71 |
|
| 69 | 72 |
// Locate config.php and set the basedir path |
| 70 | 73 |
$folder_level = ""; |
| ... | ... |
@@ -216,9 +219,20 @@ if($current == "viewuser" && isNumber($uid)) {
|
| 216 | 219 |
echo _DOCTYPE."<html><head>"; |
| 217 | 220 |
if(!isset($titleinfo)) $titleinfo = "$sitename :: $slogan"; |
| 218 | 221 |
if(isset($metaDesc)) echo "<meta name='description' content='$metaDesc'>"; |
| 219 |
-echo "<title>$titleinfo</title> |
|
| 220 |
-<link rel=\"shortcut icon\" type=\"image/ico\" href=\"skins/Snow White/images/favicon.ico\" /> |
|
| 221 |
-<meta http-equiv=\"Content-Type\" content=\"text/html; charset=\"UTF-8\">"; |
|
| 222 |
+echo "<title>$titleinfo</title>"; |
|
| 223 |
+ |
|
| 224 |
+// ---------- Favicon --------- |
|
| 225 |
+if (file_exists($skindir."/images/favicon.ico")) |
|
| 226 |
+{
|
|
| 227 |
+ 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"; |
|
| 228 |
+} |
|
| 229 |
+elseif (file_exists(_BASEDIR."favicon.ico")) |
|
| 230 |
+{
|
|
| 231 |
+ 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"; |
|
| 232 |
+} |
|
| 233 |
+ |
|
| 234 |
+ |
|
| 235 |
+echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset="._CHARSET."\">"; |
|
| 222 | 236 |
if(!isset($_GET['action']) || $_GET['action'] != "printable") {
|
| 223 | 237 |
echo "<script language=\"javascript\" type=\"text/javascript\" src=\""._BASEDIR."includes/javascript.js\"></script> |
| 224 | 238 |
<link rel=\"alternate\" type=\"application/rss+xml\" title=\"$sitename RSS Feed\" href=\""._BASEDIR."rss.php\">"; |
| ... | ... |
@@ -420,7 +434,9 @@ a.pophelp:hover span{ /*the span will display just on :hover state*/
|
| 420 | 434 |
} |
| 421 | 435 |
|
| 422 | 436 |
</style> |
| 423 |
-<link rel=\"stylesheet\" type=\"text/css\" href='$skindir/style.css'>"; |
|
| 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 |
+"; |
|
| 424 | 440 |
} |
| 425 | 441 |
echo "</head>"; |
| 426 | 442 |
$headerSent = true; |
| ... | ... |
@@ -431,4 +447,4 @@ if($debug == 1) {
|
| 431 | 447 |
echo "\n<!-- \$_COOKIE \n"; print_r($_COOKIE); echo " -->"; |
| 432 | 448 |
echo "\n<!-- \$_POST \n"; print_r($_POST); echo " -->"; |
| 433 | 449 |
} |
| 434 |
-?> |
|
| 435 | 450 |
\ No newline at end of file |
| 451 |
+?> |
| ... | ... |
@@ -1,4 +1,5 @@ |
| 1 | 1 |
<?php |
| 2 |
+header('Content-type: text/html; charset=UTF-8');
|
|
| 2 | 3 |
// ---------------------------------------------------------------------- |
| 3 | 4 |
// Copyright (c) 2007 by Tammy Keefer |
| 4 | 5 |
// Based on eFiction 1.1 |
| ... | ... |
@@ -64,7 +65,6 @@ if(ini_get('register_globals')) {
|
| 64 | 65 |
Header('Cache-Control: private, no-cache, must-revalidate, max_age=0, post-check=0, pre-check=0');
|
| 65 | 66 |
header ("Pragma: no-cache");
|
| 66 | 67 |
header ("Expires: 0");
|
| 67 |
-header("Content-Type: text/html; charset="._CHARSET);
|
|
| 68 | 68 |
|
| 69 | 69 |
// Locate config.php and set the basedir path |
| 70 | 70 |
$folder_level = ""; |
| ... | ... |
@@ -205,7 +205,7 @@ if($current == "viewstory"){
|
| 205 | 205 |
$filename = basename($titleinfo.".html"); |
| 206 | 206 |
$ie = strpos("msie", strtolower($_SERVER['HTTP_USER_AGENT'])) !== false ? true : false;
|
| 207 | 207 |
if ($ie) $filename = rawurlencode($filename); |
| 208 |
- header("Content-Disposition: inline; filename=\"".$titleinfo."\"");
|
|
| 208 |
+ //header("Content-Disposition: inline; filename=\"".$titleinfo."\"");
|
|
| 209 | 209 |
} |
| 210 | 210 |
} |
| 211 | 211 |
if($current == "viewuser" && isNumber($uid)) {
|
| ... | ... |
@@ -217,12 +217,13 @@ echo _DOCTYPE."<html><head>"; |
| 217 | 217 |
if(!isset($titleinfo)) $titleinfo = "$sitename :: $slogan"; |
| 218 | 218 |
if(isset($metaDesc)) echo "<meta name='description' content='$metaDesc'>"; |
| 219 | 219 |
echo "<title>$titleinfo</title> |
| 220 |
-<meta http-equiv=\"Content-Type\" content=\"text/html; charset="._CHARSET."\">"; |
|
| 220 |
+<link rel=\"shortcut icon\" type=\"image/ico\" href=\"skins/Snow White/images/favicon.ico\" /> |
|
| 221 |
+<meta http-equiv=\"Content-Type\" content=\"text/html; charset=\"UTF-8\">"; |
|
| 221 | 222 |
if(!isset($_GET['action']) || $_GET['action'] != "printable") {
|
| 222 | 223 |
echo "<script language=\"javascript\" type=\"text/javascript\" src=\""._BASEDIR."includes/javascript.js\"></script> |
| 223 | 224 |
<link rel=\"alternate\" type=\"application/rss+xml\" title=\"$sitename RSS Feed\" href=\""._BASEDIR."rss.php\">"; |
| 224 | 225 |
if(!empty($tinyMCE)) {
|
| 225 |
- echo "<script language=\"javascript\" type=\"text/javascript\" src=\""._BASEDIR."tinymce/jscripts/tiny_mce/tiny_mce.js\"></script> |
|
| 226 |
+ echo "<script language=\"javascript\" type=\"text/javascript\" src=\""._BASEDIR."tinymce/js/tinymce/tinymce.min.js\"></script> |
|
| 226 | 227 |
<script language=\"javascript\" type=\"text/javascript\"><!--"; |
| 227 | 228 |
$tinymessage = dbquery("SELECT message_text FROM ".TABLEPREFIX."fanfiction_messages WHERE message_name = 'tinyMCE' LIMIT 1");
|
| 228 | 229 |
list($tinysettings) = dbrow($tinymessage); |
| ... | ... |
@@ -231,28 +232,39 @@ if(!empty($tinyMCE)) {
|
| 231 | 232 |
} |
| 232 | 233 |
else {
|
| 233 | 234 |
echo " |
| 234 |
- tinyMCE.init({
|
|
| 235 |
- theme: 'advanced', |
|
| 236 |
- height: '250', |
|
| 235 |
+ tinymce.init({
|
|
| 236 |
+ selector: 'textarea:not(.mceNoEditor)', |
|
| 237 |
+ menubar: false, |
|
| 237 | 238 |
language: '$language', |
| 238 |
- convert_urls: 'false', |
|
| 239 |
- mode: 'textareas', |
|
| 240 |
- extended_valid_elements: 'a[name|href|target|title]', |
|
| 241 |
- plugins: 'advhr,advimage,advlink,searchreplace,contextmenu,preview,fullscreen,paste".($current == "adminarea" ? ",codeprotect" : "")."', |
|
| 242 |
- theme_advanced_buttons1_add: 'fontsizeselect', |
|
| 243 |
- theme_advanced_buttons2_add: 'separator,pasteword,pastetext', |
|
| 244 |
- theme_advanced_buttons3_add_before: 'tablecontrols,separator', |
|
| 245 |
- theme_advanced_buttons3_add: 'advhr', |
|
| 246 |
- theme_advanced_toolbar_align: 'center', |
|
| 247 |
- theme_advanced_statusbar_location: 'bottom', |
|
| 248 |
- theme_advanced_path: 'false', |
|
| 249 |
- editor_deselector: 'mceNoEditor', |
|
| 250 |
-"; |
|
| 239 |
+ theme: 'modern', |
|
| 240 |
+ skin: 'lightgray', |
|
| 241 |
+ min_height: 200, |
|
| 242 |
+ plugins: [ |
|
| 243 |
+ 'autolink lists link image charmap paste preview hr anchor pagebreak', |
|
| 244 |
+ 'searchreplace wordcount visualblocks visualchars code fullscreen', |
|
| 245 |
+ 'insertdatetime media nonbreaking save table contextmenu directionality', |
|
| 246 |
+ 'emoticons template textcolor colorpicker textpattern imagetools toc textcolor table' |
|
| 247 |
+ ], |
|
| 248 |
+ 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', |
|
| 249 |
+ paste_retain_style_properties : 'all', |
|
| 250 |
+ paste_strip_class_attributes: 'none', |
|
| 251 |
+ toolbar1: 'undo redo | insert styleselect | bold italic underline strikethrough | link image | alignleft aligncenter alignright alignjustify', |
|
| 252 |
+ toolbar2: 'preview | bullist numlist | forecolor backcolor emoticons | fontselect | fontsizeselect wordcount', |
|
| 253 |
+ image_advtab: true, |
|
| 254 |
+ templates: [ |
|
| 255 |
+ { title: 'Test template 1', content: 'Test 1' },
|
|
| 256 |
+ { title: 'Test template 2', content: 'Test 2' }
|
|
| 257 |
+ ], |
|
| 258 |
+ content_css: [ |
|
| 259 |
+ '//fonts.googleapis.com/css?family=Lato:300,300i,400,400i', |
|
| 260 |
+ '//www.tinymce.com/css/codepen.min.css' |
|
| 261 |
+ ],"; |
|
| 251 | 262 |
if(USERUID) |
| 252 | 263 |
echo " external_image_list_url : '".STORIESPATH."/".USERUID."/images/imagelist.js',"; |
| 253 | 264 |
echo " |
| 254 |
- theme_advanced_resizing: true,".($current == "adminarea" ? "\n\t\tentity_encoding: 'raw'" : "\n\t\tinvalid_elements: 'script,object,applet,iframe'")." |
|
| 265 |
+ theme_modern_resizing: true,".($current == "adminarea" ? "\n\t\tentity_encoding: 'raw'" : "\n\t\tinvalid_elements: 'script,object,applet,iframe'")." |
|
| 255 | 266 |
}); |
| 267 |
+ |
|
| 256 | 268 |
"; |
| 257 | 269 |
} |
| 258 | 270 |
echo " |
| ... | ... |
@@ -266,6 +278,17 @@ var tinyMCEmode = true; |
| 266 | 278 |
tinyMCE.execCommand('mceRemoveControl', false, id);
|
| 267 | 279 |
} |
| 268 | 280 |
"; |
| 281 |
+/*echo " |
|
| 282 |
+var tinyMCEmode = true; |
|
| 283 |
+ function toogleEditorMode(id) {
|
|
| 284 |
+ var elm = document.getElementById(id); |
|
| 285 |
+ |
|
| 286 |
+ if (tinyMCE.get(id) == null) |
|
| 287 |
+ tinyMCE.execCommand('mceAddControl', false, id);
|
|
| 288 |
+ else |
|
| 289 |
+ tinyMCE.execCommand('mceRemoveControl', false, id);
|
|
| 290 |
+ } |
|
| 291 |
+";*/ |
|
| 269 | 292 |
echo " --></script>"; |
| 270 | 293 |
} |
| 271 | 294 |
} |
| ... | ... |
@@ -325,7 +348,7 @@ document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
|
| 325 | 348 |
} |
| 326 | 349 |
else {
|
| 327 | 350 |
echo "<style type=\"text/css\"> |
| 328 |
-#columncontainer { margin: 1em auto; width: auto;}
|
|
| 351 |
+#columncontainer { margin: 1em auto; width: auto; padding: 5%;}
|
|
| 329 | 352 |
#browseblock, #memberblock { width: 100%; padding: 0; margin: 0; float: left; border: 0px solid transparent; }
|
| 330 | 353 |
.column { float: left; width: ".($colwidth - 1)."%; }
|
| 331 | 354 |
html>body .column { width: $colwidth%; }
|
| ... | ... |
@@ -333,7 +356,7 @@ html>body .column { width: $colwidth%; }
|
| 333 | 356 |
#settingsform { margin: 0; padding: 0; border: none; }
|
| 334 | 357 |
#settingsform FORM { width: 100%; margin: 0 10%; }
|
| 335 | 358 |
#settingsform LABEL { float: left; display: block; width: 30%; text-align: right; padding-right: 10px; clear: left; }
|
| 336 |
-#settingsform DIV { margin: 1ex auto; clear: both;}
|
|
| 359 |
+#settingsform DIV { clear: both;}
|
|
| 337 | 360 |
#settingsform .fieldset SPAN { float: left; display: block; width: 30%; text-align: right; padding-right: 10px; clear: left;}
|
| 338 | 361 |
#settingsform .fieldset LABEL { float: none; width: auto; display: inline; text-align: left; clear: none; }
|
| 339 | 362 |
#settingsform { float: left; margin: 1ex 10%; }
|
| ... | ... |
@@ -397,9 +420,7 @@ a.pophelp:hover span{ /*the span will display just on :hover state*/
|
| 397 | 420 |
} |
| 398 | 421 |
|
| 399 | 422 |
</style> |
| 400 |
-<link rel='stylesheet' type='text/css' href='$skindir/style.css' /> \n |
|
| 401 |
-<meta name='viewport' content='width=device-width, initial-scale=1.0' /> |
|
| 402 |
-"; |
|
| 423 |
+<link rel=\"stylesheet\" type=\"text/css\" href='$skindir/style.css'>"; |
|
| 403 | 424 |
} |
| 404 | 425 |
echo "</head>"; |
| 405 | 426 |
$headerSent = true; |
| ... | ... |
@@ -410,4 +431,4 @@ if($debug == 1) {
|
| 410 | 431 |
echo "\n<!-- \$_COOKIE \n"; print_r($_COOKIE); echo " -->"; |
| 411 | 432 |
echo "\n<!-- \$_POST \n"; print_r($_POST); echo " -->"; |
| 412 | 433 |
} |
| 413 |
-?> |
|
| 434 |
+?> |
|
| 414 | 435 |
\ No newline at end of file |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,413 @@ |
| 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 |
+// Prevent possible XSS attacks via $_GET. |
|
| 41 |
+foreach ($_GET as $v) {
|
|
| 42 |
+ if(preg_match('@<script[^>]*?>.*?</script>@si', $v) ||
|
|
| 43 |
+ preg_match("'@<iframe[^>]*?>.*?</script>@si'", $v) ||
|
|
| 44 |
+ preg_match("'@<applet[^>]*?>.*?</script>@si'", $v) ||
|
|
| 45 |
+ preg_match("'@<meta[^>]*?>.*?</script>@si'", $v) ||
|
|
| 46 |
+ preg_match('@<[\/\!]*?[^<>]*?>@si', $v) ||
|
|
| 47 |
+ preg_match('@<style[^>]*?>.*?</style>@siU', $v) ||
|
|
| 48 |
+ preg_match('@<![\s\S]*?--[ \t\n\r]*>@', $v)) {
|
|
| 49 |
+ include("languages/en.php"); // no language set yet, so default to English.
|
|
| 50 |
+ die (_POSSIBLEHACK); |
|
| 51 |
+ } |
|
| 52 |
+} |
|
| 53 |
+unset($v); |
|
| 54 |
+ |
|
| 55 |
+if(!isset($_SESSION)) session_start(); |
|
| 56 |
+// clear the global variables if register globals is on. |
|
| 57 |
+if(ini_get('register_globals')) {
|
|
| 58 |
+ $arrayList = array_merge($_SESSION, $_GET, $_POST, $_COOKIE); |
|
| 59 |
+ foreach($arrayList as $k => $v) {
|
|
| 60 |
+ unset($GLOBALS[$k]); |
|
| 61 |
+ } |
|
| 62 |
+} |
|
| 63 |
+ |
|
| 64 |
+Header('Cache-Control: private, no-cache, must-revalidate, max_age=0, post-check=0, pre-check=0');
|
|
| 65 |
+header ("Pragma: no-cache");
|
|
| 66 |
+header ("Expires: 0");
|
|
| 67 |
+header("Content-Type: text/html; charset="._CHARSET);
|
|
| 68 |
+ |
|
| 69 |
+// Locate config.php and set the basedir path |
|
| 70 |
+$folder_level = ""; |
|
| 71 |
+while (!file_exists($folder_level."header.php")) { $folder_level .= "../"; }
|
|
| 72 |
+if(!defined("_BASEDIR")) define("_BASEDIR", $folder_level);
|
|
| 73 |
+ |
|
| 74 |
+@ include_once(_BASEDIR."config.php"); |
|
| 75 |
+if(empty($sitekey)) {
|
|
| 76 |
+ header("Location: install/install.php");
|
|
| 77 |
+ exit( ); |
|
| 78 |
+} |
|
| 79 |
+if(isset($skin)) $globalskin = $skin; |
|
| 80 |
+$settingsresults = dbquery("SELECT * FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".$sitekey."'");
|
|
| 81 |
+$settings = dbassoc($settingsresults); |
|
| 82 |
+if(!defined("SITEKEY")) define("SITEKEY", $settings['sitekey']);
|
|
| 83 |
+unset($settings['sitekey']); |
|
| 84 |
+if(!defined("TABLEPREFIX")) define("TABLEPREFIX", $settings['tableprefix']);
|
|
| 85 |
+unset($settings['tableprefix']); |
|
| 86 |
+define("STORIESPATH", $settings['storiespath']);
|
|
| 87 |
+unset($settings['storiespath']); |
|
| 88 |
+foreach($settings as $var => $val) {
|
|
| 89 |
+ $$var = stripslashes($val); |
|
| 90 |
+ $settings[$var] = htmlspecialchars($val); |
|
| 91 |
+} |
|
| 92 |
+ |
|
| 93 |
+if(isset($_GET['debug'])) $debug = 1; |
|
| 94 |
+if(!$displaycolumns) $displaycolumns = 1; // shouldn't happen, but just in case. |
|
| 95 |
+if($words) $words = explode(", ", $words);
|
|
| 96 |
+else $words = array( ); |
|
| 97 |
+// Fix for sites with 2.0 or 1.1 running as well as 3.0 with register_globals on. |
|
| 98 |
+$defaultskin = $skin; |
|
| 99 |
+ |
|
| 100 |
+if(isset($globalskin)) $skin = $globalskin; |
|
| 101 |
+ |
|
| 102 |
+if(isset($_GET['action'])) $action = strip_tags($_GET['action']); |
|
| 103 |
+else $action = false; |
|
| 104 |
+ |
|
| 105 |
+if(file_exists(_BASEDIR."languages/{$language}.php")) include (_BASEDIR."languages/{$language}.php");
|
|
| 106 |
+else include (_BASEDIR."languages/en.php"); |
|
| 107 |
+ |
|
| 108 |
+include_once(_BASEDIR."includes/queries.php"); |
|
| 109 |
+include_once(_BASEDIR."includes/corefunctions.php"); |
|
| 110 |
+ |
|
| 111 |
+// Check and/or set some variables used at various points throughout the script |
|
| 112 |
+if(isset($_GET['offset'])) $offset = $_GET['offset']; |
|
| 113 |
+if(!isset($offset) || !isNumber($offset)) $offset = 0; |
|
| 114 |
+if(isset($_REQUEST["sid"])) $sid = $_REQUEST["sid"]; |
|
| 115 |
+if(isset($sid) && !isNumber($sid)) unset($sid); |
|
| 116 |
+if(isset($_REQUEST['seriesid'])) $seriesid = $_REQUEST["seriesid"]; |
|
| 117 |
+if(isset($seriesid) && !isNumber($seriesid)) unset($seriesid); |
|
| 118 |
+if(isset($_REQUEST['uid'])) $uid = $_REQUEST["uid"]; |
|
| 119 |
+if(isset($uid) && !isNumber($uid)) unset($uid); |
|
| 120 |
+if(isset($_REQUEST['chapid'])) $chapid = $_REQUEST["chapid"]; |
|
| 121 |
+if(isset($chapid) && !isNumber($chapid)) unset($chapid); |
|
| 122 |
+$let = false; |
|
| 123 |
+if(isset($_GET['let'])) $let = $_GET['let']; |
|
| 124 |
+if(isset($let) && !in_array($let, $alphabet)) $let = false; |
|
| 125 |
+$output = ""; |
|
| 126 |
+ |
|
| 127 |
+// Cleans these two variables of possible XSS attacks. |
|
| 128 |
+if(isset($_SERVER['PHP_SELF'])) $_SERVER['PHP_SELF'] = htmlspecialchars(descript($_SERVER['PHP_SELF']), ENT_QUOTES); |
|
| 129 |
+if(isset($PHP_SELF)) $PHP_SELF = htmlspecialchars(descript($PHP_SELF), ENT_QUOTES); |
|
| 130 |
+ |
|
| 131 |
+// Set these variables to start. |
|
| 132 |
+$agecontsent = false; $viewed = false; |
|
| 133 |
+ |
|
| 134 |
+require_once("includes/get_session_vars.php");
|
|
| 135 |
+ |
|
| 136 |
+if(isset($_GET['skin'])) {
|
|
| 137 |
+ $siteskin = $_GET['skin']; |
|
| 138 |
+ $_SESSION[SITEKEY."_skin"] = $siteskin; |
|
| 139 |
+} |
|
| 140 |
+ |
|
| 141 |
+$v = explode(".", $version);
|
|
| 142 |
+include("version.php");
|
|
| 143 |
+$newV = explode(".", $version);
|
|
| 144 |
+//if($v[0] == $newV[0] && ($v[1] < $newV[1] || (isset($newV[2]) && $v[2] < $newV[2]))) {
|
|
| 145 |
+foreach($newV AS $k => $l) {
|
|
| 146 |
+ if($newV[$k] > $v[$k] || (!empty($newV[$k]) && empty($v[$k]))) {
|
|
| 147 |
+ if(isADMIN && basename($_SERVER['PHP_SELF']) != "update.php") {
|
|
| 148 |
+ header("Location: update.php");
|
|
| 149 |
+ exit( ); |
|
| 150 |
+ } |
|
| 151 |
+ else if(!isADMIN && basename($_SERVER['PHP_SELF']) != "maintenance.php" && !(isset($_GET['action']) && $_GET['action'] == "login")) {
|
|
| 152 |
+ header("Location: maintenance.php");
|
|
| 153 |
+ exit( ); |
|
| 154 |
+ } |
|
| 155 |
+ } |
|
| 156 |
+} |
|
| 157 |
+ |
|
| 158 |
+if(!empty($_SESSION[SITEKEY."_skin"])) $siteskin = $_SESSION[SITEKEY."_skin"]; |
|
| 159 |
+if($maintenance && !isADMIN && basename($_SERVER['PHP_SELF']) != "maintenance.php" && !(isset($_GET['action']) && $_GET['action'] == "login")) {
|
|
| 160 |
+ header("Location: maintenance.php");
|
|
| 161 |
+ exit( ); |
|
| 162 |
+} |
|
| 163 |
+ |
|
| 164 |
+$blockquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_blocks");
|
|
| 165 |
+while($block = dbassoc($blockquery)) {
|
|
| 166 |
+ $blocks[$block['block_name']] = unserialize($block['block_variables']); |
|
| 167 |
+ $blocks[$block['block_name']]['title'] = $block['block_title']; |
|
| 168 |
+ $blocks[$block['block_name']]['file'] = $block['block_file']; |
|
| 169 |
+ $blocks[$block['block_name']]['status'] = $block['block_status']; |
|
| 170 |
+} |
|
| 171 |
+ |
|
| 172 |
+// This session variable is used to track the story views |
|
| 173 |
+if(isset($_SESSION[SITEKEY."_viewed"])) $viewed = $_SESSION[SITEKEY."_viewed"]; |
|
| 174 |
+ |
|
| 175 |
+if(isset($_GET['ageconsent'])) $_SESSION[SITEKEY."_ageconsent"] = 1; |
|
| 176 |
+if(isset($_GET['warning'])) $_SESSION[SITEKEY."_warned"][$_GET['warning']] = 1; |
|
| 177 |
+ |
|
| 178 |
+if(file_exists("languages/{$language}.php")) require_once ("languages/{$language}.php");
|
|
| 179 |
+else require_once ("languages/en.php");
|
|
| 180 |
+if(is_dir(_BASEDIR."skins/$siteskin")) $skindir = _BASEDIR."skins/$siteskin"; |
|
| 181 |
+else if(is_dir(_BASEDIR."skins/".$settings['skin'])) $skindir = _BASEDIR."skins/".$defaultskin; |
|
| 182 |
+else $skindir = _BASEDIR."default_tpls"; |
|
| 183 |
+if(USERUID) {
|
|
| 184 |
+ $prefs = dbquery("SELECT sortby, storyindex, tinyMCE FROM ".TABLEPREFIX."fanfiction_authorprefs WHERE uid = '".USERUID."'");
|
|
| 185 |
+ if(dbnumrows($prefs)) list($defaultsort, $displayindex, $tinyMCE) = dbrow($prefs); |
|
| 186 |
+} |
|
| 187 |
+if(isset($_REQUEST['sort'])) $defaultsort = $_REQUEST['sort'] == "update" ? 1 : 0; |
|
| 188 |
+define("_ORDERBY", " ORDER BY ".($defaultsort == 1 ? "updated DESC" : "stories.title ASC"));
|
|
| 189 |
+if($current == "viewstory"){
|
|
| 190 |
+ if(isset($chapid)) {
|
|
| 191 |
+ $squery = dbquery("SELECT sid, inorder FROM ".TABLEPREFIX."fanfiction_chapters WHERE chapid = ".$chapid." LIMIT 1");
|
|
| 192 |
+ list($sid, $chapter) = dbrow($squery); |
|
| 193 |
+ } |
|
| 194 |
+ $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");
|
|
| 195 |
+ if($story = dbassoc($titlequery)) {
|
|
| 196 |
+ $authlink[] = $story['penname']; |
|
| 197 |
+ if($story['coauthors']) {
|
|
| 198 |
+ $coquery = dbquery("SELECT "._PENNAMEFIELD." as penname FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_coauthors as ca ON "._UIDFIELD." = ca.uid WHERE ca.sid = '$sid'");
|
|
| 199 |
+ while($co = dbassoc($coquery)) {
|
|
| 200 |
+ $authlink[] = $co['penname']; |
|
| 201 |
+ } |
|
| 202 |
+ } |
|
| 203 |
+ $titleinfo = stripslashes($story['title'])." "._BY." ".implode(", ", $authlink);
|
|
| 204 |
+ $metaDesc = htmlspecialchars(stripslashes($story['summary'])); |
|
| 205 |
+ $filename = basename($titleinfo.".html"); |
|
| 206 |
+ $ie = strpos("msie", strtolower($_SERVER['HTTP_USER_AGENT'])) !== false ? true : false;
|
|
| 207 |
+ if ($ie) $filename = rawurlencode($filename); |
|
| 208 |
+ header("Content-Disposition: inline; filename=\"".$titleinfo."\"");
|
|
| 209 |
+ } |
|
| 210 |
+} |
|
| 211 |
+if($current == "viewuser" && isNumber($uid)) {
|
|
| 212 |
+ $author = dbquery("SELECT "._PENNAMEFIELD." as penname FROM "._AUTHORTABLE." WHERE "._UIDFIELD." = '".$uid."'");
|
|
| 213 |
+ list($penname) = dbrow($author); |
|
| 214 |
+ $titleinfo = "$sitename :: $penname"; |
|
| 215 |
+} |
|
| 216 |
+echo _DOCTYPE."<html><head>"; |
|
| 217 |
+if(!isset($titleinfo)) $titleinfo = "$sitename :: $slogan"; |
|
| 218 |
+if(isset($metaDesc)) echo "<meta name='description' content='$metaDesc'>"; |
|
| 219 |
+echo "<title>$titleinfo</title> |
|
| 220 |
+<meta http-equiv=\"Content-Type\" content=\"text/html; charset="._CHARSET."\">"; |
|
| 221 |
+if(!isset($_GET['action']) || $_GET['action'] != "printable") {
|
|
| 222 |
+echo "<script language=\"javascript\" type=\"text/javascript\" src=\""._BASEDIR."includes/javascript.js\"></script> |
|
| 223 |
+<link rel=\"alternate\" type=\"application/rss+xml\" title=\"$sitename RSS Feed\" href=\""._BASEDIR."rss.php\">"; |
|
| 224 |
+if(!empty($tinyMCE)) {
|
|
| 225 |
+ echo "<script language=\"javascript\" type=\"text/javascript\" src=\""._BASEDIR."tinymce/jscripts/tiny_mce/tiny_mce.js\"></script> |
|
| 226 |
+ <script language=\"javascript\" type=\"text/javascript\"><!--"; |
|
| 227 |
+ $tinymessage = dbquery("SELECT message_text FROM ".TABLEPREFIX."fanfiction_messages WHERE message_name = 'tinyMCE' LIMIT 1");
|
|
| 228 |
+ list($tinysettings) = dbrow($tinymessage); |
|
| 229 |
+ if(!empty($tinysettings) && $current != "adminarea") {
|
|
| 230 |
+ echo $tinysettings; |
|
| 231 |
+ } |
|
| 232 |
+ else {
|
|
| 233 |
+ echo " |
|
| 234 |
+ tinyMCE.init({
|
|
| 235 |
+ theme: 'advanced', |
|
| 236 |
+ height: '250', |
|
| 237 |
+ language: '$language', |
|
| 238 |
+ convert_urls: 'false', |
|
| 239 |
+ mode: 'textareas', |
|
| 240 |
+ extended_valid_elements: 'a[name|href|target|title]', |
|
| 241 |
+ plugins: 'advhr,advimage,advlink,searchreplace,contextmenu,preview,fullscreen,paste".($current == "adminarea" ? ",codeprotect" : "")."', |
|
| 242 |
+ theme_advanced_buttons1_add: 'fontsizeselect', |
|
| 243 |
+ theme_advanced_buttons2_add: 'separator,pasteword,pastetext', |
|
| 244 |
+ theme_advanced_buttons3_add_before: 'tablecontrols,separator', |
|
| 245 |
+ theme_advanced_buttons3_add: 'advhr', |
|
| 246 |
+ theme_advanced_toolbar_align: 'center', |
|
| 247 |
+ theme_advanced_statusbar_location: 'bottom', |
|
| 248 |
+ theme_advanced_path: 'false', |
|
| 249 |
+ editor_deselector: 'mceNoEditor', |
|
| 250 |
+"; |
|
| 251 |
+ if(USERUID) |
|
| 252 |
+ echo " external_image_list_url : '".STORIESPATH."/".USERUID."/images/imagelist.js',"; |
|
| 253 |
+ echo " |
|
| 254 |
+ theme_advanced_resizing: true,".($current == "adminarea" ? "\n\t\tentity_encoding: 'raw'" : "\n\t\tinvalid_elements: 'script,object,applet,iframe'")." |
|
| 255 |
+ }); |
|
| 256 |
+"; |
|
| 257 |
+ } |
|
| 258 |
+ echo " |
|
| 259 |
+var tinyMCEmode = true; |
|
| 260 |
+ function toogleEditorMode(id) {
|
|
| 261 |
+ var elm = document.getElementById(id); |
|
| 262 |
+ |
|
| 263 |
+ if (tinyMCE.getInstanceById(id) == null) |
|
| 264 |
+ tinyMCE.execCommand('mceAddControl', false, id);
|
|
| 265 |
+ else |
|
| 266 |
+ tinyMCE.execCommand('mceRemoveControl', false, id);
|
|
| 267 |
+ } |
|
| 268 |
+"; |
|
| 269 |
+echo " --></script>"; |
|
| 270 |
+} |
|
| 271 |
+} |
|
| 272 |
+if(isset($displayform) && $displayform == 1) {
|
|
| 273 |
+echo "<script language=\"javascript\" type=\"text/javascript\" src=\""._BASEDIR."includes/xmlhttp.js\"></script>"; |
|
| 274 |
+echo "<script language=\"javascript\" type=\"text/javascript\"> |
|
| 275 |
+lang = new Array( ); |
|
| 276 |
+ |
|
| 277 |
+lang['Back2Cats'] = '"._BACK2CATS."'; |
|
| 278 |
+lang['ChooseCat'] = '"._CHOOSECAT."'; |
|
| 279 |
+lang['Categories'] = '"._CATEGORIES."'; |
|
| 280 |
+lang['Characters'] = '"._CHARACTERS."'; |
|
| 281 |
+lang['MoveTop'] = '"._MOVETOP."'; |
|
| 282 |
+lang['TopLevel'] = '"._TOPLEVEL."'; |
|
| 283 |
+lang['CatLocked'] = '"._CATLOCKED."'; |
|
| 284 |
+basedir = '"._BASEDIR."'; |
|
| 285 |
+ |
|
| 286 |
+categories = new Array( ); |
|
| 287 |
+characters = new Array( ); |
|
| 288 |
+\n"; |
|
| 289 |
+/* |
|
| 290 |
+ $result = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_categories ORDER BY leveldown, displayorder");
|
|
| 291 |
+$x = 0; |
|
| 292 |
+ while($category = dbassoc($result)) {
|
|
| 293 |
+ echo "categories[$x] = new category(".$category['parentcatid'].", ".$category['catid'].", \"". str_replace('"', '\"', stripslashes($category['category']))."\", ".$category['locked'].", ".$category['displayorder'].");\r\n";
|
|
| 294 |
+ $catlist[$category['catid']] = array("name" => stripslashes($category['category']), "pid" => $category['parentcatid'], "locked" => (isADMIN ? 0 : $category['locked']), "order" => $category['displayorder'], "leveldown" => $category['leveldown']);
|
|
| 295 |
+ $x++; |
|
| 296 |
+ } |
|
| 297 |
+$x = 0; |
|
| 298 |
+ $result = dbquery("SELECT charname, catid, charid FROM ".TABLEPREFIX."fanfiction_characters ORDER BY charname");
|
|
| 299 |
+ while($char = dbassoc($result)) {
|
|
| 300 |
+ echo "characters[$x] = new character(".$char['charid'].", ".$char['catid'].", \"".str_replace('"', '\"', stripslashes($char['charname']))."\");\r\n";
|
|
| 301 |
+ $charlist[$char['charid']] = array("name" => stripslashes($char['charname']), "catid" => $char['catid']);
|
|
| 302 |
+ $x++; |
|
| 303 |
+ } |
|
| 304 |
+*/ |
|
| 305 |
+echo "</script>"; |
|
| 306 |
+} |
|
| 307 |
+if(file_exists("extra_header.php")) include_once("extra_header.php");
|
|
| 308 |
+if(file_exists("$skindir/extra_header.php")) include_once("$skindir/extra_header.php");
|
|
| 309 |
+if(!$displaycolumns) $displaycolumns = 1; |
|
| 310 |
+$colwidth = floor(100/$displaycolumns); |
|
| 311 |
+if(!empty($_GET['action']) && $_GET['action'] == "printable") {
|
|
| 312 |
+ if(file_exists("$skindir/printable.css")) echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$skindir/printable.css\">";
|
|
| 313 |
+ else echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"default_tpls/printable.css\">"; |
|
| 314 |
+ echo "<script type='text/javascript'> |
|
| 315 |
+<!-- |
|
| 316 |
+if (window.print) {
|
|
| 317 |
+ window.print() ; |
|
| 318 |
+} else {
|
|
| 319 |
+ var WebBrowser = '<OBJECT ID=\"WebBrowser1\" WIDTH=0 HEIGHT=0 CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>'; |
|
| 320 |
+document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
|
|
| 321 |
+ WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = \"\"; |
|
| 322 |
+} |
|
| 323 |
+--> |
|
| 324 |
+</script>"; |
|
| 325 |
+} |
|
| 326 |
+else {
|
|
| 327 |
+echo "<style type=\"text/css\"> |
|
| 328 |
+#columncontainer { margin: 1em auto; width: auto;}
|
|
| 329 |
+#browseblock, #memberblock { width: 100%; padding: 0; margin: 0; float: left; border: 0px solid transparent; }
|
|
| 330 |
+.column { float: left; width: ".($colwidth - 1)."%; }
|
|
| 331 |
+html>body .column { width: $colwidth%; }
|
|
| 332 |
+.cleaner { clear: both; height: 1px; font-size: 1px; margin: 0; padding: 0; background: transparent; }
|
|
| 333 |
+#settingsform { margin: 0; padding: 0; border: none; }
|
|
| 334 |
+#settingsform FORM { width: 100%; margin: 0 10%; }
|
|
| 335 |
+#settingsform LABEL { float: left; display: block; width: 30%; text-align: right; padding-right: 10px; clear: left; }
|
|
| 336 |
+#settingsform DIV { margin: 1ex auto; clear: both;}
|
|
| 337 |
+#settingsform .fieldset SPAN { float: left; display: block; width: 30%; text-align: right; padding-right: 10px; clear: left;}
|
|
| 338 |
+#settingsform .fieldset LABEL { float: none; width: auto; display: inline; text-align: left; clear: none; }
|
|
| 339 |
+#settingsform { float: left; margin: 1ex 10%; }
|
|
| 340 |
+#settingsform .tinytoggle { text-align: center; }
|
|
| 341 |
+#settingsform .tinytoggle LABEL { float: none; display: inline; width: auto; text-align: center; padding: 0; clear: none; }
|
|
| 342 |
+#settingsform #submitdiv { text-align: center; width: 100%;clear: both; height: 3em; }
|
|
| 343 |
+#settingsform #submitdiv #submit { position: absolute; z-index: 10001; margin: 1em; }
|
|
| 344 |
+a.pophelp{
|
|
| 345 |
+ position: relative; /* this is the key*/ |
|
| 346 |
+ vertical-align: super; |
|
| 347 |
+} |
|
| 348 |
+ |
|
| 349 |
+a.pophelp:hover{z-index:100; border: none; text-decoration: none;}
|
|
| 350 |
+ |
|
| 351 |
+a.pophelp span{display: none; position: absolute; top: -25em; left: 20em; }
|
|
| 352 |
+ |
|
| 353 |
+a.pophelp:hover span{ /*the span will display just on :hover state*/
|
|
| 354 |
+ display:block; |
|
| 355 |
+ position: absolute; |
|
| 356 |
+ top: -3em; left: 8em; width: 225px; |
|
| 357 |
+ border:1px solid #000; |
|
| 358 |
+ background-color:#CCC; color:#000; |
|
| 359 |
+ text-decoration: none; |
|
| 360 |
+ text-align: left; |
|
| 361 |
+ padding: 5px; |
|
| 362 |
+ font-weight: normal; |
|
| 363 |
+ visibility: visible; |
|
| 364 |
+} |
|
| 365 |
+.required { color: red; }
|
|
| 366 |
+.shim {
|
|
| 367 |
+ position: absolute; |
|
| 368 |
+ display: none; |
|
| 369 |
+ height: 0; |
|
| 370 |
+ width:0; |
|
| 371 |
+ margin: 0; |
|
| 372 |
+ padding: 0; |
|
| 373 |
+ z-index: 100; |
|
| 374 |
+} |
|
| 375 |
+ |
|
| 376 |
+.ajaxOptList {
|
|
| 377 |
+ background: #CCC; |
|
| 378 |
+ border: 1px solid #000; |
|
| 379 |
+ margin: 0; |
|
| 380 |
+ position: absolute; |
|
| 381 |
+ padding: 0; |
|
| 382 |
+ z-index: 1000; |
|
| 383 |
+ text-align: left; |
|
| 384 |
+} |
|
| 385 |
+.ajaxListOptOver {
|
|
| 386 |
+ padding: 4px; |
|
| 387 |
+ background: #CCC; |
|
| 388 |
+ margin: 0; |
|
| 389 |
+} |
|
| 390 |
+.ajaxListOpt {
|
|
| 391 |
+ background: #EEE; |
|
| 392 |
+ padding: 4px; |
|
| 393 |
+ margin: 0; |
|
| 394 |
+} |
|
| 395 |
+.multiSelect {
|
|
| 396 |
+ width: 300px; |
|
| 397 |
+} |
|
| 398 |
+ |
|
| 399 |
+</style> |
|
| 400 |
+<link rel='stylesheet' type='text/css' href='$skindir/style.css' /> \n |
|
| 401 |
+<meta name='viewport' content='width=device-width, initial-scale=1.0' /> |
|
| 402 |
+"; |
|
| 403 |
+} |
|
| 404 |
+echo "</head>"; |
|
| 405 |
+$headerSent = true; |
|
| 406 |
+include (_BASEDIR."includes/class.TemplatePower.inc.php"); |
|
| 407 |
+if($debug == 1) {
|
|
| 408 |
+ @ error_reporting(E_ALL); |
|
| 409 |
+ echo "\n<!-- \$_SESSION \n"; print_r($_SESSION); echo " -->"; |
|
| 410 |
+ echo "\n<!-- \$_COOKIE \n"; print_r($_COOKIE); echo " -->"; |
|
| 411 |
+ echo "\n<!-- \$_POST \n"; print_r($_POST); echo " -->"; |
|
| 412 |
+} |
|
| 413 |
+?> |