|
Юридичні
консультації
Для отримання відповіді на запитання,
заповніть форму
запиту>>>
Версия PHP интерпретатора должна быть 4.1.0 или выше, но никак не ниже (ваша версия интерпретатора: ".phpversion().")");}
unset($manlix);
function error($error,$file){exit(''.$error.' ['.htmlspecialchars($file).']');}
$manlix=parse_ini_file("./inc/config.inc.dat",true) or error("не могу загрузить основной файл конфигурации","./inc/config.inc.dat");
if(!is_dir($manlix[dir][path]."/".$manlix[dir][inc])) {error("не найдена системная папка скрипта",$manlix[dir][path]."/".$manlix[dir][inc]);}
if(!is_dir($manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[dir][templates])) {error("не найдена папка, в которой должны храниться все шаблоны скрипта",$manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[dir][templates]);}
if(!is_dir($manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[dir][templates]."/".$manlix[template][parse])) {error("папка, в которой должны находиться шаблонные файлы - не существует",$manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[dir][templates]."/".$manlix[template][parse]);}
if(!is_readable($manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[dir][templates]."/".$manlix[template][parse]."/config.inc.dat")){error("не могу загрузить специальный файл конфигурации для шаблона",$manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[dir][templates]."/".$manlix[template][parse]."/config.inc.dat");}
else{$manlix=array_merge($manlix,parse_ini_file($manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[dir][templates]."/".$manlix[template][parse]."/config.inc.dat",true));}
while(list(,$file)=each($manlix[templates]))
{
if(file_exists($manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[dir][templates]."/".$manlix[template][parse]."/".$file))
{
if(!is_readable($manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[dir][templates]."/".$manlix[template][parse]."/".$file))
{error("не могу прочитать один из шаблонов",$manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[dir][templates]."/".$manlix[template][parse]."/".$file);}
}
else{error("не найден один из шаблонов /файл не существует/",$manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[dir][templates]."/".$manlix[template][parse]."/".$file);}
}
if(!include($manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[file][functions])){error("не могу загрузить файл с функциями",$manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[file][functions]);}
if(!file_exists($manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[file][base])){error("не найден файл с базой новостей",$manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[file][base]);}
elseif(!is_readable($manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[file][base])){error("не могу прочитать базу с новостями, установите для него право на чтения",$manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[file][base]);}
else{$manlix[base]=manlix_read_file($manlix[dir][path]."/".$manlix[dir][inc]."/".$manlix[file][base]);}
if($manlix[other][count]=count($manlix[base]))
{
sort($manlix[base]);
$manlix[base]=array_reverse($manlix[base]);
}
if($show_news)
{
for($i=0;$i<$manlix[other][count];$i++)
{
list($time,$body,$author)=explode("::",$manlix[base][$i]);
if($show_news==$time)
{
$manlix[base]=array($time."::".$body."::".$author."::");
$manlix[template][status]=full;
$manlix[found_news]=true;
break;
}
}
}
if($string=ereg_replace("([[:space:]]?)+(\.|\\\|\+|\*|\(|\)|\/|\[|\]|\?)+([[:space:]]?)","",str_replace(":",":",manlix_stripslashes($string))))
{
$manlix[other][search_count_array]=count($manlix[other][search_array]=explode(" ",$string));
$manlix[temp][date1]=manlix_time();
$manlix[temp][search_count]="0";
$search_array=array();
while(list(,$searching)=each($manlix[base]))
{
list($time,$body,$author)=explode("::",$searching);
for($i=0;$i<$manlix[other][search_count_array];$i++)
{
if(strstr(strtolower(strip_tags($body)),strtolower($manlix[other][search_array][$i])))
{
if(!in_array($searching,$search_array))
{
$manlix[temp][search_count]++;
$search_array[]=$searching;
}
}
}
}
$manlix[temp][search_time]=manlix_time()-$manlix[temp][date1];
$manlix[base]=$search_array;
$manlix[other][count]=count($manlix[base]);
}
if($manlix[other][count]) {
if(eregi("^all$",$show_news))
{
$manlix[0][result_strings]=$manlix[base];
$manlix[0][navigation]=$manlix[symbol][all_news];
}
elseif(!$string)
{
array_push($manlix,manlix_array_navigation(
$manlix[base],
$manlix[numeric][show_news],
$manlix[numeric][show_pages],
"?news_page=",
$news_page,
$manlix[symbol][left],
$manlix[symbol][right],
$manlix[color][not_active_symbol],
$manlix[color][not_current_page],
$manlix[color][current_page],
$manlix[color][active_symbol],
$manlix[color][active_symbol],
$manlix[symbol][separator_between_pages]
));
$manlix[0][other]=$manlix_array_navigation;
}
else
{
array_push($manlix,manlix_array_navigation(
$manlix[base],
$manlix[numeric][show_news],
$manlix[numeric][show_pages],
"?string=".urlencode($string)."&news_page=",
$news_page,
$manlix[symbol][left],
$manlix[symbol][right],
$manlix[color][not_active_symbol],
$manlix[color][not_current_page],
$manlix[color][current_page],
$manlix[color][active_symbol],
$manlix[color][active_symbol],
$manlix[symbol][separator_between_pages]
));
$manlix[0][other]=$manlix_array_navigation;
}
}
if($manlix[found_news]) {$manlix[0][navigation]=$manlix[symbol][previous];}
parse_template($manlix[templates][top],false,false);
if($string&&!$show_news){parse_template($manlix[templates][search_stat],false,false);}
if(!$manlix[other][count]) {
if(!$string)
{
parse_template($manlix[templates][no_news],false,false);
$manlix[0][navigation]=$manlix[symbol][no_navigation];
}
else
{
parse_template($manlix[templates][search_no_found],false,false);
$manlix[0][navigation]=$manlix[symbol][all_news];
}
}
else {
if($manlix[0][count_all_strings]>$manlix[numeric][show_news])
{
if(!$string){$manlix[0][navigation].=$manlix[symbol][show_all_news];}
else
{
$manlix[symbol][show_all_news]=eregi_replace("show_news=all","string=".urlencode($string)."&show_news=all",$manlix[symbol][show_all_news]);
$manlix[0][navigation].=$manlix[symbol][show_all_news];
}
}
while(list($numeric,$body)=each($manlix[0][result_strings]))
{
list($time,$news,$author)=explode("::",$body);
$body=array($time,$news,$author);
$body[1]=eregi_replace(":",":",$body[1]);
if($manlix[template][status]==full)
{
parse_template($manlix[templates][full_news],$body,$numeric);
}
else
{
if(count($manlix[temp][body_array]=explode(" ",$body[1]))<=$manlix[numeric][short_news])
{
parse_template($manlix[templates][full_news],$body,$numeric);
}
else
{
array_splice($manlix[temp][body_array],$manlix[numeric][short_news]);
$body[1]=implode(" ",$manlix[temp][body_array]);
$body[1]=strip_tags($body[1],$manlix[symbol][tags]);
parse_template($manlix[templates][short_news],$body,$numeric);
}
}
}
}
if($manlix[other][count]){parse_template($manlix[templates][search_form],false,false);}
parse_template($manlix[templates][bottom],false,false);
?>
© ТОВ "ЮРРЕСУРС" 2005-2023
|