global трет все переменные...
до это й строчки все переменные есть
Код: Выделить всё
global $cutepath, $config_notify_postponed, $config_notify_status, $config_notify_email;
а после все обнуляются переменные вообще не попадают в функцию, как будто global их трет просто
Что то в настройках хостеров?
Код: Выделить всё
function ResynchronizePostponed(){
global $cutepath, $config_notify_postponed, $config_notify_status, $config_notify_email;
$all_postponed_db = file("$cutepath/data/postponed_news.txt");
if(!empty($all_postponed_db)){
$new_postponed_db = fopen("$cutepath/data/postponed_news.txt", w);
@flock ($new_postponed_db,2);
$now_date = time();
foreach ($all_postponed_db as $p_line){
$p_item_db = explode("|",$p_line);
if($p_item_db[0] <= $now_date){
// Item is old and must be Activated, add it to news.txt
$all_active_db = file("$cutepath/data/news.txt");
$active_news_file = fopen("$cutepath/data/news.txt", "w");
@flock ($active_news_file,2);
fwrite($active_news_file,"$p_line");
foreach ($all_active_db as $active_line){ fwrite($active_news_file, "$active_line");}
@flock ($active_news_file,3);
fclose($active_news_file);
if($config_notify_postponed == "yes" and $config_notify_status == "active"){
send_mail("$config_notify_email", "CuteNews - Postponed article was Activated", "CuteNews has activated the article '$p_item_db[2]'");
}
}else{
// Item is still postponed
fwrite($new_postponed_db,"$p_line");
}
}
@flock ($new_postponed_db,3);
fclose($new_postponed_db);
}
}