Browse code

3.5.6 efiction version

Jimako authored on 2024/03/09 16:09:42
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,73 @@
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
+if(isset($_GET['action'])) $current = $_GET['action'];
23
+else $current = "login";
24
+
25
+	if($current == "logout" ) {
26
+		define("_LOGOUTCHECK", true);		
27
+		include("user/logout.php");
28
+	}
29
+	
30
+	if(!empty($_POST['submit']) && $current == "login") {
31
+	session_start();
32
+	define("_LOGINCHECK", true);		
33
+		include("user/login.php");
34
+	}
35
+
36
+require_once("header.php");
37
+//make a new TemplatePower object
38
+if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
39
+else $tpl = new TemplatePower("default_tpls/default.tpl");
40
+if(file_exists("$skindir/listings.tpl")) $tpl->assignInclude( "listings", "./$skindir/listings.tpl" );
41
+else $tpl->assignInclude( "listings", "./default_tpls/listings.tpl" );
42
+include("includes/pagesetup.php");
43
+
44
+if($action) $current = $action;
45
+else $current = "user";
46
+// end main function 
47
+if((empty($action) || $action == "login") && isMEMBER) {
48
+	$output .= "<div id=\"pagetitle\">"._USERACCOUNT."</div>
49
+		<div class=\"tblborder\" id=\"useropts\" style=\"padding: 5px; width: 50%; margin: 1em 25%;\">";
50
+	$panelquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_hidden != '1' AND panel_level = '1' AND (panel_type = 'U' ".(!$submissionsoff || isADMIN ? " OR panel_type = 'S'" : "").($favorites ? " OR panel_type = 'F'" : "").") ORDER BY panel_type, panel_order, panel_title ASC");
51
+	if(!dbnumrows($panelquery)) $output .= _FATALERROR;
52
+	while($panel = dbassoc($panelquery)) {
53
+		if(!$panel['panel_url']) $output .=  "<a href=\"user.php?action=".$panel['panel_name']."\">".$panel['panel_title']."</a><br />\n";
54
+		else $output .= "<a href=\"".$panel['panel_url']."\">".$panel['panel_title']."</a><br />\n";
55
+	}
56
+	$output .= "</div>\n";
57
+}
58
+else if(!empty($action)) {
59
+	$panelquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_name = '$action' AND (panel_type='U' ".(!$submissionsoff || isADMIN ? " OR panel_type = 'S'" : "").($favorites ? " OR panel_type = 'F'" : "").") LIMIT 1");
60
+	if(dbnumrows($panelquery)) {
61
+		$panel = dbassoc($panelquery);
62
+		if($panel['panel_level'] > 0 && !isMEMBER) accessDenied( );
63
+		if($panel['panel_url'] && file_exists(_BASEDIR.$panel['panel_url'])) require_once(_BASEDIR.$panel['panel_url']);
64
+		else if(file_exists("user/{$action}.php")) require_once("user/{$action}.php");
65
+		else $output = write_error(_ERROR);
66
+	}
67
+	else $output .= write_error(_ERROR);
68
+}
69
+else $output = write_error(_NOTAUTHORIZED);
70
+$tpl->assign( "output", $output );
71
+$tpl->printToScreen();
72
+dbclose( );
73
+?>
0 74
\ No newline at end of file