we3b tylko problem w tym, ze jak tak zrobie jak mi napisales, to wtedy po dodaniu kolejnego komentarza ta ramka sie nie rozciaga nizej zeby podkreslic ostatni komentarz
http://www.history.is.net.pl/index.php? ... tart_from=&
A tak byc nie powinno, jak to naprawic
Tak wyglada kod pliku
shows.inc.php :
Kod: Zaznacz cały
//####################################################################################################################
// Show Comments
//####################################################################################################################
if($allow_comments){
$comm_per_page = $config_comments_per_page;
$total_comments = 0;
$showed_comments = 0;
$comment_number = 0;
$showed = 0;
$all_comments = file("$comm_file");
foreach($all_comments as $comment_line)
{
$comment_line = trim($comment_line);
$comment_line_arr = explode("|>|", $comment_line);
if($id == $comment_line_arr[0])
{
$individual_comments = explode("||", $comment_line_arr[1]);
$total_comments = @count($individual_comments) - 1;
//show the page with our new comment, if we just added one
/* causes some problems, will be updated !!!
if($allow_add_comment and true){
$comm_start_from = $total_comments-1;
if($config_reverse_comments == "yes"){
$comm_start_from = 0;
}
}
*/
$iteration = 0;
if($config_reverse_comments == "yes"){$iteration = count($individual_comments)+1; $individual_comments = array_reverse($individual_comments); }
//if there is no comments
if ($total_comments == 0){ echo "<center><p><b>Brak komentarzy</b></p></center><br /><br /><br />"; break; } else { echo '<fieldset><legend><font color="#0033cc"> <b>Komentarze</b> </font></legend>'; }
foreach($individual_comments as $comment)
{
if($config_reverse_comments == "yes") { $iteration --; }
else{ $iteration ++; }
$comment_arr = explode("|", $comment);
if($comment_arr[0] != "")
{
if(isset($comm_start_from) and $comm_start_from != ""){
if($comment_number < $comm_start_from){ $comment_number++; continue; }
elseif($showed_comments == $comm_per_page){ break; }
}
$comment_number ++;
$comment_arr[4] = stripslashes(rtrim($comment_arr[4]));
if($comment_arr[2] != "none"){
if( preg_match("/^[\.A-z0-9_\-\+]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{1,4}$/", $comment_arr[2])){ $url_target = "";$mail_or_url = "mailto:"; }
else{
$url_target = "target=\"_blank\"";
$mail_or_url = "";
if(substr($comment_arr[2],0,3) == "www"){ $mail_or_url = "http://"; }
}
// SPAM Safe v1.0 - changeblock - Old
// $output = str_replace("{author}", "<a $url_target href=\"$mail_or_url".stripslashes($comment_arr[2])."\">".stripslashes($comment_arr[1])."</a>", $template_comment);
// SPAM Safe v1.0 - changeblock - New
if ($mail_or_url == "mailto:") {
$email = explode("@", stripslashes($comment_arr[2]), 2);
$output = str_replace("{author}", "<script>var em0 = '$email[0]'; document.write('<a href=\"mailto:' + em0 + '@$email[1]\">".stripslashes($comment_arr[1])."</a>');</script>", $template_comment);
echo "\n\n\n\n\n";
} else {
$output = str_replace("{author}", "<a $url_target href=\"$mail_or_url".stripslashes($comment_arr[2])."\">".stripslashes($comment_arr[1])."</a>", $template_comment);
}
// SPAM Safe v1.0 - End changeblock
}
else{ $output = str_replace("{author}", $comment_arr[1], $template_comment); }
$comment_arr[4] = preg_replace("/\b((http(s?):\/\/)|(www\.))([\w\.]+)([&-~\%\/\w+\.-?]+)\b/i", "<a href=\"http$3://$4$5$6\" target=\"_blank\">$2$4$5$6</a></fieldset>", $comment_arr[4]);
// $comment_arr[4] = preg_replace("/([\w\.]+)(@)([-\w\.]+)/i", "<a href=\"mailto:$0\">$0</a>", $comment_arr[4]);
// SPAM Safe v1.0 - changeblock - Old
// $comment_arr[4] = preg_replace("/([\w\.]+)(@)([\w\.]+)/i", "<a href=\"mailto:$0\">$0</a>", $comment_arr[4]);
// SPAM Safe v1.0 - changeblock - New
$email = explode("@", "$0", 2);
$comment_arr[4] = preg_replace("/([\w\.]+)(@)([\w\.]+)/i", "<script>var em0 = '$email[0]'; document.write('<a href=\"mailto:' + em0 + '@$email[1]\">' + em0 + '@$email[1]</a>');</script>", $comment_arr[4]);
// SPAM Safe v1.0 - End changeblock
$output = str_replace("{mail}", "$comment_arr[2]",$output);
$output = str_replace("{date}", langdate($config_timestamp_comment, $comment_arr[0]),$output);
$output = str_replace("{comment-id}", $comment_arr[0],$output);
$output = str_replace("{comment}", "<a name=\"".$comment_arr[0]."\"></a>$comment_arr[4]",$output);
$output = str_replace("{comment-iteration}", $iteration ,$output);
$output = replace_comment("show", $output);
echo $output;
$showed_comments++;
if($comm_per_page != 0 and $comm_per_page == $showed_comments){ break; }
}
}
}
}