diff -r de56132c008d -r bdac73ed481e plugins/SpecialAdmin.php --- a/plugins/SpecialAdmin.php Sun Mar 28 21:49:26 2010 -0400 +++ b/plugins/SpecialAdmin.php Sun Mar 28 23:10:46 2010 -0400 @@ -1,12 +1,12 @@ attachHook('base_classes_initted', 'SpecialAdmin_include();'); function SpecialAdmin_include() { - global $db, $session, $paths, $template, $plugins; // Common objects - - // Admin pages that were too enormous to be in this file were split off into the plugins/admin/ directory in 1.0.1. - // Only load these files if we're looking to load the admin panel - list($pid, $ns) = RenderMan::strToPageID($paths->get_pageid_from_url()); - if ( $ns == 'Admin' || ( $pid == 'Administration' && $ns == 'Special' ) ) - { - require(ENANO_ROOT . '/plugins/admin/Home.php'); - require(ENANO_ROOT . '/plugins/admin/PageManager.php'); - require(ENANO_ROOT . '/plugins/admin/PageEditor.php'); - require(ENANO_ROOT . '/plugins/admin/PageGroups.php'); - require(ENANO_ROOT . '/plugins/admin/GroupManager.php'); - require(ENANO_ROOT . '/plugins/admin/SecurityLog.php'); - require(ENANO_ROOT . '/plugins/admin/UserManager.php'); - require(ENANO_ROOT . '/plugins/admin/UserRanks.php'); - require(ENANO_ROOT . '/plugins/admin/LangManager.php'); - require(ENANO_ROOT . '/plugins/admin/ThemeManager.php'); - require(ENANO_ROOT . '/plugins/admin/PluginManager.php'); - require(ENANO_ROOT . '/plugins/admin/CacheManager.php'); - } + global $db, $session, $paths, $template, $plugins; // Common objects + + // Admin pages that were too enormous to be in this file were split off into the plugins/admin/ directory in 1.0.1. + // Only load these files if we're looking to load the admin panel + list($pid, $ns) = RenderMan::strToPageID($paths->get_pageid_from_url()); + if ( $ns == 'Admin' || ( $pid == 'Administration' && $ns == 'Special' ) ) + { + require(ENANO_ROOT . '/plugins/admin/Home.php'); + require(ENANO_ROOT . '/plugins/admin/PageManager.php'); + require(ENANO_ROOT . '/plugins/admin/PageEditor.php'); + require(ENANO_ROOT . '/plugins/admin/PageGroups.php'); + require(ENANO_ROOT . '/plugins/admin/GroupManager.php'); + require(ENANO_ROOT . '/plugins/admin/SecurityLog.php'); + require(ENANO_ROOT . '/plugins/admin/UserManager.php'); + require(ENANO_ROOT . '/plugins/admin/UserRanks.php'); + require(ENANO_ROOT . '/plugins/admin/LangManager.php'); + require(ENANO_ROOT . '/plugins/admin/ThemeManager.php'); + require(ENANO_ROOT . '/plugins/admin/PluginManager.php'); + require(ENANO_ROOT . '/plugins/admin/CacheManager.php'); + } } // For convenience and nothing more. function acp_start_form() { - global $db, $session, $paths, $template, $plugins; // Common objects - echo '
'; - ?> - auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) + { + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '
'; + return; + } + + global $mime_types, $mimetype_exps, $mimetype_extlist; + if(isset($_POST['save']) && !defined('ENANO_DEMO_MODE')) + { + $bits = ''; + $keys = array_keys($mime_types); + foreach($keys as $i => $k) + { + if(isset($_POST['ext_'.$k])) $bits .= '1'; + else $bits .= '0'; + } + $bits = compress_bitfield($bits); + setConfig('allowed_mime_types', $bits); + echo 'get('acpft_hint'); ?>
+ '."\n".'\n \n | \n "; + } + while($c < 2) + { + $c++; + echo "\n "; + } + echo ' | |
' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '
'; - return; - } - - if ( ENANO_DBLAYER != 'MYSQL' ) - die('' . $lang->get('acpdb_err_not_supported_desc') . '
'); - - if(isset($_GET['submitting']) && $_GET['submitting'] == 'yes' && defined('ENANO_DEMO_MODE') ) - { - redirect(makeUrlComplete('Special', 'Administration'), $lang->get('acpdb_err_demo_mode_title'), $lang->get('acpdb_err_demo_mode_desc'), 5); - } - - global $system_table_list; - if(isset($_GET['submitting']) && $_GET['submitting'] == 'yes') - { - - if(defined('SQL_BACKUP_CRYPT')) - // Try to increase our time limit - @set_time_limit(0); - // Do the actual export - $aesext = ( defined('SQL_BACKUP_CRYPT') ) ? '.tea' : ''; - $filename = 'enano_backup_' . enano_date('ymd') . '.sql' . $aesext; - ob_start(); - // Spew some headers - $headdate = enano_date(ED_DATE | ED_TIME); - echo <<' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '
'; + return; + } + + if ( ENANO_DBLAYER != 'MYSQL' ) + die('' . $lang->get('acpdb_err_not_supported_desc') . '
'); + + if(isset($_GET['submitting']) && $_GET['submitting'] == 'yes' && defined('ENANO_DEMO_MODE') ) + { + redirect(makeUrlComplete('Special', 'Administration'), $lang->get('acpdb_err_demo_mode_title'), $lang->get('acpdb_err_demo_mode_desc'), 5); + } + + global $system_table_list; + if(isset($_GET['submitting']) && $_GET['submitting'] == 'yes') + { + + if(defined('SQL_BACKUP_CRYPT')) + // Try to increase our time limit + @set_time_limit(0); + // Do the actual export + $aesext = ( defined('SQL_BACKUP_CRYPT') ) ? '.tea' : ''; + $filename = 'enano_backup_' . enano_date('ymd') . '.sql' . $aesext; + ob_start(); + // Spew some headers + $headdate = enano_date(ED_DATE | ED_TIME); + echo <<get('acpdb_intro'); ?>
--
get('acpdb_lbl_additional_tables'); ?>
--
-
-
-
get('acpdb_intro'); ?>
++
get('acpdb_lbl_additional_tables'); ?>
++
+
+
+
' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '
'; - return; - } - - echo '- ' . $lang->get('acpcp_intro') . ' -
'; - - // Start form - - if ( isset($_POST['coppa_address']) ) - { - // Saving changes - $enable_coppa = ( isset($_POST['enable_coppa']) ) ? '1' : '0'; - setConfig('enable_coppa', $enable_coppa); - - $address = $_POST['coppa_address']; // RenderMan::preprocess_text($_POST['coppa_address'], true, false); - setConfig('coppa_address', $address); - - echo '- ' . $lang->get('acpcp_th_form') . ' - | -|
---|---|
- ' . $lang->get('acpcp_field_enable_title') . ' - | -
- - ' . $lang->get('acpcp_field_enable_hint') . ' - |
-
- ' . $lang->get('acpcp_field_address') . ' - ' . $lang->get('acpcp_field_address_hint') . ' - |
- - - | -
- - | -
' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '
'; + return; + } + + echo '+ ' . $lang->get('acpcp_intro') . ' +
'; + + // Start form + + if ( isset($_POST['coppa_address']) ) + { + // Saving changes + $enable_coppa = ( isset($_POST['enable_coppa']) ) ? '1' : '0'; + setConfig('enable_coppa', $enable_coppa); + + $address = $_POST['coppa_address']; // RenderMan::preprocess_text($_POST['coppa_address'], true, false); + setConfig('coppa_address', $address); + + echo '+ ' . $lang->get('acpcp_th_form') . ' + | +|
---|---|
+ ' . $lang->get('acpcp_field_enable_title') . ' + | +
+ + ' . $lang->get('acpcp_field_enable_hint') . ' + |
+
+ ' . $lang->get('acpcp_field_address') . ' + ' . $lang->get('acpcp_field_address_hint') . ' + |
+ + + | +
+ + | +
' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '
'; - return; - } - - global $enano_config; - if ( isset($_POST['do_send']) && !defined('ENANO_DEMO_MODE') ) - { - $use_smtp = getConfig('smtp_enabled') == '1'; - - // - // Let's do some checking to make sure that mass mail functions - // are working in win32 versions of php. (copied from phpBB) - // - if ( preg_match('/[c-z]:\\\.*/i', getenv('PATH')) && !$use_smtp) - { - $ini_val = ( @phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var'; + global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; + if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) + { + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '
'; + return; + } + + global $enano_config; + if ( isset($_POST['do_send']) && !defined('ENANO_DEMO_MODE') ) + { + $use_smtp = getConfig('smtp_enabled') == '1'; + + // + // Let's do some checking to make sure that mass mail functions + // are working in win32 versions of php. (copied from phpBB) + // + if ( preg_match('/[c-z]:\\\.*/i', getenv('PATH')) && !$use_smtp) + { + $ini_val = ( @phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var'; - // We are running on windows, force delivery to use our smtp functions - // since php's are broken by default - $use_smtp = true; - $enano_config['smtp_server'] = @$ini_val('SMTP'); - } - - $mail = new emailer( !empty($use_smtp) ); - - // Validate subject/message body - $subject = stripslashes(trim($_POST['subject'])); - $message = stripslashes(trim($_POST['message'])); - - if ( empty($subject) ) - $errors[] = $lang->get('acpmm_err_need_subject'); - if ( empty($message) ) - $errors[] = $lang->get('acpmm_err_need_message'); - - // Get list of members - if ( !empty($_POST['userlist']) ) - { - $userlist = str_replace(', ', ',', $_POST['userlist']); - $userlist = explode(',', $userlist); - foreach ( $userlist as $k => $u ) - { - if ( $u == $session->username ) - { - // Message is automatically sent to the sender - unset($userlist[$k]); - } - else - { - $userlist[$k] = $db->escape($u); - } - } - $userlist = 'WHERE username=\'' . implode('\' OR username=\'', $userlist) . '\''; - - $q = $db->sql_query('SELECT email FROM '.table_prefix.'users ' . $userlist . ';'); - if ( !$q ) - $db->_die(); - - if ( $row = $db->fetchrow() ) - { - do { - $mail->cc($row['email']); - } while ( $row = $db->fetchrow() ); - } - - $db->free_result(); - - } - else - { - // Sending to a usergroup - - $group_id = intval($_POST['group_id']); - if ( $group_id < 1 ) - { - $errors[] = 'Invalid group ID'; - } - else - { - $q = $db->sql_query('SELECT u.email FROM '.table_prefix.'group_members AS g - LEFT JOIN '.table_prefix.'users AS u - ON (u.user_id=g.user_id) - WHERE g.group_id=' . $group_id . ';'); - if ( !$q ) - $db->_die(); - - if ( $row = $db->fetchrow() ) - { - do { - $mail->cc($row['email']); - } while ( $row = $db->fetchrow() ); - } - - $db->free_result(); - } - } - - if ( sizeof($errors) < 1 ) - { - - $mail->from(getConfig('contact_email')); - $mail->replyto(getConfig('contact_email')); - $mail->set_subject($subject); - $mail->email_address(getConfig('contact_email')); - - // Copied/modified from phpBB - $email_headers = 'X-AntiAbuse: Website server name - ' . $_SERVER['SERVER_NAME'] . "\n"; - $email_headers .= 'X-AntiAbuse: User_id - ' . $session->user_id . "\n"; - $email_headers .= 'X-AntiAbuse: Username - ' . $session->username . "\n"; - $email_headers .= 'X-AntiAbuse: User IP - ' . $_SERVER['REMOTE_ADDR'] . "\n"; - - $mail->extra_headers($email_headers); - - // FIXME: how to handle l10n with this? - $tpl = 'The following message was mass-mailed by {SENDER}, one of the administrators from {SITE_NAME}. If this message contains spam or any comments which you find abusive or offensive, please contact the administration team at: - + // We are running on windows, force delivery to use our smtp functions + // since php's are broken by default + $use_smtp = true; + $enano_config['smtp_server'] = @$ini_val('SMTP'); + } + + $mail = new emailer( !empty($use_smtp) ); + + // Validate subject/message body + $subject = stripslashes(trim($_POST['subject'])); + $message = stripslashes(trim($_POST['message'])); + + if ( empty($subject) ) + $errors[] = $lang->get('acpmm_err_need_subject'); + if ( empty($message) ) + $errors[] = $lang->get('acpmm_err_need_message'); + + // Get list of members + if ( !empty($_POST['userlist']) ) + { + $userlist = str_replace(', ', ',', $_POST['userlist']); + $userlist = explode(',', $userlist); + foreach ( $userlist as $k => $u ) + { + if ( $u == $session->username ) + { + // Message is automatically sent to the sender + unset($userlist[$k]); + } + else + { + $userlist[$k] = $db->escape($u); + } + } + $userlist = 'WHERE username=\'' . implode('\' OR username=\'', $userlist) . '\''; + + $q = $db->sql_query('SELECT email FROM '.table_prefix.'users ' . $userlist . ';'); + if ( !$q ) + $db->_die(); + + if ( $row = $db->fetchrow() ) + { + do { + $mail->cc($row['email']); + } while ( $row = $db->fetchrow() ); + } + + $db->free_result(); + + } + else + { + // Sending to a usergroup + + $group_id = intval($_POST['group_id']); + if ( $group_id < 1 ) + { + $errors[] = 'Invalid group ID'; + } + else + { + $q = $db->sql_query('SELECT u.email FROM '.table_prefix.'group_members AS g + LEFT JOIN '.table_prefix.'users AS u + ON (u.user_id=g.user_id) + WHERE g.group_id=' . $group_id . ';'); + if ( !$q ) + $db->_die(); + + if ( $row = $db->fetchrow() ) + { + do { + $mail->cc($row['email']); + } while ( $row = $db->fetchrow() ); + } + + $db->free_result(); + } + } + + if ( sizeof($errors) < 1 ) + { + + $mail->from(getConfig('contact_email')); + $mail->replyto(getConfig('contact_email')); + $mail->set_subject($subject); + $mail->email_address(getConfig('contact_email')); + + // Copied/modified from phpBB + $email_headers = 'X-AntiAbuse: Website server name - ' . $_SERVER['SERVER_NAME'] . "\n"; + $email_headers .= 'X-AntiAbuse: User_id - ' . $session->user_id . "\n"; + $email_headers .= 'X-AntiAbuse: Username - ' . $session->username . "\n"; + $email_headers .= 'X-AntiAbuse: User IP - ' . $_SERVER['REMOTE_ADDR'] . "\n"; + + $mail->extra_headers($email_headers); + + // FIXME: how to handle l10n with this? + $tpl = 'The following message was mass-mailed by {SENDER}, one of the administrators from {SITE_NAME}. If this message contains spam or any comments which you find abusive or offensive, please contact the administration team at: + {CONTACT_EMAIL} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {MESSAGE} '; - - $mail->use_template($tpl); - - $mail->assign_vars(array( - 'SENDER' => $session->username, - 'SITE_NAME' => getConfig('site_name'), - 'CONTACT_EMAIL' => getConfig('contact_email'), - 'MESSAGE' => $message - )); - - //echo ''.print_r($mail,true).''; - - // All done - $mail->send(); - $mail->reset(); - - echo '
get('acpmm_heading_main'); ?> | -|
---|---|
- get('acpmm_field_group_to'); ?> - - get('acpmm_field_group_to_hint'); ?> - - |
- - - | -
- get('acpmm_field_username'); ?> - | -|
- get('acpmm_field_subject'); ?> - | -- - | -
- get('acpmm_field_message'); ?> - | -- - | -
- - get('acpmm_msg_send_takeawhile'); ?> - | -
'.print_r($mail,true).''; + + // All done + $mail->send(); + $mail->reset(); + + echo '
get('acpmm_heading_main'); ?> | +|
---|---|
+ get('acpmm_field_group_to'); ?> + + get('acpmm_field_group_to_hint'); ?> + + |
+ + + | +
+ get('acpmm_field_username'); ?> + | +|
+ get('acpmm_field_subject'); ?> + | ++ + | +
+ get('acpmm_field_message'); ?> + | ++ + | +
+ + get('acpmm_msg_send_takeawhile'); ?> + | +
' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '
'; - return; - } - - if(isset($_GET['action']) && $_GET['action'] == 'delete' && isset($_GET['id']) && $_GET['id'] != '') - { - $e = $db->sql_query('DELETE FROM '.table_prefix.'banlist WHERE ban_id=' . intval($_GET['id']) . ''); - if ( !$e ) - $db->_die('The ban list entry was not deleted.'); - } - if(isset($_POST['create']) && !defined('ENANO_DEMO_MODE')) - { - $type = intval($_POST['type']); - $value = trim($_POST['value']); - if ( !in_array($type, array(BAN_IP, BAN_USER, BAN_EMAIL)) ) - { - echo '' . $lang->get('acpbc_col_type') . ' | -' . $lang->get('acpbc_col_value') . ' | -' . $lang->get('acpbc_col_regex') . ' | -- | ' . $lang->get('acpbc_msg_no_rules') . ' | '; - } - $cls = 'row2'; - while ( $r = $db->fetchrow() ) - { - $cls = ( $cls == 'row1' ) ? 'row2' : 'row1'; - if ( $r['ban_type'] == BAN_IP ) - $t = $lang->get('acpbc_ban_type_ip'); - else if ( $r['ban_type'] == BAN_USER ) - $t = $lang->get('acpbc_ban_type_username'); - else if ( $r['ban_type'] == BAN_EMAIL ) - $t = $lang->get('acpbc_ban_type_email'); - $g = ( $r['is_regex'] ) ? '' . $lang->get('acpbc_ban_regex_yes') . '' : $lang->get('acpbc_ban_regex_no'); - echo '
---|---|---|---|
'.$t.' | -'.htmlspecialchars($r['ban_value']).' | -'.$g.' | -' . $lang->get('acpbc_btn_delete') . ' | -
' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '
'; + return; + } + + if(isset($_GET['action']) && $_GET['action'] == 'delete' && isset($_GET['id']) && $_GET['id'] != '') + { + $e = $db->sql_query('DELETE FROM '.table_prefix.'banlist WHERE ban_id=' . intval($_GET['id']) . ''); + if ( !$e ) + $db->_die('The ban list entry was not deleted.'); + } + if(isset($_POST['create']) && !defined('ENANO_DEMO_MODE')) + { + $type = intval($_POST['type']); + $value = trim($_POST['value']); + if ( !in_array($type, array(BAN_IP, BAN_USER, BAN_EMAIL)) ) + { + echo '' . $lang->get('acpbc_col_type') . ' | +' . $lang->get('acpbc_col_value') . ' | +' . $lang->get('acpbc_col_regex') . ' | ++ | ' . $lang->get('acpbc_msg_no_rules') . ' | '; + } + $cls = 'row2'; + while ( $r = $db->fetchrow() ) + { + $cls = ( $cls == 'row1' ) ? 'row2' : 'row1'; + if ( $r['ban_type'] == BAN_IP ) + $t = $lang->get('acpbc_ban_type_ip'); + else if ( $r['ban_type'] == BAN_USER ) + $t = $lang->get('acpbc_ban_type_username'); + else if ( $r['ban_type'] == BAN_EMAIL ) + $t = $lang->get('acpbc_ban_type_email'); + $g = ( $r['is_regex'] ) ? '' . $lang->get('acpbc_ban_regex_yes') . '' : $lang->get('acpbc_ban_regex_no'); + echo '
---|---|---|---|
'.$t.' | +'.htmlspecialchars($r['ban_value']).' | +'.$g.' | +' . $lang->get('acpbc_btn_delete') . ' | +
' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '
'; - return; - } - - $session->logout(USER_LEVEL_ADMIN); - echo '' . $lang->get('acplo_msg_logout_complete', array('mainpage_link' => makeUrl(get_main_page()))) . '
'; + global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; + if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) + { + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '
'; + return; + } + + $session->logout(USER_LEVEL_ADMIN); + echo '' . $lang->get('acplo_msg_logout_complete', array('mainpage_link' => makeUrl(get_main_page()))) . '
'; } function page_Special_Administration() { - global $db, $session, $paths, $template, $plugins; // Common objects - global $lang; - global $output; - - if ( $session->auth_level < USER_LEVEL_ADMIN ) - { - $query_string = 'level=' . USER_LEVEL_ADMIN; - if ( !empty($_SERVER['QUERY_STRING']) ) - { - $query_string .= '&' . trim(preg_replace('/(?:&|^)title=.+?(?:&|$)/', '&', $_SERVER['QUERY_STRING']), '&'); - } - redirect(makeUrlNS('Special', 'Login/'.$paths->page, $query_string), 'Not authorized', 'You need an authorization level of '.USER_LEVEL_ADMIN.' to use this page, your auth level is: ' . $session->auth_level, 0); - exit; - } - else - { - $template->set_theme('admin', 'default'); - $template->preload_js('fat'); - $template->preload_js('ajax'); - $template->preload_js('l10n'); - $template->preload_js('jquery'); - $template->preload_js('jquery-ui'); - $template->preload_js('autofill'); - $template->preload_js('admin-menu'); - - $output->header(); - - echo $lang->get('adm_page_tagline'); - ?> - -
-
-
- |
-
-
- Module must be in the Admin namespace ';
- }
- else
- {
- $paths->fullpage = $_GET['module'];
- $paths->cpage['module'] = $_GET['module'];
- $page = new PageProcessor($page_id, $namespace);
- $page->send_headers = false;
- $page->send();
- $paths->fullpage = $paths->page;
- }
- }
- else
- {
- echo '';
- }
- ?>
-
-
- |
-
+
+
+ |
+
+
+ Module must be in the Admin namespace ';
+ }
+ else
+ {
+ $paths->fullpage = $_GET['module'];
+ $paths->cpage['module'] = $_GET['module'];
+ $page = new PageProcessor($page_id, $namespace);
+ $page->send_headers = false;
+ $page->send();
+ $paths->fullpage = $paths->page;
+ }
+ }
+ else
+ {
+ echo '';
+ }
+ ?>
+
+
+ |
+
- get('sbedit_create_intro'); ?> -
-- -
- -
-
- get('sbedit_field_block_title'); ?>
- get('sbedit_field_block_sidebar'); ?>
-
-
-
- -
-- -
-- -
-get('sbedit_field_php_disabled'); ?>
- - get('sbedit_field_php'); ?> - -- -
- -- -
-- - - - -
- -- get('sbedit_header_msg', array( 'create_link' => makeUrlNS('Special', 'EditSidebar', 'action=new&id=0', true) )); ?> -
- sql_query('SELECT item_id, sidebar_id, block_name, block_type, block_content, item_enabled FROM ' . table_prefix . "sidebar ORDER BY sidebar_id ASC, item_order ASC;"); - if ( !$q ) - $db->_die(); - - $switched_to_right = false; - - echo ''; - while ( $row = $db->fetchrow() ) - { - if ( $row['sidebar_id'] == SIDEBAR_RIGHT && !$switched_to_right ) - { - echo ' | ';
- $switched_to_right = true;
- }
- $disabled_class = ( $row['item_enabled'] ) ? '' : ' disabled';
- echo '
-
- ' . htmlspecialchars($template->compile_template_text_post($row['block_name'])) . '
-
- ';
- ?>
-
- ';
- }
-
- if ( !$switched_to_right )
- echo ' | '; - - echo ' |
+ get('sbedit_create_intro'); ?> +
++ +
+ +
+
+ get('sbedit_field_block_title'); ?>
+ get('sbedit_field_block_sidebar'); ?>
+
+
+
+ +
++ +
++ +
+get('sbedit_field_php_disabled'); ?>
+ + get('sbedit_field_php'); ?> + ++ +
+ ++ +
++ + + + +
+ ++ get('sbedit_header_msg', array( 'create_link' => makeUrlNS('Special', 'EditSidebar', 'action=new&id=0', true) )); ?> +
+ sql_query('SELECT item_id, sidebar_id, block_name, block_type, block_content, item_enabled FROM ' . table_prefix . "sidebar ORDER BY sidebar_id ASC, item_order ASC;"); + if ( !$q ) + $db->_die(); + + $switched_to_right = false; + + echo ''; + while ( $row = $db->fetchrow() ) + { + if ( $row['sidebar_id'] == SIDEBAR_RIGHT && !$switched_to_right ) + { + echo ' | ';
+ $switched_to_right = true;
+ }
+ $disabled_class = ( $row['item_enabled'] ) ? '' : ' disabled';
+ echo '
+
+ ' . htmlspecialchars($template->compile_template_text_post($row['block_name'])) . '
+
+ ';
+ ?>
+
+ ';
+ }
+
+ if ( !$switched_to_right )
+ echo ' | '; + + echo ' |