| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,126 +0,0 @@ |
| 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 |
- |
|
| 53 |
- |
|
| 54 |
-/* The section adds fields from the authorfields table to the authorinfo table allowing dynamic additions to the bio/registration page */ |
|
| 55 |
- $fields = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorfields WHERE field_on = '1'");
|
|
| 56 |
- while($field = dbassoc($fields)) {
|
|
| 57 |
- $uid = isset($_POST['uid']) && isNumber($_POST['uid']) ? $_POST['uid'] : false; |
|
| 58 |
- if(!$uid) continue; |
|
| 59 |
- $oldfield = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE field='".$field['field_id']."' AND uid = '".$uid."'");
|
|
| 60 |
- if(dbnumrows($oldfield) > 0) {
|
|
| 61 |
- $newinfo = isset($_POST["af_".$field['field_name']]) ? escapestring(descript($_POST["af_".$field['field_name']])) : false; |
|
| 62 |
- if(!empty($newinfo)) dbquery("UPDATE ".TABLEPREFIX."fanfiction_authorinfo SET info='".$newinfo."' WHERE uid = '$uid' AND field = '".descript($field['field_id'])."'");
|
|
| 63 |
- else dbquery("DELETE FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE uid = '$uid' AND field = '".$field['field_id']."'");
|
|
| 64 |
- } |
|
| 65 |
- 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']."');");
|
|
| 66 |
- } |
|
| 67 |
-/* End dynamic fields */ |
|
| 68 |
- |
|
| 69 |
- $output .= write_message(_ACTIONSUCCESSFUL." ".(isset($_GET['uid']) ? _BACK2ADMIN : _BACK2ACCT)); |
|
| 70 |
- |
|
| 71 |
- } |
|
| 72 |
- else {
|
|
| 73 |
- if($action != "register") {
|
|
| 74 |
- $result = dbquery("SELECT * FROM "._AUTHORTABLE." WHERE "._UIDFIELD." = '$uid' LIMIT 1");
|
|
| 75 |
- $user = dbassoc($result); |
|
| 76 |
- $result2 = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE uid = '$uid'");
|
|
| 77 |
- while($field = dbassoc($result2)) {
|
|
| 78 |
- $user["af_".$field['field']] = $field['info']; |
|
| 79 |
- } |
|
| 80 |
- } |
|
| 81 |
- |
|
| 82 |
- $output .= "<div id='settingsform'> |
|
| 83 |
- <form method=\"POST\" id=\"editbio\" name=\"editbio\" enctype=\"multipart/form-data\" style='margin: 0 auto;' |
|
| 84 |
- action=\"user.php?action=$action".($uid != USERUID ? "&uid=".$uid : "")."\"> |
|
| 85 |
- <div><label for='newpenname'>"._PENNAME.":</label>"; |
|
| 86 |
- $output .= " ".$user['user_name']; |
|
| 87 |
- $output .= "</div> |
|
| 88 |
- <div><label for='realname'>"._REALNAME.": </label>"; |
|
| 89 |
- $output .= " ".$user['user_realm']; |
|
| 90 |
- $output .= "</div>"; |
|
| 91 |
- $output .= "<div><label for='realname'>"._EMAIL.": </label>"; |
|
| 92 |
- $output .= " ".$user['user_email']; |
|
| 93 |
- $output .= "</div>"; |
|
| 94 |
- $output .= "<div><label for='realname'>"._BIO.": </label>"; |
|
| 95 |
- $output .= " ".$user['user_email']; |
|
| 96 |
- $output .= "</div>"; |
|
| 97 |
- /* The section adds fields to the form from the authorfields table to the authorinfo table allowing dynamic additions to the bio/registration page */ |
|
| 98 |
- $authorfields = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorfields WHERE field_on = '1'");
|
|
| 99 |
- while($field = dbassoc($authorfields)) {
|
|
| 100 |
- if($field['field_type'] == 1 || $field['field_type'] == 4 || $field['field_type'] == 6) |
|
| 101 |
- $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"; |
|
| 102 |
- if($field['field_type'] == 2) {
|
|
| 103 |
- $output .= "<div><label for='".$field['field_name']."'>".$field['field_title'].":</label>\n |
|
| 104 |
- <select class='textbox' name='af_".$field['field_name']."'>\n"; |
|
| 105 |
- $opts = explode("|#|", $field['field_options']);
|
|
| 106 |
- foreach($opts as $opt) {
|
|
| 107 |
- $output .= "<option".(!empty($user["af_".$field['field_id']]) && $user["af_".$field['field_id']] == $opt ? " selected" : "").">$opt</option>\n"; |
|
| 108 |
- } |
|
| 109 |
- $output .= "</select>\n</div>\n"; |
|
| 110 |
- } |
|
| 111 |
- if($field['field_type'] == 5) eval(stripslashes($field['field_code_in'])); |
|
| 112 |
- if($field['field_type'] == 3) {
|
|
| 113 |
- $output .= "<div class='fieldset'><span class='label'>".$field['field_title'].":</span>\n"; |
|
| 114 |
- $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 |
|
| 115 |
- <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"; |
|
| 116 |
- } |
|
| 117 |
- } |
|
| 118 |
-/* End dynamic fields */ |
|
| 119 |
- $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."\">"; |
|
| 120 |
- if(!isADMIN && $action != "register") |
|
| 121 |
- {
|
|
| 122 |
- $output .= " [<a href=\"admin.php?action=members&delete=$uid\">"._DELETE."</a>]"; |
|
| 123 |
- } |
|
| 124 |
- $output .= "</div></form></div>".write_message("<font color=\"red\">*</font> "._REQUIREDFIELDS);
|
|
| 125 |
- } |
|
| 126 |
-?> |
|
| 127 | 0 |
\ No newline at end of file |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,126 @@ |
| 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 |
+ |
|
| 53 |
+ |
|
| 54 |
+/* The section adds fields from the authorfields table to the authorinfo table allowing dynamic additions to the bio/registration page */ |
|
| 55 |
+ $fields = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorfields WHERE field_on = '1'");
|
|
| 56 |
+ while($field = dbassoc($fields)) {
|
|
| 57 |
+ $uid = isset($_POST['uid']) && isNumber($_POST['uid']) ? $_POST['uid'] : false; |
|
| 58 |
+ if(!$uid) continue; |
|
| 59 |
+ $oldfield = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE field='".$field['field_id']."' AND uid = '".$uid."'");
|
|
| 60 |
+ if(dbnumrows($oldfield) > 0) {
|
|
| 61 |
+ $newinfo = isset($_POST["af_".$field['field_name']]) ? escapestring(descript($_POST["af_".$field['field_name']])) : false; |
|
| 62 |
+ if(!empty($newinfo)) dbquery("UPDATE ".TABLEPREFIX."fanfiction_authorinfo SET info='".$newinfo."' WHERE uid = '$uid' AND field = '".descript($field['field_id'])."'");
|
|
| 63 |
+ else dbquery("DELETE FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE uid = '$uid' AND field = '".$field['field_id']."'");
|
|
| 64 |
+ } |
|
| 65 |
+ 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']."');");
|
|
| 66 |
+ } |
|
| 67 |
+/* End dynamic fields */ |
|
| 68 |
+ |
|
| 69 |
+ $output .= write_message(_ACTIONSUCCESSFUL." ".(isset($_GET['uid']) ? _BACK2ADMIN : _BACK2ACCT)); |
|
| 70 |
+ |
|
| 71 |
+ } |
|
| 72 |
+ else {
|
|
| 73 |
+ if($action != "register") {
|
|
| 74 |
+ $result = dbquery("SELECT * FROM "._AUTHORTABLE." WHERE "._UIDFIELD." = '$uid' LIMIT 1");
|
|
| 75 |
+ $user = dbassoc($result); |
|
| 76 |
+ $result2 = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorinfo WHERE uid = '$uid'");
|
|
| 77 |
+ while($field = dbassoc($result2)) {
|
|
| 78 |
+ $user["af_".$field['field']] = $field['info']; |
|
| 79 |
+ } |
|
| 80 |
+ } |
|
| 81 |
+ |
|
| 82 |
+ $output .= "<div id='settingsform'> |
|
| 83 |
+ <form method=\"POST\" id=\"editbio\" name=\"editbio\" enctype=\"multipart/form-data\" style='margin: 0 auto;' |
|
| 84 |
+ action=\"user.php?action=$action".($uid != USERUID ? "&uid=".$uid : "")."\"> |
|
| 85 |
+ <div><label for='newpenname'>"._PENNAME.":</label>"; |
|
| 86 |
+ $output .= " ".$user['user_name']; |
|
| 87 |
+ $output .= "</div> |
|
| 88 |
+ <div><label for='realname'>"._REALNAME.": </label>"; |
|
| 89 |
+ $output .= " ".$user['user_realm']; |
|
| 90 |
+ $output .= "</div>"; |
|
| 91 |
+ $output .= "<div><label for='realname'>"._EMAIL.": </label>"; |
|
| 92 |
+ $output .= " ".$user['user_email']; |
|
| 93 |
+ $output .= "</div>"; |
|
| 94 |
+ $output .= "<div><label for='realname'>"._BIO.": </label>"; |
|
| 95 |
+ $output .= " ".$user['user_email']; |
|
| 96 |
+ $output .= "</div>"; |
|
| 97 |
+ /* The section adds fields to the form from the authorfields table to the authorinfo table allowing dynamic additions to the bio/registration page */ |
|
| 98 |
+ $authorfields = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_authorfields WHERE field_on = '1'");
|
|
| 99 |
+ while($field = dbassoc($authorfields)) {
|
|
| 100 |
+ if($field['field_type'] == 1 || $field['field_type'] == 4 || $field['field_type'] == 6) |
|
| 101 |
+ $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"; |
|
| 102 |
+ if($field['field_type'] == 2) {
|
|
| 103 |
+ $output .= "<div><label for='".$field['field_name']."'>".$field['field_title'].":</label>\n |
|
| 104 |
+ <select class='textbox' name='af_".$field['field_name']."'>\n"; |
|
| 105 |
+ $opts = explode("|#|", $field['field_options']);
|
|
| 106 |
+ foreach($opts as $opt) {
|
|
| 107 |
+ $output .= "<option".(!empty($user["af_".$field['field_id']]) && $user["af_".$field['field_id']] == $opt ? " selected" : "").">$opt</option>\n"; |
|
| 108 |
+ } |
|
| 109 |
+ $output .= "</select>\n</div>\n"; |
|
| 110 |
+ } |
|
| 111 |
+ if($field['field_type'] == 5) eval(stripslashes($field['field_code_in'])); |
|
| 112 |
+ if($field['field_type'] == 3) {
|
|
| 113 |
+ $output .= "<div class='fieldset'><span class='label'>".$field['field_title'].":</span>\n"; |
|
| 114 |
+ $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 |
|
| 115 |
+ <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"; |
|
| 116 |
+ } |
|
| 117 |
+ } |
|
| 118 |
+/* End dynamic fields */ |
|
| 119 |
+ $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."\">"; |
|
| 120 |
+ if(!isADMIN && $action != "register") |
|
| 121 |
+ {
|
|
| 122 |
+ $output .= " [<a href=\"admin.php?action=members&delete=$uid\">"._DELETE."</a>]"; |
|
| 123 |
+ } |
|
| 124 |
+ $output .= "</div></form></div>".write_message("<font color=\"red\">*</font> "._REQUIREDFIELDS);
|
|
| 125 |
+ } |
|
| 126 |
+?> |
|
| 0 | 127 |
\ No newline at end of file |