Browse code

Initial uplad w/ php7 fixes

Rainer Volkrodt authored on 2016/03/12 15:54:02
Showing 1 changed files
1 1
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