» "._CREATEBLOCK."

\n" ."\n" ."\n" ."\n" ."\n" ."\n"; if ($conf['register_user'] == 1) { echo "\n"; } if ($conf['multi_lang'] == 1) { echo "\n"; } echo "\n"; $num_header = $db->sql_numrows ($db->sql_query ("SELECT * FROM ".SN_TABLE_BLOCKS." WHERE position='h'")); $num_left = $db->sql_numrows ($db->sql_query ("SELECT * FROM ".SN_TABLE_BLOCKS." WHERE position='l'")); $num_top = $db->sql_numrows ($db->sql_query ("SELECT * FROM ".SN_TABLE_BLOCKS." WHERE position='t'")); $num_bottom = $db->sql_numrows ($db->sql_query ("SELECT * FROM ".SN_TABLE_BLOCKS." WHERE position='b'")); $num_right = $db->sql_numrows ($db->sql_query ("SELECT * FROM ".SN_TABLE_BLOCKS." WHERE position='r'")); $num_footer = $db->sql_numrows ($db->sql_query ("SELECT * FROM ".SN_TABLE_BLOCKS." WHERE position='f'")); $sql = "SELECT * FROM ".SN_TABLE_BLOCKS." ORDER BY position, weight"; $result = $db->sql_query ($sql); while ($row = $db->sql_fetchrow ($result)) { $block_title = $row['title_'._SNSS_LANG]; if ($row['position'] == "h") { if ($num_header == 1) { $h_pic = "H\n"; } else { if ($row['weight'] == 1) { $h_pic = " H   \n"; } else if ($row['weight'] == $num_left) { $h_pic = "   H \n"; } else { $h_pic = " H \n"; } } } else { $h_pic = ""; } if ($row['position'] == "l") { if ($num_left == 1) { $l_pic = "L\n"; } else { if ($row['weight'] == 1) { $l_pic = " L   \n"; } else if ($row['weight'] == $num_left) { $l_pic = "   L \n"; } else { $l_pic = " L \n"; } } } else { $l_pic = ""; } if ($row['position'] == "r") { if ($num_right == 1) { $r_pic = "R\n"; } else { if ($row['weight'] == 1) { $r_pic = " R   \n"; } else if ($row['weight'] == $num_right) { $r_pic = "   R \n"; } else { $r_pic = " R \n"; } } } else { $r_pic = ""; } if ($row['position'] == "t") { if ($num_top == 1) { $t_pic = "T\n"; } else { if ($row['weight'] == 1) { $t_pic = " T   \n"; } else if ($row['weight'] == $num_top) { $t_pic = "   T \n"; } else { $t_pic = " T \n"; } } } else { $t_pic = ""; } if ($row['position'] == "b") { if ($num_bottom == 1) { $b_pic = "B\n"; } else { if ($row['weight'] == 1) { $b_pic = " B   \n"; } else if ($row['weight'] == $num_bottom) { $b_pic = "   B \n"; } else { $b_pic = " B \n"; } } } else { $b_pic = ""; } if ($row['position'] == "f") { if ($num_footer == 1) { $f_pic = "F\n"; } else { if ($row['weight'] == 1) { $f_pic = " F   \n"; } else if ($row['weight'] == $num_left) { $f_pic = "   f \n"; } else { $f_pic = " F \n"; } } } else { $f_pic = ""; } if ($row['status'] == 1) { $status = ""._BLOCKON."\n"; } else { $status = ""._BLOCKOFF."\n"; } if ($conf['register_user'] == 1) { if ($row['view'] == 0) { $view = _ALLUSERS; } else if ($row['view'] == 1) { $view = _ONLYREG; } else if ($row['view'] == 2) { $view = _ONLYQUEST; } } if ($conf['multi_lang'] == 1) { if ($row['language'] == "") { $read_lang = _ALLLANG; } else { $read_lang = "$row[language]\n"; } } if (($row['in_module'] == "all") AND ($row['no_module'] == "all")) { $demonstration = _ALLMOD; } else if (($row['in_module'] == "all") AND ($row['no_module'] != "all")) { $demonstration = ""._EXCEPT." $row[no_module]"; } else if ($row['in_module'] == "homeb") { $demonstration = _HOMEMOD; } else if (($row['in_module'] != "homeb") AND ($row['in_module'] != "all")) { $demonstration = "$row[in_module]"; } echo "\n" ."\n" ."\n" ."\n"; if ($conf['register_user'] == 1) { echo "\n"; } if ($conf['multi_lang'] == 1) { echo "\n"; } echo "\n"; } echo "
"._BLOCKNAME.""._BLOCKWEIGHT.""._BLOCKSTATUS.""._VIEWMODULE.""._VIEWUSERS.""._VIEWLANG.""._FUNCTION."
$block_title$h_pic".$l_pic."$t_pic".$b_pic."$r_pic".$f_pic."$status$demonstration$view$read_lang"._EDITBL."
\n"; echo "
"._FIXWEIGHTPOS."
\n"; include ('footer.php'); } function add () { global $conf, $db; include ('header.php'); echo "» "._HOMEBLOCK."

\n" ."
\n" ."\n" ."\n"; if ($conf['multi_lang'] == 1) { $snss_languageslist = ""; $handle = opendir ('../lang'); while ($file = readdir ($handle)) { if (preg_match ("/^lang\-(.+)\.php/", $file, $matches)) { $snss_langFound = $matches[1]; $snss_languageslist .= "$snss_langFound "; } } closedir ($handle); $snss_languageslist = explode (" ", $snss_languageslist); for ($i=0; $i\n" ."\n" ."\n" ."\n" ."\n" ."\n" ."\n"; } } else { echo "\n" ."\n" ."\n" ."\n" ."\n"; } echo "\n" ."\n" ."\n"; $sql2 = "SELECT title FROM ".SN_TABLE_MODULES." "; $result2 = $db->sql_query ($sql2); while ($row2 = $db->sql_fetchrow ($result2)) { $mod_list[] = "$row2[title]"; } echo "\n" ."\n" ."\n" ."\n"; if ($conf['register_user'] == 1) { echo "\n" ."\n"; } echo "\n" ."\n" ."\n" ."\n"; if ($conf['multi_lang'] == 1) { echo "\n" ."\n"; } else { echo "\n"; } echo "\n" ."
"._CREATEBLOCK."
"._BLOCKNAME." $snss_languageslist[$i]
"._BLOCKICON." $snss_languageslist[$i]
"._BLOCKNAME."
"._BLOCKICON."
"._BLOCKFILE."\n"; echo "
"._BLOCKCONTENT."\n"; if ($conf['allow_redaktor'] == 1) { $sw = new SPAW_Wysiwyg(/*name*/ 'text', /*value*/ '', /*language*/ _SNSS_LANG, /*toolbar mode*/ 'blocks', /*theme*/ '', /*width*/ '430px', /*height*/ '200px'); $sw->show (); } else { echo "\n"; } echo "
"._YESMODULE."\n" ."
"._NOMODULE."\n" ."
"._WHOMVIEW."\n" ."
"._BLOCKWEIGHT."\n" ."
"._BLOCKSTATUS."\n" ."
"._LANGVERSION."\n" ."
\n" ."\n" ."\n" ."\n" ."
\n"; include ('footer.php'); } function save_blocks () { global $conf, $db; $temp_path = '../images/block'; $title = $_POST['title']; $text = stripslashes (stripslashesfix ($_POST['text'])); $in_module = $_POST['in_module']; $no_module = $_POST['no_module']; $num = $db->sql_numrows($db->sql_query ("SELECT * FROM ".SN_TABLE_BLOCKS." WHERE position='$_POST[position]'")); if ($num > 0) { $weight = $num+1; } else { $weight = 1; } if ($in_module != "all") { $no_module = ""; } if ($conf['multi_lang'] == 1) { $snss_languageslist = ""; $handle = opendir ('../lang'); while ($file = readdir ($handle)) { if (preg_match ("/^lang\-(.+)\.php/", $file, $matches)) { $snss_langFound = $matches[1]; $snss_languageslist .= "$snss_langFound "; } } closedir ($handle); $snss_languageslist = explode (" ", $snss_languageslist); $insert_title = ""; $insert_title_value = ""; for ($i=0; $isql_query ("INSERT INTO ".SN_TABLE_BLOCKS." (block_id, $insert_title $insert_icons text, file_name, in_module, no_module, position, weight, view, language, status) VALUES (NULL, $insert_title_value $insert_icons_value '$text', '$_POST[file_name]', '$in_module', '$no_module', '$_POST[position]', '$weight', '$_POST[view]', '$_POST[language]', '$_POST[status]')"); Header ('Location: admin.php?go=blocks'); } function position () { global $conf, $db; $sql = "SELECT * FROM ".SN_TABLE_BLOCKS." WHERE block_id='$_GET[block_id]'"; $result = $db->sql_query ($sql); $row = $db->sql_fetchrow ($result); $top = $row['weight']+1; $bot = $row['weight']-1; if ($_GET['p'] == "b") { $db->sql_query ("UPDATE ".SN_TABLE_BLOCKS." SET weight=weight-1 WHERE position='$row[position]' AND weight='$top'"); $db->sql_query ("UPDATE ".SN_TABLE_BLOCKS." SET weight=weight+1 WHERE block_id='$_GET[block_id]'"); } else if ($_GET['p'] == "t") { $db->sql_query("UPDATE ".SN_TABLE_BLOCKS." SET weight=weight+1 WHERE position='$row[position]' AND weight='$bot'"); $db->sql_query("UPDATE ".SN_TABLE_BLOCKS." SET weight=weight-1 WHERE block_id='$_GET[block_id]'"); } Header ('Location: admin.php?go=blocks'); } function status () { global $conf, $db; $db->sql_query ("UPDATE ".SN_TABLE_BLOCKS." SET status='$_GET[s]' WHERE block_id='$_GET[block_id]'"); Header ('Location: admin.php?go=blocks'); } function edit_block () { global $conf, $db; include ('header.php'); $sql = "SELECT * FROM ".SN_TABLE_BLOCKS." WHERE block_id='$_GET[block_id]'"; $result = $db->sql_query ($sql); $row = $db->sql_fetchrow ($result); echo "
\n" ."\n" ."\n"; if ($conf['multi_lang'] == 1) { $snss_languageslist = ""; $handle = opendir ('../lang'); while ($file = readdir ($handle)) { if (preg_match ("/^lang\-(.+)\.php/", $file, $matches)) { $snss_langFound = $matches[1]; $snss_languageslist .= "$snss_langFound "; } } closedir ($handle); $snss_languageslist = explode(" ", $snss_languageslist); for ($i=0; $i\n" ."\n" ."\n" ."\n"; } } else { $val_title = $row['title_'.$conf['default_lang']]; $val_icons = $row['icons_'.$conf['default_lang']]; echo "\n" ."\n" ."
"._EDITBLOCK."
"._BLOCKNAME." $snss_languageslist[$i]
\n"; if ($val_icons != "") { echo ""._BLOCKICON." $snss_languageslist[$i]\n"; } else { echo ""._BLOCKICON." $snss_languageslist[$i]\n"; } echo "\n"; if ($val_icons != "") { echo "\n" ."\n" ."
"._DELIT.""._CHANGE."
\n"; } else { echo "\n"; } echo "
"._BLOCKNAME."
\n"; if ($val_icons != "") { echo ""._BLOCKICON."\n"; } else { echo _BLOCKICON; } echo "\n"; if ($val_icons != "") { echo "\n" ."\n" ."\n" ."
"._DELIT.""._CHANGE."
\n"; } else { echo "\n"; }