mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
r296
крон 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:
parent
8fb2598954
commit
87118ae0ba
17 changed files with 882 additions and 967 deletions
|
@ -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_new_window', '0');
|
||||
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 (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 (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);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
|
|
@ -8,30 +8,21 @@ if (!empty($setmodules))
|
|||
return;
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
$tpl = '';
|
||||
|
||||
$mode = isset($_GET['mode']) ? $_GET['mode'] : '';
|
||||
$job_id = isset($_GET['id']) ? (int) $_GET['id'] : '';
|
||||
|
||||
$submit = isset($_POST['submit']);
|
||||
$jobs = isset($_POST['select']) ? implode(',', $_POST['select']) : '';
|
||||
$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']);
|
||||
$confirm = isset($_POST['confirm']);
|
||||
|
||||
|
||||
if ($mode == 'run' && !$job_id) {
|
||||
if ($mode == 'run' && !$job_id)
|
||||
{
|
||||
define('BB_ROOT', './../');
|
||||
require(BB_ROOT.'common.php');
|
||||
$user->session_start();
|
||||
redirect('admin/'.basename(__FILE__) . '?mode=list');
|
||||
}
|
||||
else {
|
||||
require('./pagestart.php');
|
||||
}
|
||||
else require('./pagestart.php');
|
||||
|
||||
// ACP Header - END
|
||||
|
||||
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_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 *
|
||||
FROM ". BB_CRON ."
|
||||
WHERE cron_id = $job_id";
|
||||
|
||||
$template->assign_vars(array(
|
||||
'CRON_ENABLED' => ($new['cron_enabled']) ? true : false,
|
||||
'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) )
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Could not query cron", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
foreach($sql as $i => $row)
|
||||
{
|
||||
$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))
|
||||
{
|
||||
$cron_id = $row['cron_id'];
|
||||
$cron_active = $row['cron_active'];
|
||||
$cron_title = $row['cron_title'];
|
||||
$cron_script = $row['cron_script'];
|
||||
$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'];
|
||||
$template->assign_vars(array(
|
||||
'TPL_CRON_LIST' => true,
|
||||
'S_CRON_ACTION' => append_sid("admin_cron.php"),
|
||||
'S_MODE' => 'list',
|
||||
));
|
||||
|
||||
//detect cron status
|
||||
if (@file_exists('../triggers/cron_running'))
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'CRON_RUNNING' => true,
|
||||
));
|
||||
}
|
||||
break;
|
||||
|
||||
case 'repair':
|
||||
if (@file_exists('../triggers/cron_running'))
|
||||
{
|
||||
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;
|
||||
|
||||
}
|
||||
//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' => 'edit',
|
||||
'SCHEDULE' => $schedule_result,
|
||||
'RUN_DAY' => $run_day_html,
|
||||
'L_CRON_EDIT_HEAD' => $lang['CRON_EDIT_HEAD_EDIT'],
|
||||
));
|
||||
case 'edit':
|
||||
$sql = DB()->fetch_rowset("SELECT * FROM ". BB_CRON ." WHERE cron_id = $job_id");
|
||||
|
||||
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(
|
||||
'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,
|
||||
);
|
||||
$template->assign_vars(array(
|
||||
'TPL_CRON_EDIT' => true,
|
||||
'S_CRON_ACTION' => append_sid("admin_cron.php"),
|
||||
'S_MODE' => 'edit',
|
||||
'SCHEDULE' => build_select('schedule', $schedule, $row['schedule']),
|
||||
'RUN_DAY' => build_select('run_day', $run_day, $row['run_day']),
|
||||
'L_CRON_EDIT_HEAD' => $lang['CRON_EDIT_HEAD_EDIT'],
|
||||
));
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
$run_day = array($lang['DELTA_TIME']['INTERVALS']['mday'][0] => 0);
|
||||
for($i=1; $i<=28; $i++)
|
||||
{
|
||||
$run_day[$i] = $i;
|
||||
}
|
||||
|
||||
$schedule = array();
|
||||
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);
|
||||
|
||||
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'])) {
|
||||
case 'delete':
|
||||
delete_jobs($job_id);
|
||||
redirect('admin/'.basename(__FILE__) . '?mode=list');
|
||||
}
|
||||
else {
|
||||
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>");
|
||||
}
|
||||
}
|
||||
|
||||
$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>");
|
||||
message_die(GENERAL_MESSAGE, $message);
|
||||
break;
|
||||
}
|
||||
|
||||
if ($submit && $confirm) {
|
||||
if ($_POST['mode'] == 'list') {
|
||||
if ($cron_action == 'run' && $jobs) {
|
||||
if ($submit)
|
||||
{
|
||||
if ($_POST['mode'] == 'list')
|
||||
{
|
||||
if ($cron_action == 'run' && $jobs)
|
||||
{
|
||||
run_jobs($jobs);
|
||||
}
|
||||
else if ($cron_action == 'delete' && $jobs) {
|
||||
else if ($cron_action == 'delete' && $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);
|
||||
}
|
||||
$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');
|
||||
}
|
||||
else if (validate_cron_post($_POST) == 1) {
|
||||
if($_POST['mode'] == 'edit') {
|
||||
else if (validate_cron_post($_POST) == 1)
|
||||
{
|
||||
if($_POST['mode'] == 'edit')
|
||||
{
|
||||
update_cron_job($_POST);
|
||||
}
|
||||
else if ($_POST['mode'] == 'add'){
|
||||
else if ($_POST['mode'] == 'add')
|
||||
{
|
||||
insert_cron_job($_POST);
|
||||
}
|
||||
else {
|
||||
bb_die();
|
||||
}
|
||||
else bb_die();
|
||||
|
||||
redirect('admin/'.basename(__FILE__) . '?mode=list');
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
$message = validate_cron_post($_POST);
|
||||
message_die(GENERAL_MESSAGE, $message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
print_page('admin_cron.tpl', 'admin');
|
||||
|
|
|
@ -66,7 +66,7 @@ switch($this->request['type'])
|
|||
|
||||
// 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']);
|
||||
$message = '[quote="'. $quote_username .'"]'. $post['post_text'] .'[/quote]';
|
||||
$message = "[quote=\"". $quote_username ."\"]". $post['post_text'] ."[/quote]\n";
|
||||
// hide user passkey
|
||||
$message = preg_replace('#(?<=\?uk=)[a-zA-Z0-9]{10}(?=&)#', 'passkey', $message);
|
||||
// hide sid
|
||||
|
@ -77,9 +77,9 @@ switch($this->request['type'])
|
|||
$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)
|
||||
{
|
||||
|
|
|
@ -53,8 +53,8 @@ $bb_cfg = $tr_cfg = $page_cfg = array();
|
|||
|
||||
// Increase number of revision after update
|
||||
$bb_cfg['tp_version'] = '2.1 Stable';
|
||||
$bb_cfg['tp_release_state'] = 'R295';
|
||||
$bb_cfg['tp_release_date'] = '30-09-2011';
|
||||
$bb_cfg['tp_release_state'] = 'R296';
|
||||
$bb_cfg['tp_release_date'] = '01-10-2011';
|
||||
|
||||
// Database
|
||||
$charset = 'utf8';
|
||||
|
@ -374,10 +374,6 @@ define('BB_DISABLED', TRIGGERS_DIR .'$off');
|
|||
define('CRON_ALLOWED', TRIGGERS_DIR .'cron_allowed');
|
||||
define('CRON_RUNNING', TRIGGERS_DIR .'cron_running');
|
||||
|
||||
// Cron
|
||||
$bb_cfg['cron_enabled'] = true; // При отвязки крона старт производить из cron.php
|
||||
$bb_cfg['cron_check_interval'] = 300; // sec
|
||||
|
||||
// News
|
||||
$bb_cfg['show_latest_news'] = true;
|
||||
$bb_cfg['latest_news_count'] = 5;
|
||||
|
|
BIN
upload/images/icon_delete.gif
Normal file
BIN
upload/images/icon_delete.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 255 B |
BIN
upload/images/icon_edit.gif
Normal file
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
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
BIN
upload/images/icon_sync.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 251 B |
|
@ -80,7 +80,24 @@ function validate_cron_post($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_title = $cron_arr['cron_title'];
|
||||
$cron_script = $cron_arr['cron_script'];
|
||||
|
@ -96,7 +113,8 @@ function insert_cron_job($cron_arr)
|
|||
$log_sql_queries = $cron_arr['log_sql_queries'];
|
||||
$disable_board = $cron_arr['disable_board'];
|
||||
$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')");
|
||||
}
|
||||
|
||||
|
@ -137,23 +155,4 @@ function update_cron_job($cron_arr)
|
|||
run_counter = '$run_counter'
|
||||
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;
|
||||
}
|
|
@ -18,7 +18,7 @@ $lang['WORD_CENSOR'] = 'Word Censors';
|
|||
$lang['EXPORT'] = 'Export';
|
||||
$lang['CREATE_NEW'] = 'Create';
|
||||
$lang['ADD_NEW'] = 'Add';
|
||||
$lang['FLAGS'] = 'Flags';
|
||||
$lang['CRON'] = 'Task Scheduler (Cron)';
|
||||
$lang['FORUM_CONFIG'] = 'Forum settings';
|
||||
$lang['TRACKER_CONFIG'] = 'Tracker settings';
|
||||
$lang['RELEASE_TEMPLATES'] = 'Release Templates';
|
||||
|
@ -32,6 +32,7 @@ $lang['ADMIN'] = 'Administration';
|
|||
$lang['MAIN_INDEX'] = 'Forum Index';
|
||||
$lang['FORUM_STATS'] = 'Forum Statistics';
|
||||
$lang['ADMIN_INDEX'] = 'Admin Index';
|
||||
$lang['CREATE_PROFILE'] = 'Create profile';
|
||||
|
||||
$lang['TP_VERSION'] = 'TorrenPier version';
|
||||
$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['CLICK_RETURN_REPORT_CONFIG'] = 'Click %sHere%s to return to the configuration.';
|
||||
|
||||
$lang['MODULES_REASONS'] = 'Modules & 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_MODULE'] = 'Report module';
|
||||
$lang['INSTALLED_MODULES'] = 'Installed modules';
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
$lang['CRON_LIST'] = 'Cron list';
|
||||
$lang['CRON_ID'] = 'ID';
|
||||
$lang['CRON_ACTIVE'] = 'Active';
|
||||
$lang['CRON_ACTIVE'] = 'On';
|
||||
$lang['CRON_ACTIVE_EXPL'] = 'Active tasks';
|
||||
$lang['CRON_TITLE'] = 'Title';
|
||||
$lang['CRON_SCRIPT'] = 'Script';
|
||||
$lang['CRON_SCHEDULE'] = 'Schedule';
|
||||
|
@ -22,27 +23,21 @@ $lang['CRON_DEL'] = 'Delete';
|
|||
$lang['CRON_DISABLE'] = 'Disable';
|
||||
$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['REPAIR_CRON'] = '[Repair Cron]';
|
||||
$lang['REPAIR_CRON'] = 'Repair Cron';
|
||||
|
||||
$lang['CRON_EDIT_HEAD_EDIT'] = 'Edit job';
|
||||
$lang['CRON_EDIT_HEAD_ADD'] = 'Add job';
|
||||
$lang['CRON_ID'] = 'Cron id';
|
||||
$lang['CRON_ACTIVE'] = 'Cron active';
|
||||
$lang['CRON_ACTIVE_EXPL'] = 'this job is active?';
|
||||
$lang['CRON_TITLE'] = 'Cron title';
|
||||
$lang['CRON_SCRIPT'] = 'Cron script';
|
||||
$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';
|
||||
$lang['SCHEDULE'] = 'Schedule';
|
||||
//schedule
|
||||
$lang['HOURLY'] = 'hourly';
|
||||
$lang['DAILY'] = 'daily';
|
||||
$lang['WEEKLY'] = 'weekly';
|
||||
$lang['MONTHLY'] = 'monthly';
|
||||
$lang['INTERVAL'] = 'interval';
|
||||
//
|
||||
$lang['CRON_SCRIPT_EXPL'] = 'name of the script from "includes/cron/jobs/"';;
|
||||
$lang['SCHEDULE'] = array(
|
||||
'select' => '» Select start',
|
||||
'hourly' => 'hourly',
|
||||
'daily' => 'daily',
|
||||
'weekly' => 'weekly',
|
||||
'monthly' => 'monthly',
|
||||
'interval' => 'interval'
|
||||
);
|
||||
$lang['NOSELECT'] = 'No select';
|
||||
$lang['RUN_DAY'] = 'Run day';
|
||||
$lang['RUN_DAY_EXPL'] = 'the day when this job run';
|
||||
$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['DISABLE_BOARD'] = 'Disable board';
|
||||
$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
|
@ -2,8 +2,9 @@
|
|||
|
||||
$lang['CRON_LIST'] = 'Список задач';
|
||||
$lang['CRON_ID'] = 'ID';
|
||||
$lang['CRON_ACTIVE'] = 'Вкл.';
|
||||
$lang['CRON_TITLE'] = 'Название';
|
||||
$lang['CRON_ACTIVE'] = 'Вкл';
|
||||
$lang['CRON_ACTIVE_EXPL'] = 'Активность задачи';
|
||||
$lang['CRON_TITLE'] = 'Название задачи';
|
||||
$lang['CRON_SCRIPT'] = 'Скрипт';
|
||||
$lang['CRON_SCHEDULE'] = 'Запуск';
|
||||
$lang['CRON_LAST_RUN'] = 'Посл. запуск';
|
||||
|
@ -13,7 +14,7 @@ $lang['CRON_MANAGE'] = 'Управление';
|
|||
$lang['CRON_OPTIONS'] = 'Настройки крона';
|
||||
|
||||
$lang['CRON_ENABLED'] = 'Крон включён';
|
||||
$lang['CRON_CHECK_INTERVAL'] = 'Интервал проверки крона (в секундах)';
|
||||
$lang['CRON_CHECK_INTERVAL'] = 'Проверка (сек)';
|
||||
|
||||
$lang['WITH_SELECTED'] = 'С выделенными';
|
||||
$lang['NOTHING'] = 'ничего не делать';
|
||||
|
@ -22,27 +23,23 @@ $lang['CRON_DEL'] = 'удалить';
|
|||
$lang['CRON_DISABLE'] = 'отключить';
|
||||
$lang['CRON_ENABLE'] = 'включить';
|
||||
|
||||
$lang['RUN_MAIN_CRON'] = '[Запустить крон]';
|
||||
$lang['ADD_JOB'] = '[Добавить задачу]';
|
||||
$lang['CRON_WORKS'] = 'Крон в данный момент запущен или завис -> ';
|
||||
$lang['REPAIR_CRON'] = '[Восстановить]';
|
||||
$lang['RUN_MAIN_CRON'] = 'Запустить крон';
|
||||
$lang['ADD_JOB'] = 'Добавить задачу';
|
||||
$lang['CRON_WORKS'] = 'Крон в данный момент запущен или завис · ';
|
||||
$lang['REPAIR_CRON'] = 'Восстановить';
|
||||
|
||||
$lang['CRON_EDIT_HEAD_EDIT'] = 'Редактировать задачу';
|
||||
$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['SCHEDULE'] = 'Запуск';
|
||||
//schedule
|
||||
$lang['HOURLY'] = 'ежечасно';
|
||||
$lang['DAILY'] = 'ежедневно';
|
||||
$lang['WEEKLY'] = 'еженедельно';
|
||||
$lang['MONTHLY'] = 'ежемесячно';
|
||||
$lang['INTERVAL'] = 'интервал';
|
||||
//
|
||||
$lang['SCHEDULE'] = array(
|
||||
'select' => '» Выберите запуск',
|
||||
'hourly' => 'ежечасно',
|
||||
'daily' => 'ежедневно',
|
||||
'weekly' => 'еженедельно',
|
||||
'monthly' => 'ежемесячно',
|
||||
'interval' => 'интервал'
|
||||
);
|
||||
$lang['NOSELECT'] = 'Не указан';
|
||||
$lang['RUN_DAY'] = 'День запуска';
|
||||
$lang['RUN_DAY_EXPL'] = 'день месяца/недели, когда эта задача будет выполняться';
|
||||
$lang['RUN_TIME'] = 'Время запуска';
|
||||
|
@ -58,4 +55,10 @@ $lang['LOG_FILE_EXPL'] = 'файл, куда будут сохраняться
|
|||
$lang['LOG_SQL_QUERIES'] = 'Логировать SQL запросы';
|
||||
$lang['DISABLE_BOARD'] = 'Отключать форум';
|
||||
$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';
|
||||
|
|
|
@ -1688,7 +1688,6 @@ $lang['OLD'] = 'Прочит';
|
|||
|
||||
// DL-лист
|
||||
$lang['DL_USER'] = 'Пользователь';
|
||||
$lang['USER'] = 'Пользователь';
|
||||
$lang['DL_PERCENT'] = 'Скачано процентов';
|
||||
$lang['DL_UL'] = 'Отдано';
|
||||
$lang['DL_DL'] = 'Скачано';
|
||||
|
|
|
@ -1,105 +1,133 @@
|
|||
<SCRIPT language=JavaScript title="check">
|
||||
function CheckAll(Element,Name){
|
||||
if(document.getElementById) {
|
||||
thisCheckBoxes = Element.parentNode.parentNode.parentNode.getElementsByTagName('input');
|
||||
for (i = 1; i < thisCheckBoxes.length; i++){
|
||||
if (thisCheckBoxes[i].name == Name){
|
||||
thisCheckBoxes[i].checked = Element.checked;
|
||||
Colorize(document.getElementById(thisCheckBoxes[i].id.replace('cb','tr')), thisCheckBoxes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#check_all").click(function () {
|
||||
if (!$("#check_all").is(":checked"))
|
||||
$(".checkbox").removeAttr("checked");
|
||||
else
|
||||
$(".checkbox").attr("checked","checked");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
function Colorize(Element, CBElement){
|
||||
if(document.getElementById) {
|
||||
if(Element && CBElement){
|
||||
Element.className = ( CBElement.checked ? 'selected' : 'default' );
|
||||
}
|
||||
}
|
||||
}
|
||||
<style type="text/css">
|
||||
#cron_true, #cron_false { width: 95%; }
|
||||
#cron_true td { background: #d9facb; padding: 8px 8px; color: #286e0f; }
|
||||
#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 -->
|
||||
<!--========================================================================-->
|
||||
<form action="{S_CRON_ACTION}" method="post">
|
||||
<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>
|
||||
<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">
|
||||
<tr>
|
||||
<td colspan="10" class="catTitle">{L_CRON_LIST}</td>
|
||||
<th colspan="10">{L_CRON_LIST}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th width="5%" nowrap="nowrap"><INPUT onclick="CheckAll(this,'select[]')" type="checkbox"></th>
|
||||
<th width="5%" nowrap="nowrap">{L_CRON_ID}</th>
|
||||
<th width="5%" nowrap="nowrap">{L_CRON_ACTIVE}</th>
|
||||
<th width="30%" nowrap="nowrap" >{L_CRON_TITLE}</th>
|
||||
<th width="20%" nowrap="nowrap">{L_CRON_SCRIPT}</th>
|
||||
<th width="5%" nowrap="nowrap">{L_CRON_SCHEDULE}</th>
|
||||
<th width="5%" nowrap="nowrap">{L_CRON_LAST_RUN}</th>
|
||||
<th width="5%" nowrap="nowrap">{L_CRON_NEXT_RUN}</th>
|
||||
<th width="1%" nowrap="nowrap">{L_CRON_RUN_COUNT}</th>
|
||||
<th width="10%" nowrap="nowrap">{L_CRON_MANAGE}</th>
|
||||
|
||||
<tr class="row3 med tCenter">
|
||||
<td><input type="checkbox" id="check_all"></td>
|
||||
<td>{L_CRON_ID}</td>
|
||||
<td>{L_CRON_ACTIVE}</td>
|
||||
<td>{L_CRON_TITLE}</td>
|
||||
<td>{L_CRON_SCRIPT}</td>
|
||||
<td>{L_CRON_SCHEDULE}</td>
|
||||
<td>{L_CRON_LAST_RUN}</td>
|
||||
<td>{L_CRON_NEXT_RUN}</td>
|
||||
<td>{L_CRON_RUN_COUNT}</td>
|
||||
<td>{L_CRON_MANAGE}</td>
|
||||
</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 class="forumline">
|
||||
<tr>
|
||||
<td colspan="2" class="catBottom">
|
||||
{L_WITH_SELECTED}
|
||||
<select name="cron_action" id="cron_select" >
|
||||
<option value="" selected="selected" class="select-action">» {L_NOTHING}</option>
|
||||
<option value="run">{L_CRON_RUN}</option>
|
||||
<option value="delete">{L_CRON_DEL}</option>
|
||||
<option value="disable">{L_CRON_DISABLE}</option>
|
||||
<option value="enable">{L_CRON_ENABLE}</option>
|
||||
</select>
|
||||
<label for="confirm"> <input onclick="toggle_disabled('send', this.checked)" id="confirm" type="checkbox" name="confirm" value="1" /></label>
|
||||
<input type="submit" name="submit" id="send" value="{L_SUBMIT}" class="mainoption" disabled="disabled" />
|
||||
</td>
|
||||
<td colspan="2" class="catBottom">
|
||||
{L_WITH_SELECTED}
|
||||
<select name="cron_action" id="cron_select" >
|
||||
<option value="" selected="selected" class="select-action">» {L_NOTHING}</option>
|
||||
<option value="run">{L_CRON_RUN}</option>
|
||||
<option value="delete">{L_CRON_DEL}</option>
|
||||
<option value="disable">{L_CRON_DISABLE}</option>
|
||||
<option value="enable">{L_CRON_ENABLE}</option>
|
||||
</select>
|
||||
<label><input onclick="toggle_disabled('send', this.checked)" type="checkbox" name="confirm" value="1" /></label>
|
||||
<input type="submit" name="submit" id="send" value="{L_SUBMIT}" class="mainoption" disabled="disabled" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br />
|
||||
<center>
|
||||
<a href="admin_cron.php?mode=run"><b>{L_RUN_MAIN_CRON}</b></a> ·
|
||||
<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 -->
|
||||
|
||||
<!-- IF TPL_CRON_EDIT -->
|
||||
<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">
|
||||
<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>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4>{L_CRON_ACTIVE}</h4><h6>{L_CRON_ACTIVE_EXPL}</h6></td>
|
||||
<td><label for="cron_active1"><input type="radio" name="cron_active" id="cron_active1" value="1" {CRON_ACTIVE_YES} /> {L_CRON_ACTIVE_YES} </label><label for="cron_active2"> <input type="radio" name="cron_active" id="cron_active2" value="0" {CRON_ACTIVE_NO} /> {L_CRON_ACTIVE_NO} </label></td>
|
||||
<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>
|
||||
<label><input type="radio" name="cron_active" value="0" <!-- IF not CRON_ACTIVE -->checked="checked"<!-- ENDIF --> />{L_NO}</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4>{L_SCHEDULE}</h4></td>
|
||||
<td><h4>{L_CRON_SCHEDULE}</h4></td>
|
||||
<td>{SCHEDULE}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -155,7 +189,10 @@ if(document.getElementById) {
|
|||
</tr>
|
||||
<tr>
|
||||
<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} </label><label for="log_enabled2"> <input type="radio" name="log_enabled" id="log_enabled2" value="0" {LOG_ENABLED_NO} /> {L_LOG_ENABLED_NO} </label></td>
|
||||
<td>
|
||||
<label><input type="radio" name="log_enabled" value="1" <!-- IF LOG_ENABLED -->checked="checked"<!-- ENDIF --> />{L_YES}</label>
|
||||
<label><input type="radio" name="log_enabled" value="0" <!-- IF not LOG_ENABLED -->checked="checked"<!-- ENDIF --> />{L_NO}</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4>{L_LOG_FILE}</h4><h6>{L_LOG_FILE_EXPL}</h6></td>
|
||||
|
@ -163,11 +200,17 @@ if(document.getElementById) {
|
|||
</tr>
|
||||
<tr>
|
||||
<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} </label><label for="log_sql_queries2"> <input type="radio" name="log_sql_queries" id="log_sql_queries2" value="0" {LOG_SQL_QUERIES_NO} /> {L_LOG_SQL_QUERIES_NO} </label></td>
|
||||
<td>
|
||||
<label><input type="radio" name="log_sql_queries" value="1" <!-- IF LOG_SQL_QUERIES -->checked="checked"<!-- ENDIF --> />{L_YES}</label>
|
||||
<label><input type="radio" name="log_sql_queries" value="0" <!-- IF not LOG_SQL_QUERIES -->checked="checked"<!-- ENDIF --> />{L_NO}</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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} </label><label for="disable_board2"> <input type="radio" name="disable_board" id="disable_board2" value="0" {DISABLE_BOARD_NO} /> {L_DISABLE_BOARD_NO} </label></td>
|
||||
<td>
|
||||
<label><input type="radio" name="disable_board" value="1" <!-- IF DISABLE_BOARD -->checked="checked"<!-- ENDIF --> />{L_YES}</label>
|
||||
<label><input type="radio" name="disable_board" value="0" <!-- IF not DISABLE_BOARD -->checked="checked"<!-- ENDIF --> />{L_NO}</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4>{L_RUN_COUNTER}</h4></td>
|
||||
|
|
|
@ -72,18 +72,25 @@ table.forumline { margin: 0 auto; }
|
|||
<a href="{U_CLEAR_TPL_CACHE}">{L_TEMPLATES}</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>{L_UPDATE}:</b></td>
|
||||
<td>
|
||||
<a href="{U_UPDATE_USER_LEVEL}">{L_USER_LEVELS}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>{L_SYNCHRONIZE}:</b></td>
|
||||
<td>
|
||||
<a href="{U_SYNC_TOPICS}">{L_TOPICS}</a>,
|
||||
<a href="{U_SYNC_USER_POSTS}">{L_USER_POSTS_COUNT}</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>{L_ADMIN}:</b></td>
|
||||
<td>
|
||||
<a href="../profile.php?mode=register">{L_CREATE_PROFILE}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
|
||||
|
|
|
@ -308,7 +308,6 @@ td.topic_id { cursor: pointer; }
|
|||
</table>
|
||||
|
||||
<!-- IF SHOW_SUBFORUMS -->
|
||||
|
||||
<table class="forumline forum">
|
||||
<col class="row1">
|
||||
<col class="row1" width="60%">
|
||||
|
@ -342,7 +341,7 @@ td.topic_id { cursor: pointer; }
|
|||
</h6>
|
||||
<p class="small" style="margin-top:4px;">
|
||||
{f.last.LAST_POST_TIME}
|
||||
by
|
||||
·
|
||||
{f.last.LAST_POST_USER}
|
||||
</p>
|
||||
|
||||
|
@ -385,19 +384,6 @@ td.topic_id { cursor: pointer; }
|
|||
<td class="small nowrap" style="padding: 0 0 0 3px;">
|
||||
<form id="tpp" action="{PAGE_URL_TPP}" method="post">{SELECT_TPP}</form>
|
||||
</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;"> <input id="tst-submit-btn" type="button" class="bold" value="»" 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 -->
|
||||
|
||||
<td class="small bold nowrap tRight w100">
|
||||
|
@ -428,7 +414,6 @@ td.topic_id { cursor: pointer; }
|
|||
</table>
|
||||
|
||||
<!-- IF TORRENTS -->
|
||||
|
||||
<table class="forumline forum" id="forum-table">
|
||||
<col class="row1">
|
||||
<col class="row1">
|
||||
|
@ -465,9 +450,11 @@ td.topic_id { cursor: pointer; }
|
|||
<!-- 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>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF t.PAGINATION --><span class="topicPG">[{ICON_GOTOPOST}{L_GOTO_SHORT} {t.PAGINATION} ]</span><!-- ENDIF -->
|
||||
</div>
|
||||
<div class="topicAuthor nowrap" style="padding-top: 2px;">
|
||||
{t.TOPIC_AUTHOR}
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="tCenter nowrap" style="padding: 2px 4px;">
|
||||
|
@ -615,7 +602,7 @@ td.topic_id { cursor: pointer; }
|
|||
<div class="bottom_info">
|
||||
|
||||
<!-- IF PAGINATION -->
|
||||
<div class="nav" id="pagination">
|
||||
<div class="nav">
|
||||
<p style="float: left">{PAGE_NUMBER}</p>
|
||||
<p style="float: right">{PAGINATION}</p>
|
||||
<div class="clear"></div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue