| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,46 @@ |
| 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 |
+ if ($block['block_variables']) |
|
| 6 |
+ {
|
|
| 7 |
+ $blocks[$block['block_name']] = unserialize($block['block_variables']); |
|
| 8 |
+ } |
|
| 9 |
+ $blocks[$block['block_name']]['title'] = $block['block_title']; |
|
| 10 |
+ $blocks[$block['block_name']]['file'] = $block['block_file']; |
|
| 11 |
+ $blocks[$block['block_name']]['status'] = $block['block_status']; |
|
| 12 |
+} |
|
| 13 |
+global $language; |
|
| 14 |
+// Set $loggedin to 0 to see the block |
|
| 15 |
+include("blocks/login/login.php");
|
|
| 16 |
+// Then set it back to 1. |
|
| 17 |
+if(file_exists("blocks/login/$language.php")) include("blocks/login/$language.php");
|
|
| 18 |
+else include("blocks/login/en.php");
|
|
| 19 |
+ if(isset($_POST['submit'])) {
|
|
| 20 |
+ $blocks['login']['acctlink'] = $_POST['acctlink']; |
|
| 21 |
+ if(empty($_POST['form'])) unset($blocks['login']['form']); |
|
| 22 |
+ else $blocks['login']['form'] = $_POST['form']; |
|
| 23 |
+ $blocks['login']['template'] = addslashes(descript($_POST['template'])); |
|
| 24 |
+ save_blocks( $blocks ); |
|
| 25 |
+ unset($_GET['admin']); |
|
| 26 |
+ $output .= write_message(_ACTIONSUCCESSFUL); |
|
| 27 |
+ } |
|
| 28 |
+ else {
|
|
| 29 |
+ if(empty($blocks['login']['template'])) $template = ""; |
|
| 30 |
+ else $template = $blocks['login']['template']; |
|
| 31 |
+ $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 />"; |
|
| 32 |
+ $output .= _LOGINNOTE."<div id='settingsform'><form method=\"POST\" enctype=\"multipart/form-data\" action=\"admin.php?action=blocks&admin=login\"> |
|
| 33 |
+ <div><label for=\"template\">"._TEMPLATE.":</label><span style='clear: left;'> </span></div> |
|
| 34 |
+ <div class=\"shorttextarea\"><textarea name=\"template\" rows=\"5\" style=\"width: 100%;\" cols=\"40\">".stripslashes($template)."</textarea>"; |
|
| 35 |
+ if($tinyMCE) |
|
| 36 |
+ $output .= "<div class='tinytoggle'><input type='checkbox' name='toggle' onclick=\"toogleEditorMode('template');\" checked><label for='toggle'>"._TINYMCETOGGLE."</label></div>";
|
|
| 37 |
+ $output .= "</div> |
|
| 38 |
+ <label for=\"form\">"._DEFAULTOPTS.":</label> <select name=\"form\" id=\"form\" class=\"textbox\" ><option value=\"0\"".(empty($blocks['login']['form']) ? " selected" : "").">"._SHORT."</option> |
|
| 39 |
+ <option value=\"1\"".(!empty($blocks['login']['form']) ? " selected" : "").">"._LONG."</option> |
|
| 40 |
+ </select><br /> |
|
| 41 |
+ <label for=\"acctlink\">"._ACCTLINK."</label> <select name=\"acctlink\" id=\"acctlink\" class=\"textbox\" ><option value=\"0\"".(empty($blocks['login']['acctlink']) ? " selected" : "").">"._NO."</option> |
|
| 42 |
+ <option value=\"1\"".(!empty($blocks['login']['acctlink']) ? " selected" : "").">"._YES."</option> |
|
| 43 |
+ </select><br /> |
|
| 44 |
+ <INPUT type=\"submit\" class=\"button\" id=\"submit\" name=\"submit\" value=\""._SUBMIT."\"></form></div>"; |
|
| 45 |
+ } |
|
| 46 |
+?> |
|
| 0 | 47 |
\ No newline at end of file |