здравствуйте.
помогите поправить скрипт на пчп.
скрипт должен выводить блоки с ссылками а выдаёт ошибку.
Warning: file(.linkshow/out.txt): failed to open stream: No such file or directory in /var/www/vlad/data/www/acura.auto.vagon1.ru/linkshow/generator_block_links.
php on line 8 Warning: Invalid argument supplied for foreach() in /var/www/vlad/data/www/acura.auto.vagon1.ru/linkshow/generator_block_links.
php on line 15 Warning: file_get_contents(.linkshow/tmpl_links_block.txt): failed to open stream: No such file or directory in /var/www/vlad/data/www/acura.auto.vagon1.ru/linkshow/generator_block_links.
php on line 24 Warning: file_get_contents(.linkshow/tmpl_link.txt): failed to open stream: No such file or directory in /var/www/vlad/data/www/acura.auto.vagon1.ru/linkshow/generator_block_links.
php on line 28
<?
$TheUrl = "http://".$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$arrLinkStrings = file(".linkshow/out.txt");
$arrOtkuda = array();
$arrKuda = array();
$arrTextWords = array();
$arrTextBlock = array();
foreach($arrLinkStrings as $strString) {
list($arrOtkuda[],$arrKuda[],$TextBlock) = split("~",$strString);
$arrTextBlock[]=str_replace("%", "", $TextBlock);
list($do,$arrTextWords[],$posle) = split("%",$TextBlock);
}
$tmplLinksBlock = file_get_contents('.linkshow/tmpl_links_block.txt');
$tmplLink = file_get_contents('.linkshow/tmpl_link.txt');
$strLinks = "";
for($i = 0; $i <= (count($arrOtkuda)-1); $i++) {
$arrOtkuda[$i]=trim($arrOtkuda[$i]);
$arrKuda[$i]=trim($arrKuda[$i]);
$arrTextWords[$i]=trim($arrTextWords[$i]);
$arrTextBlock[$i]=trim($arrTextBlock[$i]);
if ($TheUrl==$arrOtkuda[$i] OR $TheUrl==$arrOtkuda[$i]."index.html" OR $TheUrl."index.html"==$arrOtkuda[$i]) {
$strLink = "<a href='" . $arrKuda[$i] . "' target=_blank class=mylinks>" . $arrTextWords[$i] . "</a>";
if( strlen( $arrTextBlock[$i]) > 1) {
$strLink = str_replace($arrTextWords[$i], $strLink, $arrTextBlock[$i]);
}
$strLink = str_replace("-item-", $strLink, $tmplLink);
$strLinks = $strLinks . $strLink;
}
}
$strLinks = str_replace("-items-", $strLinks, $tmplLinksBlock);
echo($strLinks);
?>
спасибо.