Kommentar Funktioniert nicht unter 4.8.18 und AMR?

Gesperrt
contenidoAmateur

Kommentar Funktioniert nicht unter 4.8.18 und AMR?

Beitrag von contenidoAmateur » Mo 25. Feb 2013, 19:41

Hi,

ich hab das Modul installiert und auch mal den kompletten Thread durchgeschaut bzgl. der Änderungen im AMR Modul, jedoch bekomme ich immer die Fehlerseite...

Kann mir jemand helfen? Wäre echt dankbar:)

Modul Input:

Code: Alles auswählen

/***********************************************
* CONTENIDO MODUL - INPUT
*
* Modulname   :     comments_sd
* Author(s)   :     www.Seamless-Design.de Markus Hübner
* Copyright   :     www.Seamless-Design.de Markus Hübner
* Created     :     11.09.2011
************************************************/

echo 'Kommentare erlauben? ';
if ("CMS_VALUE[10]" != "true") { 
   echo '          <input type="radio" name="CMS_VAR[10]" value="true"> ja'; 
} else { 
   echo '          <input type="radio" name="CMS_VAR[10]" value="true" checked> ja'; 
} 
if ("CMS_VALUE[10]" != "false") { 
   echo '          <input type="radio" name="CMS_VAR[10]" value="false"> nein'; 
} else { 
   echo '          <input type="radio" name="CMS_VAR[10]" value="false" checked> nein'; 
} 

echo '<font style="font-size:80%"><br/><br/>Die Konfiguration des Moduls erfolgt über die Variablen am Beginn des Modul-Outputs.<br/>
Wichtig: Kommentare können im Backend nur gelöscht werden, wenn keine Folgekommentare vorhanden sind UND sie zuerst offline gesetzt werden.<br/>
Ein Löschen per Tabellenzugriff über phpMyAdmin sollte nicht erfolgen, da sonst die Baumstruktur zusammenbrechen kann!</font>';
Modul Output:

Code: Alles auswählen

<?php

/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname   :     comments_sd
* Author(s)   :     www.Seamless-Design.de Markus Hübner
* Copyright   :     www.Seamless-Design.de Markus Hübner
* Created     :     11.09.2011
************************************************/

$enable='CMS_VALUE[10]';
if($enable=="false" AND $contenido) echo '<p><font style="color: #DF1010; font-weight: 900; font-size: 15px;">COMMENTS DISABLED IN FRONTEND!</font></p>';
if($contenido) $enable="true"; // enables showing comments in backend, which are switched to "false" after being "true" while they are hidden in frontend
if($enable=="false")
  {
  echo '';
  }
  else
{
echo '<div class="c_sd_box_main">';

/****** begin configuration ******/

$display_countchas="true"; // true or false
$amount_countchas_total="8"; // how many countchas should be displayed if anti-spam is activated?
$path_countcha_1="upload/bullets/countcha_01.jpg"; // path to first symbol
$path_countcha_2="upload/bullets/countcha_02.jpg"; // path to second symbol

$debug="false"; // true or false. if you want to see several hints how this modul works, set it to true - have fun... ;O)
$mail_alert="true"; // if you want to get an email if there is a new comment, set it to true or otherwise false
$email_comment_alert="info@weltdertutorials.de"; // email-adress for email-alert
$maximum_comment_level=15; // after the xth level (level 1: 0=first comment ... level 6: 5=fifth answer ...) there is no possibility to answer an answer anymore 
$standard_onlinestatus="0"; // 1: comment is immediately online after posting or 0: you have to set it online
$enable_br="true"; // true enables displaying <br/> within comment text, set to false to disable
$base_url="http://www.weltdertutorials.de"; //needed for correct link in email-alert and link in comment-box
$headline_comments_image="upload/bullets/comments-bubble.jpg"; //path to image displayed before the headline

$template_form="comments_sd_commentform.html"; // template containing the comment form
$template_commentbox="comments_sd_commentbox.html"; // template containing the standard html-construct to display one posted comment
$template_commentbox_no_more_comments="comments_sd_commentbox_no_more_answers.html"; // template containing the standard html-construct to display one posted comment without the answer-this-comment-link
$template_form_commentchange="comments_sd_form_commentchange.html"; // template containing the backend-form to change contents of a comment

//if you want to configure the look: use the prepared css-styles.

/****** end configuration ******/


$commentname=mysql_real_escape_string(htmlspecialchars(strip_tags($_POST[commentname])));
$commentemail=mysql_real_escape_string(htmlspecialchars(strip_tags($_POST[commentemail])));
$commentwebsite=mysql_real_escape_string(htmlspecialchars(strip_tags($_POST[commentwebsite])));
  $commentwebsite = str_replace("https://","",$commentwebsite);
  $commentwebsite = str_replace("http://","",$commentwebsite);
$commenttext=mysql_real_escape_string(htmlspecialchars(strip_tags($_POST[commenttext])));
$amount=htmlspecialchars(strip_tags($_POST[amount]));
$countcha=htmlspecialchars(strip_tags($_POST[countcha]));
$show_form=htmlspecialchars(strip_tags($_GET[show_form]));
$parent_id=htmlspecialchars(strip_tags($_GET[parent_id]));
$level=htmlspecialchars(strip_tags($_GET[level]));
$timestamp = time();
$date = date("Y.m.d",$timestamp);
$time = date("H:i",$timestamp);
$url=$_SERVER["REQUEST_URI"];


if($contenido)
  {
  $url="/cms/front_content.php?idart=".$idart;
  $reload_url="front_content.php?idcat=$idcat&idart=$idart&lang=$lang&client=$client&contenido=$contenido";
  $change_id_select=htmlspecialchars(strip_tags($_POST[change_id_select]));
  $change_name=htmlspecialchars(strip_tags($_POST[change_name])); if($change_name=="") $change_name="-";
  $change_email=htmlspecialchars(strip_tags($_POST[change_email])); if($change_email=="") $change_email="-";
  $change_www=htmlspecialchars(strip_tags($_POST[change_www])); if($change_www=="") $change_www="-";
  $change_text=htmlspecialchars(strip_tags($_POST[change_text])); if($change_text=="") $change_text="-";
  }







if ($debug=="true")
  {
  echo 'submit: '.$submit.'<br/>';
  echo 'commentname: '.$commentname.'<br/>';
  echo 'commentemail: '.$commentemail.'<br/>';
  echo 'commentwebsite: '.$commentwebsite.'<br/>';
  echo 'commenttext: '.$commenttext.'<br/>';
  echo 'date: '.$date.'<br/>';
  echo 'time: '.$time.'<br/>';
  echo 'url: '.$url.'<br/>';
  echo 'idart: '.$idart.'<br/>';
  }

/****** begin backend functions ******/

if($contenido)
  {
  $toggle_id=htmlspecialchars(strip_tags($_GET[toggle_id]));
  $toggle_onlinestatus=htmlspecialchars(strip_tags($_GET[onlinestatus]));
  $erase=htmlspecialchars(strip_tags($_GET[erase]));
  if($debug=="true")
    {
    echo 'toggle_id: '.$toggle_id.'<br/>';
    echo 'online-status: '.$toggle_onlinestatus.'<br/>';
    echo 'erase: '.$erase.'<br/>';
    }
  if($toggle_id!="" AND $toggle_onlinestatus!="")
    {
    $toggle = "UPDATE comments_sd Set online = $toggle_onlinestatus WHERE id = $toggle_id";
    $update = mysql_query($toggle);
    }
  if($erase=="1")
    {
    $erase = "DELETE from comments_sd WHERE id = $toggle_id";
    $erase = mysql_query($erase);
    }


$query = "SELECT id FROM comments_sd WHERE idart='$idart' ORDER by id ASC";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result))
  {
  $ids_to_select[]=$row[id];
  }
$select="<option>?</option>";
$amount_of_comments = mysql_num_rows($result); //edit blau1 contenido post Do Nov 10, 2011 7:19 pm http://forum.contenido.org/viewtopic.php?f=60&t=31573
if($amount_of_comments>0)
{
foreach($ids_to_select AS $element)
{
$select=$select.'<option>'.$element.'</option>';
}
}
echo '<div style="background-color: #FFE4E4;border: 1px solid #FFE4E4;border-radius: 5px;padding: 5px;margin-bottom: 10px;">';
echo '<strong>Inhalte eines Kommentars &auml;ndern</strong><br/><span style="font-size: 80%;">(Wenn für Feld <u>keine</u> Änderung gewünscht ist, bitte "-" im Feld belassen. Leer führt zu L&ouml;schung des Inhalts!)</span>';
  if(!isset($tpl) || !is_object($tpl)) $tpl = new Template();
    $tpl->reset();
    $tpl->set('s', 'value_change_name', $change_name);
    $tpl->set('s', 'value_change_email', $change_email);
    $tpl->set('s', 'value_change_www', $change_www);
    $tpl->set('s', 'value_change_text', $change_text);
    $tpl->set('s', 'button_text', "update");
    $tpl->set('s', 'select', $select);
    $tpl->generate('templates/'.$template_form_commentchange);
echo '</div>';

if($change_id_select!="")
  {
  if($change_id_select=="?")
    {
    echo mi18n("please_select_a_change_id").'<br/>';
    }
    else
      {
      if($debug=="true") {echo $change_id_select.'<br/>';echo $change_name.'<br/>';echo $change_email.'<br/>';echo $change_www.'<br/>';echo $change_text.'<br/>';}
      if($change_name!="-") mysql_query("UPDATE comments_sd SET name='$change_name' WHERE id='$change_id_select'");
      if($change_email!="-") mysql_query("UPDATE comments_sd SET email='$change_email' WHERE id='$change_id_select'");
      if($change_www!="-") mysql_query("UPDATE comments_sd SET website='$change_www' WHERE id='$change_id_select'");
      if($change_text!="-") mysql_query("UPDATE comments_sd SET text='$change_text' WHERE id='$change_id_select'");
      }
  }

  }

function backend_comment_options ($reload_url,$toggle_id,$onlinestatus,$commentemail,$has_child){
echo '<div class="c_sd_commentbox_backend_options">';
if($debug=="true") echo 'has child: '.$has_child.'<br/>';
if($onlinestatus=="0")
  {
  echo 'eMail: <a href="mailto:'.$commentemail.'">'.$commentemail.'</a>&nbsp;&nbsp;|&nbsp;&nbsp;';
  if($has_child!="true") echo '<a href="'.$reload_url.'&toggle_id='.$toggle_id.'&onlinestatus=0&erase=1"><img src="/contenido/images/delete.gif" alt="delete" title="delete"/></a>&nbsp;&nbsp;|&nbsp;&nbsp;';
  echo '<a href="'.$reload_url.'&toggle_id='.$toggle_id.'&onlinestatus=1&erase=0"><img src="/contenido/images/offline.gif" alt="offline" title="offline"/></a>';
  }
if($onlinestatus=="1") echo 'eMail: <a href="mailto:'.$commentemail.'">'.$commentemail.'</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                              <a href="'.$reload_url.'&toggle_id='.$toggle_id.'&onlinestatus=0&erase=0"><img src="/contenido/images/online.gif" alt="online" title="online"/></a>';
echo ' | id: '.$toggle_id;
echo '</div>';
}

/****** end backend functions ******/



/****** begin checking errors ******/  

if($submit!="")
  {
  if($commentemail != "")
    {
    if(!preg_match("/^[\w-]+((\.|\+)[\w-]+)*@([a-z0-9-]+(\.[a-z0-9-]+)*?\.[a-z]{2,6}|(\d{1,3}\.){3}\d{1,3})(:\d{4})?$/i", $commentemail))
      {
      $errormessage_commentemail=mi18n("errormessage_commentemail").'<br/>';
      }
        else $errormessage_commentemail="";
    } 

  if($commentwebsite != "")
    {
    if(!preg_match("/[w.0-9]{0,4}[a-zA-Z0-9.-]{2,40}[.][a-zA-Z]{2,7}/", $commentwebsite))
      {
      $errormessage_commentwebsite=mi18n("errormessage_commentwebsite").'<br/>';
      }
      else $errormessage_commentwebsite="";
    }

  if($commenttext=="") $errormessage_commenttext=mi18n("errormessage_commenttext").'<br/>';
      else $errormessage_commenttext="";

  if($display_countchas=="true")
    {
      if($amount!=$countcha) $errormessage_countchas=mi18n("errormessage_countchas").'<br/>';
         else $errormessage_countchas="";
    }
  }

if($show_form=="true")
  {
  if($errormessage_commentemail!="" OR $errormessage_commentwebsite!="" OR $errormessage_commenttext!="" OR $errormessage_countchas!="")
    {
    echo '<h2>'.mi18n("headline_form").'</h2>';
    echo '<p class="c_sd_box_errormessages">';
    echo $errormessage_commentemail;
    echo $errormessage_commentwebsite;
    echo $errormessage_commenttext;
    if($display_countchas=="true") echo $errormessage_countchas;
    echo '<p>';
    }
    elseif ($submit!="")
      {
      echo '<h2>'.mi18n("headline_form").'</h2>';
      if($standard_onlinestatus=="0") echo mi18n("confirmation");
      if($standard_onlinestatus=="1") echo mi18n("confirmation_immediately_online");
      $insert_data="true";
      }
      else echo '<h2>'.mi18n("headline_form").'</h2>';
  }
/****** end checking errors ******/




/****** begin displaying form ******/ 

if($insert_data!="true" AND $show_form=="true")
  {
  if($display_countchas=="true")
    {
    $countchas_1="";
    $countchas_2="";
    $amount=rand(1,$amount_countchas_total); // amount of symbols to count
    $amount_wrong_countchas=$amount_countchas_total-$amount;
    $i=0;
    while ($i<$amount_wrong_countchas)
      {
      $countchas_2=$countchas_2."<img src=\"".$path_countcha_2."\" border=\"0\" alt=\"\"></img>&nbsp;";
      $i=$i+1;
      }
    while ($i<$amount_countchas_total)
      {
      $countchas_1=$countchas_1."<img src=\"".$path_countcha_1."\" border=\"0\" alt=\"\"></img>&nbsp;";
      $i=$i+1;
      }
    }

  if(!isset($tpl) || !is_object($tpl)) $tpl = new Template();
    $tpl->reset();
    $tpl->set('s', 'name', mi18n("name"));
    $tpl->set('s', 'commentname', $commentname);
    $tpl->set('s', 'email', mi18n("email"));
    $tpl->set('s', 'commentemail', $commentemail);
    $tpl->set('s', 'website', mi18n("website"));
    $tpl->set('s', 'commentwebsite', $commentwebsite);
    $tpl->set('s', 'text', mi18n("text"));
    $tpl->set('s', 'commenttext', $commenttext);
    $tpl->set('s', 'countchas_2', $countchas_2);
    $tpl->set('s', 'countchas_1', $countchas_1);
    $tpl->set('s', 'how_many_countchas', mi18n("how_many_countchas"));
    $tpl->set('s', 'title_right_countcha', mi18n("title_right_countcha"));
    $tpl->set('s', 'how_many_countchas_hint_spam', mi18n("how_many_countchas_hint_spam"));
    $tpl->set('s', 'how_many_countchas_input', mi18n("how_many_countchas_input"));
    $tpl->set('s', 'countchas', $countchas);
    $tpl->set('s', 'title_right_countcha_input', mi18n("title_right_countcha_input"));
    $tpl->set('s', 'amount', $amount);
    $tpl->set('s', 'button_text', mi18n("button_text"));
    $tpl->generate('templates/'.$template_form);
  }
  

/****** end displaying form ******/



/****** begin displaying comment after confirmation and mysql-insert ******/ 

if($insert_data=="true")
  {

  /****** begin displaying comment after confirmation ******/ 
  $stringposition=strpos ($url,'&'); //clear url from variables
  $url_for_insert=substr($url,0,$stringposition);
  echo'<p><a class="c_sd_link" href="'.$url_for_insert.'" title="'.mi18n("back_to_article").'">'.mi18n("back_to_article").'</a></p>';
  /****** end displaying comment after confirmation ******/

  /****** begin mysql-insert ******/
  $insert="INSERT INTO comments_sd (idart, url, name, email, website, text, parent_id, level, date, time, online) VALUES ('$idart', '$url_for_insert', '$commentname', '$commentemail', '$commentwebsite', '$commenttext', '$parent_id', '$level', '$date', '$time', '$standard_onlinestatus')";
  $insert = mysql_query($insert);
  if($debug=="true") {if ($insert==true) {echo 'insert: success';} else echo 'insert: failure';}
  /****** end mysql-insert ******/

  /****** begin email-alert ******/

if($mail_alert=="true")
  {
  // eMail-header:
  $link_new_comment = $base_url.$_SERVER["REQUEST_URI"];  $mail_header = mi18n("email_header");
  $from="From: Website <no_reply@new_comment.com>\n";
  $from .= "Reply-To: no_reply@new_comment.com\n";
  $from .= "Content-Type: text/html\n";
  $message=mi18n("email_message_new_comment_for").' <a href="'.$link_new_comment.'" target="_blank">'.$link_new_comment.'</a>';
  // send eMail
  $emails_in_array=explode("//",$email_comment_alert);
  foreach($emails_in_array as $mailto)
    {
    mail($mailto, $mail_header, $message, $from);
    }
  }
  
  /****** end email-alert ******/

}
/****** end displaying comment after confirmation and mysql-insert ******/ 



/****** begin displaying comments ******/

echo '<div class="c_sd_headline_comments">';
if($headline_comments_image!="") echo '<img src="'.$headline_comments_image.'" alt="'.mi18n("headline_comments").'" title alt="'.mi18n("headline_comments").'"/>';
echo mi18n("headline_comments").'</div><br/>';

if($show_form!="true") echo '<p><a class="c_sd_link" href="'.$main_url.'?idcat='.$idcat.'&idart='.$idart.'&show_form=true" title="'.mi18n("post_a_comment").'">'.mi18n("post_a_comment").'</a><p>';

if($show_form=="true")//for displaying form, the url contains &show_form - what blocks searching the correct data in the database. so it has to be cut
  {
  $stringposition=strpos ($url,'&'); 
  $url=substr($url,0,$stringposition);
  }

function datatransfer($commentname,$commentemail,$commentwebsite,$commentdate,$commenttime,$commenttext,$url,$main_url,$idart,$commentlevel,$comment_parent_id,$linktext,$id,$online,$reload_url,$has_child,$maximum_comment_level)
{
//echo 'reload_url: '.$reload_url.'<br/>';
global $array_displayed_comments,$contenido,$template_commentbox,$template_commentbox_no_more_comments,$enable_br;
if($enable_br=="true") $commenttext = nl2br($commenttext);// enables displaying <br/>
$d=explode("-",$commentdate);
$commentdate=sprintf("%02d.%02d.%04d", $d[2], $d[1], $d[0]);
$margin_left=$commentlevel*20;
$commentlevel=$commentlevel+1;
if(!isset($tpl) || !is_object($tpl))
  {
  $tpl = new Template();
  }
  $tpl->reset();
  $tpl->set('s', 'margin_left', $margin_left);
  $tpl->set('s', 'commentname', $commentname);
  $tpl->set('s', 'commentwebsite', $commentwebsite);
  $tpl->set('s', 'commentdate', $commentdate);
  $tpl->set('s', 'commenttime', $commenttime);
  $tpl->set('s', 'commenttext', $commenttext);
  $tpl->set('s', 'url', $url); //currently not in use, the database table contains url, because the next step would be enabling comments for dynamic contents of articles. e.g. a picture-gallery -> the url contains besides the idart other information like name and path of picture
  $tpl->set('s', 'main_url', $main_url);
  $tpl->set('s', 'idart', $idart);
  $tpl->set('s', 'commentlevel', $commentlevel);
  $tpl->set('s', 'comment_parent_id', $comment_parent_id);
  $tpl->set('s', 'linktext', $linktext);
  if($commentlevel<=$maximum_comment_level) 
    $tpl->generate('templates/'.$template_commentbox);
    else
      $tpl->generate('templates/'.$template_commentbox_no_more_comments);
  if($contenido) backend_comment_options ($reload_url,$id,$online,$commentemail,$has_child);
}


//$query = "SELECT parent_id, id,level FROM comments_sd WHERE url='$url' ORDER by id ASC"; //currently not possible, the database table contains url, because the next step would be enabling comments for dynamic contents of articles. e.g. a picture-gallery -> the url contains besides the idart other information like name and path of picture

if($edit)
  {
  // backend: count all comments (on- and offline)
  $query = "SELECT parent_id, id,level FROM comments_sd WHERE idart='$idart' ORDER by id ASC";
  }
  else
    {
    //frontend: count comments which are online
    $query = "SELECT parent_id, id,level FROM comments_sd WHERE idart='$idart' AND online = '1' ORDER by id ASC";
    }
$result = mysql_query($query);
$amount_of_comments = mysql_num_rows($result);
if($amount_of_comments=="0")
  {
  echo mi18n("no_comments_yet");
  }
  else
    {
    echo mi18n("amount_of_comments_yet").' '.$amount_of_comments.'<br/>';
    if($edit) echo '(online + offline)<br/>';
    $maxlevel=0;
    while ($row = mysql_fetch_array($result))// AND $i<=$maxlevel)
      {
      ${'array_l_'.$row[level]}[]=$row[id];
      if($maxlevel<$row[level]) $maxlevel=$row[level];
      $array_level_id_parent_id[]=array($row[level],$row[id],$row[parent_id]);
      }
    if($debug=="true") echo 'maxlevel: '.$maxlevel.'<br/>';
     }

if($debug=="true")
  {
  $i=0;
  while($i<=$maxlevel)
    {
    echo 'level '.$i.': ';  if(count(${'array_l_'.$i}) > 0) {foreach(${'array_l_'.$i}  AS ${'element_l_'.$i})  echo ${'element_l_'.$i}." | ";}  echo '<br/>';
    $i++;
    }
     
  $i=0;
  while($i<$amount_of_comments)
    {
    echo $all_comments[$i].'<br/>';
    $i++;
    }

  echo '<br/>array_level_id_parent_id<br/>';
  $i=0;
  foreach($array_level_id_parent_id AS $element)
    {
    echo $i.' ';
    print_r($element);
    echo '<br/>';
    $i++;
    }

  echo '<br/>array_level_id_parent_id - sorting<br/>';
  }


/****** begin building comment ranking ******/

$array_used_comments=array();
$array_comment_ranking=array();

$levelcounter=1;

function unset_array_level_id_parent_id($element)
  {
  global $array_level_id_parent_id;
  $i=0;
  $n=count($array_level_id_parent_id);
  while($i<$n)
    {
     if($array_level_id_parent_id[$i][1]==$element) unset($array_level_id_parent_id[$i]);
     $i++;
    }
  }


function level_extractor($levelcounter) 
  {
  global $array_level_id_parent_id;
  foreach($array_level_id_parent_id AS $element)
    {
    if($element[0]==$levelcounter) $extracted_levels[]=$element;
    }
  return $extracted_levels;
  }


function collect_level_parent_ids($extracted_levels)
  {
  foreach($extracted_levels AS $element)
    {
    $collected_level_parent_ids[]=$element[2];
    }
  $collected_level_parent_ids=array_unique($collected_level_parent_ids);
  return $collected_level_parent_ids;
  }


function integrate($parent_id,$ids_for_function_integrate)
  {
  global $array_comment_ranking;
  $i=0;
  foreach($array_comment_ranking AS $element) //search for parent_id to place the pointer for integration
    {
    if($element==$parent_id) 
      {
      $pointer=$i+1;
      break;
      }
    $i++;
    }
  $array_comment_ranking=array_merge(array_slice($array_comment_ranking, 0, $pointer), array_values($ids_for_function_integrate), array_slice($array_comment_ranking, $pointer));
  if($debug=="true") {echo '<br/>integrate<br/>';print_r($array_comment_ranking);}
  }


function collect_ids_to_integrate($collected_level_parent_ids)
  {
  global $array_level_id_parent_id; 
  foreach($collected_level_parent_ids AS $element)
    {
    $i=0;
    $n=count($array_level_id_parent_id);
    while($i<=$n)
      {
      if($element==$array_level_id_parent_id[$i][2])
        {
        $ids_to_integrate[]=$array_level_id_parent_id[$i];
        }
      $i++;
      }
    foreach($ids_to_integrate AS $element)
      {
      if($debug=="true") echo 'element: '.$element[1].'<br/>';
      $i=0;
      $n=count($array_level_id_parent_id);
      while($i<=$n)
      {
      if($element[1]==$array_level_id_parent_id[$i][1])
        {
        unset($array_level_id_parent_id[$i]);
        $array_level_id_parent_id=array_values($array_level_id_parent_id);
        }
      $i++;
      }
      }
    $parent_id=$ids_to_integrate[0][2];

    foreach($ids_to_integrate AS $element)
      {
      $ids_for_function_integrate[]=$element[1];
      }
    if($debug=="true") {echo 'parent_id: '.$parent_id.' '; echo 'ids to integrate: '; foreach($ids_for_function_integrate AS $element) {echo $element.',';} echo '<br/>';}
    integrate($parent_id,$ids_for_function_integrate);
    $ids_to_integrate=array(); // setting back, so childs of a further parent-id will not be appended to childs of previous parent-id
    $ids_for_function_integrate=array();
    }
  }


//LEVEL 0
$array_comment_ranking=$array_l_0;
$array_used_comments=$array_l_0;

if($amount_of_comments>0)
{
foreach($array_comment_ranking AS $element)
  {
  unset_array_level_id_parent_id($element);
  $array_level_id_parent_id=array_values($array_level_id_parent_id);
  }

//LEVELS > 0
while($levelcounter<=$maxlevel)
  {
  $extracted_levels=level_extractor($levelcounter);
  if($debug=="true") {echo '<br/>extracted_levels<br/>'; foreach($extracted_levels AS $element) {print_r($element); echo '<br/>';}}

  $collected_level_parent_ids=collect_level_parent_ids($extracted_levels);
  if($debug=="true") {echo '<br/>collected_level_parent_ids<br/>'; foreach($collected_level_parent_ids AS $element) {print_r($element); echo '<br/>';}}

  $collected_ids_to_integrate=collect_ids_to_integrate($collected_level_parent_ids);

  $levelcounter++; 
  }
}
/****** end building comment ranking ******/




if($debug=="true")
  {
  echo '<br/>array_used_comments:<br/>';
  $i=0;
  while($i<count($array_used_comments))
    {
    echo $array_used_comments[$i].'<br/>';
    $i++;
    }

  echo '<br/>array_level_id_parent_id<br/>';
  $i=0;
  foreach($array_level_id_parent_id AS $element)
    {
    echo $i.' ';
    print_r($element);
    echo '<br/>';
    $i++;
    }

  echo '<br/>array_comment_ranking:<br/>';
  $i=0;
  while($i<count($array_comment_ranking))
    {
    echo $array_comment_ranking[$i].'<br/>';
    $i++;
    }
  }

/****** begin building the comment tree ******/

if($amount_of_comments>0)
{
echo '<div class="c_sd_box_comment_tree">';

foreach($array_comment_ranking AS $element)
  {
  $has_child="false";
  $query = "SELECT * FROM comments_sd WHERE id='$element' ORDER by id ASC";
  $result = mysql_query($query);
  $row = mysql_fetch_array($result);
  $has_child="";
  if($contenido) // only needed for backend, not for frontend
    {$array_children_element_l_0=array("");
    $query_b = "SELECT id FROM comments_sd WHERE parent_id='$element' ORDER by id ASC";
    $result_b = mysql_query($query_b);
    $num_rows= mysql_num_rows($result_b);
    if($num_rows>0) $has_child="true";
    }
  if($row[online]=="1" AND !$contenido) datatransfer ($row[name],$row[email],$row[website],$row[date],$row[time],$row[text],$url,$main_url,$idart,$row[level],$row[id],mi18n("answer_comment"),$row[id],$row[online],$reload_url,$has_child,$maximum_comment_level);
  if($row[text]!="" AND $contenido) datatransfer ($row[name],$row[email],$row[website],$row[date],$row[time],$row[text],$url,$main_url,$idart,$row[level],$row[id],mi18n("answer_comment"),$row[id],$row[online],$reload_url,$has_child,$maximum_comment_level);
  }
echo '</div>';
}

/****** end building the comment tree ******/

/****** end displaying comments ******/

echo '</div>';
}
?>

comments_sd_commentbox.htmlt:

Code: Alles auswählen

<div class="c_sd_commentbox_{commentlevel}" style="margin-left:{margin_left}px">
<table class="c_sd_commentbox">
<tr>
  <td class="c_sd_commentbox_1_a">
    <span class="c_sd_commentbox_name">{commentname}</span><br/>
    <span class="c_sd_commentbox_website">web: <a href="http://{commentwebsite}" target="_blank" title="{commentwebsite}">{commentwebsite}</a></span>
  </td>
  <td class="c_sd_commentbox_1_b">
    <span class="c_sd_commentbox_date">{commentdate}</span><br/>
    <span class="c_sd_commentbox_time">{commenttime}</span>
  </td>
</tr>
<tr>
  <td colspan="2" class="c_sd_commentbox_2">{commenttext}</td>
</tr>
<tr>
  <td colspan="2" class="c_sd_commentbox_3">
    <a class="c_sd_link" href="'.$main_url.'?idcat='.$idcat.'&idart='.$idart.'&show_form=true" title="'.mi18n("post_a_comment").'">'.mi18n("post_a_comment").'</a>
  </td>
</tr>
</table>
</div>
comments_sd_commentbox_no_more_answers.html:

Code: Alles auswählen

<div class="c_sd_commentbox_{commentlevel}" style="margin-left:{margin_left}px">
<table class="c_sd_commentbox">
<tr>
  <td class="c_sd_commentbox_1_a">
    <span class="c_sd_commentbox_name">{commentname}</span><br/>
    <span class="c_sd_commentbox_website">web: <a href="http://{commentwebsite}" target="_blank" title="{commentwebsite}">{commentwebsite}</a></span>
  </td>
  <td class="c_sd_commentbox_1_b">
    <span class="c_sd_commentbox_date">{commentdate}</span><br/>
    <span class="c_sd_commentbox_time">{commenttime}</span>
  </td>
</tr>
<tr>
  <td colspan="2" class="c_sd_commentbox_2" style="border-bottom: 0px;">{commenttext}</td>
</tr>

</table>
</div>

comments_sd_commentform.html:

Code: Alles auswählen

<form id="commentform" name="comments" method="post" action="">
  <table>
    <tr>
      <td class="tabellenzelle_formular_ueberschrift">{name}</td>
      <td><input type="text" name="commentname" value="{commentname}"/></td>
    </tr>
    <tr>
      <td class="tabellenzelle_formular_ueberschrift">{email}</td>
      <td><input type="text" name="commentemail" value="{commentemail}"/></td>
    </tr>
    <tr>
      <td class="tabellenzelle_formular_ueberschrift">{website}</td>
      <td><input type="text" name="commentwebsite" value="{commentwebsite}"/></td>
    </tr>
    <tr>
      <td class="tabellenzelle_formular_ueberschrift">{text}</td>
      <td><textarea cols="40" rows="10" name="commenttext">{commenttext}</textarea></td>
    </tr>
  </table>
  {how_many_countchas} {title_right_countcha}<br/>
  <span class="hinweis_klein">{how_many_countchas_hint_spam}</span><br/>
  {countchas_2}{countchas_1}
  <table>
    <tr>
      <td>{how_many_countchas_input}</td>
      <td><input style="width: 40px;" type="text" name="countcha" value="{countchas}" size="1" maxlength="10"></input></td>
      <td>{title_right_countcha_input}</td>
    </tr>
  </table>
  <br/>
  <input type="hidden" name="amount" value="{amount}"></input>
  <input type="submit" class="button" name="submit" value="{button_text}">
</form>
<br/>
<br/>
comments_sd_form_commentchange.html:

Code: Alles auswählen

<form id="commentform" name="comments" method="post" action="">
  <table>
    <tr>
      <td>comment-id</td>
      <td>
        <select name="change_id_select">
          {select}
        </select>   
      </td>
      <td rowspan="4">Text<br/><textarea cols="30" rows="4" name="change_text"/>{value_change_text}</textarea></td>
    </tr>
    <tr>
      <td>Name</td><td><input type="text" name="change_name" value="{value_change_name}" size="20"/></td>
    </tr>
    <tr>
      <td>eMail</td><td><input type="text" name="change_email" value="{value_change_email}" size="20"/></td>
    </tr>
    <tr>
      <td>www</td><td><input type="text" name="change_www" value="{value_change_www}" size="20"/></td>
    </tr>
  </table>
  <span style="font-size: 80%;"><u>Wichtig:</u> &Auml;nderungen k&ouml;nnen nicht wieder r&uuml;ckg&auml;ngig gemacht werden. Richtige Comment-ID eingetragen?</span><br/>
  <input type="submit" class="button" name="submit" value="{button_text}">
</form>
Dankeschön :)

McHubi
Beiträge: 1210
Registriert: Do 18. Nov 2004, 23:06
Wohnort: Mettmann
Kontaktdaten:

Re: Kommentar Funktioniert nicht unter 4.8.18 und AMR?

Beitrag von McHubi » Di 26. Feb 2013, 16:40

Hi,

warum postest Du Deine Frage nicht im ursprünglichen Thread? So macht das keinen Sinn und sorgt nur für Verwirrung! Vor allem auch weil Du hier - unnötigerweise - die kompletten Sourcen erneut postet... :motz:

Also stell Deine Frage bitte hier http://forum.contenido.org/viewtopic.php?f=60&t=31573 und beschreibe den Fehler bitte etwas genauer. Mit
jedoch bekomme ich immer die Fehlerseite
weiß keiner was anzufangen. Meinst Du die Fehlerseite von Contenido? Meinst Du eine 404er? Wie auch immer...

@Admins: Bitte Eröffnungspost um die Sourcen kürzen und mit ursprünglichem Thread zusammenführen. Danke euch! :D
seamless-design.de
"Geht nicht!" wohnt in der "Will nicht!"-Strasse.

Das Handbuch zur Version 4.10: CONTENIDO für Einsteiger (4.10)

Das Handbuch zur Version 4.9: CONTENIDO für Einsteiger (4.9)

contenidoAmateur

Re: Kommentar Funktioniert nicht unter 4.8.18 und AMR?

Beitrag von contenidoAmateur » Di 26. Feb 2013, 21:50

sry, ist im andere Forum gepostet :)

Kann gelöscht werden :)

Gesperrt