callHook('deleteComment', $get['id']);
if( trash($get['id'], JLOG_DB_COMMENTS ) == true) {
$c['main'] .= $l['admin']['kill_c_killed'];
include_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'update.php');
}
}
elseif ($get['action'] == 'trash' AND empty($data['trash'])) {
$c['main'] .= "
";
$sql = 'SELECT id, sid, name, city, email, homepage, content, ' .
'date, reference, mail_by_comment, type FROM ' .
JLOG_DB_COMMENTS."
WHERE id = ".$mysql_id."
ORDER BY id DESC LIMIT 1;";
$comment = new Query($sql);
if($comment->error()) {
echo "\n";
echo $comment->getError();
echo "
\n";
die();
}
$daten = $comment->fetch();
$c['main'] .= "";
}
elseif($get['action'] == 'change' AND !empty($get['id'])) {
$l["comments_comment_topic"] = $l['admin']["comments_comment_topic"];
$l["comments_by"] = $l['admin']["comments_by"];
$l["comments_name"] = $l['admin']["comments_name"];
$l["comments_city"] = $l['admin']["comments_city"];
$l["comments_email"] = $l['admin']["comments_email"];
$l["comments_homepage"] = $l['admin']["comments_homepage"];
$l["comments_bbcode"] = $l['admin']["comments_bbcode"];
$l["comments_send"] = $l['admin']["comments_send"];
$l["comments_preview"] = $l['admin']["comments_preview"];
$l["comments_no_sid"] = $l['admin']["comments_no_sid"];
$l["comments_false_mail"] = $l['admin']["comments_false_mail"];
$l["comments_notext"] = $l['admin']["comments_notext"];
$l["comments_false_hp"] = $l['admin']["comments_false_hp"];
$l["comments_anonym"] = $l['admin']["comments_anonym"];
$l["comments_permalink"] = $l['admin']["comments_permalink"];
$l["comments_from"] = $l['admin']["comments_from"];
$l["comments_posted"] = $l['admin']["comments_posted"];
$l["comments_entryform"] = $l['admin']["comments_entryform"];
$l["comments_mail_by_comment"] = $l['admin']["comments_mail_by_comment"];
$l["comments_thx"] = $l['admin']["comments_thx"];
$l["comments_preview"] = $l['admin']["comments_preview"];
$l["comments_send"] = $l['admin']["comments_send"];
$l["comments_bold"] = $l['admin']["comments_bold"];
$l["comments_italic"] = $l['admin']["comments_italic"];
$l["comments_quote"] = $l['admin']["comments_quote"];
$l["comments_url"] = $l['admin']["comments_url"];
$l["comments_plz_format_txt"] = $l['admin']["comments_plz_format_txt"];
$l["comments_url_href"] = $l['admin']["comments_url_href"];
$l["comments_url_node"] = $l['admin']["comments_url_node"];
if($data['form_submitted'] == $l['comments_preview']) {
$c['main'] .= "\n ".$l['admin']['comments_change_h']."
".com_form_output($data).com_javascript_variables();
}
elseif($data['form_submitted'] == $l['comments_send']) {
if(count($errors = com_check_errors($data)) > 0) $c['main'] .= "\n ".$l['admin']['comments_change_h']."
\n".error_output($error).com_form_output($data).com_javascript_variables();
else {
$data = com_clean_data($data);
### Plugin Hook
$data = $plugins->callHook('updateComment', $data);
$data = escape_for_mysql($data);
$sql = "UPDATE ".JLOG_DB_COMMENTS."
SET
name = '".$data['name']."',
city = '".$data['city']."',
email = '".$data['email']."',
homepage = '".$data['homepage']."',
content = '".$data['content']."',
mail_by_comment = '".$data['mail_by_comment']."'
WHERE id = '".$data['id']."' LIMIT 1;";
$updatecomment = new Query($sql);
if($updatecomment->error()) {
echo "\n";
echo $updatecomment->getError();
echo "
\n";
die();
}
$c['main'] .= "\n ".$l['admin']['comments_change_h']."
\n".$l['admin']['comments_updated']." ".$l['admin']['comments_admin']."";
include_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'update.php');
}
}
else {
$sql = 'SELECT id, sid, name, city, email, homepage, content, ' .
'UNIX_TIMESTAMP(date) AS date, reference, ' .
'mail_by_comment, type FROM '.JLOG_DB_COMMENTS."
WHERE id = ".$mysql_id."
ORDER BY id DESC LIMIT 1;";
$comment = new Query($sql);
if($comment->error()) {
echo "\n";
echo $comment->getError();
echo "
\n";
die();
}
$data = $comment->fetch();
if(empty($data['name'])) $data['name'] = $l['comments_name'];
if(empty($data['city'])) $data['city'] = $l['comments_city'];
if(empty($data['email'])) $data['email'] = $l['comments_email'];
if(empty($data['homepage'])) $data['homepage'] = $l['comments_homepage'];
$c['main'] .= "\n ".$l['admin']['comments_change_h']."
".com_form_output($data).com_javascript_variables();
}
}
else {
$yl = new Year_Links($get['y'], JLOG_START_YEAR, add_session_id_to_url(JLOG_PATH."/admin/comments.php"), $l['admin']);
$c['main'] .= "
".$l['admin']['kill_c_topic']."
".$l['admin']['kill_c_description']."
".$yl->get_admin_linklist()."
".$l['admin']['change']." | ".$l['admin']['delete']." | ID | ".$l['comments_name']." | ".$l['comments_posted']." | ".$l['admin']['kill_c_entry']." |
";
$sql = "SELECT
".JLOG_DB_COMMENTS.".id AS id,
".JLOG_DB_CONTENT.".url AS url,
UNIX_TIMESTAMP(".JLOG_DB_CONTENT.".date) AS reference_date,
UNIX_TIMESTAMP(".JLOG_DB_COMMENTS.".date) AS date,
".JLOG_DB_COMMENTS.".name AS name,
".JLOG_DB_CONTENT.".topic AS topic,
".JLOG_DB_COMMENTS.".email AS email,
".JLOG_DB_COMMENTS.".type AS type
FROM ".JLOG_DB_COMMENTS.", ".JLOG_DB_CONTENT."
WHERE ".JLOG_DB_COMMENTS.".reference = ".JLOG_DB_CONTENT.".id
AND YEAR(".JLOG_DB_COMMENTS.".date) = '".$yl->get_selected_year()."'
ORDER BY id DESC;";
$comments = new Query($sql);
if($comments->error()) {
echo "\n";
echo $comments->getError();
echo "
\n";
die();
}
while ($daten = $comments->fetch()) {
if(empty($daten['name'])) $daten['name'] = $l['comments_anonym'];
elseif($daten['type'] != 'pingback') $daten['name'] = htmlspecialchars($daten['name'], ENT_QUOTES);
if(!empty($daten['email'])) {
$email_a = "";
$email_b = "";
}
else {
$email_a = "";
$email_b = "";
}
$comment = "
 |
 |
".$daten['id']." |
".$email_a.$daten['name'].$email_b." |
".strftime(JLOG_DATE_COMMENT, $daten['date'])." |
".$daten['topic']." |
";
### Plugin Hook
$c['main'] .= $plugins->callHook('commentAdminList', $comment, $daten);
}
$c['main'] .= "
";
}
require(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'do_template.php');
echo $body;
?>