Browse code

Restore eFiction 3.x bridges

Clarissa Walker authored on 2026/07/23 10:30:45
Showing 56 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,37 @@
1
+This folder contains the files to replace in your eFiction install to bridge it with 
2
+an installation of SMF.  These files will let you use your SMF members 
3
+table as the authors table for eFiction.  This bridge assumes your SMF intall 
4
+and your eFiction install share the same database.
5
+
6
+Move the following files to the user/ folder in your eFiction install:
7
+
8
+editbio.php
9
+login.php
10
+profile.php
11
+register.php
12
+logout.php
13
+
14
+Move the following files to the includes/ folder in your eFiction install:
15
+
16
+get_session_vars.php
17
+queries.php
18
+
19
+Move the en_SMF.php file to the languages/ folder in your eFiction install.
20
+
21
+Edit queries.php to point to your SMF tables and directory.
22
+
23
+Goto Admin->Page Links and edit your Register and Lost Password links to point to your 
24
+SMF pages.
25
+
26
+Register -> PATHTOSMF/index.php?action=register
27
+Lost Password -> PATHTOSMF/index.php?action=reminder
28
+
29
+If eFiction is a sub-folder under SMF PATHTOSMF will be ../
30
+If they are siblings the path will be ../SMFFOLDER/ where SMFFOLDER is tha name of SMF's folder.
31
+If SMF is a subfolder if eFiction PATHTOSMF will be SMFFOLDER/ where SMFFOLDER is tha name of SMF's folder.
32
+
33
+Move QueryString.php to the Sources folder of your SMF installation. Note this is the QueryString.php 
34
+from version 1.1.2 of SMF.
35
+
36
+
37
+
0 38
new file mode 100644
... ...
@@ -0,0 +1,35 @@
1
+<?php
2
+if(!defined("_CHARSET")) exit( );
3
+
4
+global $language;
5
+$blockquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_blocks WHERE block_name = 'info'");
6
+while($block = dbassoc($blockquery)) {
7
+	$blocks[$block['block_name']] = unserialize($block['block_variables']);
8
+	$blocks[$block['block_name']]['title'] = $block['block_title'];
9
+	 $blocks[$block['block_name']]['file'] = $block['block_file'];
10
+	$blocks[$block['block_name']]['status'] = $block['block_status'];
11
+}
12
+include("blocks/info/info.php");
13
+if(file_exists("blocks/info/{$language}.php")) include_once("blocks/info/{$language}.php");
14
+else include_once("blocks/info/en.php");
15
+	if(isset($_POST['submit'])) {
16
+		$blocks['info']['style'] = !empty($_POST['style']) && isNumber($_POST['style']) ? $_POST['style'] : 0;
17
+		if($_POST['template'] != _NARTEXT) $blocks['info']['template'] = $_POST['template'];
18
+		$output .= "<center>"._ACTIONSUCCESSFUL."</center>";
19
+		save_blocks( $blocks );
20
+	}
21
+	else {
22
+		$style = isset($blocks['info']['style']) ? $blocks['info']['style'] : 0;
23
+		if(empty($blocks['info']['template']) && $style == 1) $template = _NARTEXT;
24
+		else if($style == 1) $template = $blocks['info']['template'];
25
+		else $template = "";
26
+		$output .= "<div style='margin: 1em auto; width: 80%;'><b>"._CURRENT.":</b><br /><div class=\"tblborder\" style=\"text-align: left; padding: 4px; margin: 0 auto;\">$content</div><br />";
27
+		$output .= "<form method='POST' enctype='multipart/form-data' name='blockadmin' action='admin.php?action=blocks&admin=info'>
28
+			<label for='template'>"._TEMPLATE.":</label><br /><textarea name='template' rows='5' cols='50' style='width: 100%;'>$template</textarea>";
29
+		if($tinyMCE) $output .= "<div style='display: block; margin: 0; padding: 0;'><input type='checkbox' name='toggle' onclick=\"toogleEditorMode('template');\" checked><label for='toggle'>"._TINYMCETOGGLE."</label></div>";
30
+		$output .= "<label for='style'>"._DISPLAY.": </label><select name='style'class='textbox' ><option value='0'".(!$style ? " selected" : "").">"._CHART."</option>
31
+				<option value='1'".($style == 1 ? " selected" : "").">"._NARRATIVE."</option>
32
+				<option value='2'".($style == 2 ? " selected" : "").">"._VARIABLES."</option></select><br />
33
+			<INPUT type='submit' class='button' name='submit' value='"._SUBMIT."'></form></div>";
34
+	}
35
+?>
0 36
\ No newline at end of file
1 37
new file mode 100644
... ...
@@ -0,0 +1,41 @@
1
+<?php
2
+
3
+// ----------------------------------------------------------------------
4
+// eFiction 3.2
5
+// Copyright (c) 2007 by Tammy Keefer
6
+// Valid HTML 4.01 Transitional
7
+// Based on eFiction 1.1
8
+// Copyright (C) 2003 by Rebecca Smallwood.
9
+// http://efiction.sourceforge.net/
10
+// ----------------------------------------------------------------------
11
+// LICENSE
12
+//
13
+// This program is free software; you can redistribute it and/or
14
+// modify it under the terms of the GNU General Public License (GPL)
15
+// as published by the Free Software Foundation; either version 2
16
+// of the License, or (at your option) any later version.
17
+//
18
+// This program is distributed in the hope that it will be useful,
19
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
+// GNU General Public License for more details.
22
+//
23
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
24
+// ----------------------------------------------------------------------
25
+
26
+if(!defined("_CHARSET")) exit( );
27
+
28
+
29
+define("_CHART", "Chart");
30
+define("_NARRATIVE", "Narrative");
31
+define("_LOGGEDINAS", "You are currently logged in as");
32
+define("_VARIABLES", "Variables");
33
+define("_DISPLAY",  "Style of Display");
34
+define("_NARTEXT", "We are the home of  {authors} authors from among our {members} members.  There have been {reviews} reviews written about our {stories} stories consisting of {chapters} chapters and {totalwords} words.  A special welcome to our newest member, {newest}. {loggedinas} {submissions}");
35
+define("_NEWESTMEMBER", "Newest Member");
36
+define("_REVIEWERS", "Reviewers");
37
+define("_POSTS", "Forum Posts");
38
+define("_BOARDS", "Forum Boards");
39
+define("_TOPICS", "Forum Topics");
40
+define("_FORUMCATS", "Forum Categories");
41
+?>
0 42
\ No newline at end of file
1 43
new file mode 100644
2 44
new file mode 100644
... ...
@@ -0,0 +1,75 @@
1
+<?php
2
+if(!defined("_CHARSET")) exit( );
3
+
4
+if(file_exists(_BASEDIR."blocks/info/{$language}.php")) include_once(_BASEDIR."blocks/info/{$language}.php");
5
+else include_once(_BASEDIR."blocks/info/en.php");
6
+	global $noskin, $tpl;
7
+
8
+	if(_AUTHORTABLE != TABLEPREFIX."fanfiction_authors") {
9
+		list($members) = dbrow(dbquery("SELECT COUNT("._UIDFIELD.") as members FROM "._AUTHORTABLE));
10
+		list($newest) = dbrow(dbquery("SELECT "._UIDFIELD." as uid FROM "._AUTHORTABLE." ORDER BY "._UIDFIELD." DESC LIMIT 1"));
11
+		dbquery("UPDATE ".TABLEPREFIX."fanfiction_stats SET members = $members, newestmember = '$newest' WHERE sitekey = '".SITEKEY."' LIMIT 1");
12
+	}
13
+	$stats = dbassoc(dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_stats WHERE sitekey = '".SITEKEY."' LIMIT 1"));
14
+	list($newmember) = dbrow(dbquery("SELECT "._PENNAMEFIELD." as penname FROM "._AUTHORTABLE." WHERE "._UIDFIELD." = '".$stats['newestmember']."' LIMIT 1"));
15
+	$adminnotices = "";
16
+	if(isADMIN) {
17
+		if(file_exists(_BASEDIR."languages/".$language."_admin.php")) include_once(_BASEDIR."languages/".$language."_admin.php");
18
+		else include_once(_BASEDIR."languages/en_admin.php");
19
+		$countquery = dbquery("SELECT COUNT(DISTINCT chapid) FROM ".TABLEPREFIX."fanfiction_chapters WHERE validated = '0'");
20
+		list($count) = dbrow($countquery);
21
+		if($count) $adminnotices = sprintf(_QUEUECOUNT, $count);
22
+		$codequery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'adminnotices'");
23
+		while($code = dbassoc($codequery)) {
24
+				eval($code['code_text']);
25
+		}
26
+	}
27
+	$forums = ssi_boardStats("array");
28
+	if(!empty($blocks['info']['style']) && $blocks['info']['style'] == 2) {
29
+		$tpl->assignGlobal("totalstories", $stats['stories']);
30
+		$tpl->assignGlobal("totalauthors", $stats['authors']);
31
+		$tpl->assignGlobal("totalmembers", $stats['members']);
32
+		$tpl->assignGlobal("totalreviews", $stats['reviews']);
33
+		$tpl->assignGlobal("totalreviewers", $stats['reviewers']);	
34
+		$tpl->assignGlobal("totalwords", $stats['wordcount']);
35
+		$tpl->assignGlobal("totalchapters", $stats['chapters']);
36
+		$tpl->assignGlobal("totalseries", $stats['series']);
37
+		$tpl->assignGlobal("totalposts", $forums['posts']);
38
+		$tpl->assignGlobal("totaltopics", $forums['topics']);
39
+		$tpl->assignGlobal("totalboards", $forums['boards']);
40
+		$tpl->assignGlobal("totalforumcategories", $forums['categories']);
41
+		$tpl->assignGlobal("newestmember", "<a href=\"viewuser.php?uid=".$stats['newestmember']."\">$newmember</a>");
42
+		if(isMEMBER) $tpl->assignGlobal("loggedinas", _LOGGEDINAS." ".USERPENNAME.". ".($noskin ? " "._NOSKIN : ""));
43
+		$tpl->assignGlobal("submissions", $adminnotices);
44
+	}
45
+	else {
46
+		if(isMEMBER) $loggedinas = _LOGGEDINAS." ".USERPENNAME.". ".($noskin ? " "._NOSKIN : "");
47
+		else $loggedinas = "";
48
+		if(empty($blocks['info']['style'])) {
49
+			$content = "<div id='infoblock'>
50
+<div><span class='label'>"._MEMBERS.": </span>".$stats['members']."</div>
51
+<div><span class='label'>"._SERIES.": </span>".$stats['series']."</div>
52
+<div><span class='label'>"._STORIES.": </span>".$stats['stories']."</div>
53
+<div><span class='label'>"._CHAPTERS.": </span>".$stats['chapters']."</div>
54
+<div><span class='label'>"._WORDCOUNT.": </span>".$stats['wordcount']."</div>
55
+<div><span class='label'>"._AUTHORS.": </span>".$stats['authors']."</div>
56
+<div><span class='label'>"._REVIEWS.": </span>".$stats['reviews']."</div>
57
+<div><span class='label'>"._REVIEWERS.": </span>".$stats['reviewers']."</div>
58
+<div><span class='label'>"._POSTS.": </span>".$forums['posts']."</div>
59
+<div><span class='label'>"._TOPICS.": </span>".$forums['topics']."</div>
60
+<div><span class='label'>"._BOARDS.": </span>".$forums['boards']."</div>
61
+<div><span class='label'>"._FORUMCATS.": </span>".$forums['categories']."</div>
62
+<div><span class='label'>"._NEWESTMEMBER.": </span><a href=\"viewuser.php?uid=".$stats['newestmember']."\">$newmember</a></div>";
63
+		}
64
+		else if($blocks["info"]["style"] == 1) {
65
+			$replace = array($stats['authors'], $stats['members'], $stats['reviews'], $stats['reviewers'], $stats['wordcount'], $stats['chapters'], $stats['stories'], $stats['series'],"<a href=\"viewuser.php?uid=".$stats['newestmember']."\">$newmember</a>", $loggedinas, $adminnotices, $forums['posts'], $forums['topics'], $forums['boards'], $forums['categories']);
66
+			$search = array("@\{authors\}@", "@\{members\}@", "@\{reviews\}@", "@{reviewers\}@", "@\{totalwords\}@","@\{chapters\}@", "@\{stories\}@", "@\{series\}@", "@\{newest\}@", "@\{loggedinas\}@", "@\{submissions\}@", "@\{posts\}@", "@\{topics\}@", "@\{boards\}@", "@\{forumcats\}@");
67
+			$content = preg_replace($search, $replace, (!empty($blocks['info']['template']) ? stripslashes($blocks['info']['template']) : _NARTEXT));
68
+		}
69
+	}
70
+	$codequery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_codeblocks WHERE code_type = 'sitestats'");
71
+	while($code = dbassoc($codequery)) {
72
+			eval($code['code_text']);
73
+	}
74
+	if(empty($blocks['info']['style'])) $content .= "<div class='cleaner'>&nbsp;</div></div>";
75
+?>
0 76
\ No newline at end of file
1 77
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+<?php
2
+
3
+// ----------------------------------------------------------------------
4
+// eFiction 3.2
5
+// Copyright (c) 2007 by Tammy Keefer
6
+// Valid HTML 4.01 Transitional
7
+// Based on eFiction 1.1
8
+// Copyright (C) 2003 by Rebecca Smallwood.
9
+// http://efiction.sourceforge.net/
10
+// ----------------------------------------------------------------------
11
+// LICENSE
12
+//
13
+// This program is free software; you can redistribute it and/or
14
+// modify it under the terms of the GNU General Public License (GPL)
15
+// as published by the Free Software Foundation; either version 2
16
+// of the License, or (at your option) any later version.
17
+//
18
+// This program is distributed in the hope that it will be useful,
19
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
+// GNU General Public License for more details.
22
+//
23
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
24
+// ----------------------------------------------------------------------
25
+
26
+if(!defined("_CHARSET")) exit( );
27
+
28
+
29
+dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_blocks(`block_name`, `block_title`, `block_status`, `block_file`, `block_variables`) VALUES('info', 'Site Information', '0', 'info/info.php', '');");
30
+?>
0 31
\ No newline at end of file
1 32
new file mode 100644
... ...
@@ -0,0 +1,20 @@
1
+// ----------------------------------------------------------------------
2
+// LICENSE
3
+//
4
+// This program is free software; you can redistribute it and/or
5
+// modify it under the terms of the GNU General Public License (GPL)
6
+// as published by the Free Software Foundation; either version 2
7
+// of the License, or (at your option) any later version.
8
+//
9
+// This program is distributed in the hope that it will be useful,
10
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+// GNU General Public License for more details.
13
+//
14
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
15
+// ----------------------------------------------------------------------
16
+
17
+Copyright 2007 by Tammy Keefer.
18
+
19
+This block for eFiction 3.0 bridged to SMF displays a login block on your
20
+eFiction site that will log you in via your SMF site. 
0 21
\ No newline at end of file
1 22
new file mode 100644
... ...
@@ -0,0 +1,45 @@
1
+<?php
2
+if(!defined("_CHARSET")) exit( );
3
+$blockquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_blocks WHERE block_name = 'login'");
4
+while($block = dbassoc($blockquery)) {
5
+	$blocks[$block['block_name']] = unserialize($block['block_variables']);
6
+	$blocks[$block['block_name']]['title'] = $block['block_title'];
7
+	 $blocks[$block['block_name']]['file'] = $block['block_file'];
8
+	$blocks[$block['block_name']]['status'] = $block['block_status'];
9
+}
10
+global $language;
11
+// Set $loggedin to 0 to see the block
12
+$loggedin = 0;
13
+include("blocks/login/login.php");
14
+// Then set it back to 1. 
15
+$loggedin = 1;
16
+if(file_exists("blocks/login/$language.php")) include("blocks/login/$language.php");
17
+else include("blocks/login/en.php");
18
+	if(isset($_POST['submit'])) {
19
+		$blocks['login']['acctlink'] = $_POST['acctlink'];
20
+		if(empty($_POST['form'])) unset($blocks['login']['form']);
21
+		else $blocks['login']['form'] = $_POST['form'];
22
+		$blocks['login']['template'] = addslashes(descript($_POST['template']));
23
+		save_blocks( $blocks );
24
+		unset($_GET['admin']);
25
+		$output .= write_message(_ACTIONSUCCESSFUL);
26
+	}
27
+	else {
28
+		if(empty($blocks['login']['template'])) $template = "";
29
+		else $template = $blocks['login']['template'];
30
+		$output .= "<div style='text-align: center;'><span class='label'>"._CURRENT.":</span><br /><div class=\"tblborder\" style=\"width: 80%; text-align: left; margin: 1ex auto;\">$content</div></div><br />";
31
+		$output .= _LOGINNOTE."<div id='settingsform'><form method=\"POST\" enctype=\"multipart/form-data\" action=\"admin.php?action=blocks&admin=login\">
32
+			<div><label for=\"template\">"._TEMPLATE.":</label><span style='clear: left;'>&nbsp;</span></div>
33
+			<div class=\"shorttextarea\"><textarea name=\"template\" rows=\"5\" style=\"width: 100%;\" cols=\"40\">".stripslashes($template)."</textarea>";
34
+		if($tinyMCE) 
35
+			$output .= "<div class='tinytoggle'><input type='checkbox' name='toggle' onclick=\"toogleEditorMode('template');\" checked><label for='toggle'>"._TINYMCETOGGLE."</label></div>";
36
+		$output .= "</div>
37
+			<label for=\"form\">"._DEFAULTOPTS.":</label> <select name=\"form\" id=\"form\" class=\"textbox\" ><option value=\"0\"".(empty($blocks['login']['form']) ? " selected" : "").">"._SHORT."</option>
38
+					<option value=\"1\"".(!empty($blocks['login']['form']) ? " selected" : "").">"._LONG."</option>
39
+			</select><br />
40
+			<label for=\"acctlink\">"._ACCTLINK."</label> <select name=\"acctlink\" id=\"acctlink\" class=\"textbox\" ><option value=\"0\"".(empty($blocks['login']['acctlink']) ? " selected" : "").">"._NO."</option>
41
+					<option value=\"1\"".(!empty($blocks['login']['acctlink']) ? " selected" : "").">"._YES."</option>
42
+			</select><br />
43
+			<INPUT type=\"submit\" class=\"button\" id=\"submit\" name=\"submit\" value=\""._SUBMIT."\"></form></div>";
44
+	}
45
+?>
0 46
\ No newline at end of file
1 47
new file mode 100644
... ...
@@ -0,0 +1,34 @@
1
+<?php
2
+
3
+// ----------------------------------------------------------------------
4
+// eFiction 3.2
5
+// Copyright (c) 2007 by Tammy Keefer
6
+// Valid HTML 4.01 Transitional
7
+// Based on eFiction 1.1
8
+// Copyright (C) 2003 by Rebecca Smallwood.
9
+// http://efiction.sourceforge.net/
10
+// ----------------------------------------------------------------------
11
+// LICENSE
12
+//
13
+// This program is free software; you can redistribute it and/or
14
+// modify it under the terms of the GNU General Public License (GPL)
15
+// as published by the Free Software Foundation; either version 2
16
+// of the License, or (at your option) any later version.
17
+//
18
+// This program is distributed in the hope that it will be useful,
19
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
+// GNU General Public License for more details.
22
+//
23
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
24
+// ----------------------------------------------------------------------
25
+
26
+if(!defined("_CHARSET")) exit( );
27
+
28
+
29
+define ("_SHORT", "Short Form");
30
+define ("_LONG", "Long Form");
31
+define ("_ACCTLINK", "Display '".$pagelinks['login']['text']."' link:");
32
+define ("_DEFAULTOPTS", "Default Display Options");
33
+define ("_LOGINNOTE", "The 'short form' will not include the register and lost password links while the 'long form' will.  You may also use the textbox to customize the display."); 
34
+?>
0 35
\ No newline at end of file
1 36
new file mode 100644
2 37
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+<?php
2
+
3
+// ----------------------------------------------------------------------
4
+// eFiction 3.2
5
+// Copyright (c) 2007 by Tammy Keefer
6
+// Valid HTML 4.01 Transitional
7
+// Based on eFiction 1.1
8
+// Copyright (C) 2003 by Rebecca Smallwood.
9
+// http://efiction.sourceforge.net/
10
+// ----------------------------------------------------------------------
11
+// LICENSE
12
+//
13
+// This program is free software; you can redistribute it and/or
14
+// modify it under the terms of the GNU General Public License (GPL)
15
+// as published by the Free Software Foundation; either version 2
16
+// of the License, or (at your option) any later version.
17
+//
18
+// This program is distributed in the hope that it will be useful,
19
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
+// GNU General Public License for more details.
22
+//
23
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
24
+// ----------------------------------------------------------------------
25
+
26
+if(!defined("_CHARSET")) exit( );
27
+
28
+
29
+dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_blocks(`block_name`, `block_title`, `block_status`, `block_file`, `block_variables`) VALUES('login', 'Login', '0', 'login/login.php', '');");
30
+?>
0 31
\ No newline at end of file
1 32
new file mode 100644
... ...
@@ -0,0 +1,22 @@
1
+<?php
2
+if(!defined("_CHARSET")) exit( );
3
+if(!isMEMBER) {
4
+if(!isset($_SESSION)) session_start();
5
+if(isset($_GET['sid']) && isNumber($_GET['sid'])) $_SESSION['login_url'] = $url."/viewstory.php?sid=".$_GET['sid'];
6
+else $_SESSION['login_url'] = $url."/user.php";
7
+	$longform = "{penname} {password} {rememberme} {go} <div id='loginlinks'>{register} | {lostpwd}</div>";
8
+	$shortform = "{penname} {password} {rememberme} {go}";
9
+	$content = "<form method=\"POST\"enctype=\"multipart/form-data\" id=\"loginblock\" action=\"".PATHTOSMF."index.php?action=login2\"><input type=\"hidden\" name=\"cookielength\" value=\"-1\" />";
10
+	$replace = array("<label for=\"penname\">"._PENNAME.":</label><INPUT type=\"text\" class=\"textbox\" name=\"user\" id=\"user\">", 
11
+			"<label for=\"pswd\">"._PASSWORD.":</label><INPUT type=\"password\" class=\"textbox\" id=\"passwrd\" name=\"passwrd\">",
12
+			"<span id='rememberme'><INPUT type=\"checkbox\" class=\"checkbox\" name=\"cookieneverexp\" id=\"cookieneverexp\" value=\"1\"><label for=\"cookieneverexp\">"._REMEMBERME."</label></span>",
13
+			(!empty($pagelinks['register']['link']) ? $pagelinks['register']['link'] : ""), $pagelinks['lostpassword']['link'],
14
+			"<INPUT type=\"submit\" class=\"button\" name=\"submit\" value=\""._GO."\">");
15
+	$search = array("@\{penname\}@", "@\{password\}@", "@\{rememberme\}@", "@\{register\}@", "@\{lostpwd\}@", "@\{go\}@");
16
+	if(!empty($blocks['login']['template'])) $content .= preg_replace($search, $replace, stripslashes($blocks['login']['template']));
17
+	else $content .= preg_replace( $search, $replace , (!empty($blocks['login']['form']) ? $longform : $shortform));		
18
+	$content .= "</form>";
19
+}
20
+else if(!empty($blocks['login']['acctlink'])) $content = $pagelinks['login']['link'];
21
+else $content = "";
22
+?>
0 23
\ No newline at end of file
1 24
new file mode 100644
... ...
@@ -0,0 +1,34 @@
1
+// ----------------------------------------------------------------------
2
+// LICENSE
3
+//
4
+// This program is free software; you can redistribute it and/or
5
+// modify it under the terms of the GNU General Public License (GPL)
6
+// as published by the Free Software Foundation; either version 2
7
+// of the License, or (at your option) any later version.
8
+//
9
+// This program is distributed in the hope that it will be useful,
10
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+// GNU General Public License for more details.
13
+//
14
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
15
+// ----------------------------------------------------------------------
16
+
17
+Copyright 2006 by Tammy Keefer.
18
+
19
+This block for eFiction 3.0 displays which of your members is currently online 
20
+and how many guests are visiting the site as well. In addition to the standard 
21
+{blockname_title} and {blockname_content}, this block also adds {guests} as 
22
+the number of guests and {onlinemembers} as the hyperlinked list of members online.
23
+
24
+VERY IMPORTANT NOTE:  For this block to work correctly it must be set to Active 
25
+even if it is only displayed on the index page because the block not only displays 
26
+who is online it also tracks that information.  If it is set to "Index Only" you 
27
+will only get the information for people on your index page.  And it must be set
28
+this way on EVERY skin.  Again, even if it doesn't display, it must still be
29
+set to Active for the visitor information to be recorded.
30
+
31
+There is no admin panel for this block.  As is, it displays the people who have 
32
+been on the site(loaded a page) in the last minute.  If you want to increase 
33
+that time, open online.php and go to line 13 and replace 60 with the number of 
34
+seconds you wish.
0 35
\ No newline at end of file
1 36
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+<?php
2
+
3
+// ----------------------------------------------------------------------
4
+// eFiction 3.2
5
+// Copyright (c) 2007 by Tammy Keefer
6
+// Valid HTML 4.01 Transitional
7
+// Based on eFiction 1.1
8
+// Copyright (C) 2003 by Rebecca Smallwood.
9
+// http://efiction.sourceforge.net/
10
+// ----------------------------------------------------------------------
11
+// LICENSE
12
+//
13
+// This program is free software; you can redistribute it and/or
14
+// modify it under the terms of the GNU General Public License (GPL)
15
+// as published by the Free Software Foundation; either version 2
16
+// of the License, or (at your option) any later version.
17
+//
18
+// This program is distributed in the hope that it will be useful,
19
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
+// GNU General Public License for more details.
22
+//
23
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
24
+// ----------------------------------------------------------------------
25
+
26
+if(!defined("_CHARSET")) exit( );
27
+
28
+
29
+define("_GUESTS", "Guests");
30
+?>
0 31
\ No newline at end of file
1 32
new file mode 100644
2 33
new file mode 100644
... ...
@@ -0,0 +1,35 @@
1
+<?php
2
+
3
+// ----------------------------------------------------------------------
4
+// eFiction 3.2
5
+// Copyright (c) 2007 by Tammy Keefer
6
+// Valid HTML 4.01 Transitional
7
+// Based on eFiction 1.1
8
+// Copyright (C) 2003 by Rebecca Smallwood.
9
+// http://efiction.sourceforge.net/
10
+// ----------------------------------------------------------------------
11
+// LICENSE
12
+//
13
+// This program is free software; you can redistribute it and/or
14
+// modify it under the terms of the GNU General Public License (GPL)
15
+// as published by the Free Software Foundation; either version 2
16
+// of the License, or (at your option) any later version.
17
+//
18
+// This program is distributed in the hope that it will be useful,
19
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
+// GNU General Public License for more details.
22
+//
23
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
24
+// ----------------------------------------------------------------------
25
+
26
+if(!defined("_CHARSET")) exit( );
27
+
28
+
29
+dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_blocks(`block_name`, `block_title`, `block_status`, `block_file`, `block_variables`) VALUES('online', 'Who\'s Online', '0', 'online/online.php', '');");
30
+dbquery("CREATE TABLE IF NOT EXISTS `".TABLEPREFIX."fanfiction_online` (
31
+  `online_uid` int(11) NOT NULL default '0',
32
+  `online_ip` int(11) NOT NULL default '0',
33
+  `online_timestamp` int(11) NOT NULL default '0'
34
+) ENGINE=MyISAM;");
35
+?>
0 36
\ No newline at end of file
1 37
new file mode 100644
... ...
@@ -0,0 +1,19 @@
1
+<?php
2
+if(!defined("_CHARSET")) exit( );
3
+
4
+	global $dateformat, $tpl;
5
+
6
+	if(file_exists(_BASEDIR."blocks/online/{$language}.php")) include(_BASEDIR."blocks/online/{$language}.php");
7
+	else include(_BASEDIR."blocks/online/en.php");
8
+
9
+	$onlineInfo = ssi_whosOnline("array");
10
+	$tpl->assignGlobal("guests", empty($guests) ? 0 : $onlineInfo['guests']);
11
+	$omlist = array( );
12
+	foreach($onlineInfo['users'] as $k => $v) {
13
+		$omlist[] = "<a href='viewuser.php?uid=".$v['id']."'>".$v['username']."</a>";
14
+	}
15
+	$tpl->assignGlobal("onlinemembers", count($omlist) ? implode(", ", $omlist) : "");
16
+	$content = "<div id='who_online'><span class='label'>"._GUESTS.":</span> ".($onlineInfo['guests'] ? $onlineInfo['guests'] : 0)."<br />\n
17
+		<span class='label'>"._MEMBERS.":</span> ".($omlist ? implode(", ", $omlist) : "")."</div>";
18
+
19
+?>
0 20
\ No newline at end of file
1 21
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.0
4
+// Copyright (c) 2007 by Tammy Keefer
5
+// Valid HTML 4.01 Transitional
6
+// Based on eFiction 1.1
7
+// Copyright (C) 2003 by Rebecca Smallwood.
8
+// http://efiction.sourceforge.net/
9
+// ----------------------------------------------------------------------
10
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+
27
+$output .= "<script language=\"javascript\" type=\"text/javascript\">
28
+location = \"".PATHTOSMF."index.php?action=profile\";
29
+</script>";
30
+?>
0 31
\ No newline at end of file
1 32
new file mode 100644
... ...
@@ -0,0 +1,5 @@
1
+<?php
2
+if(!defined("_CHARSET")) exit( );
3
+define("_PRIVATEMESSAGE", "Private Message");
4
+
5
+?>
0 6
\ No newline at end of file
1 7
new file mode 100644
... ...
@@ -0,0 +1,52 @@
1
+<?php
2
+// Get session variables from cookie data if not logged in.
3
+// To bridge to another program replace (or add to) this information with the bridge to your other script.  See examples in the includes/bridges/ folder.
4
+if(!defined("_CHARSET")) exit( );
5
+
6
+if (!empty($_COOKIE[$sitekey."_useruid"])  && !isset($_SESSION[$sitekey."_useruid"])) {
7
+	$userdata = dbassoc(dbquery("SELECT "._UIDFIELD." as uid, "._PENNAMEFIELD." as penname, "._EMAILFIELD." as email, "._PASSWORDFIELD." as password, ap.* FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs as ap ON ap.uid = "._UIDFIELD." WHERE "._UIDFIELD." = '".$_COOKIE[$sitekey."_useruid"]."'"));
8
+	if($userdata && $userdata['level'] != -1 && $_COOKIE[$sitekey.'_pwd'] == md5($userdata['email']+$userdata['password'])) {
9
+		define("USERUID", $userdata['uid']);
10
+		define("USERPENNAME", $userdata['penname']);
11
+		if(!isset($_SESSION[$sitekey."_skin"]) && !empty($userdata['userskin'])) $siteskin = $userdata['userskin'];
12
+		else if(isset($_SESSION[$sitekey."_skin"])) $siteskin = $_SESSION[$sitekey."_skin"];
13
+		else $siteskin = $defaultskin;
14
+		define("uLEVEL", $userdata['level']);
15
+		define("isADMIN", uLEVEL > 0 ? true : false);
16
+		define("isMEMBER", true);
17
+		if(!isset($_SESSION[$sitekey."_agecontsent"])) $ageconsent = $userdata['ageconsent'];
18
+		else $ageconsent = $_SESSION[$sitekey."_agecontsent"];
19
+	}
20
+}
21
+$user_info = array( );
22
+$eFicLang = $language;
23
+require_once(_BASEDIR.PATHTOSMF."SSI.php");
24
+$language = $eFicLang;
25
+$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];
26
+	// SMF has already loaded it's sessions in queries.php.  So we'll pull the data from the $user_info array from there.
27
+	if($ID_MEMBER) {
28
+		$eficdata = dbquery("SELECT "._UIDFIELD." as uid, "._PENNAMEFIELD." as penname, ap.level, ap.userskin, ap.ageconsent FROM ".TABLEPREFIX."fanfiction_authorprefs as ap RIGHT JOIN "._AUTHORTABLE." ON ap.uid = "._UIDFIELD." WHERE "._UIDFIELD." = '$ID_MEMBER'");
29
+		if(dbnumrows($eficdata)) {
30
+			$userdata = dbassoc($eficdata);
31
+			if($userdata['level'] != "-1") {
32
+				define("USERUID", $userdata['uid']);
33
+				define("USERPENNAME", $userdata['penname']);
34
+				if(!isset($_SESSION[$sitekey."_skin"]) && !empty($userdata['userskin'])) $siteskin = $userdata['userskin'];
35
+				else if(isset($_SESSION[$sitekey."_skin"])) $siteskin = $_SESSION[$sitekey."_skin"];
36
+				else $siteskin = $defaultskin;
37
+				define("uLEVEL", $userdata['level']);
38
+				define("isADMIN", uLEVEL > 0 ? true : false);
39
+				define("isMEMBER", true);
40
+				if(!isset($_SESSION[$sitekey."_agecontsent"])) $ageconsent = $userdata['ageconsent'];
41
+				else $ageconsent = $_SESSION[$sitekey."_agecontsent"];
42
+			}	
43
+		}
44
+	}
45
+if(!defined("USERUID")) define("USERUID", false);
46
+if(!defined("USERPENNAME")) define("USERPENNAME", false);
47
+if(!defined("uLEVEL")) define("uLEVEL", 0);
48
+if(!defined("isMEMBER")) define("isMEMBER", false);
49
+if(!defined("isADMIN")) define("isADMIN", false);
50
+if(empty($siteskin)) $siteskin = $defaultskin;
51
+echo "<!-- USERUID ".USERUID." ".$ID_MEMBER." -->";
52
+?>
0 53
\ No newline at end of file
1 54
new file mode 100644
2 55
new file mode 100644
... ...
@@ -0,0 +1,25 @@
1
+<?php
2
+if(!defined("_CHARSET")) exit( );
3
+if(!isMEMBER) {
4
+		$output .= "<div id=\"pagetitle\">"._MEMBERLOGIN."</div>";
5
+
6
+if(!isset($_SESSION)) session_start();
7
+if(isset($_GET['sid']) && isNumber($_GET['sid'])) $_SESSION['login_url'] = $url."/viewstory.php?sid=".$_GET['sid'];
8
+else $_SESSION['login_url'] = $url."/user.php";
9
+		$output .= "<div style='text-align: center;'><form method=\"POST\"enctype=\"multipart/form-data\" action=\"".PATHTOSMF."index.php?action=login2\"><div style=\"width: 320px; padding: 5px; margin: 0 auto;\">
10
+		<input type=\"hidden\" name=\"cookielength\" value=\"-1\" /><input type=\"hidden\" name=\"login_url\" value=\"".$_SESSION['login_url']."\" />
11
+		<div class=\"label\" style=\"float: left;  width: 30%; text-align: right;\"><label for=\"penname\">"._PENNAME.":</label></div><INPUT type=\"text\" class=\"textbox\" name=\"user\" id=\"user\"><br />
12
+		<div class=\"label\" style=\"float: left; width: 30%; text-align: right;\"><label for=\"pswd\">"._PASSWORD.":</label></div><INPUT type=\"password\" class=\"textbox\" id=\"passwrd\" name=\"passwrd\"><br />
13
+		<INPUT type=\"checkbox\" class=\"checkbox\" name=\"cookieneverexp\" id=\"cookieneverexp\" value=\"1\"><label for=\"cookieneverexp\">"._REMEMBERME."</label><br />
14
+		<INPUT type=\"submit\" class=\"button\" name=\"submit\" value=\""._SUBMIT."\">
15
+		</div></form></div>";
16
+		$linkquery = dbquery("SELECT * from ".TABLEPREFIX."fanfiction_pagelinks WHERE link_name = 'login' OR link_name = 'lostpassword'");
17
+		while($link = dbassoc($linkquery)) {
18
+			if($link['link_access'] && !isMEMBER) continue;
19
+			if($link['link_access'] == 2 && !isADMIN) continue;
20
+			$pagelinks[$link['link_name']] = array("id" => $link['link_id'], "text" => $link['link_text'], "url" => _BASEDIR.$link['link_url'], "link" => "<a href=\"".$link['link_url']."\" title=\"".$link['link_text']."\"".($link['link_target'] ? " target=\"_blank\"" : "").($current == $link['link_name'] ? " id=\"current\"" : "").">".$link['link_text']."</a>");
21
+		}
22
+		$output .= "<div style='text-align: center;'>".$pagelinks['register']['link']." | ".$pagelinks['lostpassword']['link']."</div>";
23
+}
24
+else accessDenied( );
25
+?>
0 26
\ No newline at end of file
1 27
new file mode 100644
... ...
@@ -0,0 +1,37 @@
1
+<?php
2
+// Generally, you should be able to leave this alone.  This logout function will unset all session variables and cookie variables of the same name that begin with the site's sitekey.
3
+
4
+if(!defined("_LOGOUTCHECK")) exit( );
5
+	define("_BASEDIR", "");
6
+	include("config.php");
7
+	include_once("includes/queries.php");
8
+	session_start( );
9
+	require_once(PATHTOSMF."SSI.php");
10
+	$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];
11
+	loadUserSettings( );
12
+	include_once(PATHTOSMF."Sources/Subs-Auth.php");
13
+	// If you log out, you aren't online anymore :P.
14
+	dbquery("DELETE FROM {$db_prefix}log_online WHERE ID_MEMBER = $ID_MEMBER LIMIT 1");
15
+	$_SESSION['log_time'] = 0;
16
+	// Empty the cookie! (set it in the past, and for ID_MEMBER = 0)
17
+	setLoginCookie(-3600, 0);
18
+	foreach ($_SESSION as $VarName => $Value)  { 
19
+		if(substr($VarName, 0, strlen($sitekey)) == $sitekey) {
20
+			if(strpos($VarName, "skin")) continue;
21
+			unset($$VarName);
22
+			$_SESSION[$VarName] = ""; 
23
+			setcookie($VarName, '0');
24
+		}
25
+	}
26
+require_once("header.php");
27
+//make a new TemplatePower object
28
+if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
29
+else $tpl = new TemplatePower("default_tpls/default.tpl");
30
+if(file_exists("$skindir/listings.tpl")) $tpl->assignInclude( "listings", "./$skindir/listings.tpl" );
31
+else $tpl->assignInclude( "listings", "./default_tpls/listings.tpl" );
32
+include("includes/pagesetup.php");
33
+
34
+$output .= write_message(_ACTIONSUCCESSFUL);
35
+$tpl->assign("output", $output);
36
+$tpl->printToScreen( );
37
+?>
0 38
\ No newline at end of file
1 39
new file mode 100644
... ...
@@ -0,0 +1,29 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.0
4
+// Copyright (c) 2007 by Tammy Keefer
5
+// Valid HTML 4.01 Transitional
6
+// Based on eFiction 1.1
7
+// Copyright (C) 2003 by Rebecca Smallwood.
8
+// http://efiction.sourceforge.net/
9
+// ----------------------------------------------------------------------
10
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+$output .= "<script language=\"javascript\" type=\"text/javascript\">
27
+location = \"".PATHTOSMF."index.php?action=reminder\";
28
+</script>";
29
+?>
0 30
\ No newline at end of file
1 31
new file mode 100644
... ...
@@ -0,0 +1,34 @@
1
+// ----------------------------------------------------------------------
2
+// LICENSE
3
+//
4
+// This program is free software; you can redistribute it and/or
5
+// modify it under the terms of the GNU General Public License (GPL)
6
+// as published by the Free Software Foundation; either version 2
7
+// of the License, or (at your option) any later version.
8
+//
9
+// This program is distributed in the hope that it will be useful,
10
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+// GNU General Public License for more details.
13
+//
14
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
15
+// ----------------------------------------------------------------------
16
+
17
+Copyright 2006 by Tammy Keefer.
18
+
19
+This block for eFiction 3.0 displays which of your members is currently online 
20
+and how many guests are visiting the site as well. In addition to the standard 
21
+{blockname_title} and {blockname_content}, this block also adds {guests} as 
22
+the number of guests and {onlinemembers} as the hyperlinked list of members online.
23
+
24
+VERY IMPORTANT NOTE:  For this block to work correctly it must be set to Active 
25
+even if it is only displayed on the index page because the block not only displays 
26
+who is online it also tracks that information.  If it is set to "Index Only" you 
27
+will only get the information for people on your index page.  And it must be set
28
+this way on EVERY skin.  Again, even if it doesn't display, it must still be
29
+set to Active for the visitor information to be recorded.
30
+
31
+There is no admin panel for this block.  As is, it displays the people who have 
32
+been on the site(loaded a page) in the last minute.  If you want to increase 
33
+that time, open online.php and go to line 13 and replace 60 with the number of 
34
+seconds you wish.
0 35
\ No newline at end of file
1 36
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+<?php
2
+
3
+// ----------------------------------------------------------------------
4
+// eFiction 3.2
5
+// Copyright (c) 2007 by Tammy Keefer
6
+// Valid HTML 4.01 Transitional
7
+// Based on eFiction 1.1
8
+// Copyright (C) 2003 by Rebecca Smallwood.
9
+// http://efiction.sourceforge.net/
10
+// ----------------------------------------------------------------------
11
+// LICENSE
12
+//
13
+// This program is free software; you can redistribute it and/or
14
+// modify it under the terms of the GNU General Public License (GPL)
15
+// as published by the Free Software Foundation; either version 2
16
+// of the License, or (at your option) any later version.
17
+//
18
+// This program is distributed in the hope that it will be useful,
19
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
+// GNU General Public License for more details.
22
+//
23
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
24
+// ----------------------------------------------------------------------
25
+
26
+if(!defined("_CHARSET")) exit( );
27
+
28
+
29
+define("_GUESTS", "Guests");
30
+?>
0 31
\ No newline at end of file
1 32
new file mode 100644
2 33
new file mode 100644
... ...
@@ -0,0 +1,35 @@
1
+<?php
2
+
3
+// ----------------------------------------------------------------------
4
+// eFiction 3.2
5
+// Copyright (c) 2007 by Tammy Keefer
6
+// Valid HTML 4.01 Transitional
7
+// Based on eFiction 1.1
8
+// Copyright (C) 2003 by Rebecca Smallwood.
9
+// http://efiction.sourceforge.net/
10
+// ----------------------------------------------------------------------
11
+// LICENSE
12
+//
13
+// This program is free software; you can redistribute it and/or
14
+// modify it under the terms of the GNU General Public License (GPL)
15
+// as published by the Free Software Foundation; either version 2
16
+// of the License, or (at your option) any later version.
17
+//
18
+// This program is distributed in the hope that it will be useful,
19
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
+// GNU General Public License for more details.
22
+//
23
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
24
+// ----------------------------------------------------------------------
25
+
26
+if(!defined("_CHARSET")) exit( );
27
+
28
+
29
+dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_blocks(`block_name`, `block_title`, `block_status`, `block_file`, `block_variables`) VALUES('online', 'Who\'s Online', '0', 'online/online.php', '');");
30
+dbquery("CREATE TABLE IF NOT EXISTS `".TABLEPREFIX."fanfiction_online` (
31
+  `online_uid` int(11) NOT NULL default '0',
32
+  `online_ip` int(11) NOT NULL default '0',
33
+  `online_timestamp` int(11) NOT NULL default '0'
34
+) ENGINE=MyISAM;");
35
+?>
0 36
\ No newline at end of file
1 37
new file mode 100644
... ...
@@ -0,0 +1,19 @@
1
+<?php
2
+if(!defined("_CHARSET")) exit( );
3
+
4
+	global $dateformat, $tpl;
5
+
6
+	if(file_exists(_BASEDIR."blocks/online/{$language}.php")) include(_BASEDIR."blocks/online/{$language}.php");
7
+	else include(_BASEDIR."blocks/online/en.php");
8
+
9
+	$onlineInfo = ssi_whosOnline("array");
10
+	$tpl->assignGlobal("guests", empty($guests) ? 0 : $onlineInfo['guests']);
11
+	$omlist = array( );
12
+	foreach($onlineInfo['users'] as $k => $v) {
13
+		$omlist[] = "<a href='viewuser.php?uid=".$v['id']."'>".$v['username']."</a>";
14
+	}
15
+	$tpl->assignGlobal("onlinemembers", count($omlist) ? implode(", ", $omlist) : "");
16
+	$content = "<div id='who_online'><span class='label'>"._GUESTS.":</span> ".($onlineInfo['guests'] ? $onlineInfo['guests'] : 0)."<br />\n
17
+		<span class='label'>"._MEMBERS.":</span> ".($omlist ? implode(", ", $omlist) : "")."</div>";
18
+
19
+?>
0 20
\ No newline at end of file
1 21
new file mode 100644
... ...
@@ -0,0 +1,76 @@
1
+<?php
2
+// Build the user's profile information
3
+if(!defined("_CHARSET")) exit( );
4
+if(file_exists("languages/{$language}_SMF.php")) include("languages/{$language}_SMF.php");
5
+else include("languages/en_SMF.php");
6
+
7
+$tpl->newBlock("profile");
8
+$result2 = dbquery("SELECT *, "._UIDFIELD." as uid FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs as ap ON ap.uid = "._UIDFIELD." WHERE "._UIDFIELD." = '$uid' LIMIT 1");
9
+$userinfo = dbassoc($result2);
10
+$nameinfo = "";
11
+if($userinfo['emailAddress']) {
12
+	list($allowGuestsContact) = dbrow(dbquery("SELECT panel_level FROM ".TABLEPREFIX."fanfiction_panels WHERE panel_type = 'P' AND panel_name = 'contact' LIMIT 1"));
13
+	if($allowGuestsContact == "0") $nameinfo .= " [<a href=\"viewuser.php?action=contact&amp;uid=".$userinfo['uid']."\">"._CONTACT."</a>]";
14
+}
15
+if(isMEMBER) {
16
+	$nameinfo .= "[<a href='".PATHTOSMF."index.php?action=pm;sa=send;u=".$userinfo['uid']."'>"._PRIVATEMESSAGE."</a>]";
17
+}
18
+if(!empty($favorites) && isMEMBER && $userinfo['uid'] != USERUID) {
19
+	$fav = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_favorites WHERE uid = '".USERUID."' AND type = 'AU' AND item = '".$userinfo['uid']."'");
20
+	if(dbnumrows($fav) == 0) $nameinfo .= " [<a href=\"user.php?uid=USERUID&amp;action=favau&amp;author=".$userinfo['uid']."\">"._ADDAUTHOR2FAVES."</a>]";
21
+}
22
+$tpl->assign("userpenname", $userinfo['memberName']." ".$nameinfo);
23
+$tpl->assign("membersince", date("$dateformat", $userinfo['dateRegistered']));
24
+if($userinfo['realName'])
25
+	$tpl->assign("realname", $userinfo['realName']);
26
+if(!empty($userinfo['avatar']))
27
+	$tpl->assign("image", "<img src=\"".$path_to_smf."avatars/".$userinfo['avatar']."\">");
28
+$tpl->assign("userlevel", isset($userinfo['level']) && $userinfo['level'] > 0 && $userinfo['level'] < 4 ? _ADMINISTRATOR.(isADMIN ? " - ".$userinfo['level'] : "") : _MEMBER);
29
+/* Dynamic authorinfo fields */
30
+$result2 = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE uid = '$uid'");
31
+if(!empty($userinfo['websiteUrl'])) 
32
+	$tpl->assign("website", "<a href='".$userinfo['websiteUrl']."'>".(!empty($userinfo['websiteTitle']) ? $userinfo['websiteTitle'] : $userinfo['websiteUrl'])."</a>");
33
+	$tpl->assign("aol", !empty($userinfo['AOL']) ? "<img src=\"http://big.oscar.aol.com/".$userinfo['AOL']."?on_url=$url/images/aim.gif&amp;off_url=$url/images/aim.gif\"> <a href=\"aim:goim?{aol}ScreenName=".$userinfo['AOL']."\">".$userinfo['AOL']."</a>" : "<img src=\"images/aim.gif\" alt=\""._AOL."\"> "._NONE);
34
+	$tpl->assign("icq", !empty($userinfo['ICQ']) ? "<img src=\"http://status.icq.com/online.gif?icq=$userinfo[ICQ]&amp;img=5\"> $userinfo[ICQ]" : "<img src=\"images/icq.gif\" alt=\""._ICQ."\"> "._NONE);
35
+	$tpl->assign("msn", "<img src=\"images/msntalk.gif\" alt=\""._MSN."\"> ".($userinfo['MSN'] ? $userinfo['MSN'] : _NONE));
36
+	$tpl->assign("yahoo", !empty($userinfo['YIM']) ? "<a href=\"http://edit.yahoo.com/config/send_webmesg?.target=".$userinfo['YIM']."&amp;.src=pg\"><img border=\"0\" src=\"http://opi.yahoo.com/online?u=".$userinfo['YIM']."&amp;m=g&amp;t=1\"> ".$userinfo['YIM']."</a>" : "<img src=\"images/yim.gif\" alt=\""._YAHOO."\"> "._NONE);
37
+
38
+$dynamicfields = "";
39
+while($field = dbassoc($result2)) {
40
+	if($field['info'] == "") continue;
41
+	$fieldinfo = dbassoc(dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorfields WHERE field_id = '".$field['field']."' LIMIT 1"));
42
+	if($fieldinfo) {
43
+		$thisfield = "";
44
+		if($fieldinfo['field_on'] == 0) continue;
45
+		if($fieldinfo['field_type'] == 1) {
46
+			$thisfield =  preg_replace('/(\w+:\/\/)(\S+)/', '<a href="\\1\\2" target="_blank">\\1\\2</a>', $field['info']);
47
+			if(strpos($thisfield, "http://") == false) $thisfield = preg_replace('/(\S+\.)(\S+)/', '<a href="http://\\1\\2" target="_blank">\\1\\2</a>', $thisfield);
48
+		}
49
+		if($fieldinfo['field_type'] == 4) {
50
+			$thisfield = preg_replace("@\{info\}@", $field['info'], $fieldinfo['field_options']);
51
+			$thisfield =  preg_replace('/(\w+:\/\/)(\S+)/', '<a href="\\1\\2" target="_blank">'.$field['info'].'</a>', $thisfield);
52
+			if(strpos($thisfield, "http://") == false) $thisfield = preg_replace('/(\S+\.)(\S+)/', '<a href="http://\\1\\2" target="_blank">\\1\\2</a>', $thisfield);
53
+		}
54
+		if($fieldinfo['field_type'] == 2 || $fieldinfo['field_type'] == 6) {
55
+			$thisfield = stripslashes($field['info']);
56
+		}
57
+		if($fieldinfo['field_type'] == 3) {
58
+			$thisfield = !empty($field['info']) ? _YES : _NO;
59
+		}
60
+		else eval($fieldinfo['field_code_out']);
61
+		$tpl->assign($fieldinfo['field_name'], $thisfield);
62
+		$dynamicfields .= "<div class='authorfields'><span class='label'>".$fieldinfo['field_title'].":</span> ".$thisfield."</div>";
63
+	}
64
+}
65
+if(!empty($dynamicfields)) $tpl->assign("authorfields", $dynamicfields);
66
+$tpl->assign("reportthis", "[<a href=\""._BASEDIR."contact.php?action=report&amp;url=viewuser.php?uid=".$uid."\">"._REPORTTHIS."</a>]");
67
+/* End dynamic fields */
68
+$adminopts = "";
69
+if(isADMIN && uLEVEL < 3) {
70
+	$adminopts .= "<div class=\"adminoptions\"><span class='label'>"._ADMINOPTIONS.":</span> ".(isset($userinfo['validated']) && $userinfo['validated'] ? "[<a href=\"admin.php?action=members&amp;revoke=$uid\" class=\"vuadmin\">"._REVOKEVAL."</a>] " : "[<a href=\"admin.php?action=members&amp;validate=$uid\" class=\"vuadmin\">"._VALIDATE."</a>] ")."[<a href=\"user.php?action=editbio&amp;uid=$uid\" class=\"vuadmin\">"._EDIT."</a>] [<a href=\"admin.php?action=members&amp;delete=$uid\" class=\"vuadmin\">"._DELETE."</a>]";
71
+	$adminopts .= " [<a href=\"admin.php?action=lock&amp;".($userinfo['level'] < 0 ? "unlock=".$userinfo['uid']."\" class=\"vuadmin\">"._UNLOCKMEM : "do=lock&amp;uid=".$userinfo['uid']."\" class=\"vuadmin\">"._LOCKMEM)."</a>]";
72
+	$adminopts .= " [<a href=\"admin.php?action=admins&amp;".(isset($userinfo['level']) && $userinfo['level'] > 0 ? "revoke=$uid\" class=\"vuadmin\">"._REVOKEADMIN."</a>] [<a href=\"admin.php?action=admins&amp;do=edit&amp;uid=$uid\" class=\"vuadmin\">"._EDITADMIN : "do=new&amp;uid=$uid\" class=\"vuadmin\">"._MAKEADMIN)."</a>]</div>";
73
+	$tpl->assign("adminoptions", $adminopts);
74
+}
75
+$tpl->gotoBlock("_ROOT");
76
+?>
0 77
\ No newline at end of file
1 78
new file mode 100644
... ...
@@ -0,0 +1,26 @@
1
+<?php
2
+
3
+// The table prefix for SMF
4
+$db_prefix = "smf_";
5
+
6
+// The RELATIVE path to your SMF install from your eFiction install.  
7
+// The example given is an SMF and eFiction install as sibling folders.
8
+define("PATHTOSMF", "../smf/");
9
+
10
+$db_connection = $dbconnect;
11
+
12
+// Default query strings used throughout the script.  You may need to alter these to bridge to other scripts or databases.
13
+
14
+define ("_UIDFIELD", "author.ID_MEMBER");  // Do not change the aliasing (the "author." part)!
15
+define ("_PENNAMEFIELD", "author.realName");  // Do not change the aliasing (the "author." part)!
16
+define ("_EMAILFIELD", "author.emailAddress");  // Do not change the aliasing (the "author." part)!
17
+define ("_PASSWORDFIELD", "author.passwd"); //  Do not change the aliasing (the "author." part)!
18
+define ("_AUTHORTABLE", $db_prefix."members as author"); // Do not change the aliasing (the "as author" part)!
19
+
20
+define ("_STORYQUERY",  "SELECT stories.*, "._PENNAMEFIELD." as penname, UNIX_TIMESTAMP(stories.date) as date, UNIX_TIMESTAMP(stories.updated) as updated FROM ("._AUTHORTABLE.", ".TABLEPREFIX."fanfiction_stories as stories) WHERE "._UIDFIELD." = stories.uid AND stories.validated > 0 ");
21
+define ("_STORYCOUNT", "SELECT count(sid) FROM ".TABLEPREFIX."fanfiction_stories as stories WHERE validated > 0");
22
+define ("_SERIESQUERY", "SELECT series.*, "._PENNAMEFIELD." as penname FROM "._AUTHORTABLE.", ".TABLEPREFIX."fanfiction_series as series WHERE "._UIDFIELD." = series.uid ");
23
+define ("_SERIESCOUNT", "SELECT COUNT(seriesid) FROM ".TABLEPREFIX."fanfiction_series as series ");
24
+define ("_MEMBERLIST", "SELECT count( stories.sid ) as stories, "._PENNAMEFIELD." as penname, "._UIDFIELD." as uid FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs AS ap ON "._UIDFIELD." = ap.uid LEFT JOIN ".TABLEPREFIX."fanfiction_stories AS stories ON stories.validated > 0 AND (FIND_IN_SET("._UIDFIELD.", stories.coauthors) > 0 OR stories.uid = "._UIDFIELD.") ");
25
+define ("_MEMBERCOUNT", "SELECT COUNT(DISTINCT "._UIDFIELD.") FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_stories as stories ON stories.validated > 0 AND (FIND_IN_SET("._UIDFIELD.", stories.coauthors) > 0 OR stories.uid = "._UIDFIELD.")  LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs as ap ON "._UIDFIELD." = ap.uid");
26
+?>
0 27
\ No newline at end of file
1 28
new file mode 100644
... ...
@@ -0,0 +1,7 @@
1
+<?php
2
+if(!defined("_CHARSET")) exit( );
3
+
4
+$output .= "<script language=\"javascript\" type=\"text/javascript\">
5
+location = \"".PATHTOSMF."index.php?action=register\";
6
+</script>";
7
+?>
0 8
\ No newline at end of file
1 9
new file mode 100644
... ...
@@ -0,0 +1,3 @@
1
+This folder contains the default files for connecting to the default author
2
+table for eFiction.  They are included here as a backup in case you need 
3
+to restore from a failed bridge.
0 4
\ No newline at end of file
1 5
new file mode 100644
... ...
@@ -0,0 +1,224 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.2
4
+// Copyright (c) 2007 by Tammy Keefer
5
+// Valid HTML 4.01 Transitional
6
+// Based on eFiction 1.1
7
+// Copyright (C) 2003 by Rebecca Smallwood.
8
+// http://efiction.sourceforge.net/
9
+// ----------------------------------------------------------------------
10
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+if(!function_exists("random_char")) {
27
+
28
+function random_char($string)
29
+{
30
+	$length = strlen($string);
31
+	$position = mt_rand(0, $length - 1);
32
+	$output = ($string[$position]);
33
+	return $output;
34
+}
35
+
36
+function random_string ($charset_string, $length)
37
+{
38
+	$return_string = random_char($charset_string);
39
+	for ($x = 1; $x < $length; $x++)
40
+	$return_string .= random_char($charset_string);
41
+	return $return_string;
42
+}
43
+
44
+}
45
+	$uid = isset($_REQUEST['uid']) ? $_REQUEST['uid'] : false;
46
+	if(!$uid) $uid = USERUID;
47
+
48
+	if((!isADMIN || uLEVEL > 2) && $uid != USERUID && $action == "editbio") $output .= write_error(_NOTAUTHORIZED);
49
+	if(isMEMBER) $output .= "<div id=\"pagetitle\">"._EDITPERSONAL."</div>";
50
+	else $output .= "<div id=\"pagetitle\">"._NEWACCOUNT."</div>";
51
+	if(!empty($_POST['submit'])) {
52
+		$penname = isset($_POST['newpenname']) ? escapestring($_POST['newpenname']) : false;
53
+		$email = escapestring($_POST[email]);
54
+		if(!isset($email) && !isADMIN) $output .= "<div style='text-align: center;'>"._EMAILREQUIRED."</div>";
55
+		else if($penname && !preg_match("!^[a-z0-9_ ]{3,30}$!i", $penname)) $output .= "<div style='text-align: center;'>"._BADUSERNAME."</div>";
56
+		else if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) $output .= "<div style='text-align: center;'>"._INVALIDEMAIL." "._TRYAGAIN."</div>";
57
+		else if($action == "register") {
58
+			if(!$penname || empty($email) || !eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email) || !preg_match("/^[-0-9A-Z_-\s]+$/i", $penname)) $output .= write_error(_PENEMAILREQUIRED);
59
+			else if($pwdsetting && empty($_POST['password'])) $output .= write_error(_PWDREQUIRED."  "._TRYAGAIN);
60
+			else  {
61
+				$result = dbquery("SELECT "._PENNAMEFIELD." FROM "._AUTHORTABLE." WHERE "._PENNAMEFIELD." = '".escapestring($penname)."'");
62
+				$result2 = dbquery("SELECT "._EMAILFIELD." as email FROM "._AUTHORTABLE." WHERE "._EMAILFIELD." = ''");
63
+				if($captcha && !captcha_confirm()) $output .= write_error(_CAPTCHAFAIL);
64
+				else if(dbnumrows($result) > 0) $output .= write_error(_PENNAMEINUSE."  "._TRYAGAIN);
65
+				else if(dbnumrows($result2) > 0) $output .= write_error(_EMAILINUSE."  "._TRYAGAIN);
66
+				else if(preg_match("!^[a-z0-9_ ]{3,30}$!i", $penname)) {
67
+					if(!$pwdsetting) {
68
+						$charset = '23456789' . 'abcdefghijkmnpqrstuvwxyz' . 'ABCDEFGHJKLMNPQRSTUVWXYZ';
69
+						$pass = random_string($charset, 10);
70
+						$encryppass = md5($pass);
71
+					}
72
+					else {
73
+						if($_POST['password'] != $_POST['password2']) {
74
+							$output .=  write_error(_PASSWORDTWICE);
75
+							$tpl->assign("output", $output);
76
+							$tpl->printToScreen( );
77
+							dbclose( );
78
+							exit( );
79
+						}
80
+						$pass = $_POST['password2'];
81
+						$encryppass = md5($pass);
82
+					}
83
+					dbquery("INSERT INTO ".substr(_AUTHORTABLE, 0, strpos(_AUTHORTABLE, "as author"))." (penname, realname, bio, email, date, password) VALUES ('".escapestring($penname)."', '".escapestring(strip_tags($_POST['realname']))."', '".strip_tags(escapestring($_POST['bio']), $allowed_tags)."', '$email', now(), '$encryppass')");
84
+					$useruid = dbinsertid( );
85
+					if($logging) dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`) VALUES('".escapestring(sprintf(_LOG_REGISTER, $penname, USERUID, $_SERVER['REMOTE_ADDR']))."', '".$useruid."', INET_ATON('".$_SERVER['REMOTE_ADDR']."'), 'RG')");
86
+					if(empty($siteskin)) {
87
+						$skinquery = dbquery("SELECT skin FROM ".$settingsprefix."fanfiction_settings WHERE sitekey ='".SITEKEY."'");
88
+						list($skin) = dbrow($skinquery);
89
+					}
90
+					else $skin = $siteskin;
91
+					dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_authorprefs(uid, userskin, storyindex, sortby, tinyMCE) VALUES('".USERUID."', '$skin', '$displayindex', '$defaultsort', '$tinyMCE')");
92
+/* The section adds fields from the authorfields table to the authorinfo table allowing dynamic additions to the bio/registration page */
93
+					$fields = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorfields WHERE field_on = '1'");
94
+					while($field = dbassoc($fields)) {
95
+						$uid = isset($_POST['uid']) && isNumber($_POST['uid']) ? $_POST['uid'] : false;
96
+						if(!$uid) continue;
97
+						$oldfield = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE field='".$field['field_id']."' AND uid = '".$uid."'");
98
+						if(dbnumrows($oldfield) > 0) {
99
+							$newinfo = isset($_POST["af_".$field['field_name']]) ? escapestring($_POST["af_".$field['field_name']]) : false;
100
+							if(!empty($newinfo)) dbquery("UPDATE ".TABLEPREFIX."fanfiction_authorinfo SET info='$newinfo' WHERE uid = '$uid' AND field = '".$field['field_id']."'");
101
+							else dbquery("DELETE FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE uid = '$uid' AND field = '".$field['field_id']."'");
102
+						}
103
+						else if(!empty($_POST["af_".$field['field_name']])) dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_authorinfo(`uid`, `info`, `field`) VALUES('$uid', '".escapestring($_POST["af_".$field['field_name']])."', '".$field['field_id']."');");
104
+					}
105
+/* End dynamic fields */
106
+					$subject = _SIGNUPSUBJECT;
107
+					$mailtext = _SIGNUPMESSAGE._LOGIN.": $penname\n"._PASSWORD.": $pass \n\n";
108
+					if(!$pwdsetting) $mailtext .= _SIGNUPWARNING;
109
+					include("includes/emailer.php");
110
+					sendemail($penname, $email, $sitename, $siteemail, $subject, $mailtext, "html");
111
+					dbquery("UPDATE ".TABLEPREFIX."fanfiction_stats SET newestmember = '$penname', members = members + 1");
112
+					unset($_POST['submit']);
113
+					$output = write_message(_ACTIONSUCCESSFUL);
114
+					include("user/login.php");
115
+				}
116
+				else $output .= _BADUSERNAME;
117
+			}
118
+		}
119
+		else{
120
+			$oldinfo = dbassoc(dbquery("SELECT * FROM "._AUTHORTABLE." WHERE uid = '".USERUID."' LIMIT 1"));
121
+			// Update the password
122
+			if(($_POST['password']) || ($_POST['password2'])) {
123
+				if($_POST['password'] == $_POST['password2']) {
124
+					$encryppassword = md5($_POST['password']);
125
+					dbquery("UPDATE "._AUTHORTABLE." SET password='$encryppassword' WHERE uid = '$uid'");
126
+				}
127
+				else $output .=  write_error(_PASSWORDTWICE);
128
+			}
129
+			// Update the penname.
130
+			if(isset($_POST['oldpenname']) && $penname != $_POST['oldpenname']) {
131
+				$checkresult = dbquery("SELECT * FROM "._AUTHORTABLE." WHERE penname = '".escapestring($penname)."'");
132
+				if(dbnumrows($checkresult)) {
133
+					$output .= write_message(_PENNAMEINUSE."  "._TRYAGAIN);
134
+				}
135
+				else {
136
+					dbquery("UPDATE "._AUTHORTABLE." SET penname = '".escapestring($penname)."' WHERE uid = '$_POST[uid]'");
137
+					if($logging) dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`) VALUES('".escapestring(sprintf(_NEWPEN, USERPENNAME, USERUID, $_POST[oldpenname], $uid, $penname))."', '".USERUID."', INET_ATON('".$_SERVER['REMOTE_ADDR']."'), 'EB')");
138
+				}
139
+			}
140
+/* This section adds fields from the authorfields table to the authorinfo table allowing dynamic additions to the bio/registration page */
141
+			$fields = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorfields WHERE field_on = '1'");
142
+			while($field = dbassoc($fields)) {
143
+				$uid = isset($_POST['uid']) && isNumber($_POST['uid']) ? $_POST['uid'] : false;
144
+				if(!$uid) continue;
145
+				$oldfield = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE field='".$field['field_id']."' AND uid = '".$uid."'");
146
+				if(dbnumrows($oldfield) > 0) {
147
+					$newinfo = isset($_POST["af_".$field['field_name']]) ? escapestring(descript($_POST["af_".$field['field_name']])) : false;
148
+					if(!empty($newinfo)) dbquery("UPDATE ".TABLEPREFIX."fanfiction_authorinfo SET info='".$newinfo."' WHERE uid = '$uid' AND field = '".descript($field['field_id'])."'");
149
+					else dbquery("DELETE FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE uid = '$uid' AND field = '".$field['field_id']."'");
150
+				}
151
+				else if(!empty($_POST["af_".$field['field_name']])) dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_authorinfo(`uid`, `info`, `field`) VALUES('$uid', '".escapestring($_POST["af_".$field['field_name']])."', '".$field['field_id']."');");
152
+			}
153
+/* End dynamic fields */
154
+			// Now we'll update the rest.
155
+			$result = dbquery("UPDATE "._AUTHORTABLE." SET realname='".descript(strip_tags(escapestring($_POST['realname'])), $allowed_tags)."', email='$email', bio='".descript(strip_tags(escapestring($_POST['bio']), $allowed_tags))."', image='".($imageupload && !empty($_POST['image']) ? escapestring($_POST['image']) : "")."' WHERE uid = '$uid'");
156
+			if($result) { // only if the info actually got updated.
157
+				if($oldinfo['email'] != $email) { // Need to reset the session and cookies in this case.
158
+					$_SESSION[SITEKEY."_salt"] = md5($email+$encryptedpassword);
159
+					if(isset($_COOKIE[SITEKEY."_salt"])) setcookie(SITEKEY."_salt", md5($email+$encryptedpassword),  time()+60*60*24*30, "/");		
160
+				}
161
+			}
162
+			$output .= write_message(_ACTIONSUCCESSFUL."  ".(isset($_GET['uid']) ? _BACK2ADMIN : _BACK2ACCT));
163
+		}
164
+	}
165
+	else {
166
+		if($action != "register") {
167
+			$result = dbquery("SELECT * FROM "._AUTHORTABLE." WHERE "._UIDFIELD." = '$uid' LIMIT 1");
168
+			$user = dbassoc($result);
169
+			$result2 = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE uid = '$uid'");
170
+			while($field = dbassoc($result2)) {
171
+				$user["af_".$field['field']] = $field['info'];
172
+			}
173
+		}
174
+		if($action == "register") {
175
+			$query = dbquery("SELECT message_text FROM ".TABLEPREFIX."fanfiction_messages WHERE message_name = 'tos'");
176
+			list($tos) = dbrow($query);
177
+			$output .= "<div class='tblborder' style='width: 90%; margin: 1em auto;'>$tos</div>";
178
+		}
179
+		$output .= "<div id='settingsform'><form method=\"POST\" enctype=\"multipart/form-data\" style='margin: 0 auto;' action=\"user.php?action=$action".($uid != USERUID ? "&uid=".$uid : "")."\">
180
+		<div><label for='newpenname'>"._PENNAME.":</label>";
181
+		if((isADMIN && uLEVEL == 1) || $action == "register")
182
+			$output .= "<INPUT name=\"newpenname\" type=\"text\" class=\"textbox\" maxlength=\"200\" value=\"".(isset($user) ? $user['penname'] : "")."\"><INPUT name=\"oldpenname\" type=\"hidden\" value=\"".(isset($user) ? $user['penname'] : "")."\"><font color=\"red\">*</font> ";
183
+		else if(isset($user)) $output .= " ".$user['penname'];
184
+		$output .= "</div>
185
+	 	<div><label for='realname'>"._REALNAME.": </label><INPUT type=\"text\" class=\"textbox=\" name=\"realname\" maxlength=\"200\" value=\"".(isset($user) ? $user['realname'] : "")."\"></div>
186
+	 	<div><label for='email'>"._EMAIL.":</label><INPUT  type=\"text\" class=\"textbox=\" name=\"email\" value=\"".(isset($user) ? $user['email'] : "")."\" maxlength=\"200\" size=\"35\"><font color=\"red\">*</font></div>
187
+	 	<div><label for='bio'>"._BIO.":</label></div>
188
+		<div style='width: 450px; margin: 0 auto;'><textarea class=\"textbox\" name=\"bio\" cols=\"50\" rows=\"6\">".(isset($user) ? stripslashes($user['bio']) : "")."</TEXTAREA></div>";
189
+/* The section adds fields to the form from the authorfields table to the authorinfo table allowing dynamic additions to the bio/registration page */
190
+		$authorfields = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorfields WHERE field_on = '1'");
191
+		while($field = dbassoc($authorfields)) {
192
+			if($field['field_type'] == 1 || $field['field_type'] == 4 || $field['field_type'] == 6) 
193
+				$output .= "<div><label for='".$field['field_name']."'>".$field['field_title'].":</label>\n<input type='text' class='textbox' name='af_".$field['field_name']."'".(!empty($user["af_".$field['field_id']]) ? "value='".$user["af_".$field['field_id']]."'" : "").">\n</div>\n";
194
+			if($field['field_type'] == 2) {
195
+				$output .= "<div><label for='".$field['field_name']."'>".$field['field_title'].":</label>\n
196
+						<select class='textbox' name='af_".$field['field_name']."'>\n";
197
+				$opts = explode("|#|", $field['field_options']);
198
+				foreach($opts as $opt) {
199
+					$output .= "<option".(!empty($user["af_".$field['field_id']]) && $user["af_".$field['field_id']] == $opt ? " selected" : "").">$opt</option>\n";
200
+				}
201
+				$output .= "</select>\n</div>\n";
202
+			}
203
+			if($field['field_type'] == 5) eval(stripslashes($field['field_code_in']));
204
+			if($field['field_type'] == 3) {
205
+				$output .= "<div class='fieldset'><span class='label'>".$field['field_title'].":</span>\n";
206
+				$output .= "<input type='radio' name='af_".$field['field_name']."' id='af_".$field['field_name']._YES."' value='"._YES."'".(!empty($user["af_".$field['field_id']]) && $user["af_".$field['field_id']] == _YES ? "checked='checked'" : "")."> <label for='".$field['field_name']._YES."'>"._YES."</label>\n
207
+					<input type='radio' name='af_".$field['field_name']."' id='af_".$field['field_name']._NO."' value='"._NO."'".(!empty($user["af_".$field['field_id']]) && $user["af_".$field['field_id']] == _NO ? "checked='checked'" : "")."> <label for='".$field['field_name']._NO."'>"._NO."</label></div>\n";
208
+			}
209
+		}
210
+/* End dynamic fields */
211
+	 	if($imageupload == "1")
212
+	 		$output .= "<div><label for='image'>"._IMAGE.":</label> <INPUT  type=\"text\" class=\"textbox=\" name=\"image\" maxlength=\"200\" value=\"".(!empty($user['image']) ? $user['image'] : "")."\"></div>";
213
+		if($action != "register" || $pwdsetting)
214
+	 	$output .= "<div><label for='password'>"._PASSWORD.":</label>  <INPUT name=\"password\" class=\"textbox\" value=\"\" type=\"password\">".($action == "register" ? "<font color=\"red\">*</font>" : "")."</div>
215
+			<div><label for='password2'>"._PASSWORD2.":</label> <INPUT name=\"password2\" class=\"textbox=\" value=\"\" type=\"password\">".($action == "register" ? "<font color=\"red\">*</font>" : "")."</div>";
216
+		if(!empty($captcha) && $action == "register") $output .= "<div><label for='userdigit'>"._CAPTCHANOTE."</label><input MAXLENGTH=5 SIZE=5 name=\"userdigit\" type=\"text\" value=\"\"><div style='text-align: center;'><img width=120 height=40 src=\""._BASEDIR."includes/button.php\" style=\"border: 1px solid #111;\"></div></div>";
217
+	 	$output .= "<div style='text-align: center; margin: 1em;'><INPUT type=\"hidden\" name=\"uid\" value=\"".(isset($user) ? $user['uid'] : "")."\"><INPUT type=\"submit\" class=\"button\" name=\"submit\" value=\""._SUBMIT."\">";
218
+	 	if(!isADMIN)
219
+	 	{
220
+			 	$output .= " [<a href=\"admin.php?action=deleteuser&amp;uid=$uid\">"._DELETE."</a>]";
221
+	 	}
222
+	 	$output .= "</div></form></div>".write_message("<font color=\"red\">*</font> "._REQUIREDFIELDS);
223
+	}
224
+?>
0 225
\ No newline at end of file
1 226
new file mode 100644
... ...
@@ -0,0 +1,65 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.2
4
+// Copyright (c) 2007 by Tammy Keefer
5
+// Valid HTML 4.01 Transitional
6
+// Based on eFiction 1.1
7
+// Copyright (C) 2003 by Rebecca Smallwood.
8
+// http://efiction.sourceforge.net/
9
+// ----------------------------------------------------------------------
10
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+// Get session variables from cookie data if not logged in.
27
+// To bridge to another program replace (or add to) this information with the bridge to your other script.  See examples in the includes/bridges/ folder.
28
+if (!empty($_COOKIE[$sitekey."_useruid"])) {
29
+	$userdata = dbassoc(dbquery("SELECT ap.*, "._UIDFIELD." as uid, "._PENNAMEFIELD." as penname, "._EMAILFIELD." as email, "._PASSWORDFIELD." as password FROM "._AUTHORTABLE." LEFT JOIN ".$tableprefix."fanfiction_authorprefs as ap ON ap.uid = "._UIDFIELD." WHERE "._UIDFIELD." = '".$_COOKIE[$sitekey."_useruid"]."'"));
30
+	if($userdata && $userdata['level'] != -1 && $_COOKIE[$sitekey.'_salt'] == md5($userdata['email']+$userdata['password'])) {
31
+		define("USERUID", $userdata['uid']);
32
+		define("USERPENNAME", $userdata['penname']);
33
+		if(!isset($_SESSION[$sitekey."_skin"]) && !empty($userdata['userskin'])) $siteskin = $userdata['userskin'];
34
+		else if(isset($_SESSION[$sitekey."_skin"])) $siteskin = $_SESSION[$sitekey."_skin"];
35
+		else $siteskin = $defaultskin;
36
+		define("uLEVEL", $userdata['level']);
37
+		define("isADMIN", uLEVEL > 0 ? true : false);
38
+		define("isMEMBER", true);
39
+		if(!isset($_SESSION[$sitekey."_agecontsent"])) $ageconsent = $userdata['ageconsent'];
40
+		else $ageconsent = $_SESSION[$sitekey."_agecontsent"];
41
+	}
42
+}
43
+if(!empty($_SESSION[$sitekey."_useruid"]) && !defined("USERUID")) {
44
+	$userdata = dbassoc(dbquery("SELECT ap.*, "._UIDFIELD." as uid, "._PENNAMEFIELD." as penname, "._EMAILFIELD." as email, "._PASSWORDFIELD." as password FROM "._AUTHORTABLE." LEFT JOIN ".$tableprefix."fanfiction_authorprefs as ap ON ap.uid = "._UIDFIELD." WHERE "._UIDFIELD." = '".$_SESSION[$sitekey."_useruid"]."'"));
45
+	if($userdata && $userdata['level'] != -1 && $_SESSION[$sitekey.'_salt'] == md5($userdata['email']+$userdata['password'])) {
46
+		define("USERUID", $userdata['uid']);
47
+		define("USERPENNAME", $userdata['penname']);
48
+		if(!isset($_SESSION[$sitekey."_skin"]) && !empty($userdata['userskin'])) $siteskin = $userdata['userskin'];
49
+		else if(isset($_SESSION[$sitekey."_skin"])) $siteskin = $_SESSION[$sitekey."_skin"];
50
+		else $siteskin = $defaultskin;
51
+		define("uLEVEL", $userdata['level']);
52
+		define("isADMIN", uLEVEL > 0 ? true : false);
53
+		define("isMEMBER", true);
54
+		if(!isset($_SESSION[$sitekey."_agecontsent"])) $ageconsent = $userdata['ageconsent'];
55
+		else $ageconsent = $_SESSION[$sitekey."_agecontsent"];
56
+	}
57
+}
58
+if(!defined("USERUID")) define("USERUID", false);
59
+if(!defined("USERPENNAME")) define("USERPENNAME", false);
60
+if(!defined("uLEVEL")) define("uLEVEL", 0);
61
+if(!defined("isMEMBER")) define("isMEMBER", false);
62
+if(!defined("isADMIN")) define("isADMIN", false);
63
+if(empty($siteskin)) $siteskin = $defaultskin;
64
+
65
+?>
0 66
\ No newline at end of file
1 67
new file mode 100644
2 68
new file mode 100644
... ...
@@ -0,0 +1,87 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.2
4
+// Copyright (c) 2007 by Tammy Keefer
5
+// Valid HTML 4.01 Transitional
6
+// Based on eFiction 1.1
7
+// Copyright (C) 2003 by Rebecca Smallwood.
8
+// http://efiction.sourceforge.net/
9
+// ----------------------------------------------------------------------
10
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_LOGINCHECK")) exit( );
26
+	if(isset($_POST['submit']) && preg_match("!^[a-z0-9_ ]{3,30}$!i", $_POST['penname'])) {
27
+		define("_BASEDIR", "");
28
+		include_once("config.php");
29
+		$settings = dbquery("SELECT tableprefix, maintenance, sitekey, debug FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".$sitekey."'");
30
+		list($tableprefix, $maintenance, $sitekey, $debug) = dbrow($settings);
31
+		include_once("includes/queries.php");
32
+		$result = dbquery("SELECT *, "._UIDFIELD." as uid FROM "._AUTHORTABLE." LEFT JOIN ".$tableprefix."fanfiction_authorprefs AS ap ON ap.uid = "._UIDFIELD." WHERE "._PENNAMEFIELD." = '".$_POST['penname']."'");
33
+		$passwd = dbassoc($result);
34
+		if($maintenance && $passwd['level'] < 0) {
35
+			header("Location: maintenance.php");
36
+			exit( );
37
+		}
38
+		$encryptedpassword = md5($_POST['password']);
39
+		if($passwd['level'] == -1) {
40
+			require_once("header.php");
41
+			//make a new TemplatePower object
42
+			if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
43
+			else $tpl = new TemplatePower("default_tpls/default.tpl");
44
+			include_once("includes/corefunctions.php");
45
+			accessDenied( );
46
+		}
47
+		if(isset($_POST['cookiecheck'])) {
48
+			setcookie($sitekey."_useruid",$passwd['uid'], time()+60*60*24*30, "/");
49
+			setcookie($sitekey."_salt", md5($passwd['email']+$encryptedpassword),  time()+60*60*24*30, "/");
50
+		}
51
+		if($passwd['password'] == $encryptedpassword) {
52
+			if(!isset($_SESSION)) session_start( );
53
+			$_SESSION[$sitekey."_useruid"] = $passwd['uid'];
54
+			$_SESSION[$sitekey."_salt"] = md5($passwd['email']+$encryptedpassword);
55
+		}
56
+
57
+		else { 
58
+			require_once("header.php");
59
+			//make a new TemplatePower object
60
+			if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
61
+			else $tpl = new TemplatePower("default_tpls/default.tpl");
62
+			include_once("includes/pagesetup.php");
63
+			$output .= "<div id=\"pagetitle\">"._MEMBERLOGIN."</div>";
64
+			$output .= "<div style='text-align: center;'>"._WRONGPASSWORD."</div>";
65
+			$tpl->assign("output", $output);
66
+			$tpl->printToScreen( );
67
+			dbclose( );
68
+			exit( );
69
+		}
70
+	}
71
+	else if(!isMEMBER) {
72
+		$output .= "<div id=\"pagetitle\">"._MEMBERLOGIN."</div>";
73
+		$output .= "<div style=\"width: 250px; margin: 0 auto; text-align: center;\"><form method=\"POST\" enctype=\"multipart/form-data\" action=\"user.php?action=login".(isset($_GET['sid']) && isNumber($_GET['sid']) ? "&amp;sid=".$_GET['sid'] : "")."\">
74
+		<div class=\"label\" style=\"float: left;  width: 30%; text-align: right;\"><label for=\"penname\">"._PENNAME.":</label></div><INPUT type=\"text\" class=\"textbox\" name=\"penname\" id=\"penname\"><br />
75
+		<div class=\"label\" style=\"float: left; width: 30%; text-align: right;\"><label for=\"pswd\">"._PASSWORD.":</label></div><INPUT type=\"password\" class=\"textbox\" id=\"pswd\" name=\"password\"><br />
76
+		<INPUT type=\"checkbox\" class=\"checkbox\" name=\"cookiecheck\" id=\"cookiecheck\" value=\"1\"><label for=\"cookiecheck\">"._REMEMBERME."</label><br />
77
+		<INPUT type=\"submit\" class=\"button\" name=\"submit\" value=\""._SUBMIT."\">
78
+		</form></div>";
79
+		$linkquery = dbquery("SELECT * from ".TABLEPREFIX."fanfiction_pagelinks WHERE link_name = 'login' OR link_name = 'lostpassword'");
80
+		while($link = dbassoc($linkquery)) {
81
+			if($link['link_access'] && !isMEMBER) continue;
82
+			if($link['link_access'] == 2 && !isADMIN) continue;
83
+			$pagelinks[$link['link_name']] = array("id" => $link['link_id'], "text" => $link['link_text'], "url" => _BASEDIR.$link['link_url'], "link" => "<a href=\"".$link['link_url']."\" title=\"".$link['link_text']."\"".($link['link_target'] ? " target=\"_blank\"" : "").($current == $link['link_name'] ? " id=\"current\"" : "").">".$link['link_text']."</a>");
84
+		}
85
+		$output .= "<div style='text-align: center;'>".$pagelinks['register']['link']." | ".$pagelinks['lostpassword']['link']."</div>";
86
+	}
87
+?>
0 88
\ No newline at end of file
1 89
new file mode 100644
... ...
@@ -0,0 +1,33 @@
1
+<?php
2
+if(!defined("_LOGOUTCHECK")) exit( );
3
+	define("_BASEDIR", "");
4
+	include("config.php");
5
+	include("includes/queries.php");
6
+	session_start( );
7
+	foreach ($_SESSION as $VarName => $Value)  { 
8
+		if(substr($VarName, 0, strlen($sitekey)) == $sitekey) {
9
+			if(strpos($VarName, "skin")) continue;
10
+			$_SESSION[$VarName] = "";
11
+			unset($_SESSION[$VarName]);
12
+			unset($_COOKIE[$VarName]);
13
+			setcookie($VarName, '', time() - 1000, '/', '', '' );
14
+		}
15
+	} 
16
+	foreach ($_COOKIE as $VarName => $Value)  { 
17
+		if(substr($VarName, 0, strlen($sitekey)) == $sitekey) {
18
+			unset($_COOKIE[$VarName]);
19
+			setcookie($VarName, "", time() - 1000, '/', '', '' );
20
+		}
21
+	} 
22
+require_once("header.php");
23
+//make a new TemplatePower object
24
+if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
25
+else $tpl = new TemplatePower("default_tpls/default.tpl");
26
+if(file_exists("$skindir/listings.tpl")) $tpl->assignInclude( "listings", "./$skindir/listings.tpl" );
27
+else $tpl->assignInclude( "listings", "./default_tpls/listings.tpl" );
28
+include("includes/pagesetup.php");
29
+
30
+$output .= write_message(_ACTIONSUCCESSFUL);
31
+$tpl->assign("output", $output);
32
+$tpl->printToScreen( );
33
+?>
0 34
\ No newline at end of file
1 35
new file mode 100644
... ...
@@ -0,0 +1,80 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.2
4
+// Copyright (c) 2007 by Tammy Keefer
5
+// Valid HTML 4.01 Transitional
6
+// Based on eFiction 1.1
7
+// Copyright (C) 2003 by Rebecca Smallwood.
8
+// http://efiction.sourceforge.net/
9
+// ----------------------------------------------------------------------
10
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+if(!function_exists("random_char")) {
27
+
28
+function random_char($string)
29
+{
30
+	$length = strlen($string);
31
+	$position = mt_rand(0, $length - 1);
32
+	return ($string[$position]);
33
+}
34
+
35
+function random_string ($charset_string, $length)
36
+{
37
+	$return_string = random_char($charset_string);
38
+	for ($x = 1; $x < $length; $x++)
39
+	$return_string .= random_char($charset_string);
40
+	return $return_string;
41
+}
42
+
43
+}
44
+if($loggedin) accessDenied( );
45
+	$output = "<div id=\"pagetitle\">"._LOSTPASSWORD."</div>";
46
+
47
+	  if(isset($_POST['submit'])) {
48
+		  $result = dbquery("SELECT "._UIDFIELD." as uid, "._PENNAMEFIELD." as penname FROM "._AUTHORTABLE." WHERE email = '$_POST[email]'");
49
+		  list($uid, $penname) = dbrow($result);
50
+		  if(dbnumrows($result) == 0) $output .= write_message(_BADEMAIL);
51
+		  else {
52
+			include("includes/emailer.php");
53
+			mt_srand((double)microtime() * 1000000);
54
+			$charset = '23456789' . 'abcdefghijkmnpqrstuvwxyz' . 'ABCDEFGHJKLMNPQRSTUVWXYZ';		
55
+			$pass = random_string($charset, 10);
56
+			$encryppass = md5($pass);
57
+			$subject = _NEWPWDSUB;
58
+			$mailtext = sprintf(_NEWPWDMSG, $pass);
59
+
60
+		
61
+			$result = sendemail($penname, $_POST['email'], $sitename, $siteemail, $subject, $mailtext, "html");
62
+			if($result) {
63
+				$output .= write_message(_PASSWORDSENT);
64
+				dbquery("UPDATE "._AUTHORTABLE." SET password='$encryppass' WHERE uid = '".$uid."'");
65
+			}
66
+			else $output .=  write_message(_EMAILFAILED);
67
+			if($logging) 
68
+				dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`) VALUES('".escapestring(sprintf(_LOG_LOST_PASSWORD, $penname, $uid, ($result ? _YES : _NO)))."', '$uid', INET_ATON('".$_SERVER['REMOTE_ADDR']."'), 'LP')");
69
+
70
+		}
71
+	}
72
+	else {
73
+		$output .= "<form method=\"POST\" enctype=\"multipart/form-data\" action=\"user.php?action=lostpassword\">
74
+		<table align=\"center\" width=\"300\">
75
+		<tr><td>"._ENTEREMAIL."</td></tr>
76
+		<tr><td><INPUT  type=\"text\" class=\"textbox=\" name=\"email\"> <INPUT type=\"submit\" class=\"button\" name=\"submit\" value=\""._SUBMIT."\"></form>
77
+		</td></tr></table>";
78
+	}
79
+
80
+?>
0 81
\ No newline at end of file
1 82
new file mode 100644
... ...
@@ -0,0 +1,86 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.2
4
+// Copyright (c) 2007 by Tammy Keefer
5
+// Valid HTML 4.01 Transitional
6
+// Based on eFiction 1.1
7
+// Copyright (C) 2003 by Rebecca Smallwood.
8
+// http://efiction.sourceforge.net/
9
+// ----------------------------------------------------------------------
10
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+
27
+// Build the user's profile information
28
+$tpl->newBlock("profile");
29
+$result2 = dbquery("SELECT *, UNIX_TIMESTAMP(date) as date FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs as ap ON ap.uid = "._UIDFIELD." WHERE "._UIDFIELD." = '$uid' LIMIT 1");
30
+$userinfo = dbassoc($result2);
31
+$nameinfo = "";
32
+if($userinfo['email'])
33
+	$nameinfo .= " [<a href=\"viewuser.php?action=contact&amp;uid=".$userinfo['uid']."\">"._CONTACT."</a>]";
34
+if(!empty($favorites) && $loggedin && $userinfo['uid'] != USERUID) {
35
+	$fav = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_favorites WHERE uid = '".USERUID."' AND type = 'AU' AND item = '".$userinfo['uid']."'");
36
+	if(dbnumrows($fav) == 0) $nameinfo .= " [<a href=\"user.php?uid=USERUID&amp;action=favau&amp;author=".$userinfo['uid']."\">"._ADDAUTHOR2FAVES."</a>]";
37
+}
38
+$tpl->assign("userpenname", $userinfo['penname']." ".$nameinfo);
39
+$tpl->assign("membersince", date("$dateformat", $userinfo['date']));
40
+if($userinfo['realname'])
41
+	$tpl->assign("realname", $userinfo['realname']);
42
+if($userinfo['bio']) {
43
+	$bio = nl2br($userinfo['bio']);	
44
+	$tpl->assign("bio", stripslashes($bio));
45
+}
46
+if($userinfo['image'])
47
+	$tpl->assign("image", "<img src=\"".$userinfo['image']."\">");
48
+$tpl->assign("userlevel", isset($userinfo['level']) && $userinfo['level'] > 0 && $userinfo['level'] < 4 ? _ADMINISTRATOR.(isADMIN ? " - ".$userinfo['level'] : "") : _MEMBER);
49
+/* Dynamic authorinfo fields */
50
+$result2 = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE uid = '$uid'");
51
+$dynamicfields = "";
52
+while($field = dbassoc($result2)) {
53
+	if($field['info'] == "") continue;
54
+	$fieldinfo = dbassoc(dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorfields WHERE field_id = '".$field['field']."' LIMIT 1"));
55
+	if($fieldinfo) {
56
+		$thisfield = "";
57
+		if($fieldinfo['field_on'] == 0) continue;
58
+		if($fieldinfo['field_type'] == 1) { $thisfield = format_link($field['info']);
59
+		}
60
+		if($fieldinfo['field_type'] == 4) {
61
+			$thisfield = preg_replace("@\{info\}@", $field['info'], $fieldinfo['field_options']);
62
+			$thisfield = format_link($thisfield);
63
+		}
64
+		if($fieldinfo['field_type'] == 2 || $fieldinfo['field_type'] == 6) {
65
+			$thisfield = stripslashes($field['info']);
66
+		}
67
+		if($fieldinfo['field_type'] == 3) {
68
+			$thisfield = $field['info'];
69
+		}
70
+		else eval($fieldinfo['field_code_out']);
71
+		$tpl->assign($fieldinfo['field_name'], $thisfield);
72
+		$dynamicfields .= "<div class='authorfields'><span class='label'>".$fieldinfo['field_title'].":</span> ".$thisfield."</div>";
73
+	}
74
+}
75
+if(!empty($dynamicfields)) $tpl->assign("authorfields", $dynamicfields);
76
+$tpl->assign("reportthis", "[<a href=\""._BASEDIR."contact.php?action=report&amp;url=viewuser.php?uid=".$uid."\">"._REPORTTHIS."</a>]");
77
+/* End dynamic fields */
78
+$adminopts = "";
79
+if(isADMIN && uLEVEL < 3) {
80
+	$adminopts .= "<div class=\"adminoptions\"><span class='label'>"._ADMINOPTIONS.":</span> ".(isset($userinfo['validated']) && $userinfo['validated'] ? "[<a href=\"admin.php?action=members&amp;revoke=$uid\" class=\"vuadmin\">"._REVOKEVAL."</a>] " : "[<a href=\"admin.php?action=members&amp;validate=$uid\" class=\"vuadmin\">"._VALIDATE."</a>] ")."[<a href=\"user.php?action=editbio&amp;uid=$uid\" class=\"vuadmin\">"._EDIT."</a>] [<a href=\"admin.php?action=members&amp;delete=$uid\" class=\"vuadmin\">"._DELETE."</a>]";
81
+	$adminopts .= " [<a href=\"admin.php?action=members&amp;".($userinfo['level'] < 0 ? "unlock=".$userinfo['uid']."\" class=\"vuadmin\">"._UNLOCKMEM : "lock=".$userinfo['uid']."\" class=\"vuadmin\">"._LOCKMEM)."</a>]";
82
+	$adminopts .= " [<a href=\"admin.php?action=admins&amp;".(isset($userinfo['level']) && $userinfo['level'] > 0 ? "revoke=$uid\" class=\"vuadmin\">"._REVOKEADMIN."</a>] [<a href=\"admin.php?action=admins&amp;do=edit&amp;uid=$uid\" class=\"vuadmin\">"._EDITADMIN : "do=new&amp;uid=$uid\" class=\"vuadmin\">"._MAKEADMIN)."</a>]</div>";
83
+	$tpl->assign("adminoptions", $adminopts);
84
+}
85
+$tpl->gotoBlock("_ROOT");
86
+?>
0 87
\ No newline at end of file
1 88
new file mode 100644
... ...
@@ -0,0 +1,17 @@
1
+<?php
2
+
3
+// Default query strings used throughout the script.  You may need to alter these to bridge to other scripts or databases.
4
+
5
+define ("_UIDFIELD", "author.uid");  // Do not change the aliasing (the "author." part)!
6
+define ("_PENNAMEFIELD", "author.penname");  // Do not change the aliasing (the "author." part)!
7
+define ("_EMAILFIELD", "author.email");  // Do not change the aliasing (the "author." part)!
8
+define ("_PASSWORDFIELD", "author.password"); //  Do not change the aliasing (the "author." part)!
9
+define ("_AUTHORTABLE", $tableprefix."fanfiction_authors as author"); // Do not change the aliasing (the "as author" part)!
10
+
11
+define ("_STORYQUERY",  "SELECT stories.*, "._PENNAMEFIELD." as penname, UNIX_TIMESTAMP(stories.date) as date, UNIX_TIMESTAMP(stories.updated) as updated FROM ("._AUTHORTABLE.", ".$tableprefix."fanfiction_stories as stories) WHERE "._UIDFIELD." = stories.uid AND stories.validated > 0 ");
12
+define ("_STORYCOUNT", "SELECT count(sid) FROM ".$tableprefix."fanfiction_stories as stories WHERE validated > 0");
13
+define ("_SERIESQUERY", "SELECT series.*, "._PENNAMEFIELD." as penname FROM "._AUTHORTABLE.", ".$tableprefix."fanfiction_series as series WHERE "._UIDFIELD." = series.uid ");
14
+define ("_SERIESCOUNT", "SELECT COUNT(seriesid) FROM ".$tableprefix."fanfiction_series as series ");
15
+define ("_MEMBERLIST", "SELECT count( stories.sid ) as stories, "._PENNAMEFIELD." as penname, "._UIDFIELD." as uid FROM "._AUTHORTABLE." LEFT JOIN ".$tableprefix."fanfiction_authorprefs AS ap ON "._UIDFIELD." = ap.uid LEFT JOIN ".$tableprefix."fanfiction_stories AS stories ON stories.validated > 0 AND (FIND_IN_SET("._UIDFIELD.", stories.coauthors) > 0 OR stories.uid = "._UIDFIELD.") ");
16
+define ("_MEMBERCOUNT", "SELECT COUNT(DISTINCT "._UIDFIELD.") FROM "._AUTHORTABLE." LEFT JOIN ".$tableprefix."fanfiction_stories as stories ON stories.validated > 0 AND (FIND_IN_SET("._UIDFIELD.", stories.coauthors) > 0 OR stories.uid = "._UIDFIELD.")  LEFT JOIN ".$tableprefix."fanfiction_authorprefs as ap ON "._UIDFIELD." = ap.uid");
17
+?>
0 18
\ No newline at end of file
1 19
new file mode 100644
... ...
@@ -0,0 +1,28 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.2
4
+// Copyright (c) 2007 by Tammy Keefer
5
+// Valid HTML 4.01 Transitional
6
+// Based on eFiction 1.1
7
+// Copyright (C) 2003 by Rebecca Smallwood.
8
+// http://efiction.sourceforge.net/
9
+// ----------------------------------------------------------------------
10
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+
27
+include("user/editbio.php");
28
+?>
0 29
\ No newline at end of file
1 30
new file mode 100644
... ...
@@ -0,0 +1,3 @@
1
+This folder contains the default files for connecting to the default author
2
+table for eFiction.  They are included here as a backup in case you need 
3
+to restore from a failed bridge.
0 4
\ No newline at end of file
1 5
new file mode 100644
... ...
@@ -0,0 +1,216 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.2
4
+// Copyright (c) 2007 by Tammy Keefer
5
+// Valid HTML 4.01 Transitional
6
+// Based on eFiction 1.1
7
+// Copyright (C) 2003 by Rebecca Smallwood.
8
+// http://efiction.sourceforge.net/
9
+// ----------------------------------------------------------------------
10
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+if(!function_exists("random_char")) {
27
+
28
+function random_char($string)
29
+{
30
+	$length = strlen($string);
31
+	$position = mt_rand(0, $length - 1);
32
+	$output = ($string[$position]);
33
+	return $output;
34
+}
35
+
36
+function random_string ($charset_string, $length)
37
+{
38
+	$return_string = random_char($charset_string);
39
+	for ($x = 1; $x < $length; $x++)
40
+	$return_string .= random_char($charset_string);
41
+	return $return_string;
42
+}
43
+
44
+}
45
+	$uid = isset($_REQUEST['uid']) ? $_REQUEST['uid'] : false;
46
+	if(!$uid) $uid = USERUID;
47
+
48
+	if((!isADMIN || uLEVEL > 2) && $uid != USERUID && $action == "editbio") $output .= write_error(_NOTAUTHORIZED);
49
+	if(isMEMBER) $output .= "<div id=\"pagetitle\">"._EDITPERSONAL."</div>";
50
+	else $output .= "<div id=\"pagetitle\">"._NEWACCOUNT."</div>";
51
+	if(!empty($_POST['submit'])) {
52
+		$penname = isset($_POST['newpenname']) ? escapestring($_POST['newpenname']) : false;
53
+		$email = escapestring($_POST['email']);
54
+		if(!isset($email) && !isADMIN) $output .= "<div style='text-align: center;'>"._EMAILREQUIRED."</div>";
55
+		else if($penname && !preg_match("!^[a-z0-9-_ ]{3,30}$!i", $penname)) $output .= "<div style='text-align: center;'>"._BADUSERNAME."</div>";
56
+		else if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) $output .= "<div style='text-align: center;'>"._INVALIDEMAIL." "._TRYAGAIN."</div>";
57
+		else if($action == "register") {
58
+			if(!$penname || empty($email) || !eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email) || !preg_match("!^[a-z0-9-_ ]{3,30}$!i", $penname)) $output .= write_error(_PENEMAILREQUIRED);
59
+			else if($pwdsetting && empty($_POST['password'])) $output .= write_error(_PWDREQUIRED."  "._TRYAGAIN);
60
+			else  {
61
+				$result = dbquery("SELECT "._PENNAMEFIELD." FROM "._AUTHORTABLE." WHERE "._PENNAMEFIELD." = '".escapestring($penname)."'");
62
+				$result2 = dbquery("SELECT "._EMAILFIELD." as email FROM "._AUTHORTABLE." WHERE "._EMAILFIELD." = '$email'");
63
+				if($captcha && !captcha_confirm()) $output .= write_error(_CAPTCHAFAIL);
64
+				else if(dbnumrows($result) > 0) $output .= write_error(_PENNAMEINUSE."  "._TRYAGAIN);
65
+				else if(dbnumrows($result2) > 0) $output .= write_error(_EMAILINUSE."  "._TRYAGAIN);
66
+				else if(preg_match("!^[a-z0-9-_ ]{3,30}$!i", $penname)) {
67
+					if(!$pwdsetting) {
68
+						$charset = '23456789' . 'abcdefghijkmnpqrstuvwxyz' . 'ABCDEFGHJKLMNPQRSTUVWXYZ';
69
+						$pass = random_string($charset, 10);
70
+						$encryppass = md5($pass);
71
+					}
72
+					else {
73
+						if($_POST['password'] != $_POST['password2']) {
74
+							$output .=  write_error(_PASSWORDTWICE);
75
+							$tpl->assign("output", $output);
76
+							$tpl->printToScreen( );
77
+							dbclose( );
78
+							exit( );
79
+						}
80
+						$pass = $_POST['password2'];
81
+						$encryppass = md5($pass);
82
+					}
83
+					dbquery("INSERT INTO ".substr(_AUTHORTABLE, 0, strpos(_AUTHORTABLE, "as author"))." (penname, realname, bio, email, date, password) VALUES ('".escapestring($penname)."', '".escapestring(strip_tags($_POST['realname']))."', '".strip_tags(escapestring($_POST['bio']), $allowed_tags)."', '$email', now(), '$encryppass')");
84
+					$useruid = dbinsertid();
85
+					if($logging) dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`) VALUES('".escapestring(sprintf(_LOG_REGISTER, $penname, $useruid, $_SERVER['REMOTE_ADDR']))."', '".$useruid."', INET_ATON('".$_SERVER['REMOTE_ADDR']."'), 'RG')");
86
+					if(empty($siteskin)) {
87
+						$skinquery = dbquery("SELECT skin FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".SITEKEY."'");
88
+						list($skin) = dbrow($skinquery);
89
+					}
90
+					else $skin = $siteskin;
91
+					dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_authorprefs(uid, userskin, storyindex, sortby, tinyMCE) VALUES('".$useruid."', '$skin', '$displayindex', '$defaultsort', '$tinyMCE')");
92
+/* The section adds fields from the authorfields table to the authorinfo table allowing dynamic additions to the bio/registration page */
93
+					$fields = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorfields WHERE field_on = '1'");
94
+					while($field = dbassoc($fields)) {
95
+						$uid = isset($_POST['uid']) && isNumber($_POST['uid']) ? $_POST['uid'] : false;
96
+						if(!$uid) continue;
97
+						$oldfield = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE field='".$field['field_id']."' AND uid = '".$uid."'");
98
+						if(dbnumrows($oldfield) > 0) {
99
+							$newinfo = isset($_POST["af_".$field['field_name']]) ? escapestring($_POST["af_".$field['field_name']]) : false;
100
+							if(!empty($newinfo)) dbquery("UPDATE ".TABLEPREFIX."fanfiction_authorinfo SET info='$newinfo' WHERE uid = '$uid' AND field = '".$field['field_id']."'");
101
+							else dbquery("DELETE FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE uid = '$uid' AND field = '".$field['field_id']."'");
102
+						}
103
+						else if(!empty($_POST["af_".$field['field_name']])) dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_authorinfo(`uid`, `info`, `field`) VALUES('$uid', '".escapestring($_POST["af_".$field['field_name']])."', '".$field['field_id']."');");
104
+					}
105
+/* End dynamic fields */
106
+					$subject = _SIGNUPSUBJECT;
107
+					$mailtext = _SIGNUPMESSAGE._LOGIN.": $penname\n"._PASSWORD.": $pass \n\n";
108
+					if(!$pwdsetting) $mailtext .= _SIGNUPWARNING;
109
+					include("includes/emailer.php");
110
+					sendemail($penname, $email, $sitename, $siteemail, $subject, $mailtext, "html");
111
+					dbquery("UPDATE ".TABLEPREFIX."fanfiction_stats SET newestmember = '".$useruid."', members = members + 1");
112
+					if(defined("AUTHORPREFIX")) dbquery("UPDATE ".AUTHORPREFIX."fanfiction_stats SET newestmember = '".$useruid."', members = members + 1");
113
+					unset($_POST['submit']);
114
+					$output = write_message(_ACTIONSUCCESSFUL);
115
+					define("_LOGINCHECK", true);
116
+					include("user/login.php");
117
+				}
118
+				else $output .= _BADUSERNAME;
119
+			}
120
+		}
121
+		else{
122
+			 if(($_POST['password']) && ($_POST['password2'])) {
123
+				if($_POST['password'] == $_POST['password2']) {
124
+					$encryppassword = md5($_POST['password']);
125
+					dbquery("UPDATE "._AUTHORTABLE." SET password='$encryppassword' WHERE uid = '$uid'");
126
+				}
127
+				else $output .=  write_error(_PASSWORDTWICE);
128
+			}
129
+			if(isset($_POST['oldpenname']) && $penname != $_POST['oldpenname']) {
130
+				$checkresult = dbquery("SELECT * FROM "._AUTHORTABLE." WHERE penname = '".escapestring($penname)."'");
131
+				if(dbnumrows($checkresult)) {
132
+					$output .= write_message(_PENNAMEINUSE."  "._TRYAGAIN);
133
+				}
134
+				else {
135
+					dbquery("UPDATE "._AUTHORTABLE." SET penname = '".escapestring($penname)."' WHERE uid = '$_POST[uid]'");
136
+					if($logging) dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_log (`log_action`, `log_uid`, `log_ip`, `log_type`) VALUES('".escapestring(sprintf(_NEWPEN, USERPENNAME, USERUID, $_POST[oldpenname], $uid, $penname))."', '".USERUID."', INET_ATON('".$_SERVER['REMOTE_ADDR']."'), 'EB')");
137
+				}
138
+			}
139
+/* The section adds fields from the authorfields table to the authorinfo table allowing dynamic additions to the bio/registration page */
140
+			$fields = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorfields WHERE field_on = '1'");
141
+			while($field = dbassoc($fields)) {
142
+				$uid = isset($_POST['uid']) && isNumber($_POST['uid']) ? $_POST['uid'] : false;
143
+				if(!$uid) continue;
144
+				$oldfield = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE field='".$field['field_id']."' AND uid = '".$uid."'");
145
+				if(dbnumrows($oldfield) > 0) {
146
+					$newinfo = isset($_POST["af_".$field['field_name']]) ? escapestring(descript($_POST["af_".$field['field_name']])) : false;
147
+					if(!empty($newinfo)) dbquery("UPDATE ".TABLEPREFIX."fanfiction_authorinfo SET info='".$newinfo."' WHERE uid = '$uid' AND field = '".descript($field['field_id'])."'");
148
+					else dbquery("DELETE FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE uid = '$uid' AND field = '".$field['field_id']."'");
149
+				}
150
+				else if(!empty($_POST["af_".$field['field_name']])) dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_authorinfo(`uid`, `info`, `field`) VALUES('$uid', '".escapestring($_POST["af_".$field['field_name']])."', '".$field['field_id']."');");
151
+			}
152
+/* End dynamic fields */
153
+			dbquery("UPDATE "._AUTHORTABLE." SET realname='".descript(strip_tags(escapestring($_POST['realname'])), $allowed_tags)."', email='$email', bio='".descript(strip_tags(escapestring($_POST['bio']), $allowed_tags))."', image='".($imageupload && !empty($_POST['image']) ? escapestring($_POST['image']) : "")."' WHERE uid = '$uid'");
154
+			$output .= write_message(_ACTIONSUCCESSFUL."  ".(isset($_GET['uid']) ? _BACK2ADMIN : _BACK2ACCT));
155
+		}
156
+	}
157
+	else {
158
+		if($action != "register") {
159
+			$result = dbquery("SELECT * FROM "._AUTHORTABLE." WHERE "._UIDFIELD." = '$uid' LIMIT 1");
160
+			$user = dbassoc($result);
161
+			$result2 = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE uid = '$uid'");
162
+			while($field = dbassoc($result2)) {
163
+				$user["af_".$field['field']] = $field['info'];
164
+			}
165
+		}
166
+		if($action == "register") {
167
+			$query = dbquery("SELECT message_text FROM ".TABLEPREFIX."fanfiction_messages WHERE message_name = 'tos'");
168
+			list($tos) = dbrow($query);
169
+			$output .= "<div class='tblborder' style='width: 90%; margin: 1em auto;'>$tos</div>";
170
+		}
171
+		$output .= "<div id='settingsform'><form method=\"POST\" enctype=\"multipart/form-data\" style='margin: 0 auto;' action=\"user.php?action=$action".($uid != USERUID ? "&uid=".$uid : "")."\">
172
+		<div><label for='newpenname'>"._PENNAME.":</label>";
173
+		if((isADMIN && uLEVEL == 1) || $action == "register")
174
+			$output .= "<INPUT name=\"newpenname\" type=\"text\" class=\"textbox\" maxlength=\"200\" value=\"".(isset($user) ? $user['penname'] : "")."\"><INPUT name=\"oldpenname\" type=\"hidden\" value=\"".(isset($user) ? $user['penname'] : "")."\"><font color=\"red\">*</font> ";
175
+		else if(isset($user)) $output .= " ".$user['penname'];
176
+		$output .= "</div>
177
+	 	<div><label for='realname'>"._REALNAME.": </label><INPUT type=\"text\" class=\"textbox=\" name=\"realname\" maxlength=\"200\" value=\"".(isset($user) ? $user['realname'] : "")."\"></div>
178
+	 	<div><label for='email'>"._EMAIL.":</label><INPUT  type=\"text\" class=\"textbox=\" name=\"email\" value=\"".(isset($user) ? $user['email'] : "")."\" maxlength=\"200\" size=\"35\"><font color=\"red\">*</font></div>
179
+	 	<div><label for='bio'>"._BIO.":</label></div>
180
+		<div style='width: 450px; margin: 0 auto;'><textarea class=\"textbox\" name=\"bio\" cols=\"50\" rows=\"6\">".(isset($user) ? stripslashes($user['bio']) : "")."</TEXTAREA></div>";
181
+/* The section adds fields to the form from the authorfields table to the authorinfo table allowing dynamic additions to the bio/registration page */
182
+		$authorfields = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorfields WHERE field_on = '1'");
183
+		while($field = dbassoc($authorfields)) {
184
+			if($field['field_type'] == 1 || $field['field_type'] == 4 || $field['field_type'] == 6) 
185
+				$output .= "<div><label for='".$field['field_name']."'>".$field['field_title'].":</label>\n<input type='text' class='textbox' name='af_".$field['field_name']."'".(!empty($user["af_".$field['field_id']]) ? "value='".$user["af_".$field['field_id']]."'" : "").">\n</div>\n";
186
+			if($field['field_type'] == 2) {
187
+				$output .= "<div><label for='".$field['field_name']."'>".$field['field_title'].":</label>\n
188
+						<select class='textbox' name='af_".$field['field_name']."'>\n";
189
+				$opts = explode("|#|", $field['field_options']);
190
+				foreach($opts as $opt) {
191
+					$output .= "<option".(!empty($user["af_".$field['field_id']]) && $user["af_".$field['field_id']] == $opt ? " selected" : "").">$opt</option>\n";
192
+				}
193
+				$output .= "</select>\n</div>\n";
194
+			}
195
+			if($field['field_type'] == 5) eval(stripslashes($field['field_code_in']));
196
+			if($field['field_type'] == 3) {
197
+				$output .= "<div class='fieldset'><span class='label'>".$field['field_title'].":</span>\n";
198
+				$output .= "<input type='radio' name='af_".$field['field_name']."' id='af_".$field['field_name']._YES."' value='"._YES."'".(!empty($user["af_".$field['field_id']]) && $user["af_".$field['field_id']] == _YES ? "checked='checked'" : "")."> <label for='".$field['field_name']._YES."'>"._YES."</label>\n
199
+					<input type='radio' name='af_".$field['field_name']."' id='af_".$field['field_name']._NO."' value='"._NO."'".(!empty($user["af_".$field['field_id']]) && $user["af_".$field['field_id']] == _NO ? "checked='checked'" : "")."> <label for='".$field['field_name']._NO."'>"._NO."</label></div>\n";
200
+			}
201
+		}
202
+/* End dynamic fields */
203
+	 	if($imageupload == "1")
204
+	 		$output .= "<div><label for='image'>"._IMAGE.":</label> <INPUT  type=\"text\" class=\"textbox=\" name=\"image\" maxlength=\"200\" value=\"".(!empty($user['image']) ? $user['image'] : "")."\"></div>";
205
+		if($action != "register" || $pwdsetting)
206
+	 	$output .= "<div><label for='password'>"._PASSWORD.":</label>  <INPUT name=\"password\" class=\"textbox\" value=\"\" type=\"password\">".($action == "register" ? "<font color=\"red\">*</font>" : "")."</div>
207
+			<div><label for='password2'>"._PASSWORD2.":</label> <INPUT name=\"password2\" class=\"textbox=\" value=\"\" type=\"password\">".($action == "register" ? "<font color=\"red\">*</font>" : "")."</div>";
208
+		if(!empty($captcha) && $action == "register") $output .= "<div><label for='userdigit'>"._CAPTCHANOTE."</label><input MAXLENGTH=5 SIZE=5 name=\"userdigit\" type=\"text\" value=\"\"><div style='text-align: center;'><img width=120 height=30 src=\""._BASEDIR."includes/button.php\" style=\"border: 1px solid #111;\"></div></div>";
209
+	 	$output .= "<div style='text-align: center; margin: 1em;'><INPUT type=\"hidden\" name=\"uid\" value=\"".(isset($user) ? $user['uid'] : "")."\"><INPUT type=\"submit\" class=\"button\" name=\"submit\" value=\""._SUBMIT."\">";
210
+	 	if(!isADMIN)
211
+	 	{
212
+			 	$output .= " [<a href=\"admin.php?action=members&delete=$uid\">"._DELETE."</a>]";
213
+	 	}
214
+	 	$output .= "</div></form></div>".write_message("<font color=\"red\">*</font> "._REQUIREDFIELDS);
215
+	}
216
+?>
0 217
\ No newline at end of file
1 218
new file mode 100644
... ...
@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+// Default query strings used throughout the script.  You may need to alter these to bridge to other scripts or databases.
4
+
5
+define ("_AUTHORPREFIX", "");
6
+
7
+define ("_UIDFIELD", "author.uid");  // Do not change the aliasing (the "author." part)!
8
+define ("_PENNAMEFIELD", "author.penname");  // Do not change the aliasing (the "author." part)!
9
+define ("_EMAILFIELD", "author.email");  // Do not change the aliasing (the "author." part)!
10
+define ("_PASSWORDFIELD", "author.password"); //  Do not change the aliasing (the "author." part)!
11
+define ("_AUTHORTABLE", _AUTHORPREFIX."fanfiction_authors as author"); // Do not change the aliasing (the "as author" part)!
12
+
13
+define ("_STORYQUERY",  "SELECT stories.*, "._PENNAMEFIELD." as penname, UNIX_TIMESTAMP(stories.date) as date, UNIX_TIMESTAMP(stories.updated) as updated FROM ("._AUTHORTABLE.", ".TABLEPREFIX."fanfiction_stories as stories) WHERE "._UIDFIELD." = stories.uid AND stories.validated > 0 ");
14
+define ("_STORYCOUNT", "SELECT count(sid) FROM ".TABLEPREFIX."fanfiction_stories as stories WHERE validated > 0");
15
+define ("_SERIESQUERY", "SELECT series.*, "._PENNAMEFIELD." as penname FROM "._AUTHORTABLE.", ".TABLEPREFIX."fanfiction_series as series WHERE "._UIDFIELD." = series.uid ");
16
+define ("_SERIESCOUNT", "SELECT COUNT(seriesid) FROM ".TABLEPREFIX."fanfiction_series as series ");
17
+define ("_MEMBERLIST", "SELECT count( stories.sid ) as stories, "._PENNAMEFIELD." as penname, "._UIDFIELD." as uid FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs AS ap ON "._UIDFIELD." = ap.uid LEFT JOIN ".TABLEPREFIX."fanfiction_stories AS stories ON stories.validated > 0 AND (FIND_IN_SET("._UIDFIELD.", stories.coauthors) > 0 OR stories.uid = "._UIDFIELD.") ");
18
+define ("_MEMBERCOUNT", "SELECT COUNT(DISTINCT "._UIDFIELD.") FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_stories as stories ON stories.validated > 0 AND (FIND_IN_SET("._UIDFIELD.", stories.coauthors) > 0 OR stories.uid = "._UIDFIELD.")  LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs as ap ON "._UIDFIELD." = ap.uid");
19
+?>
0 20
\ No newline at end of file
1 21
new file mode 100644
2 22
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+This folder contains the files to replace in your eFiction install to bridge it with 
2
+an installation of PHP-Fusion.  These files will let you use your PHP-Fusion users 
3
+table as the authors table for eFiction.  This bridge assumes your PHP-Fusion intall 
4
+and your eFiction install share the same database.
5
+
6
+Move the following files to the users/ folder in your eFiction install:
7
+
8
+editbio.php
9
+login.php
10
+profile.php
11
+register.php
12
+lostpassword.php
13
+
14
+Move the following files to the includes/ folder in your eFiction install:
15
+
16
+get_session_vars.php
17
+queries.php
18
+
19
+Edit queries.php to point to your PHP-Fusion tables.
20
+
21
+Goto Admin->Page Links and edit your Register and Lost Password links to point to your 
22
+PHP-Fusion pages.
23
+
24
+Register -> PATHTOPHPFUSION/register.php 
25
+Lost Password -> PATHTOPHPFUSION/lostpassword.php
26
+
27
+If eFiction is a sub-folder under PHP-Fusion PATHTOPHPFUSION will be ../
28
+
29
+
30
+
0 31
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.0
4
+// Copyright (c) 2007 by Tammy Keefer
5
+// Valid HTML 4.01 Transitional
6
+// Based on eFiction 1.1
7
+// Copyright (C) 2003 by Rebecca Smallwood.
8
+// http://efiction.sourceforge.net/
9
+// ----------------------------------------------------------------------
10
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+
27
+$output .= "<script language=\"javascript\" type=\"text/javascript\">
28
+location = \""._PATHTOFUSION."edit_profile.php".(isset($_GET['uid']) ? ";u=".$_GET['uid'] : "")."\";
29
+</script>";
30
+?>
0 31
\ No newline at end of file
1 32
new file mode 100644
... ...
@@ -0,0 +1,54 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.2
4
+// Copyright (c) 2007 by Tammy Keefer
5
+// Valid HTML 4.01 Transitional
6
+// Based on eFiction 1.1
7
+// Copyright (C) 2003 by Rebecca Smallwood.
8
+// http://efiction.sourceforge.net/
9
+// ----------------------------------------------------------------------
10
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+// Get session variables from cookie data if not logged in.
27
+if (isset($_COOKIE['fusion_user']) && !defined("isMEMBER")) {
28
+	$cookie_vars = explode(".", $_COOKIE['fusion_user']);
29
+	$cookie_1 = preg_match("/^[0-9]+$/", $cookie_vars['0']) ? $cookie_vars['0'] : "0";
30
+	$cookie_2 = (preg_match("/^[0-9a-z]{32}$/", $cookie_vars['1']) ? $cookie_vars['1'] : "");
31
+	$userdata = dbassoc(dbquery("SELECT * FROM ("._AUTHORTABLE.", ".TABLEPREFIX."fanfiction_authorprefs as ap) WHERE "._UIDFIELD." = '$cookie_1' AND "._PASSWORDFIELD." ='$cookie_2' AND "._UIDFIELD." = ap.uid"));
32
+	if($userdata) {
33
+		if($userdata['uid'] == 0) dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_authorprefs(uid, userskin, storyindex, sortby, tinyMCE) VALUES('".$userdata['user_id']."', '$defaultskin', '$displayindex', '$defaultsort', '$tinyMCE')");
34
+		define("USERUID", $userdata['user_id']);
35
+		define("USERPENNAME", $userdata['user_name']);
36
+		if(!isset($_SESSION[$sitekey."_skin"]) && !empty($userdata['userskin'])) $siteskin = $userdata['userskin'];
37
+		else if(isset($_SESSION[$sitekey."_skin"])) $siteskin = $_SESSION[$sitekey."_skin"];
38
+		else $siteskin = $defaultskin;
39
+		define("uLEVEL", $userdata['level']);
40
+		define("isADMIN", uLEVEL > 0 ? true : false);
41
+		define("isMEMBER", true);
42
+		if(!isset($_SESSION[$sitekey."_agecontsent"])) $ageconsent = $userdata['ageconsent'];
43
+		else $ageconsent = $_SESSION[$sitekey."_agecontsent"];
44
+		if (empty($_COOKIE['fusion_lastvisit'])) 
45
+			setcookie("fusion_lastvisit", $userdata['user_lastvisit'], time() + 3600, "/", "", "0");
46
+	}
47
+}
48
+if(!defined("USERUID")) define("USERUID", false);
49
+if(!defined("USERPENNAME")) define("USERPENNAME", false);
50
+if(!defined("uLEVEL")) define("uLEVEL", 0);
51
+if(!defined("isMEMBER")) define("isMEMBER", false);
52
+if(!defined("isADMIN")) define("isADMIN", false);
53
+
54
+?>
0 55
\ No newline at end of file
1 56
new file mode 100644
2 57
new file mode 100644
... ...
@@ -0,0 +1,71 @@
1
+<?php
2
+	if(isset($_POST['submit']) && preg_match("!^[a-z0-9_ ]{3,30}$!i", $_POST['penname'])) {
3
+if(!defined("_LOGINCHECK")) exit( );
4
+		define("_BASEDIR", "");
5
+		include("config.php");
6
+		$settings = dbquery("SELECT tableprefix, maintenance FROM ".$settingsprefix."fanfiction_settings WHERE sitekey = '".$sitekey."'");
7
+		list($tableprefix, $maintenance) = dbrow($settings);
8
+		include("includes/queries.php");
9
+		$result = dbquery("SELECT * FROM "._AUTHORTABLE." LEFT JOIN ".$tableprefix."fanfiction_authorprefs AS ap ON ap.uid = "._UIDFIELD." WHERE "._PENNAMEFIELD." = '".$_POST['penname']."'");
10
+		$passwd = dbassoc($result);
11
+		if($maintenance && $passwd['level'] == 0) {
12
+			header("Location: maintenance.php");
13
+			exit( );
14
+		}
15
+		$encryptedpassword = md5($_POST['password']);
16
+		if($passwd['user_password'] == $encryptedpassword) {
17
+			if(!isset($_SESSION)) session_start( );
18
+			$_SESSION[$sitekey."_useruid"] = $passwd['user_id'];
19
+			$_SESSION[$sitekey."_salt"] = md5($passwd['user_email']+$encryptedpassword);
20
+			if(isset($_POST['cookiecheck'])) {
21
+				$cookie_exp = time() + 3600*24*30; } else { $cookie_exp = time() + 3600*3; 
22
+			}
23
+			$cookie_value = $passwd['user_id'].".".$passwd['user_password'];
24
+			setcookie("fusion_user", $cookie_value, $cookie_exp);
25
+			setcookie("fusion_lastvisit", $userdata['user_lastvisit'], time() + 3600);
26
+			define("USERUID", $passwd['uid']);
27
+			define("USERPENNAME", $passwd['penname']);
28
+			if(!isset($_SESSION[$sitekey."_skin"])) $siteskin = $passwd['userskin'];
29
+			else $siteskin = $_SESSION[$sitekey."_skin"];
30
+			define("uLEVEL", $passwd['level']);
31
+			define("isADMIN", uLEVEL > 0 ? true : false);
32
+			define("isMEMBER", true);
33
+			if(!isset($_SESSION[$sitekey."_agecontsent"])) $ageconsent = $passwd['ageconsent'];
34
+			else $ageconsent = $_SESSION[$sitekey."_agecontsent"];
35
+			$cookie_value = $passwd['user_id'].".".$passwd['user_password'];
36
+			setcookie("fusion_user", $cookie_value, time() + 3600, "/", "", "0");
37
+			if (empty($_COOKIE['fusion_lastvisit'])) 
38
+				setcookie("fusion_lastvisit", $userdata['user_lastvisit'], time() + 3600, "/", "", "0");
39
+		}
40
+		else { 
41
+			require_once("header.php");
42
+			//make a new TemplatePower object
43
+			if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
44
+			else $tpl = new TemplatePower("default_tpls/default.tpl");
45
+			include_once("includes/pagesetup.php");
46
+			$output2 .= "<div id=\"pagetitle\">"._MEMBERLOGIN."</div>";
47
+			$output2 .= "<div style='text-align: center;'>"._WRONGPASSWORD."</div>";
48
+			$tpl->assign("output", $output);
49
+			$tpl->printToScreen( );
50
+			dbclose( );
51
+			exit( );
52
+		}
53
+	}
54
+	else {
55
+if(!defined("_CHARSET")) exit( );
56
+		$output .= "<div id=\"pagetitle\">"._MEMBERLOGIN."</div>";
57
+		$output .= "<div style=\"width: 250px; margin: 0 auto; text-align: center;\"><form method=\"POST\" enctype=\"multipart/form-data\" action=\"user.php?action=login".(isset($_GET['sid']) && isNumber($_GET['sid']) ? "&amp;sid=".$_GET['sid'] : "")."\">
58
+		<div class=\"label\" style=\"float: left;  width: 30%; text-align: right;\"><label for=\"penname\">"._PENNAME.":</label></div><INPUT type=\"text\" class=\"textbox\" name=\"penname\" id=\"penname\"><br />
59
+		<div class=\"label\" style=\"float: left; width: 30%; text-align: right;\"><label for=\"pswd\">"._PASSWORD.":</label></div><INPUT type=\"password\" class=\"textbox\" id=\"pswd\" name=\"password\"><br />
60
+		<INPUT type=\"checkbox\" class=\"checkbox\" name=\"cookiecheck\" id=\"cookiecheck\" value=\"1\"><label for=\"cookiecheck\">"._REMEMBERME."</label><br />
61
+		<INPUT type=\"submit\" class=\"button\" name=\"submit\" value=\""._SUBMIT."\">
62
+		</form></div>";
63
+		$linkquery = dbquery("SELECT * from ".TABLEPREFIX."fanfiction_pagelinks WHERE link_name = 'login' OR link_name = 'lostpassword'");
64
+		while($link = dbassoc($linkquery)) {
65
+			if($link['link_access'] && !isMEMBER) continue;
66
+			if($link['link_access'] == 2 && !isADMIN) continue;
67
+			$pagelinks[$link['link_name']] = array("id" => $link['link_id'], "text" => $link['link_text'], "url" => _BASEDIR.$link['link_url'], "link" => "<a href=\"".$link['link_url']."\" title=\"".$link['link_text']."\"".($link['link_target'] ? " target=\"_blank\"" : "").($current == $link['link_name'] ? " id=\"current\"" : "").">".$link['link_text']."</a>");
68
+		}
69
+		$output .= "<div style='text-align: center;'>".$pagelinks['register']['link']." | ".$pagelinks['lostpassword']['link']."</div>";
70
+	}
71
+?>
0 72
\ No newline at end of file
1 73
new file mode 100644
... ...
@@ -0,0 +1,44 @@
1
+<?php
2
+if(!defined("_LOGOUTCHECK")) exit( );
3
+	define("_BASEDIR", "");
4
+	include("config.php");
5
+	include("includes/queries.php");
6
+	session_start( );
7
+	foreach ($_SESSION as $VarName => $Value)  { 
8
+		if(substr($VarName, 0, strlen($sitekey)) == $sitekey) {
9
+			if(strpos($VarName, "skin")) continue;
10
+			$_SESSION[$VarName] = "";
11
+			unset($_SESSION[$VarName]);
12
+			unset($_COOKIE[$VarName]);
13
+			setcookie($VarName, '', time() - 1000, '/', '', '' );
14
+		}
15
+	} 
16
+	foreach ($_COOKIE as $VarName => $Value)  { 
17
+		if(substr($VarName, 0, strlen($sitekey)) == $sitekey) {
18
+			unset($_COOKIE[$VarName]);
19
+			setcookie($VarName, "", time() - 1000, '/', '', '' );
20
+		}
21
+	} 
22
+	$result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_ip='".$_SERVER['REMOTE_ADDR']."'");
23
+	unset($_COOKIE["fusion_user"], $_COOKIE["fusion_lastvisited"], $_COOKIE['fusion_visited']);
24
+	setcookie("fusion_user", "", time() - 1000);
25
+	setcookie("fusion_lastvisit", "", time() - 1000);
26
+	setcookie("fusion_visited", "", time() - 1000);
27
+
28
+require_once("header.php");
29
+//make a new TemplatePower object
30
+if(file_exists("$skindir/default.tpl")) $tpl = new TemplatePower( "$skindir/default.tpl" );
31
+else $tpl = new TemplatePower("default_tpls/default.tpl");
32
+if(file_exists("$skindir/listings.tpl")) $tpl->assignInclude( "listings", "./$skindir/listings.tpl" );
33
+else $tpl->assignInclude( "listings", "./default_tpls/listings.tpl" );
34
+include("includes/pagesetup.php");
35
+
36
+$output .= write_message(_ACTIONSUCCESSFUL);
37
+$tpl->assign("output", $output);
38
+$tpl->printToScreen( );
39
+dbclose( );
40
+exit();
41
+
42
+//	header("Location: index.php");
43
+//	exit( );
44
+?>
0 45
\ No newline at end of file
1 46
new file mode 100644
... ...
@@ -0,0 +1,29 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.0
4
+// Copyright (c) 2007 by Tammy Keefer
5
+// Valid HTML 4.01 Transitional
6
+// Based on eFiction 1.1
7
+// Copyright (C) 2003 by Rebecca Smallwood.
8
+// http://efiction.sourceforge.net/
9
+// ----------------------------------------------------------------------
10
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+$output .= "<script language=\"javascript\" type=\"text/javascript\">
27
+location = \""._PATHTOFUSION."lostpassword.php\";
28
+</script>";
29
+?>
0 30
\ No newline at end of file
1 31
new file mode 100644
... ...
@@ -0,0 +1,52 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.0
4
+// Copyright (c) 2007 by Tammy Keefer
5
+// Valid HTML 4.01 Transitional
6
+// Based on eFiction 1.1
7
+// Copyright (C) 2003 by Rebecca Smallwood.
8
+// http://efiction.sourceforge.net/
9
+// ----------------------------------------------------------------------
10
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+// Build the user's profile information
27
+$tpl->newBlock("profile");
28
+$result2 = dbquery("SELECT *,"._PENNAMEFIELD." as penname,user_avatar as image, user_email as email FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs as ap ON ap.uid = "._UIDFIELD." WHERE "._UIDFIELD." = '$uid' LIMIT 1");
29
+$userinfo = dbassoc($result2);
30
+$nameinfo = "";
31
+if($userinfo['email'])
32
+	$nameinfo .= " [<a href=\"viewuser.php?action=contact&amp;uid=".$userinfo['uid']."\">"._CONTACT."</a>]";
33
+if($favorites == "1" && isMEMBER)
34
+	$nameinfo .= " [<a href=\"viewuser.php?uid=USERUID&amp;action=addfav&amp;author=".$userinfo['uid']."\">"._ADDAUTHOR2FAVES."</a>]";
35
+$tpl->assign("userpenname", $userinfo['penname']." ".$nameinfo);
36
+$tpl->assign("membersince", date("$dateformat", $userinfo['user_joined']));
37
+if($userinfo['image'])
38
+	$tpl->assign("image", "<img src=\"../images/avatars/".$userinfo['image']."\">");
39
+$tpl->assign("userlevel", isset($userinfo['level']) && $userinfo['level'] > 0 && $userinfo['level'] < 4 ? _ADMINISTRATOR.(isADMIN ? " - ".$userinfo['level'] : "") : _MEMBER);
40
+$tpl->assign("aol", !empty($userinfo['user_aol']) ? "<img src=\"http://big.oscar.aol.com/".$userinfo['user_aol']."?on_url=$url/images/aim.gif&amp;off_url=$url/images/aim.gif\"> <a href=\"aim:goim?{aol}ScreenName=".$userinfo['user_aol']."\">".$userinfo['user_aol']."</a>" : "<img src=\"images/aim.gif\" alt=\""._AOL."\"> "._NONE);
41
+$tpl->assign("icq", !empty($userinfo['user_icq']) ? "<img src=\"http://status.icq.com/online.gif?icq=".$userinfo['user_icq']."&amp;img=5\"> ".$userinfo['user_icq'] : "<img src=\"images/icq.gif\" alt=\""._ICQ."\"> "._NONE);
42
+$tpl->assign("msn", "<img src=\"images/msntalk.gif\" alt=\""._MSN."\"> ".($userinfo['user_msn'] ? $userinfo['user_msn'] : _NONE));
43
+$tpl->assign("yahoo", !empty($userinfo['user_yahoo']) ? "<a href=\"http://edit.yahoo.com/config/send_webmesg?.target=".$userinfo['user_yahoo']."&amp;.src=pg\"><img border=\"0\" src=\"http://opi.yahoo.com/online?u=".$userinfo['user_yahoo']."&amp;m=g&amp;t=1\"> ".$userinfo['user_yahoo']."</a>" : "<img src=\"images/yim.gif\" alt=\""._YAHOO."\"> "._NONE);
44
+$adminopts = "";
45
+if(isADMIN && uLEVEL < 3) {
46
+	$adminopts .= "<div class=\"adminoptions\"><span class='label'>"._ADMINOPTIONS.":</span> ".(isset($userinfo['validated']) && $userinfo['validated'] ? "[<a href=\"admin.php?action=members&amp;revoke=$uid\" class=\"vuadmin\">"._REVOKEVAL."</a>] " : "[<a href=\"admin.php?action=members&amp;validate=$uid\" class=\"vuadmin\">"._VALIDATE."</a>] ")."[<a href=\"user.php?action=editbio&amp;uid=$uid\" class=\"vuadmin\">"._EDIT."</a>] [<a href=\"admin.php?action=members&amp;delete=$uid\" class=\"vuadmin\">"._DELETE."</a>]";
47
+	$adminopts .= " [<a href=\"admin.php?action=lock&amp;".($userinfo['level'] < 0 ? "unlock=".$userinfo['uid']."\" class=\"vuadmin\">"._UNLOCKMEM : "do=lock&amp;uid=".$userinfo['uid']."\" class=\"vuadmin\">"._LOCKMEM)."</a>]";
48
+	$adminopts .= " [<a href=\"admin.php?action=admins&amp;".(isset($userinfo['level']) && $userinfo['level'] > 0 ? "revoke=$uid\" class=\"vuadmin\">"._REVOKEADMIN."</a>] [<a href=\"admin.php?action=admins&amp;do=edit&amp;uid=$uid\" class=\"vuadmin\">"._EDITADMIN : "do=new&amp;uid=$uid\" class=\"vuadmin\">"._MAKEADMIN)."</a>]</div>";
49
+	$tpl->assign("adminoptions", $adminopts);
50
+}
51
+$tpl->gotoBlock("_ROOT");
52
+?>
0 53
\ No newline at end of file
1 54
new file mode 100644
... ...
@@ -0,0 +1,23 @@
1
+<?php
2
+
3
+// Default query strings used throughout the script.  You may need to alter these to bridge to other scripts or databases.
4
+
5
+// Your php-fusion database prefix found in the config.php of your php-fusion directory.
6
+$db_prefix = "fusion_";
7
+
8
+// This should be the relative path to your PHP-Fusion installation.  It will be used for your register, edit bio, etc. pages.
9
+define("_PATHTOFUSION", "../fusion");
10
+
11
+define("_UIDFIELD", "author.user_id");  // Do not change the aliasing (the "author." part)!
12
+define("_PENNAMEFIELD", "author.user_name");  // Do not change the aliasing (the "author." part)!
13
+define("_EMAILFIELD", "author.user_email");  // Do not change the aliasing (the "author." part)!
14
+define("_PASSWORDFIELD", "author.user_password"); // Do not change the aliasing (the "author." part)!
15
+define("_AUTHORTABLE", $db_prefix."users as author"); // Do not change the aliasing (the "as author" part)!
16
+
17
+define ("_STORYQUERY",  "SELECT stories.*, "._PENNAMEFIELD." as penname, UNIX_TIMESTAMP(stories.date) as date, UNIX_TIMESTAMP(stories.updated) as updated FROM ("._AUTHORTABLE.", ".TABLEPREFIX."fanfiction_stories as stories) WHERE "._UIDFIELD." = stories.uid AND stories.validated > 0 ");
18
+define ("_STORYCOUNT", "SELECT count(sid) FROM ".TABLEPREFIX."fanfiction_stories as stories WHERE validated > 0");
19
+define ("_SERIESQUERY", "SELECT series.*, "._PENNAMEFIELD." as penname FROM "._AUTHORTABLE.", ".TABLEPREFIX."fanfiction_series as series WHERE "._UIDFIELD." = series.uid ");
20
+define ("_SERIESCOUNT", "SELECT COUNT(seriesid) FROM ".TABLEPREFIX."fanfiction_series as series ");
21
+define ("_MEMBERLIST", "SELECT count( stories.sid ) as stories, "._PENNAMEFIELD." as penname, "._UIDFIELD." as uid FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs AS ap ON "._UIDFIELD." = ap.uid LEFT JOIN ".TABLEPREFIX."fanfiction_stories AS stories ON stories.validated > 0 AND (FIND_IN_SET("._UIDFIELD.", stories.coauthors) > 0 OR stories.uid = "._UIDFIELD.") ");
22
+define ("_MEMBERCOUNT", "SELECT COUNT(DISTINCT "._UIDFIELD.") FROM "._AUTHORTABLE." LEFT JOIN ".TABLEPREFIX."fanfiction_stories as stories ON stories.validated > 0 AND (FIND_IN_SET("._UIDFIELD.", stories.coauthors) > 0 OR stories.uid = "._UIDFIELD.")  LEFT JOIN ".TABLEPREFIX."fanfiction_authorprefs as ap ON "._UIDFIELD." = ap.uid");
23
+?>
0 24
\ No newline at end of file
1 25
new file mode 100644
... ...
@@ -0,0 +1,29 @@
1
+<?php
2
+// ----------------------------------------------------------------------
3
+// eFiction 3.0
4
+// Copyright (c) 2007 by Tammy Keefer
5
+// Valid HTML 4.01 Transitional
6
+// Based on eFiction 1.1
7
+// Copyright (C) 2003 by Rebecca Smallwood.
8
+// http://efiction.sourceforge.net/
9
+// ----------------------------------------------------------------------
10
+// LICENSE
11
+//
12
+// This program is free software; you can redistribute it and/or
13
+// modify it under the terms of the GNU General Public License (GPL)
14
+// as published by the Free Software Foundation; either version 2
15
+// of the License, or (at your option) any later version.
16
+//
17
+// This program is distributed in the hope that it will be useful,
18
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
+// GNU General Public License for more details.
21
+//
22
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
23
+// ----------------------------------------------------------------------
24
+
25
+if(!defined("_CHARSET")) exit( );
26
+$output .= "<script language=\"javascript\" type=\"text/javascript\">
27
+location = \""._PATHTOFUSION."register.php\";
28
+</script>";
29
+?>
0 30
\ No newline at end of file