|
1
|
1
|
new file mode 100644
|
|
...
|
...
|
@@ -0,0 +1,451 @@
|
|
|
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
|
+-->
|
|
|
362
|
+</script>";
|
|
|
363
|
+}
|
|
|
364
|
+else {
|
|
|
365
|
+echo "<style type=\"text/css\">
|
|
|
366
|
+#columncontainer { margin: 1em auto; width: auto; padding: 5%;}
|
|
|
367
|
+#browseblock, #memberblock { width: 100%; padding: 0; margin: 0; float: left; border: 0px solid transparent; }
|
|
|
368
|
+.column { float: left; width: ".($colwidth - 1)."%; }
|
|
|
369
|
+html>body .column { width: $colwidth%; }
|
|
|
370
|
+.cleaner { clear: both; height: 1px; font-size: 1px; margin: 0; padding: 0; background: transparent; }
|
|
|
371
|
+#settingsform { margin: 0; padding: 0; border: none; }
|
|
|
372
|
+#settingsform FORM { width: 100%; margin: 0 10%; }
|
|
|
373
|
+#settingsform LABEL { float: left; display: block; width: 30%; text-align: right; padding-right: 10px; clear: left; }
|
|
|
374
|
+#settingsform DIV { clear: both;}
|
|
|
375
|
+#settingsform .fieldset SPAN { float: left; display: block; width: 30%; text-align: right; padding-right: 10px; clear: left;}
|
|
|
376
|
+#settingsform .fieldset LABEL { float: none; width: auto; display: inline; text-align: left; clear: none; }
|
|
|
377
|
+#settingsform { float: left; margin: 1ex 10%; }
|
|
|
378
|
+#settingsform .tinytoggle { text-align: center; }
|
|
|
379
|
+#settingsform .tinytoggle LABEL { float: none; display: inline; width: auto; text-align: center; padding: 0; clear: none; }
|
|
|
380
|
+#settingsform #submitdiv { text-align: center; width: 100%;clear: both; height: 3em; }
|
|
|
381
|
+#settingsform #submitdiv #submit { position: absolute; z-index: 10001; margin: 1em; }
|
|
|
382
|
+a.pophelp{
|
|
|
383
|
+ position: relative; /* this is the key*/
|
|
|
384
|
+ vertical-align: super;
|
|
|
385
|
+}
|
|
|
386
|
+
|
|
|
387
|
+a.pophelp:hover{z-index:100; border: none; text-decoration: none;}
|
|
|
388
|
+
|
|
|
389
|
+a.pophelp span{display: none; position: absolute; top: -25em; left: 20em; }
|
|
|
390
|
+
|
|
|
391
|
+a.pophelp:hover span{ /*the span will display just on :hover state*/
|
|
|
392
|
+ display:block;
|
|
|
393
|
+ position: absolute;
|
|
|
394
|
+ top: -3em; left: 8em; width: 225px;
|
|
|
395
|
+ border:1px solid #000;
|
|
|
396
|
+ background-color:#CCC; color:#000;
|
|
|
397
|
+ text-decoration: none;
|
|
|
398
|
+ text-align: left;
|
|
|
399
|
+ padding: 5px;
|
|
|
400
|
+ font-weight: normal;
|
|
|
401
|
+ visibility: visible;
|
|
|
402
|
+}
|
|
|
403
|
+.required { color: red; }
|
|
|
404
|
+.shim {
|
|
|
405
|
+ position: absolute;
|
|
|
406
|
+ display: none;
|
|
|
407
|
+ height: 0;
|
|
|
408
|
+ width:0;
|
|
|
409
|
+ margin: 0;
|
|
|
410
|
+ padding: 0;
|
|
|
411
|
+ z-index: 100;
|
|
|
412
|
+}
|
|
|
413
|
+
|
|
|
414
|
+.ajaxOptList {
|
|
|
415
|
+ background: #CCC;
|
|
|
416
|
+ border: 1px solid #000;
|
|
|
417
|
+ margin: 0;
|
|
|
418
|
+ position: absolute;
|
|
|
419
|
+ padding: 0;
|
|
|
420
|
+ z-index: 1000;
|
|
|
421
|
+ text-align: left;
|
|
|
422
|
+}
|
|
|
423
|
+.ajaxListOptOver {
|
|
|
424
|
+ padding: 4px;
|
|
|
425
|
+ background: #CCC;
|
|
|
426
|
+ margin: 0;
|
|
|
427
|
+}
|
|
|
428
|
+.ajaxListOpt {
|
|
|
429
|
+ background: #EEE;
|
|
|
430
|
+ padding: 4px;
|
|
|
431
|
+ margin: 0;
|
|
|
432
|
+}
|
|
|
433
|
+.multiSelect {
|
|
|
434
|
+ width: 300px;
|
|
|
435
|
+}
|
|
|
436
|
+
|
|
|
437
|
+</style>
|
|
|
438
|
+<link rel='stylesheet' type='text/css' href='$skindir/style.css' /> \n
|
|
|
439
|
+<meta name='viewport' content='width=device-width, initial-scale=1.0' />
|
|
|
440
|
+";
|
|
|
441
|
+}
|
|
|
442
|
+echo "</head>";
|
|
|
443
|
+$headerSent = true;
|
|
|
444
|
+include (_BASEDIR."includes/class.TemplatePower.inc.php");
|
|
|
445
|
+if($debug == 1) {
|
|
|
446
|
+ @ error_reporting(E_ALL);
|
|
|
447
|
+ echo "\n<!-- \$_SESSION \n"; print_r($_SESSION); echo " -->";
|
|
|
448
|
+ echo "\n<!-- \$_COOKIE \n"; print_r($_COOKIE); echo " -->";
|
|
|
449
|
+ echo "\n<!-- \$_POST \n"; print_r($_POST); echo " -->";
|
|
|
450
|
+}
|
|
|
451
|
+?>
|