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,34 @@
1
+<?php
2
+if(!defined("_CHARSET")) exit( );
3
+
4
+global $language;
5
+$blockquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_blocks WHERE block_name = 'random'");
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/".$blocks['random']['file']);
13
+if(!empty($blocks['random']['tpl'])) $tpl->gotoBlock("_ROOT");
14
+	if(isset($_POST['submit'])) {
15
+		if($_POST['tpl']) $blocks['random']['tpl'] = 1;
16
+		else unset($blocks['random']['tpl']);
17
+		if($_POST['allowtags']) $blocks['random']['allowtags'] = 1;
18
+		else unset($blocks['random']['allowtags']);
19
+		if(isset($_POST['sumlength']) && isNumber($_POST['sumlength'])) $blocks['random']['sumlength'] = $_POST['sumlength'];
20
+		else unset($blocks['random']['sumlength']);
21
+		$output .= "<div style='text-align: center;'>"._ACTIONSUCCESSFUL."</div>";
22
+		save_blocks( $blocks );
23
+	}
24
+	else  {
25
+		$output .= "<div style='text-align: center;'><b>"._CURRENT.":</b><br /><div class=\"tblborder\" style=\"width: 80%; margin: 1ex auto; text-align: left;\">".(!empty($blocks['random']['tpl']) ? _NATPL : $content)."</div><br /></div>";
26
+		$output .= "<div id='settingsform'><form method=\"POST\" enctype=\"multipart/form-data\" action=\"admin.php?action=blocks&admin=random\">
27
+			<label for=\"tpl\">"._BLOCKTYPE.":</label><select class=\"textbox\" name=\"tpl\" id=\"tpl\"><option value=\"0\"".(empty($blocks['random']['tpl']) ? " selected" : "").">"._DEFAULT."</option>
28
+					<option value=\"1\"".(!empty($blocks['random']['tpl']) ? " selected" : "").">"._USETPL."</option></select><br />
29
+			<label for=\"allowtags\">"._TAGS.":</label><select class=\"textbox\" name=\"allowtags\" id=\"allowtags\"><option value=\"0\"".(empty($blocks['random']['allowtags']) ? " selected" : "").">"._STRIPTAGS."</option>
30
+					<option value=\"1\"".(!empty($blocks['random']['allowtags']) ? " selected" : "").">"._ALLOWTAGS."</option></select><br />
31
+			<label for=\"sumlength\">"._SUMLENGTH.":</label><input type=\"text\" class=\"textbox\" name=\"sumlength\" id=\"sumlength\" size=\"4\" value=\"".(!empty($blocks['random']['sumlength']) ? $blocks['random']['sumlength'] : "")."\"><br />
32
+			<INPUT type=\"submit\" name=\"submit\" id=\"submit\" class=\"button\" value=\""._SUBMIT."\"></form></div><div style='text-align: center;'>"._SUMNOTE."</div>";
33
+	}
34
+?>
0 35
\ No newline at end of file