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,31 @@
1
+<?php
2
+if(!defined("_CHARSET")) exit( );
3
+
4
+global $language, $numupdated;
5
+$blockquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_blocks WHERE block_name = 'countdown'");
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/countdown/block.php");
13
+	if(isset($_POST['submit'])) {
14
+		if(!empty($_POST['target'])) $blocks['countdown']['target'] = escapestring($_POST['target']);
15
+		else unset($blocks['countdown']['target']);
16
+		if(!empty($_POST['CDformat'])) $blocks['countdown']['CDformat'] = escapestring($_POST['CDformat']);
17
+		else unset($blocks['countdown']['CDformat']);
18
+		if(!empty($_POST['finish'])) $blocks['countdown']['CDfinal'] = escapestring($_POST['finish']);
19
+		else unset($blocks['countdown']['CDfinal']);
20
+		$output .= "<div style='text-align: center;'>"._ACTIONSUCCESSFUL."</div>";
21
+		save_blocks( $blocks );
22
+	}
23
+	else  {
24
+		$output .= "<div style='text-align: center;'><b>"._CURRENT.":</b><br /><div class=\"tblborder\" style=\"width: 80%; margin: 0 auto; text-align: left;\">".$content."</div><br /></div>";
25
+		$output .= "<div id='settingsform'><form method=\"POST\" enctype=\"multipart/form-data\" action=\"admin.php?action=blocks&amp;admin=countdown\">
26
+			<div><label for=\"target\">"._TARGETDATE.":</label><input type=\"text\" class=\"textbox\" name=\"target\" id=\"target\" value=\"".(!empty($blocks['countdown']['target']) ? $blocks['countdown']['target'] : date("m/d/Y G:H"))."\"></div>
27
+			<div><label for=\"CDformat\">"._FORMATCOUNT.":</label><input type=\"text\" class=\"textbox\" name=\"CDformat\" id=\"CDformat\" size=\"40\" value=\"".(empty($blocks['countdown']['CDformat']) ? _COUNTDOWNFORMAT : $blocks['countdown']['CDformat'])."\"></div>
28
+			<div><label for=\"finish\">"._FINISHMESSAGE.":</label><input type=\"text\" class=\"textbox\" name=\"finish\" id=\"finish\" size=\"40\" value=\"".(empty($blocks['countdown']['finish']) ? _COUNTDOWNOVER : $blocks['countdown']['finish'])."\"></div>
29
+			<INPUT type=\"submit\" name=\"submit\" class=\"button\" id=\"submit\" value=\""._SUBMIT."\"></form></div><div style='text-align: center;'>"._DATENOTE."</div>";
30
+	}
31
+?>
0 32
\ No newline at end of file