Всем доброго времени суток. Сайт работал на PHP 5.3, понадобилось повысить версию до PHP 5.4. Теперь отказывается работать один скрипт. В интернете не нашел нужной информации. Сам скрипт Код (Text): <?php @header("Content-type: image/png"); @error_reporting ( E_ALL ^ E_WARNING ^ E_NOTICE ); @ini_set ( 'display_errors', true ); @ini_set ( 'html_errors', false ); @ini_set ( 'error_reporting', E_ALL ^ E_WARNING ^ E_NOTICE ); define ( 'ROOT_DIR', reset(explode('/engine',dirname ( __FILE__ ))) ); define ( 'ENGINE_DIR', ROOT_DIR . '/engine' ); echo file_get_contents(ROOT_DIR.'/templates/kino24-7/dleimages/sitemap.png'); ///////////////////////////////////////////////////////////////////////////////////////////////// $time_diap = 24; $time_diap = $time_diap * 3600; if ((time() - @filemtime(ROOT_DIR."/uploads/sitemap.xml")) > $time_diap or !file_exists(ROOT_DIR."/uploads/sitemap.xml")) { define ( 'DATALIFEENGINE', true ); @include (ENGINE_DIR . '/data/config.php'); require ENGINE_DIR . '/classes/mysql.php'; require ENGINE_DIR . '/data/dbconfig.php'; require ENGINE_DIR . '/modules/functions.php'; function stmp_curl($url){ $id = curl_init($url); curl_setopt($id, CURLOPT_HEADER, 1); curl_setopt($id, CURLOPT_NOBODY, 1); curl_setopt($id, CURLOPT_RETURNTRANSFER, 1); curl_setopt($id, CURLOPT_TIMEOUT, 3); curl_setopt($id, CURLOPT_REFERER, $url); curl_setopt($id, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11'); $page = curl_exec($id); curl_close($id); return $page; } $cat_info = get_vars ( "category" ); if (! is_array ( $cat_info )) { $cat_info = array (); $db->query ( "SELECT * FROM " . PREFIX . "_category ORDER BY posi ASC" ); while ( $row = $db->get_row () ) { $cat_info[$row['id']] = array (); foreach ( $row as $key => $value ) { $cat_info[$row['id']][$key] = stripslashes ( $value ); } } set_vars ( "category", $cat_info ); $db->free (); } include ENGINE_DIR . '/classes/google.class.php'; $config['http_home_url'] = 'http://'.str_replace('www.', '', strtolower($_SERVER['HTTP_HOST'])).'/'; $map = new googlemap($config); $map->limit = intval(0); $map->news_priority = strip_tags(stripslashes('0.7')); $map->stat_priority = strip_tags(stripslashes('0.5')); $map->cat_priority = strip_tags(stripslashes('0.6')); $row = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_post"); if (!$map->limit) $map->limit = $row['count']; if ($map->limit > 45000) { $pages_count = @ ceil($row['count'] / 40000); $sitemap = $map->build_index($pages_count); $handler = fopen(ROOT_DIR . "/uploads/sitemap.xml", "wb+"); fwrite($handler, $sitemap); fclose($handler); @ chmod(ROOT_DIR . "/uploads/sitemap.xml", 0666); $sitemap = $map->build_stat(); $handler = fopen(ROOT_DIR . "/uploads/sitemap1.xml", "wb+"); fwrite($handler, $sitemap); fclose($handler); @ chmod(ROOT_DIR . "/uploads/sitemap1.xml", 0666); for ($i = 0; $i < $pages_count; $i++) { $t = $i + 2; $n = $n + 1; $sitemap = $map->build_map_news($n); $handler = fopen(ROOT_DIR . "/uploads/sitemap{$t}.xml", "wb+"); fwrite($handler, $sitemap); fclose($handler); @ chmod(ROOT_DIR . "/uploads/sitemap{$t}.xml", 0666); } }else { $sitemap = $map->build_map(); $handler = fopen(ROOT_DIR . "/uploads/sitemap.xml", "wb+"); fwrite($handler, $sitemap); fclose($handler); @chmod(ROOT_DIR . "/uploads/sitemap.xml", 0666); } $sitemaplink = 'http://' . str_replace('www.', '', strtolower($_SERVER['HTTP_HOST'])) . '/uploads/sitemap.xml'; $sitemaplink = rawurlencode($sitemaplink); $sitemaplist = array( "http://google.com/webmasters/sitemaps/ping?sitemap=" . $sitemaplink, "http://bing.com/webmaster/ping.aspx?siteMap=" . $sitemaplink, "http://ping.blogs.yandex.ru/ping?sitemap=" . $sitemaplink, ); foreach ($sitemaplist as $sitemapping){ @stmp_curl($sitemapping); } } ?> Кто может помочь, что в скрипте изменить нужно?
Должна выводится вот эта картинка echo file_get_contents(ROOT_DIR.'/templates/Default/dleimages/sitemap.png'); Выводится так <img src="/engine/ajax/autositemap.php" border="0" alt="" /> На сайте картинки нет, написано не удается загрузить. Вот сайт где поменял на 5.4 http://kino24-7.ru/ Вот сайт где стоит 5.3 http://more-smeha.ru/ Картинка в самом низу где счетчики, надпись sitemap
@ushkom у вас включено отображение ошибок это может быть безобидный нотис, но если сообщение об ошибке смешивается с файлом картинке, то естественно она получается битой. Попробуйте установить false. Чтобы увидеть, какие ошибки возникают в скрипте, замените на Код (Text): header("Content-type: text/plain"); http://phpfaq.ru/debug
@ushkom для дебага смените header и открывайте картинку отдельно в браузере как http://site/engine/ajax/autositemap.php