| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,36 @@ |
| 1 |
+<?php |
|
| 2 |
+if(!defined("_CHARSET")) exit( );
|
|
| 3 |
+ |
|
| 4 |
+$blockquery = dbquery("SELECT * FROM ".TABLEPREFIX."fanfiction_blocks WHERE block_name = 'news'");
|
|
| 5 |
+while($block = dbassoc($blockquery)) {
|
|
| 6 |
+ if ($block['block_variables']) |
|
| 7 |
+ {
|
|
| 8 |
+ $blocks[$block['block_name']] = unserialize($block['block_variables']); |
|
| 9 |
+ } |
|
| 10 |
+ $blocks[$block['block_name']]['title'] = $block['block_title']; |
|
| 11 |
+ $blocks[$block['block_name']]['file'] = $block['block_file']; |
|
| 12 |
+ $blocks[$block['block_name']]['status'] = $block['block_status']; |
|
| 13 |
+} |
|
| 14 |
+global $language, $numupdated; |
|
| 15 |
+ |
|
| 16 |
+if (file_exists(_BASEDIR . "blocks/news/" . $language . ".php")) include(_BASEDIR . "blocks/news/" . $language . ".php"); |
|
| 17 |
+else include(_BASEDIR . "blocks/news/en.php"); |
|
| 18 |
+ |
|
| 19 |
+include("blocks/".$blocks['news']['file']);
|
|
| 20 |
+ if(isset($_POST['submit'])) {
|
|
| 21 |
+ if(isset($_POST['num']) && isNumber($_POST['num'])) $blocks['news']['num'] = $_POST['num']; |
|
| 22 |
+ else $blocks['news']['num'] = 1; |
|
| 23 |
+ if(isset($_POST['sumlength']) && isNumber($_POST['sumlength'])) $blocks['news']['sumlength'] = $_POST['sumlength']; |
|
| 24 |
+ else unset($blocks['news']['sumlength']); |
|
| 25 |
+ $output .= "<div style='text-align: center;'>"._ACTIONSUCCESSFUL."</div>"; |
|
| 26 |
+ save_blocks( $blocks ); |
|
| 27 |
+ } |
|
| 28 |
+ else {
|
|
| 29 |
+ if(!isset($blocks['news']['sumlength'])) $blocks['news']['sumlength'] = ""; |
|
| 30 |
+ $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>"; |
|
| 31 |
+ $output .= "<div><div id='settingsform'><form method=\"POST\" enctype=\"multipart/form-data\" action=\"admin.php?action=blocks&admin=news\"> |
|
| 32 |
+ <div><label for=\"num\">"._NUMNEWS.":</label><input type=\"text\" class=\"textbox\" name=\"num\" id=\"num\" size=\"4\" value=\"".$blocks['news']['num']."\"></div> |
|
| 33 |
+ <div><label for=\"num\">"._SUMLENGTH.":</label><input type=\"text\" class=\"textbox\" name=\"sumlength\" id=\"sumlength\" size=\"6\" value=\"".$blocks['news']['sumlength']."\"></div> |
|
| 34 |
+ <INPUT type=\"submit\" name=\"submit\" class=\"button\" id=\"submit\" value=\""._SUBMIT."\"></form></div><div style='clear: both;'></div></div>"; |
|
| 35 |
+ } |
|
| 36 |
+?> |
|
| 0 | 37 |
\ No newline at end of file |