Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Название темы: Правка скрипта
Показать сообщение отдельно

Аватара для Rudy

Пользователь


Сообщения: 116
Благодарности: 1

Профиль | Отправить PM | Цитировать


Полный текст вывода новости:
Цитата:
Код:
if($allow_full_story){

$all_active_news = file("$news_file");

foreach($all_active_news as $active_news)
{
$news_arr = explode("|", $active_news);
if($news_arr[0] == $id and (!$catid or $catid == $news_arr[6]))
{
$found = TRUE;

/* Counter of views */
$article_counter = file("$cutepath/data/counter.txt");
$article_counteradd = fopen("$cutepath/data/counter.txt", w);
foreach ($article_counter as $counter_line)
{
$count_arr = explode("|", $counter_line);
if ($count_arr[0] != $news_arr[0])
{
fwrite($article_counteradd, $counter_line);
}
else
{
$foundcount = 1;
$count=$count_arr[1];
$count++;
fwrite ($article_counteradd, "$count_arr[0]|$count|\n");
}
}
if ($foundcount != 1)
{
$foundcount = 1;
fwrite ($article_counteradd, "$news_arr[0]|1|\n");
}
fclose ($article_counteradd);
/* Counter of views */

if($news_arr[4] == "" and (!eregi("\{short-story\}", $template_full)) ){ $news_arr[4] = $news_arr[3]; }

if($my_names[$news_arr[1]]){ $my_author = $my_names[$news_arr[1]]; }
else{ $my_author = $news_arr[1]; }

$output = str_replace("{title}", $news_arr[2], $template_full);
$output = str_replace("{date}", langdate($config_timestamp_active, $news_arr[0]), $output);
$output = str_replace("{author}", $my_author, $output);
$output = str_replace("{short-story}", $news_arr[3], $output);
$output = str_replace("{full-story}", $news_arr[4], $output);
if($news_arr[5] != ""){$output = str_replace("{avatar}", "<img alt=\"\" src=\"$news_arr[5]\" border=0 />", $output); }
else{ $output = str_replace("{avatar}", "", $output); }
$output = str_replace("{avatar-url}", "$news_arr[5]", $output);
$output = str_replace("{comments-num}", countComments($news_arr[0], $archive), $output);
$output = str_replace("{category}", $cat[$news_arr[6]], $output);
$output = str_replace("{category-id}", $news_arr[6], $output);
if($cat_icon[$news_arr[6]] != ""){ $output = str_replace("{category-icon}", "<img style=\"border: none;\" alt=\"".$cat[$news_arr[6]]." icon\" src=\"".$cat_icon[$news_arr[6]]."\" />", $output); }
else{ $output = str_replace("{category-icon}", "", $output); }

if($config_comments_popup == "yes"){
$output = str_replace("[com-link]","<a href=\"#\" onclick=\"window.open('$config_http_script_dir/show_news.php?subaction=showcomments&template=$template&id=$news_arr[0]&archive=$archive&start_from=$my_start_from&ucat=$news_arr[6]', '_News', '$config_comments_popup_string');return false;\">", $output);
}else{
$output = str_replace("[com-link]","<a href=\"$PHP_SELF?subaction=showcomments&id=$news_arr[0]&archive=$archive&start_from=$my_start_from&ucat=$news_arr[6]&$user_query\">", $output);
}
$output = str_replace("[/com-link]","</a>", $output);
$output = str_replace("{author-name}", $name_to_nick[$news_arr[1]], $output);

if($my_mails[$news_arr[1]] != ""){
$output = str_replace("[mail]","<a href=\"mailto:".$my_mails[$news_arr[1]]."\">", $output);
$output = str_replace("[/mail]","</a>", $output);
}else{
$output = str_replace("[mail]","", $output);
$output = str_replace("[/mail]","", $output);
}
$output = str_replace("{news-id}", $news_arr[0], $output);
$output = str_replace("{archive-id}", $archive, $output);
$output = str_replace("{php-self}", $PHP_SELF, $output);
$output = str_replace("{cute-http-path}", $config_http_script_dir, $output);

// XFields Call
$xfieldsaction = "templatereplace";
$xfieldsinput = $output;
$xfieldsid = $news_arr[0];
include("xfields.mdu");
$output = $xfieldsoutput;
// End XFields Call

$output = replace_news("show", $output);

echo $output;
}
}
if(!$found){

echo("<div style=\"text-align: center;\"> Новость не найдена с таким id: <strong>". @(int) htmlspecialchars($id)."</strong></div>");
$CN_HALT = TRUE;
break 1;
}
}

Отправлено: 15:58, 24-10-2005 | #8

Название темы: Правка скрипта