крон INSERT INTO `bb_config` VALUES ('cron_enabled', '1'); INSERT INTO `bb_config` VALUES ('cron_check_interval', '300'); git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@296 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
pherum83 2011-09-30 20:29:22 +00:00
commit 87118ae0ba
17 changed files with 882 additions and 967 deletions

View file

@ -636,6 +636,8 @@ INSERT INTO `bb_config` VALUES ('report_notify', '0');
INSERT INTO `bb_config` VALUES ('report_list_admin', '0'); INSERT INTO `bb_config` VALUES ('report_list_admin', '0');
INSERT INTO `bb_config` VALUES ('report_new_window', '0'); INSERT INTO `bb_config` VALUES ('report_new_window', '0');
INSERT INTO `bb_config` VALUES ('torrent_pass_private_key', 'вставить_из_конфига_XBTT'); INSERT INTO `bb_config` VALUES ('torrent_pass_private_key', 'вставить_из_конфига_XBTT');
INSERT INTO `bb_config` VALUES ('cron_enabled', '1');
INSERT INTO `bb_config` VALUES ('cron_check_interval', '300');
-- -------------------------------------------------------- -- --------------------------------------------------------
@ -690,7 +692,6 @@ INSERT INTO `bb_cron` VALUES (18, 1, 'Seeder last seen', 'tr_update_seeder_last_
INSERT INTO `bb_cron` VALUES (19, 1, 'Captcha', 'captcha_gen_gc.php', 'daily', NULL, '05:00:00', 120, '2008-05-22 19:11:58', '2008-05-23 01:11:58', NULL, 0, '', 0, 0, 3); INSERT INTO `bb_cron` VALUES (19, 1, 'Captcha', 'captcha_gen_gc.php', 'daily', NULL, '05:00:00', 120, '2008-05-22 19:11:58', '2008-05-23 01:11:58', NULL, 0, '', 0, 0, 3);
INSERT INTO `bb_cron` VALUES (20, 1, 'Tracker dl-complete count', 'tr_complete_count.php', 'interval', NULL, NULL, 255, '2008-05-22 19:12:01', '2008-05-23 01:12:01', '06:00:00', 0, '', 0, 0, 3); INSERT INTO `bb_cron` VALUES (20, 1, 'Tracker dl-complete count', 'tr_complete_count.php', 'interval', NULL, NULL, 255, '2008-05-22 19:12:01', '2008-05-23 01:12:01', '06:00:00', 0, '', 0, 0, 3);
INSERT INTO `bb_cron` VALUES (21, 1, 'Cache garbage collector', 'cache_gc.php', 'interval', NULL, NULL, 255, '2008-05-22 19:18:13', '2008-05-22 19:23:13', '00:05:00', 0, '', 0, 0, 24); INSERT INTO `bb_cron` VALUES (21, 1, 'Cache garbage collector', 'cache_gc.php', 'interval', NULL, NULL, 255, '2008-05-22 19:18:13', '2008-05-22 19:23:13', '00:05:00', 0, '', 0, 0, 24);
INSERT INTO `bb_cron` VALUES (22, 1, 'Manage Antibroot', 'bb_manage_untrusted.php', 'interval', NULL, NULL, 255, '2008-05-22 19:18:13', '2008-05-22 19:23:13', '00:10:00', 0, '', 0, 0, 24);
-- -------------------------------------------------------- -- --------------------------------------------------------

View file

@ -8,30 +8,21 @@ if (!empty($setmodules))
return; return;
} }
$i = 0;
$tpl = '';
$mode = isset($_GET['mode']) ? $_GET['mode'] : ''; $mode = isset($_GET['mode']) ? $_GET['mode'] : '';
$job_id = isset($_GET['id']) ? (int) $_GET['id'] : ''; $job_id = isset($_GET['id']) ? (int) $_GET['id'] : '';
$submit = isset($_POST['submit']);
$jobs = isset($_POST['select']) ? implode(',', $_POST['select']) : ''; $jobs = isset($_POST['select']) ? implode(',', $_POST['select']) : '';
$cron_action = isset($_POST['cron_action']) ? $_POST['cron_action'] : ''; $cron_action = isset($_POST['cron_action']) ? $_POST['cron_action'] : '';
$cron_enabled = isset($_POST['cron_enabled']) ? $_POST['cron_enabled'] : '';
$cron_check_interval = isset($_POST['cron_check_interval']) ? $_POST['cron_check_interval'] : '';
$submit = isset($_POST['submit']); if ($mode == 'run' && !$job_id)
$confirm = isset($_POST['confirm']); {
if ($mode == 'run' && !$job_id) {
define('BB_ROOT', './../'); define('BB_ROOT', './../');
require(BB_ROOT.'common.php'); require(BB_ROOT.'common.php');
$user->session_start(); $user->session_start();
redirect('admin/'.basename(__FILE__) . '?mode=list'); redirect('admin/'.basename(__FILE__) . '?mode=list');
} }
else { else require('./pagestart.php');
require('./pagestart.php');
}
// ACP Header - END // ACP Header - END
if(!IS_SUPER_ADMIN) bb_die($lang['NOT_ADMIN']); if(!IS_SUPER_ADMIN) bb_die($lang['NOT_ADMIN']);
@ -40,323 +31,207 @@ require(LANG_DIR .'lang_admin_cron.php');
require(INC_DIR .'functions_admin_torrent.php'); require(INC_DIR .'functions_admin_torrent.php');
require(INC_DIR .'functions_admin_cron.php'); require(INC_DIR .'functions_admin_cron.php');
if ($mode == 'list') {
$sql = "SELECT * FROM ". BB_CRON ." ORDER BY cron_id";
if( !$result1 = DB()->sql_query($sql) ) $sql = DB()->fetch_rowset("SELECT * FROM " . BB_CONFIG);
foreach($sql as $row)
{
$config_name = $row['config_name'];
$config_value = $row['config_value'];
$default_config[$config_name] = $config_value;
$new[$config_name] = isset($_POST[$config_name]) ? $_POST[$config_name] : $default_config[$config_name];
if (isset($_POST['submit']) && $row['config_value'] != $new[$config_name])
{ {
message_die(GENERAL_ERROR, "Could not query cron list", "", __LINE__, __FILE__, $sql); bb_update_config(array($config_name => $new[$config_name]));
} }
while($row = DB()->sql_fetchrow($result1))
{
$cron_id = $row['cron_id'];
$cron_active = $row['cron_active'] ? $lang['YES'] : $lang['NO'];
$cron_title = $row['cron_title'];
$cron_script = $row['cron_script'];
$schedule = $row['schedule'];
$leech = $row['run_day'];
$row_style = ( !($i % 2) ) ? 'row1' : 'row2';
$last_run = $row['last_run'];
$next_run = $row['next_run'];
$run_count = $row['run_counter'];
$tpl .= "<tr>";
$tpl .= "<td width=\"2%\" nowrap=\"nowrap\" class=\"$row_style\" align=\"center\"><input type=\"checkbox\" name=\"select[]\" value=\"$cron_id\" onclick=\"return CheckCB(this);\"></td>";
$tpl .= "<td width=\"2%\" nowrap=\"nowrap\" class=\"$row_style\" align=\"center\">$cron_id</td>";
$tpl .= "<td width=\"3%\" nowrap=\"nowrap\" class=\"$row_style\" align=\"center\">$cron_active</td>";
$tpl .= "<td width=\"30%\" nowrap=\"nowrap\" class=\"$row_style\" align=\"left\">$cron_title</td>";
$tpl .= "<td width=\"20%\" nowrap=\"nowrap\" class=\"$row_style\" align=\"left\">$cron_script</td>";
$tpl .= "<td width=\"5%\" nowrap=\"nowrap\" class=\"$row_style\" align=\"center\"><font color=\"#505050\"><b> <span class='leechmed'> $schedule </span></b></font></td>";
$tpl .= "<td width=\"5%\" nowrap=\"nowrap\" class=\"$row_style\" align=\"center\"><i> $last_run </i></td>";
$tpl .= "<td width=\"5%\" nowrap=\"nowrap\" class=\"$row_style\" align=\"center\"><i> $next_run </i></td>";
$tpl .= "<td width=\"1%\" nowrap=\"nowrap\" class=\"$row_style\" align=\"center\"><font color=\"#505050\"><b><i> <span class='leechmed'>$run_count</span></i></b></font></td>";
$tpl .= "<td width=\"5%\" nowrap=\"nowrap\" class=\"$row_style\" align=\"center\"><font color=\"#505050\">
<b>
<a href='admin_cron.php?mode=run&id=$cron_id'>[Run]</a>
<a href='admin_cron.php?mode=edit&id=$cron_id'>[Edit]</a>
<a href='admin_cron.php?mode=delete&id=$cron_id'>[Del]</a>
</b></font></td>";
$tpl .= "</tr>";
$i++;
}
// $tpl .= "</table>";
$template->assign_vars(array(
'TPL_CRON_LIST' => true,
'LIST' => $tpl,
'S_CRON_ACTION' => append_sid("admin_cron.php"),
'S_MODE' => 'list',
));
$default_cfg_bool = array(
'cron_enabled' => true,
);
$default_cfg_num = array(
'cron_check_interval' => $bb_cfg['cron_check_interval'],
);
$cfg = array_merge($default_cfg_bool, $default_cfg_num);
set_tpl_vars_bool ($default_cfg_bool, $cfg);
set_tpl_vars_lang ($default_cfg_bool);
set_tpl_vars ($default_cfg_num, $cfg);
set_tpl_vars_lang ($default_cfg_num);
//detect cron status
if (@file_exists('../triggers/cron_running')){
$template->assign_vars(array(
'CRON_RUNNING' => true,
));
}
print_page('admin_cron.tpl', 'admin');
}
if ($mode == 'repair') {
if (@file_exists('../triggers/cron_running')) {
rename("../triggers/cron_running", "../triggers/cron_allowed");
}
redirect('admin/'.basename(__FILE__) . '?mode=list');
}
if (($mode == 'run' && $job_id)) {
run_jobs($job_id);
redirect('admin/'.basename(__FILE__) . '?mode=list');
} }
if ($mode == 'edit' && $job_id) {
$sql = "SELECT * $template->assign_vars(array(
FROM ". BB_CRON ." 'CRON_ENABLED' => ($new['cron_enabled']) ? true : false,
WHERE cron_id = $job_id"; 'CRON_CHECK_INTERVAL' => $new['cron_check_interval'],
));
switch($mode)
{
case 'list':
$sql = DB()->fetch_rowset("SELECT * FROM ". BB_CRON ." ORDER BY cron_id");
if( !$result = DB()->sql_query($sql) ) foreach($sql as $i => $row)
{ {
message_die(GENERAL_ERROR, "Could not query cron", "", __LINE__, __FILE__, $sql); $template->assign_block_vars('list', array(
} 'ROW_CLASS' => !($i % 2) ? 'row2' : 'row1',
'CRON_ID' => $row['cron_id'],
'CRON_ACTIVE' => $row['cron_active'] ? '<img src="../images/icon_run.gif" alt="'. $lang['YES'] .'" />' : '<img src="../images/icon_delete.gif" alt="'. $lang['NO'] .'" />',
'CRON_TITLE' => $row['cron_title'],
'CRON_SCRIPT' => $row['cron_script'],
'SCHEDULE' => $row['schedule'] ? $lang['SCHEDULE'][$row['schedule']] : '<b class="leech">'. $lang['NOSELECT'] .'</b>',
'RUN_DAY' => $row['run_day'],
'LAST_RUN' => $row['last_run'],
'NEXT_RUN' => $row['next_run'],
'RUN_COUNT' => $row['run_counter'],
));
}
while($row = DB()->sql_fetchrow($result)) $template->assign_vars(array(
{ 'TPL_CRON_LIST' => true,
$cron_id = $row['cron_id']; 'S_CRON_ACTION' => append_sid("admin_cron.php"),
$cron_active = $row['cron_active']; 'S_MODE' => 'list',
$cron_title = $row['cron_title']; ));
$cron_script = $row['cron_script'];
$schedule = $row['schedule']; //detect cron status
$run_day = $row['run_day']; if (@file_exists('../triggers/cron_running'))
$run_time = $row['run_time']; {
$run_order = $row['run_order']; $template->assign_vars(array(
$last_run = $row['last_run']; 'CRON_RUNNING' => true,
$next_run = $row['next_run']; ));
$run_interval = $row['run_interval']; }
$log_enabled = $row['log_enabled']; break;
$log_file = $row['log_file'];
$log_sql_queries = $row['log_sql_queries']; case 'repair':
$disable_board = $row['disable_board']; if (@file_exists('../triggers/cron_running'))
$run_counter = $row['run_counter']; {
rename("../triggers/cron_running", "../triggers/cron_allowed");
}
redirect('admin/'.basename(__FILE__) . '?mode=list');
break;
case 'run':
run_jobs($job_id);
redirect('admin/'.basename(__FILE__) . '?mode=list');
break;
} case 'edit':
//build schedule html $sql = DB()->fetch_rowset("SELECT * FROM ". BB_CRON ." WHERE cron_id = $job_id");
$schedule_html = '<select name="schedule" tabindex="13">
<option value=""></option>
<option value="hourly">'.$lang['HOURLY'].'</option>
<option value="daily" >'.$lang['DAILY'].'</option>
<option value="weekly">'.$lang['WEEKLY'].'</option>
<option value="monthly">'.$lang['MONTHLY'].'</option>
<option value="interval">'.$lang['INTERVAL'].'</option>
</select>';
$schedule_option = 'value="'.$schedule.'"';
$schedule_selected = 'value="'.$schedule.'" selected="selected"';
$schedule_result = str_replace( $schedule_option, $schedule_selected, $schedule_html);
//build run_day html
$run_day_html = '<select name="run_day" width="100px" tabindex="13"><option value=""></option>';
for ($i = 1; $i <= 28; $i++) {
if($run_day == $i) {
$run_day_html .= '<option value="'.$i.'" selected="selected">'.$i.'</option>' ;
}
else {
$run_day_html .= '<option value="'.$i.'">'.$i.'</option>' ;
}
}
$run_day_html .= '</select>';
//
$template->assign_vars(array(
'TPL_CRON_EDIT' => true,
'S_CRON_ACTION' => append_sid("admin_cron.php"),
'S_MODE' => 'edit',
'SCHEDULE' => $schedule_result,
'RUN_DAY' => $run_day_html,
'L_CRON_EDIT_HEAD' => $lang['CRON_EDIT_HEAD_EDIT'],
));
foreach($sql as $row)
{
$template->assign_vars(array(
'CRON_ID' => $row['cron_id'],
'CRON_ACTIVE' => $row['cron_active'],
'CRON_TITLE' => $row['cron_title'],
'CRON_SCRIPT' => $row['cron_script'],
'SCHEDULE' => $row['schedule'] ? $lang['SCHEDULE'][$row['schedule']] : '',
'RUN_DAY' => $row['run_day'],
'RUN_TIME' => $row['run_time'],
'RUN_ORDER' => $row['run_order'],
'LAST_RUN' => $row['last_run'],
'NEXT_RUN' => $row['next_run'],
'RUN_INTERVAL' => $row['run_interval'],
'LOG_ENABLED' => $row['log_enabled'],
'LOG_FILE' => $row['log_file'],
'LOG_SQL_QUERIES' => $row['log_sql_queries'],
'DISABLE_BOARD' => $row['disable_board'],
'RUN_COUNTER' => $row['run_counter'],
));
}
$run_day = array($lang['DELTA_TIME']['INTERVALS']['mday'][0] => 0);
for($i=1; $i<=28; $i++)
{
$run_day[$i] = $i;
}
$schedule = array($lang['SCHEDULE']['select'] => 0);
foreach ($lang['SCHEDULE'] as $type => $key)
{
$schedule[$key] = $type;
}
$default_cfg_str = array( $template->assign_vars(array(
'cron_title' => $cron_title, 'TPL_CRON_EDIT' => true,
'cron_script' => $cron_script, 'S_CRON_ACTION' => append_sid("admin_cron.php"),
'run_time' => $run_time, 'S_MODE' => 'edit',
'last_run' => $last_run, 'SCHEDULE' => build_select('schedule', $schedule, $row['schedule']),
'next_run' => $next_run, 'RUN_DAY' => build_select('run_day', $run_day, $row['run_day']),
'run_interval' => $run_interval, 'L_CRON_EDIT_HEAD' => $lang['CRON_EDIT_HEAD_EDIT'],
'log_file' => $log_file, ));
); break;
$default_cfg_bool = array(
'cron_active' => $cron_active, case 'add':
'log_enabled' => $log_enabled, $run_day = array($lang['DELTA_TIME']['INTERVALS']['mday'][0] => 0);
'log_sql_queries' => $log_sql_queries, for($i=1; $i<=28; $i++)
'disable_board' => $disable_board, {
); $run_day[$i] = $i;
$default_cfg_num = array( }
'cron_id' => $cron_id,
'run_order' => $run_order, $schedule = array();
'run_counter' => $run_counter, foreach ($lang['SCHEDULE'] as $type => $key)
); {
$schedule[$key] = $type;
}
$template->assign_vars(array(
'TPL_CRON_EDIT' => true,
'S_CRON_ACTION' => append_sid("admin_cron.php"),
'S_MODE' => 'add',
'SCHEDULE' => build_select('schedule', $schedule, 'select', null, null),
'RUN_DAY' => build_select('run_day', $run_day, 0, null, null),
'L_CRON_EDIT_HEAD' => $lang['CRON_EDIT_HEAD_ADD'],
'CRON_ID' => 'none',
'CRON_ACTIVE' => 1,
'CRON_TITLE' => '',
'CRON_SCRIPT' => '',
'RUN_TIME' => '',
'RUN_ORDER' => 255,
'LAST_RUN' => '0000-00-00 00:00:00',
'NEXT_RUN' => '0000-00-00 00:00:00',
'RUN_INTERVAL' => '',
'LOG_ENABLED' => 0,
'LOG_FILE' => '',
'LOG_SQL_QUERIES' => 0,
'DISABLE_BOARD' => 0,
'RUN_COUNTER' => 0,
));
break;
$cfg = array_merge($default_cfg_str, $default_cfg_bool, $default_cfg_num); case 'delete':
set_tpl_vars ($default_cfg_str, $cfg);
set_tpl_vars_lang ($default_cfg_str);
set_tpl_vars_bool ($default_cfg_bool, $cfg);
set_tpl_vars_lang ($default_cfg_bool);
set_tpl_vars ($default_cfg_num, $cfg);
set_tpl_vars_lang ($default_cfg_num);
print_page('admin_cron.tpl', 'admin');
}
if ($mode == 'add') {
$cron_id = 'none';
$cron_active = 1;
$cron_title = '';
$cron_script = '';
$schedule = '';
$run_day = '';
$run_time = '';
$run_order = 255;
$last_run = '0000-00-00 00:00:00';
$next_run = '0000-00-00 00:00:00';
$run_interval = '';
$log_enabled = 0;
$log_file = '';
$log_sql_queries = 0;
$disable_board = 0;
$run_counter = 0;
//build schedule html
$schedule_html = '<select name="schedule" tabindex="13">
<option value=""></option>
<option value="hourly">'.$lang['HOURLY'].'</option>
<option value="daily" >'.$lang['DAILY'].'</option>
<option value="weekly">'.$lang['WEEKLY'].'</option>
<option value="monthly">'.$lang['MONTHLY'].'</option>
<option value="interval">'.$lang['INTERVAL'].'</option>
</select>';
$schedule_option = 'value="'.$schedule.'"';
$schedule_selected = 'value="'.$schedule.'" selected="selected"';
$schedule_result = str_replace( $schedule_option, $schedule_selected, $schedule_html);
//build run_day html
$run_day_html = '<select name="run_day" width="100px" tabindex="13"><option value=""></option>';
for ($i = 1; $i <= 28; $i++) {
if($run_day == $i) {
$run_day_html .= '<option value="'.$i.'" selected="selected">'.$i.'</option>' ;
}
else {
$run_day_html .= '<option value="'.$i.'">'.$i.'</option>' ;
}
}
$run_day_html .= '</select>';
//
$template->assign_vars(array(
'TPL_CRON_EDIT' => true,
'S_CRON_ACTION' => append_sid("admin_cron.php"),
'S_MODE' => 'add',
'SCHEDULE' => $schedule_result,
'RUN_DAY' => $run_day_html,
'L_CRON_EDIT_HEAD' => $lang['CRON_EDIT_HEAD_ADD'],
));
$default_cfg_str = array(
'cron_title' => $cron_title,
'cron_script' => $cron_script,
'run_time' => $run_time,
'last_run' => $last_run,
'next_run' => $next_run,
'run_interval' => $run_interval,
'log_file' => $log_file,
);
$default_cfg_bool = array(
'cron_active' => $cron_active,
'log_enabled' => $log_enabled,
'log_sql_queries' => $log_sql_queries,
'disable_board' => $disable_board,
);
$default_cfg_num = array(
'cron_id' => $cron_id,
'run_order' => $run_order,
'run_counter' => $run_counter,
);
$cfg = array_merge($default_cfg_str, $default_cfg_bool, $default_cfg_num);
set_tpl_vars ($default_cfg_str, $cfg);
set_tpl_vars_lang ($default_cfg_str);
set_tpl_vars_bool ($default_cfg_bool, $cfg);
set_tpl_vars_lang ($default_cfg_bool);
set_tpl_vars ($default_cfg_num, $cfg);
set_tpl_vars_lang ($default_cfg_num);
print_page('admin_cron.tpl', 'admin');
}
if ($mode == 'delete' && $job_id) {
if (isset($_GET['confirm'])) {
delete_jobs($job_id); delete_jobs($job_id);
redirect('admin/'.basename(__FILE__) . '?mode=list');
} $message = $lang['JOB_REMOVED'] . "<br /><br />" . sprintf($lang['CLICK_RETURN_JOBS'], "<a href=\"" . append_sid("admin_cron.php?mode=list") . "\">", "</a>") . "<br /><br />" . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], "<a href=\"" . append_sid("index.php?pane=right") . "\">", "</a>");
else { message_die(GENERAL_MESSAGE, $message);
message_die(GENERAL_MESSAGE, "Are you sure? <br /> <a href='admin_cron.php?mode=delete&id=$job_id&confirm'>Delete</a> <a href='javascript:history.back(-1)'>Back</a>"); break;
} }
}
if ($submit && $confirm) { if ($submit)
if ($_POST['mode'] == 'list') { {
if ($cron_action == 'run' && $jobs) { if ($_POST['mode'] == 'list')
{
if ($cron_action == 'run' && $jobs)
{
run_jobs($jobs); run_jobs($jobs);
} }
else if ($cron_action == 'delete' && $jobs) { else if ($cron_action == 'delete' && $jobs)
{
delete_jobs($jobs); delete_jobs($jobs);
} }
else if (($cron_action == 'disable' || $cron_action == 'enable') && $jobs) { else if (($cron_action == 'disable' || $cron_action == 'enable') && $jobs)
{
toggle_active($jobs, $cron_action); toggle_active($jobs, $cron_action);
} }
$bb_cfg_options = array(
'cron_enabled',
'cron_check_interval'
);
foreach ($bb_cfg_options as $option) {
update_config_php($option, $_POST[$option]);
}
redirect('admin/'.basename(__FILE__) . '?mode=list'); redirect('admin/'.basename(__FILE__) . '?mode=list');
} }
else if (validate_cron_post($_POST) == 1) { else if (validate_cron_post($_POST) == 1)
if($_POST['mode'] == 'edit') { {
if($_POST['mode'] == 'edit')
{
update_cron_job($_POST); update_cron_job($_POST);
} }
else if ($_POST['mode'] == 'add'){ else if ($_POST['mode'] == 'add')
{
insert_cron_job($_POST); insert_cron_job($_POST);
} }
else { else bb_die();
bb_die();
}
redirect('admin/'.basename(__FILE__) . '?mode=list'); redirect('admin/'.basename(__FILE__) . '?mode=list');
} }
else { else
{
$message = validate_cron_post($_POST); $message = validate_cron_post($_POST);
message_die(GENERAL_MESSAGE, $message); message_die(GENERAL_MESSAGE, $message);
} }
}
} print_page('admin_cron.tpl', 'admin');

View file

@ -66,7 +66,7 @@ switch($this->request['type'])
// Use trim to get rid of spaces placed there by MS-SQL 2000 // Use trim to get rid of spaces placed there by MS-SQL 2000
$quote_username = (trim($post['post_username']) != '') ? $post['post_username'] : get_username($post['poster_id']); $quote_username = (trim($post['post_username']) != '') ? $post['post_username'] : get_username($post['poster_id']);
$message = '[quote="'. $quote_username .'"]'. $post['post_text'] .'[/quote]'; $message = "[quote=\"". $quote_username ."\"]". $post['post_text'] ."[/quote]\n";
// hide user passkey // hide user passkey
$message = preg_replace('#(?<=\?uk=)[a-zA-Z0-9]{10}(?=&)#', 'passkey', $message); $message = preg_replace('#(?<=\?uk=)[a-zA-Z0-9]{10}(?=&)#', 'passkey', $message);
// hide sid // hide sid
@ -77,9 +77,9 @@ switch($this->request['type'])
$message = (!empty($message)) ? preg_replace($orig_word, $replace_word, $message) : ''; $message = (!empty($message)) ? preg_replace($orig_word, $replace_word, $message) : '';
} }
if($post['post_attachment'] || $post['topic_first_post_id']) if($post['post_id'] == $post['topic_first_post_id'])
{ {
$message = '[quote]'. $post['topic_title'] .'[/quote]'; $message = "[quote]". $post['topic_title'] ."[/quote]\n";
} }
if(mb_strlen($message, 'UTF-8') > 1000) if(mb_strlen($message, 'UTF-8') > 1000)
{ {

View file

@ -53,8 +53,8 @@ $bb_cfg = $tr_cfg = $page_cfg = array();
// Increase number of revision after update // Increase number of revision after update
$bb_cfg['tp_version'] = '2.1 Stable'; $bb_cfg['tp_version'] = '2.1 Stable';
$bb_cfg['tp_release_state'] = 'R295'; $bb_cfg['tp_release_state'] = 'R296';
$bb_cfg['tp_release_date'] = '30-09-2011'; $bb_cfg['tp_release_date'] = '01-10-2011';
// Database // Database
$charset = 'utf8'; $charset = 'utf8';
@ -374,10 +374,6 @@ define('BB_DISABLED', TRIGGERS_DIR .'$off');
define('CRON_ALLOWED', TRIGGERS_DIR .'cron_allowed'); define('CRON_ALLOWED', TRIGGERS_DIR .'cron_allowed');
define('CRON_RUNNING', TRIGGERS_DIR .'cron_running'); define('CRON_RUNNING', TRIGGERS_DIR .'cron_running');
// Cron
$bb_cfg['cron_enabled'] = true; // При отвязки крона старт производить из cron.php
$bb_cfg['cron_check_interval'] = 300; // sec
// News // News
$bb_cfg['show_latest_news'] = true; $bb_cfg['show_latest_news'] = true;
$bb_cfg['latest_news_count'] = 5; $bb_cfg['latest_news_count'] = 5;

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

BIN
upload/images/icon_edit.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

BIN
upload/images/icon_run.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

BIN
upload/images/icon_sync.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

View file

@ -80,7 +80,24 @@ function validate_cron_post($cron_arr) {
} }
function insert_cron_job($cron_arr) function insert_cron_job($cron_arr)
{ {
$row = DB()->fetch_row("SELECT cron_title, cron_script FROM ". BB_CRON ." WHERE cron_title = '". $_POST['cron_title'] ."' or cron_script = '". $_POST['cron_script'] ."' ");
if($row)
{
global $lang;
if ($_POST['cron_script'] == $row['cron_script'])
{
$langmode = $lang['SCRIPT_DUPLICATE'];
}
else $langmode = $lang['TITLE_DUPLICATE'];
$message = $langmode . "<br /><br />" . sprintf($lang['CLICK_RETURN_JOBS_ADDED'], "<a href=\"javascript:history.back(-1)\">", "</a>") . "<br /><br />" . sprintf($lang['CLICK_RETURN_JOBS'], "<a href=\"" . append_sid("admin_cron.php?mode=list") . "\">", "</a>") . "<br /><br />" . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], "<a href=\"" . append_sid("index.php?pane=right") . "\">", "</a>");
message_die(GENERAL_MESSAGE, $message);
}
$cron_active = $cron_arr['cron_active']; $cron_active = $cron_arr['cron_active'];
$cron_title = $cron_arr['cron_title']; $cron_title = $cron_arr['cron_title'];
$cron_script = $cron_arr['cron_script']; $cron_script = $cron_arr['cron_script'];
@ -96,7 +113,8 @@ function insert_cron_job($cron_arr)
$log_sql_queries = $cron_arr['log_sql_queries']; $log_sql_queries = $cron_arr['log_sql_queries'];
$disable_board = $cron_arr['disable_board']; $disable_board = $cron_arr['disable_board'];
$run_counter = $cron_arr['run_counter']; $run_counter = $cron_arr['run_counter'];
DB()->query("INSERT INTO ".BB_CRON." (cron_active, cron_title, cron_script, schedule, run_day, run_time, run_order, last_run, next_run, run_interval, log_enabled, log_file, log_sql_queries, disable_board, run_counter) VALUES (
DB()->query("INSERT INTO ". BB_CRON ." (cron_active, cron_title, cron_script, schedule, run_day, run_time, run_order, last_run, next_run, run_interval, log_enabled, log_file, log_sql_queries, disable_board, run_counter) VALUES (
$cron_active, '$cron_title', '$cron_script', '$schedule', '$run_day', '$run_time', '$run_order', '$last_run', '$next_run', '$run_interval', $log_enabled, '$log_file', $log_sql_queries, $disable_board, '$run_counter')"); $cron_active, '$cron_title', '$cron_script', '$schedule', '$run_day', '$run_time', '$run_order', '$last_run', '$next_run', '$run_interval', $log_enabled, '$log_file', $log_sql_queries, $disable_board, '$run_counter')");
} }
@ -137,23 +155,4 @@ function update_cron_job($cron_arr)
run_counter = '$run_counter' run_counter = '$run_counter'
WHERE cron_id = $cron_id WHERE cron_id = $cron_id
"); ");
}
function update_config_php($config_option_name, $new_value) {
$file = file(BB_ROOT.'config.php');
$i = 0;
$count = count($file);
while ($i<$count) {
if (preg_match("/$config_option_name/i", $file[$i])) {
$line = explode(';', $file[$i]); //explode comments
$line[0] = '$bb_cfg[\''.$config_option_name.'\'] = '.$new_value.''; //assign a new value
$file[$i] = implode(';', $line); //build a new line
$fp = fopen(BB_ROOT."config.php","w");
fputs($fp,implode("",$file));
fclose($fp);
}
$i++;
}
return;
} }

View file

@ -18,7 +18,7 @@ $lang['WORD_CENSOR'] = 'Word Censors';
$lang['EXPORT'] = 'Export'; $lang['EXPORT'] = 'Export';
$lang['CREATE_NEW'] = 'Create'; $lang['CREATE_NEW'] = 'Create';
$lang['ADD_NEW'] = 'Add'; $lang['ADD_NEW'] = 'Add';
$lang['FLAGS'] = 'Flags'; $lang['CRON'] = 'Task Scheduler (Cron)';
$lang['FORUM_CONFIG'] = 'Forum settings'; $lang['FORUM_CONFIG'] = 'Forum settings';
$lang['TRACKER_CONFIG'] = 'Tracker settings'; $lang['TRACKER_CONFIG'] = 'Tracker settings';
$lang['RELEASE_TEMPLATES'] = 'Release Templates'; $lang['RELEASE_TEMPLATES'] = 'Release Templates';
@ -32,6 +32,7 @@ $lang['ADMIN'] = 'Administration';
$lang['MAIN_INDEX'] = 'Forum Index'; $lang['MAIN_INDEX'] = 'Forum Index';
$lang['FORUM_STATS'] = 'Forum Statistics'; $lang['FORUM_STATS'] = 'Forum Statistics';
$lang['ADMIN_INDEX'] = 'Admin Index'; $lang['ADMIN_INDEX'] = 'Admin Index';
$lang['CREATE_PROFILE'] = 'Create profile';
$lang['TP_VERSION'] = 'TorrenPier version'; $lang['TP_VERSION'] = 'TorrenPier version';
$lang['TP_RELEASE_DATE'] = 'Release date'; $lang['TP_RELEASE_DATE'] = 'Release date';
@ -593,7 +594,7 @@ $lang['REPORT_NEW_WINDOW_EXPLAIN'] = 'This setting also affects direct links to
$lang['REPORT_CONFIG_UPDATED'] = 'The configuration was updated.'; $lang['REPORT_CONFIG_UPDATED'] = 'The configuration was updated.';
$lang['CLICK_RETURN_REPORT_CONFIG'] = 'Click %sHere%s to return to the configuration.'; $lang['CLICK_RETURN_REPORT_CONFIG'] = 'Click %sHere%s to return to the configuration.';
$lang['MODULES_REASONS'] = 'Modules &amp; Reasons'; $lang['MODULES_REASONS'] = 'Modules and Reasons';
$lang['REPORT_ADMIN_EXPLAIN'] = 'On this page you can install new report modules and edit or uninstall currently installed modules. In addition you can set up predefined reasons for every report module.'; $lang['REPORT_ADMIN_EXPLAIN'] = 'On this page you can install new report modules and edit or uninstall currently installed modules. In addition you can set up predefined reasons for every report module.';
$lang['REPORT_MODULE'] = 'Report module'; $lang['REPORT_MODULE'] = 'Report module';
$lang['INSTALLED_MODULES'] = 'Installed modules'; $lang['INSTALLED_MODULES'] = 'Installed modules';

View file

@ -2,7 +2,8 @@
$lang['CRON_LIST'] = 'Cron list'; $lang['CRON_LIST'] = 'Cron list';
$lang['CRON_ID'] = 'ID'; $lang['CRON_ID'] = 'ID';
$lang['CRON_ACTIVE'] = 'Active'; $lang['CRON_ACTIVE'] = 'On';
$lang['CRON_ACTIVE_EXPL'] = 'Active tasks';
$lang['CRON_TITLE'] = 'Title'; $lang['CRON_TITLE'] = 'Title';
$lang['CRON_SCRIPT'] = 'Script'; $lang['CRON_SCRIPT'] = 'Script';
$lang['CRON_SCHEDULE'] = 'Schedule'; $lang['CRON_SCHEDULE'] = 'Schedule';
@ -22,27 +23,21 @@ $lang['CRON_DEL'] = 'Delete';
$lang['CRON_DISABLE'] = 'Disable'; $lang['CRON_DISABLE'] = 'Disable';
$lang['CRON_ENABLE'] = 'Enable'; $lang['CRON_ENABLE'] = 'Enable';
$lang['RUN_MAIN_CRON'] = '[Run cron]';
$lang['ADD_JOB'] = '[Add job]';
$lang['CRON_WORKS'] = 'Cron is now works or is broken -> '; $lang['CRON_WORKS'] = 'Cron is now works or is broken -> ';
$lang['REPAIR_CRON'] = '[Repair Cron]'; $lang['REPAIR_CRON'] = 'Repair Cron';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job'; $lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job'; $lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
$lang['CRON_ID'] = 'Cron id'; $lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
$lang['CRON_ACTIVE'] = 'Cron active'; $lang['SCHEDULE'] = array(
$lang['CRON_ACTIVE_EXPL'] = 'this job is active?'; 'select' => '&raquo; Select start',
$lang['CRON_TITLE'] = 'Cron title'; 'hourly' => 'hourly',
$lang['CRON_SCRIPT'] = 'Cron script'; 'daily' => 'daily',
$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"'; 'weekly' => 'weekly',
$lang['SCHEDULE'] = 'Schedule'; 'monthly' => 'monthly',
//schedule 'interval' => 'interval'
$lang['HOURLY'] = 'hourly'; );
$lang['DAILY'] = 'daily'; $lang['NOSELECT'] = 'No select';
$lang['WEEKLY'] = 'weekly';
$lang['MONTHLY'] = 'monthly';
$lang['INTERVAL'] = 'interval';
//
$lang['RUN_DAY'] = 'Run day'; $lang['RUN_DAY'] = 'Run day';
$lang['RUN_DAY_EXPL'] = 'the day when this job run'; $lang['RUN_DAY_EXPL'] = 'the day when this job run';
$lang['RUN_TIME'] = 'Run time'; $lang['RUN_TIME'] = 'Run time';
@ -58,4 +53,10 @@ $lang['LOG_FILE_EXPL'] = 'the file for save the log';
$lang['LOG_SQL_QUERIES'] = 'Log SQL queries'; $lang['LOG_SQL_QUERIES'] = 'Log SQL queries';
$lang['DISABLE_BOARD'] = 'Disable board'; $lang['DISABLE_BOARD'] = 'Disable board';
$lang['DISABLE_BOARD_EXPL'] = 'disable board when this job is run'; $lang['DISABLE_BOARD_EXPL'] = 'disable board when this job is run';
$lang['RUN_COUNTER'] = 'Run counter'; $lang['RUN_COUNTER'] = 'Run counter';
$lang['JOB_REMOVED'] = 'The problem was successfully removed';
$lang['SCRIPT_DUPLICATE'] = 'Script <b>'. @$_POST['cron_script'] .'</b> already exists!';
$lang['TITLE_DUPLICATE'] = 'Task Name <b>'. @$_POST['cron_title'] .'</b> already exists!';
$lang['CLICK_RETURN_JOBS_ADDED'] = '%sReturn to the addition problem%s';
$lang['CLICK_RETURN_JOBS'] = '%sBack to the Task Scheduler%s';

File diff suppressed because it is too large Load diff

View file

@ -2,8 +2,9 @@
$lang['CRON_LIST'] = 'Список задач'; $lang['CRON_LIST'] = 'Список задач';
$lang['CRON_ID'] = 'ID'; $lang['CRON_ID'] = 'ID';
$lang['CRON_ACTIVE'] = 'Вкл.'; $lang['CRON_ACTIVE'] = 'Вкл';
$lang['CRON_TITLE'] = 'Название'; $lang['CRON_ACTIVE_EXPL'] = 'Активность задачи';
$lang['CRON_TITLE'] = 'Название задачи';
$lang['CRON_SCRIPT'] = 'Скрипт'; $lang['CRON_SCRIPT'] = 'Скрипт';
$lang['CRON_SCHEDULE'] = 'Запуск'; $lang['CRON_SCHEDULE'] = 'Запуск';
$lang['CRON_LAST_RUN'] = 'Посл. запуск'; $lang['CRON_LAST_RUN'] = 'Посл. запуск';
@ -13,7 +14,7 @@ $lang['CRON_MANAGE'] = 'Управление';
$lang['CRON_OPTIONS'] = 'Настройки крона'; $lang['CRON_OPTIONS'] = 'Настройки крона';
$lang['CRON_ENABLED'] = 'Крон включён'; $lang['CRON_ENABLED'] = 'Крон включён';
$lang['CRON_CHECK_INTERVAL'] = 'Интервал проверки крона (в секундах)'; $lang['CRON_CHECK_INTERVAL'] = 'Проверка (сек)';
$lang['WITH_SELECTED'] = 'С выделенными'; $lang['WITH_SELECTED'] = 'С выделенными';
$lang['NOTHING'] = 'ничего не делать'; $lang['NOTHING'] = 'ничего не делать';
@ -22,27 +23,23 @@ $lang['CRON_DEL'] = 'удалить';
$lang['CRON_DISABLE'] = 'отключить'; $lang['CRON_DISABLE'] = 'отключить';
$lang['CRON_ENABLE'] = 'включить'; $lang['CRON_ENABLE'] = 'включить';
$lang['RUN_MAIN_CRON'] = '[Запустить крон]'; $lang['RUN_MAIN_CRON'] = 'Запустить крон';
$lang['ADD_JOB'] = '[Добавить задачу]'; $lang['ADD_JOB'] = 'Добавить задачу';
$lang['CRON_WORKS'] = 'Крон в данный момент запущен или завис -> '; $lang['CRON_WORKS'] = 'Крон в данный момент запущен или завис &#0183; ';
$lang['REPAIR_CRON'] = '[Восстановить]'; $lang['REPAIR_CRON'] = 'Восстановить';
$lang['CRON_EDIT_HEAD_EDIT'] = 'Редактировать задачу'; $lang['CRON_EDIT_HEAD_EDIT'] = 'Редактировать задачу';
$lang['CRON_EDIT_HEAD_ADD'] = 'Добавить задачу'; $lang['CRON_EDIT_HEAD_ADD'] = 'Добавить задачу';
$lang['CRON_ID'] = 'ID';
$lang['CRON_ACTIVE'] = 'Активность';
$lang['CRON_ACTIVE_EXPL'] = 'эта задача включена?';
$lang['CRON_TITLE'] = 'Название задачи';
$lang['CRON_SCRIPT'] = 'Скрипт';
$lang['CRON_SCRIPT_EXPL'] = 'название в папке "includes/cron/jobs/"'; $lang['CRON_SCRIPT_EXPL'] = 'название в папке "includes/cron/jobs/"';
$lang['SCHEDULE'] = 'Запуск'; $lang['SCHEDULE'] = array(
//schedule 'select' => '&raquo; Выберите запуск',
$lang['HOURLY'] = 'ежечасно'; 'hourly' => 'ежечасно',
$lang['DAILY'] = 'ежедневно'; 'daily' => 'ежедневно',
$lang['WEEKLY'] = 'еженедельно'; 'weekly' => 'еженедельно',
$lang['MONTHLY'] = 'ежемесячно'; 'monthly' => 'ежемесячно',
$lang['INTERVAL'] = 'интервал'; 'interval' => 'интервал'
// );
$lang['NOSELECT'] = 'Не указан';
$lang['RUN_DAY'] = 'День запуска'; $lang['RUN_DAY'] = 'День запуска';
$lang['RUN_DAY_EXPL'] = 'день месяца/недели, когда эта задача будет выполняться'; $lang['RUN_DAY_EXPL'] = 'день месяца/недели, когда эта задача будет выполняться';
$lang['RUN_TIME'] = 'Время запуска'; $lang['RUN_TIME'] = 'Время запуска';
@ -58,4 +55,10 @@ $lang['LOG_FILE_EXPL'] = 'файл, куда будут сохраняться
$lang['LOG_SQL_QUERIES'] = 'Логировать SQL запросы'; $lang['LOG_SQL_QUERIES'] = 'Логировать SQL запросы';
$lang['DISABLE_BOARD'] = 'Отключать форум'; $lang['DISABLE_BOARD'] = 'Отключать форум';
$lang['DISABLE_BOARD_EXPL'] = 'отключать форум, когда задача выполняется?'; $lang['DISABLE_BOARD_EXPL'] = 'отключать форум, когда задача выполняется?';
$lang['RUN_COUNTER'] = 'Кол-во запусков'; $lang['RUN_COUNTER'] = 'Кол-во запусков';
$lang['JOB_REMOVED'] = 'Задача была успешно удалена';
$lang['SCRIPT_DUPLICATE'] = 'Скрипт <b>'. @$_POST['cron_script'] .'</b> уже существует!';
$lang['TITLE_DUPLICATE'] = 'Название задачи <b>'. @$_POST['cron_title'] .'</b> уже существует!';
$lang['CLICK_RETURN_JOBS_ADDED'] = '%sВернуться к добавлению задачи%s';
$lang['CLICK_RETURN_JOBS'] = '%sВернуться к планировщику задач%s';

View file

@ -1688,7 +1688,6 @@ $lang['OLD'] = 'Прочит';
// DL-лист // DL-лист
$lang['DL_USER'] = 'Пользователь'; $lang['DL_USER'] = 'Пользователь';
$lang['USER'] = 'Пользователь';
$lang['DL_PERCENT'] = 'Скачано процентов'; $lang['DL_PERCENT'] = 'Скачано процентов';
$lang['DL_UL'] = 'Отдано'; $lang['DL_UL'] = 'Отдано';
$lang['DL_DL'] = 'Скачано'; $lang['DL_DL'] = 'Скачано';

View file

@ -1,105 +1,133 @@
<SCRIPT language=JavaScript title="check"> <script type="text/javascript">
function CheckAll(Element,Name){ $(document).ready(function() {
if(document.getElementById) { $("#check_all").click(function () {
thisCheckBoxes = Element.parentNode.parentNode.parentNode.getElementsByTagName('input'); if (!$("#check_all").is(":checked"))
for (i = 1; i < thisCheckBoxes.length; i++){ $(".checkbox").removeAttr("checked");
if (thisCheckBoxes[i].name == Name){ else
thisCheckBoxes[i].checked = Element.checked; $(".checkbox").attr("checked","checked");
Colorize(document.getElementById(thisCheckBoxes[i].id.replace('cb','tr')), thisCheckBoxes[i]); });
} });
} </script>
}
}
function Colorize(Element, CBElement){ <style type="text/css">
if(document.getElementById) { #cron_true, #cron_false { width: 95%; }
if(Element && CBElement){ #cron_true td { background: #d9facb; padding: 8px 8px; color: #286e0f; }
Element.className = ( CBElement.checked ? 'selected' : 'default' ); #cron_false td { background: #eaeadf; padding: 8px 8px; color: #286e0f; }
} table.cron_true { width: 100%; border: 2px solid #169900; background: #60f950; margin: 0 auto; }
} table.cron_false { width: 100%; border: 2px solid #796405; background: #d7b101; margin: 0 auto; }
} tr.hl-tr:hover td { background-color: #CFC !important; }
</style>
function CheckRadioTR(Element){
if(document.getElementById) {
CheckTR(Element);
thisTRs = Element.parentNode.getElementsByTagName('tr');
for (i = 0; i < thisTRs.length; i++){
if (thisTRs[i].id != Element.id && thisTRs[i].className != 'header') thisTRs[i].className = 'default';
}
}
}
function CheckTR(Element){
if(document.getElementById) {
thisCheckbox = document.getElementById(Element.id.replace('tr','cb'));
thisCheckbox.checked = !thisCheckbox.checked;
Colorize(Element, thisCheckbox);
}
}
function CheckCB(Element){
if(document.getElementById) {
if(document.getElementById(Element.id.replace('cb','tr'))){Element.checked = !Element.checked;}
}
}
</SCRIPT>
<!-- IF TPL_CRON_LIST --> <!-- IF TPL_CRON_LIST -->
<!--========================================================================--> <!--========================================================================-->
<form action="{S_CRON_ACTION}" method="post"> <form action="{S_CRON_ACTION}" method="post">
<input class="text" type="hidden" name="mode" value="{S_MODE}" /> <input class="text" type="hidden" name="mode" value="{S_MODE}" />
<table cellpadding="2" cellspacing="0" width="100%">
<tr>
<td width="80%">
<h1>{L_CRON}</h1>
<a href="admin_cron.php?mode=add">{L_CRON_EDIT_HEAD_ADD}</a>
</td>
<td width="20%" class="vBottom tRight nowrap med">
<!-- IF TPL_CRON_LIST -->
<table id="cron_<!-- IF CRON_ENABLED -->true<!-- ELSE -->false<!-- ENDIF -->" class="cron_<!-- IF CRON_ENABLED -->true<!-- ELSE -->false<!-- ENDIF -->">
<tr>
<td>{L_CRON_ENABLED}</td>
<td>
<label><input type="radio" name="cron_enabled" value="1" <!-- IF CRON_ENABLED -->checked="checked"<!-- ENDIF --> />{L_YES}</label>&nbsp;&nbsp;
<label><input type="radio" name="cron_enabled" value="0" <!-- IF not CRON_ENABLED -->checked="checked"<!-- ENDIF --> />{L_NO}</label>
</td>
<td>{L_CRON_CHECK_INTERVAL}</td>
<td>
<input class="post" type="text" size="10" maxlength="255" name="cron_check_interval" value="{CRON_CHECK_INTERVAL}" />
</td>
<td>
<input type="submit" name="submit" value="{L_SUBMIT}" class="mainoption" />
</td>
</tr>
</table>
<!-- ELSE IF CRON_RUNNING -->
<table id="tor_blocked" class="error">
<tr>
<td>
<p class="error_msg">{L_CRON_WORKS} <a href="admin_cron.php?mode=repair"><b>{L_REPAIR_CRON}</b></a></p>
</td>
</tr>
</table>
<!-- ENDIF -->
</td>
</tr>
</table>
<br />
<table class="forumline"> <table class="forumline">
<tr> <tr>
<td colspan="10" class="catTitle">{L_CRON_LIST}</td> <th colspan="10">{L_CRON_LIST}</th>
</tr> </tr>
<tr>
<th width="5%" nowrap="nowrap"><INPUT onclick="CheckAll(this,'select[]')" type="checkbox"></th> <tr class="row3 med tCenter">
<th width="5%" nowrap="nowrap">{L_CRON_ID}</th> <td><input type="checkbox" id="check_all"></td>
<th width="5%" nowrap="nowrap">{L_CRON_ACTIVE}</th> <td>{L_CRON_ID}</td>
<th width="30%" nowrap="nowrap" >{L_CRON_TITLE}</th> <td>{L_CRON_ACTIVE}</td>
<th width="20%" nowrap="nowrap">{L_CRON_SCRIPT}</th> <td>{L_CRON_TITLE}</td>
<th width="5%" nowrap="nowrap">{L_CRON_SCHEDULE}</th> <td>{L_CRON_SCRIPT}</td>
<th width="5%" nowrap="nowrap">{L_CRON_LAST_RUN}</th> <td>{L_CRON_SCHEDULE}</td>
<th width="5%" nowrap="nowrap">{L_CRON_NEXT_RUN}</th> <td>{L_CRON_LAST_RUN}</td>
<th width="1%" nowrap="nowrap">{L_CRON_RUN_COUNT}</th> <td>{L_CRON_NEXT_RUN}</td>
<th width="10%" nowrap="nowrap">{L_CRON_MANAGE}</th> <td>{L_CRON_RUN_COUNT}</td>
<td>{L_CRON_MANAGE}</td>
</tr> </tr>
{LIST}
<!-- BEGIN list -->
<tr class="{list.ROW_CLASS} hl-tr">
<td align="center"><input type="checkbox" name="select[]" class="checkbox" value="{list.CRON_ID}"></td>
<td nowrap="nowrap" align="center">{list.CRON_ID}</td>
<td nowrap="nowrap" align="center">{list.CRON_ACTIVE}</td>
<td nowrap="nowrap" align="left">{list.CRON_TITLE}</td>
<td nowrap="nowrap" align="left">{list.CRON_SCRIPT}</td>
<td nowrap="nowrap" class="med tCenter">{list.SCHEDULE}</td>
<td nowrap="nowrap" align="center">{list.LAST_RUN}</td>
<td nowrap="nowrap" align="center">{list.NEXT_RUN}</td>
<td nowrap="nowrap" align="center"><font color="#505050"><b><span class="leechmed">{list.RUN_COUNT}</span></b></font></td>
<td nowrap="nowrap" align="center">
<a href="admin_cron.php?mode=run&id={list.CRON_ID}"><img src="../images/icon_sync.gif" alt="[Run]" title="{L_CRON_RUN}" /></a>
<a href="admin_cron.php?mode=edit&id={list.CRON_ID}"><img src="../images/icon_edit.gif" alt="[Edit]" title="{L_CRON_EDIT_HEAD_EDIT}" /></a>
<a href="admin_cron.php?mode=delete&id={list.CRON_ID}"><img src="../images/icon_delete.gif" alt="[Del]" title="{L_CRON_DEL}" /></a>
</td>
</tr>
<!-- END list -->
</table> </table>
<table class="forumline"> <table class="forumline">
<tr> <tr>
<td colspan="2" class="catBottom"> <td colspan="2" class="catBottom">
{L_WITH_SELECTED} {L_WITH_SELECTED}
<select name="cron_action" id="cron_select" > <select name="cron_action" id="cron_select" >
<option value="" selected="selected" class="select-action">&raquo; {L_NOTHING}</option> <option value="" selected="selected" class="select-action">&raquo; {L_NOTHING}</option>
<option value="run">{L_CRON_RUN}</option> <option value="run">{L_CRON_RUN}</option>
<option value="delete">{L_CRON_DEL}</option> <option value="delete">{L_CRON_DEL}</option>
<option value="disable">{L_CRON_DISABLE}</option> <option value="disable">{L_CRON_DISABLE}</option>
<option value="enable">{L_CRON_ENABLE}</option> <option value="enable">{L_CRON_ENABLE}</option>
</select> </select>
<label for="confirm">&nbsp;<input onclick="toggle_disabled('send', this.checked)" id="confirm" type="checkbox" name="confirm" value="1" /></label> <label><input onclick="toggle_disabled('send', this.checked)" type="checkbox" name="confirm" value="1" /></label>&nbsp;
<input type="submit" name="submit" id="send" value="{L_SUBMIT}" class="mainoption" disabled="disabled" />&nbsp;&nbsp; <input type="submit" name="submit" id="send" value="{L_SUBMIT}" class="mainoption" disabled="disabled" />
</td> </td>
</tr> </tr>
</table> </table>
</form> </form>
<br /> <br />
<center>
<a href="admin_cron.php?mode=run"><b>{L_RUN_MAIN_CRON}</b></a> &middot;
<a href="admin_cron.php?mode=add"><b>{L_ADD_JOB}</b></a>
</center>
{CRON_ACTION}
<!-- IF CRON_RUNNING -->
<center><b>{L_CRON_WORKS}
<a href="admin_cron.php?mode=repair">{L_REPAIR_CRON}</b></a></center>
<!-- ENDIF / CRON_RUNNING -->
<br />
<!--========================================================================--> <!--========================================================================-->
<!-- ENDIF / TPL_CRON_LIST --> <!-- ENDIF / TPL_CRON_LIST -->
<!-- IF TPL_CRON_EDIT --> <!-- IF TPL_CRON_EDIT -->
<h1>{L_CRON_EDIT_HEAD}</h1> <h1>{L_CRON_EDIT_HEAD}</h1>
<a href="admin_cron.php?mode=list">{L_CRON_LIST}</a>
<br /><br />
<form action="{S_CRON_ACTION}" method="post"> <form action="{S_CRON_ACTION}" method="post">
<input class="text" type="hidden" name="mode" value="{S_MODE}" /> <input class="text" type="hidden" name="mode" value="{S_MODE}" />
@ -114,8 +142,14 @@ if(document.getElementById) {
<td><input class="text" type="hidden" size="30" maxlength="255" name="cron_id" value="{CRON_ID}" /> <b>{CRON_ID}</b></td> <td><input class="text" type="hidden" size="30" maxlength="255" name="cron_id" value="{CRON_ID}" /> <b>{CRON_ID}</b></td>
</tr> </tr>
<tr> <tr>
<td><h4>{L_CRON_ACTIVE}</h4><h6>{L_CRON_ACTIVE_EXPL}</h6></td> <td>
<td><label for="cron_active1"><input type="radio" name="cron_active" id="cron_active1" value="1" {CRON_ACTIVE_YES} /> {L_CRON_ACTIVE_YES}&nbsp;</label><label for="cron_active2">&nbsp;<input type="radio" name="cron_active" id="cron_active2" value="0" {CRON_ACTIVE_NO} /> {L_CRON_ACTIVE_NO} &nbsp;</label></td> <h4>{L_CRON_ACTIVE}</h4>
<h6>{L_CRON_ACTIVE_EXPL}</h6>
</td>
<td>
<label><input type="radio" name="cron_active" value="1" <!-- IF CRON_ACTIVE -->checked="checked"<!-- ENDIF --> />{L_YES}</label>&nbsp;&nbsp;
<label><input type="radio" name="cron_active" value="0" <!-- IF not CRON_ACTIVE -->checked="checked"<!-- ENDIF --> />{L_NO}</label>
</td>
</tr> </tr>
<tr> <tr>
<td><h4>{L_CRON_TITLE}</h4></td> <td><h4>{L_CRON_TITLE}</h4></td>
@ -126,7 +160,7 @@ if(document.getElementById) {
<td><input class="post" type="text" size="35" maxlength="255" name="cron_script" value="{CRON_SCRIPT}" /></td> <td><input class="post" type="text" size="35" maxlength="255" name="cron_script" value="{CRON_SCRIPT}" /></td>
</tr> </tr>
<tr> <tr>
<td><h4>{L_SCHEDULE}</h4></td> <td><h4>{L_CRON_SCHEDULE}</h4></td>
<td>{SCHEDULE}</td> <td>{SCHEDULE}</td>
</tr> </tr>
<tr> <tr>
@ -155,7 +189,10 @@ if(document.getElementById) {
</tr> </tr>
<tr> <tr>
<td><h4>{L_LOG_ENABLED}</h4></td> <td><h4>{L_LOG_ENABLED}</h4></td>
<td><label for="log_enabled1"><input type="radio" name="log_enabled" id="log_enabled1" value="1" {LOG_ENABLED_YES} /> {L_LOG_ENABLED_YES}&nbsp;</label><label for="log_enabled2">&nbsp;<input type="radio" name="log_enabled" id="log_enabled2" value="0" {LOG_ENABLED_NO} /> {L_LOG_ENABLED_NO} &nbsp;</label></td> <td>
<label><input type="radio" name="log_enabled" value="1" <!-- IF LOG_ENABLED -->checked="checked"<!-- ENDIF --> />{L_YES}</label>&nbsp;&nbsp;
<label><input type="radio" name="log_enabled" value="0" <!-- IF not LOG_ENABLED -->checked="checked"<!-- ENDIF --> />{L_NO}</label>
</td>
</tr> </tr>
<tr> <tr>
<td><h4>{L_LOG_FILE}</h4><h6>{L_LOG_FILE_EXPL}</h6></td> <td><h4>{L_LOG_FILE}</h4><h6>{L_LOG_FILE_EXPL}</h6></td>
@ -163,11 +200,17 @@ if(document.getElementById) {
</tr> </tr>
<tr> <tr>
<td><h4>{L_LOG_SQL_QUERIES}</h4></td> <td><h4>{L_LOG_SQL_QUERIES}</h4></td>
<td><label for="log_sql_queries1"><input type="radio" name="log_sql_queries" id="log_sql_queries1" value="1" {LOG_SQL_QUERIES_YES} /> {L_LOG_SQL_QUERIES_YES}&nbsp;</label><label for="log_sql_queries2">&nbsp;<input type="radio" name="log_sql_queries" id="log_sql_queries2" value="0" {LOG_SQL_QUERIES_NO} /> {L_LOG_SQL_QUERIES_NO} &nbsp;</label></td> <td>
<label><input type="radio" name="log_sql_queries" value="1" <!-- IF LOG_SQL_QUERIES -->checked="checked"<!-- ENDIF --> />{L_YES}</label>&nbsp;&nbsp;
<label><input type="radio" name="log_sql_queries" value="0" <!-- IF not LOG_SQL_QUERIES -->checked="checked"<!-- ENDIF --> />{L_NO}</label>
</td>
</tr> </tr>
<tr> <tr>
<td><h4>{L_DISABLE_BOARD}</h4><h6>{L_DISABLE_BOARD_EXPL}</h6></td> <td><h4>{L_DISABLE_BOARD}</h4><h6>{L_DISABLE_BOARD_EXPL}</h6></td>
<td><label for="disable_board1"><input type="radio" name="disable_board" id="disable_board1" value="1" {DISABLE_BOARD_YES} /> {L_DISABLE_BOARD_YES}&nbsp;</label><label for="disable_board2">&nbsp;<input type="radio" name="disable_board" id="disable_board2" value="0" {DISABLE_BOARD_NO} /> {L_DISABLE_BOARD_NO} &nbsp;</label></td> <td>
<label><input type="radio" name="disable_board" value="1" <!-- IF DISABLE_BOARD -->checked="checked"<!-- ENDIF --> />{L_YES}</label>&nbsp;&nbsp;
<label><input type="radio" name="disable_board" value="0" <!-- IF not DISABLE_BOARD -->checked="checked"<!-- ENDIF --> />{L_NO}</label>
</td>
</tr> </tr>
<tr> <tr>
<td><h4>{L_RUN_COUNTER}</h4></td> <td><h4>{L_RUN_COUNTER}</h4></td>

View file

@ -72,18 +72,25 @@ table.forumline { margin: 0 auto; }
<a href="{U_CLEAR_TPL_CACHE}">{L_TEMPLATES}</a>&nbsp; <a href="{U_CLEAR_TPL_CACHE}">{L_TEMPLATES}</a>&nbsp;
</td> </td>
</tr> </tr>
<tr>
<td><b>{L_UPDATE}:</b></td> <td><b>{L_UPDATE}:</b></td>
<td> <td>
<a href="{U_UPDATE_USER_LEVEL}">{L_USER_LEVELS}</a>&nbsp; <a href="{U_UPDATE_USER_LEVEL}">{L_USER_LEVELS}</a>&nbsp;
</td> </td>
</tr> </tr>
</tr> <tr>
<td><b>{L_SYNCHRONIZE}:</b></td> <td><b>{L_SYNCHRONIZE}:</b></td>
<td> <td>
<a href="{U_SYNC_TOPICS}">{L_TOPICS}</a>,&nbsp; <a href="{U_SYNC_TOPICS}">{L_TOPICS}</a>,&nbsp;
<a href="{U_SYNC_USER_POSTS}">{L_USER_POSTS_COUNT}</a>&nbsp; <a href="{U_SYNC_USER_POSTS}">{L_USER_POSTS_COUNT}</a>&nbsp;
</td> </td>
</tr> </tr>
<tr>
<td><b>{L_ADMIN}:</b></td>
<td>
<a href="../profile.php?mode=register">{L_CREATE_PROFILE}</a>
</td>
</tr>
</table> </table>
<br /> <br />

View file

@ -308,7 +308,6 @@ td.topic_id { cursor: pointer; }
</table> </table>
<!-- IF SHOW_SUBFORUMS --> <!-- IF SHOW_SUBFORUMS -->
<table class="forumline forum"> <table class="forumline forum">
<col class="row1"> <col class="row1">
<col class="row1" width="60%"> <col class="row1" width="60%">
@ -342,7 +341,7 @@ td.topic_id { cursor: pointer; }
</h6> </h6>
<p class="small" style="margin-top:4px;"> <p class="small" style="margin-top:4px;">
{f.last.LAST_POST_TIME} {f.last.LAST_POST_TIME}
by &middot;
{f.last.LAST_POST_USER} {f.last.LAST_POST_USER}
</p> </p>
@ -385,19 +384,6 @@ td.topic_id { cursor: pointer; }
<td class="small nowrap" style="padding: 0 0 0 3px;"> <td class="small nowrap" style="padding: 0 0 0 3px;">
<form id="tpp" action="{PAGE_URL_TPP}" method="post">{SELECT_TPP}</form> <form id="tpp" action="{PAGE_URL_TPP}" method="post">{SELECT_TPP}</form>
</td> </td>
<!-- IF TORRENTS -->
<td class="small nowrap" style="padding: 0 0 0 6px;">{L_STATUS}:</td>
<td class="small nowrap" style="padding: 0 0 0 3px;">{SELECT_TST}</td>
<!-- ENDIF -->
<td class="small nowrap" style="padding: 0 0 0 3px;">&nbsp;<input id="tst-submit-btn" type="button" class="bold" value="&raquo;" style="width: 30px;" onclick="mod_goto(); return false;" /></td>
<script type="text/javascript">
function mod_goto(){
window.location = '{MOD_URL}' +'&tpp='+ $('#tpp').val() <!-- IF TORRENTS -->+'&tst='+ $('#tst').val()<!-- ENDIF --> +'&mod=1';
}
$(function(){
$('#tst').bind('change', function(){ $('#tst-submit-btn').attr({disabled: 1}); mod_goto(); });
});
</script>
<!-- ENDIF / AUTH_MOD --> <!-- ENDIF / AUTH_MOD -->
<td class="small bold nowrap tRight w100"> <td class="small bold nowrap tRight w100">
@ -428,7 +414,6 @@ td.topic_id { cursor: pointer; }
</table> </table>
<!-- IF TORRENTS --> <!-- IF TORRENTS -->
<table class="forumline forum" id="forum-table"> <table class="forumline forum" id="forum-table">
<col class="row1"> <col class="row1">
<col class="row1"> <col class="row1">
@ -465,9 +450,11 @@ td.topic_id { cursor: pointer; }
<!-- ELSE --> <!-- ELSE -->
{t.TOR_TYPE}<a id="tt-{t.TOPIC_ID}" href="{TOPIC_URL}{t.HREF_TOPIC_ID}" class="torTopic tt-text"><b>{t.TOPIC_TITLE}</b></a> {t.TOR_TYPE}<a id="tt-{t.TOPIC_ID}" href="{TOPIC_URL}{t.HREF_TOPIC_ID}" class="torTopic tt-text"><b>{t.TOPIC_TITLE}</b></a>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF t.PAGINATION --><span class="topicPG">[{ICON_GOTOPOST}{L_GOTO_SHORT} {t.PAGINATION} ]</span><!-- ENDIF -->
</div> </div>
<div class="topicAuthor nowrap" style="padding-top: 2px;"> <div class="topicAuthor nowrap" style="padding-top: 2px;">
{t.TOPIC_AUTHOR} {t.TOPIC_AUTHOR}
</div>
</td> </td>
<td class="tCenter nowrap" style="padding: 2px 4px;"> <td class="tCenter nowrap" style="padding: 2px 4px;">
@ -615,7 +602,7 @@ td.topic_id { cursor: pointer; }
<div class="bottom_info"> <div class="bottom_info">
<!-- IF PAGINATION --> <!-- IF PAGINATION -->
<div class="nav" id="pagination"> <div class="nav">
<p style="float: left">{PAGE_NUMBER}</p> <p style="float: left">{PAGE_NUMBER}</p>
<p style="float: right">{PAGINATION}</p> <p style="float: right">{PAGINATION}</p>
<div class="clear"></div> <div class="clear"></div>