1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-09 17:16:20 +02:00

Bugtracker #4364 - support comment edit for downloads, content. Also bugtracker #4381 don't display blocked comments

This commit is contained in:
e107steved
2008-05-25 08:26:11 +00:00
parent 62401cd74d
commit 33f96bb871
6 changed files with 377 additions and 334 deletions

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/comment.php,v $ | $Source: /cvs_backup/e107_0.8/comment.php,v $
| $Revision: 1.4 $ | $Revision: 1.5 $
| $Date: 2007-12-08 14:49:44 $ | $Date: 2008-05-25 08:26:11 $
| $Author: e107steved $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@ -36,13 +36,12 @@ $id = intval(varset($temp_query[2], "")); // ID of item associated with comment
$nid = intval(varset($temp_query[3], "")); // Action - e.g. 'edit'. Or news ID for reply with nested comments $nid = intval(varset($temp_query[3], "")); // Action - e.g. 'edit'. Or news ID for reply with nested comments
$xid = intval(varset($temp_query[4], "")); // ID of target comment $xid = intval(varset($temp_query[4], "")); // ID of target comment
global $comment_edit_query; global $comment_edit_query;
//$comment_edit_query = '';
//if ($temp_query[3] == 'edit') $comment_edit_query = $temp_query[0].".".$temp_query[1].".".$temp_query[2];
$comment_edit_query = $temp_query[0].".".$temp_query[1].".".$temp_query[2]; $comment_edit_query = $temp_query[0].".".$temp_query[1].".".$temp_query[2];
unset($temp_query); unset($temp_query);
$redirectFlag = 0;
if (isset($_POST['commentsubmit']) || isset($_POST['editsubmit'])) if (isset($_POST['commentsubmit']) || isset($_POST['editsubmit']))
{ { // New comment, or edited comment, being posted.
if(!ANON && !USER) if(!ANON && !USER)
{ {
header("location: ".e_BASE."index.php"); header("location: ".e_BASE."index.php");
@ -56,7 +55,8 @@ if (isset($_POST['commentsubmit']) || isset($_POST['editsubmit']))
header("location: ".e_BASE."index.php"); header("location: ".e_BASE."index.php");
exit; exit;
} }
} else if($table == "news") }
elseif($table == "news")
{ {
if (!$sql->db_Select("news", "news_allow_comments", "`news_id` = '{$id}' AND `news_allow_comments` = 0")) if (!$sql->db_Select("news", "news_allow_comments", "`news_id` = '{$id}' AND `news_allow_comments` = 0"))
{ {
@ -65,11 +65,9 @@ if (isset($_POST['commentsubmit']) || isset($_POST['editsubmit']))
} }
} }
// $pid = (isset($_POST['pid']) ? $_POST['pid'] : 0); $pid = intval(varset($_POST['pid'], 0)); // ID of the specific comment being edited (nested comments - replies)
// $pid = intval($pid);
$pid = intval(varset($_POST['pid'], 0));
$editpid = intval(varset($_POST['editpid'], 0)); // ID of the specific comment being edited $editpid = intval(varset($_POST['editpid'], 0)); // ID of the specific comment being edited (in-line comments)
$clean_authorname = $_POST['author_name']; $clean_authorname = $_POST['author_name'];
$clean_comment = $_POST['comment']; $clean_comment = $_POST['comment'];
@ -87,15 +85,16 @@ if (isset($_POST['commentsubmit']) || isset($_POST['editsubmit']))
if($editpid) if($editpid)
{ {
$redir = preg_replace("#\.edit.*#si", "", e_QUERY); $redirectFlag = $id;
/* $redir = preg_replace("#\.edit.*#si", "", e_QUERY);
header("Location: ".e_SELF."?{$redir}"); header("Location: ".e_SELF."?{$redir}");
exit; exit; */
} }
} }
if (isset($_POST['replysubmit'])) if (isset($_POST['replysubmit']))
{ { // Reply to nested comment being posted
if ($table == "news" && !$sql->db_Select("news", "news_allow_comments", "news_id='{$nid}' ")) if ($table == "news" && !$sql->db_Select("news", "news_allow_comments", "news_id='{$nid}' "))
{ {
header("location:".e_BASE."index.php"); header("location:".e_BASE."index.php");
@ -104,7 +103,8 @@ if (isset($_POST['replysubmit']))
else else
{ {
$row = $sql->db_Fetch(); $row = $sql->db_Fetch();
if (!$row['news_id']) { if (!$row['news_id'])
{
$pid = (isset($_POST['pid']) ? $_POST['pid'] : 0); $pid = (isset($_POST['pid']) ? $_POST['pid'] : 0);
$pid = intval($pid); $pid = intval($pid);
@ -115,42 +115,44 @@ if (isset($_POST['replysubmit']))
$cobj->enter_comment($clean_authorname, $clean_comment, $table, $nid, $pid, $clean_subject); $cobj->enter_comment($clean_authorname, $clean_comment, $table, $nid, $pid, $clean_subject);
$e107cache->clear("comment.php?{$table}.{$id}"); $e107cache->clear("comment.php?{$table}.{$id}");
} }
//plugin e_comment.php files $redirectFlag = $nid;
}
}
if ($redirectFlag)
{ // Need to go back to original page
// Check plugin e_comment.php files
$plugin_redir = false; $plugin_redir = false;
$e_comment = $cobj->get_e_comment(); $e_comment = $cobj->get_e_comment();
if ($table == $e_comment[$table]['eplug_comment_ids']){ if ($table == $e_comment[$table]['eplug_comment_ids'])
{
$plugin_redir = TRUE; $plugin_redir = TRUE;
$reply_location = str_replace("{NID}", $nid, $e_comment[$table]['reply_location']); $reply_location = str_replace("{NID}", $redirectFlag, $e_comment[$table]['reply_location']);
} }
if ($plugin_redir) if ($plugin_redir)
{ {
echo "<script type='text/javascript'>document.location.href='{$reply_location}'</script>\n"; echo "<script type='text/javascript'>document.location.href='{$reply_location}'</script>\n";
exit; exit;
} elseif ($table == "news" || $table == "poll") }
else
{ {
echo "<script type='text/javascript'>document.location.href='".e_BASE."comment.php?comment.{$table}.{$nid}'</script>\n"; switch ($table)
exit;
} elseif($table == "bugtrack")
{ {
echo "<script type='text/javascript'>document.location.href='".e_PLUGIN."bugtracker/bugtracker.php?show.{$nid}'</script>\n"; case "news" :
case "poll" :
echo "<script type='text/javascript'>document.location.href='".e_BASE."comment.php?comment.{$table}.{$redirectFlag}'</script>\n";
exit; exit;
} elseif($table == "faq") break;
{ case "download" :
echo "<script type='text/javascript'>document.location.href='".e_PLUGIN."faq/faq.php?cat.{$xid}.{$nid}'</script>\n"; echo "<script type='text/javascript'>document.location.href='".e_BASE."download.php?view.{$redirectFlag}'</script>\n";
exit; exit;
} elseif ($table == "content") break;
{ case "page" :
echo "<script type='text/javascript'>document.location.href='".e_BASE."content.php?{$_POST['content_type']}.{$nid}'</script>\n"; echo "<script type='text/javascript'>document.location.href='".e_BASE."page.php?{$redirectFlag}'</script>\n";
exit;
} elseif ($table == "download")
{
echo "<script type='text/javascript'>document.location.href='".e_BASE."download.php?view.{$nid}'</script>\n";
exit;
} elseif ($table == "page")
{
echo "<script type='text/javascript'>document.location.href='".e_BASE."page.php?{$nid}'</script>\n";
exit; exit;
break;
} }
} }
} }
@ -174,8 +176,9 @@ if ($action == "reply")
if ($subject == "") if ($subject == "")
{ {
if ($table == "news") switch ($table)
{ {
case "news" :
if (!$sql->db_Select("news", "news_title", "news_id='{$nid}' ")) if (!$sql->db_Select("news", "news_title", "news_id='{$nid}' "))
{ {
header("location: ".e_BASE."index.php"); header("location: ".e_BASE."index.php");
@ -187,51 +190,41 @@ if ($action == "reply")
$subject = $news['news_title']; $subject = $news['news_title'];
$title = COMLAN_100; $title = COMLAN_100;
} }
} case "poll" :
elseif ($table == "poll") if (!$sql->db_Select("polls", "poll_title", "poll_id='{$nid}' "))
{ {
if (!$sql->db_Select("polls", "poll_title", "poll_id='{$nid}' ")) {
header("location:".e_BASE."index.php"); header("location:".e_BASE."index.php");
exit; exit;
} else { }
else
{
list($poll['poll_title']) = $sql->db_Fetch(); list($poll['poll_title']) = $sql->db_Fetch();
$subject = $poll['poll_title']; $subject = $poll['poll_title'];
$title = COMLAN_101; $title = COMLAN_101;
} }
} break;
elseif ($table == "content") case 'download' :
if ($sql->db_Select('download','download_name',"download_id={$nid} "))
{ {
$sql->db_Select("content", "content_heading", "content_id='{$nid}'"); $row = $sql->db_Fetch();
$subject = $content['content_heading']; $subject = $row['download_name'];
$title = COMLAN_106;
} }
elseif ($table == "bugtracker") else
{ {
$sql->db_Select("bugtrack", "bugtrack_summary", "bugtrack_id='{$nid}'"); header("location:".e_BASE."index.php");
$subject = $content['content_heading']; exit;
}
break;
} }
} }
if ($table == "content")
{
$sql->db_Select("content", "content_type", "content_id='{$nid}'");
list($content['content_type']) = $sql->db_Fetch();
if ($content['content_type'] == "0") {
$content_type = "article";
$title = COMLAN_103;
} elseif ($content['content_type'] == "3") {
$content_type = "review";
$title = COMLAN_104;
} elseif ($content['content_type'] == "1") {
$content_type = "content";
$title = COMLAN_105;
}
}
define('e_PAGETITLE', $title." / ".COMLAN_99." / ".COMLAN_102.$subject.""); define('e_PAGETITLE', $title." / ".COMLAN_99." / ".COMLAN_102.$subject."");
require_once(HEADERF); require_once(HEADERF);
} }
else else
{ { // Default code if not reply
// Check cache
if ($cache = $e107cache->retrieve("comment.php?{$table}.{$id}")) if ($cache = $e107cache->retrieve("comment.php?{$table}.{$id}"))
{ {
require_once(HEADERF); require_once(HEADERF);
@ -241,13 +234,9 @@ else
} }
else else
{ {
if ($table == "news") switch ($table)
{ {
/* case "news" :
changes by jalist 19/01/05:
updated db query removed one call
*/
if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled']) if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'])
{ {
$query = "SELECT COUNT(tb.trackback_pid) AS tb_count, n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n $query = "SELECT COUNT(tb.trackback_pid) AS tb_count, n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
@ -285,11 +274,9 @@ else
$ix = new news; $ix = new news;
$ix->render_newsitem($news, "extend"); // extend so that news-title-only news text is displayed in full when viewing comments. $ix->render_newsitem($news, "extend"); // extend so that news-title-only news text is displayed in full when viewing comments.
$field = $news['news_id']; $field = $news['news_id'];
$comtype = 0;
} }
} break;
else if($table == "poll") case "poll" :
{
if (!$sql->db_Select("polls", "*", "poll_id='{$id}'")) if (!$sql->db_Select("polls", "*", "poll_id='{$id}'"))
{ {
header("location:".e_BASE."index.php"); header("location:".e_BASE."index.php");
@ -304,30 +291,72 @@ else
require_once(HEADERF); require_once(HEADERF);
require(e_PLUGIN."poll/poll_menu.php"); require(e_PLUGIN."poll/poll_menu.php");
$field = $row['poll_id']; $field = $row['poll_id'];
$comtype = 4;
if(!$comments_poll) if(!$comments_poll)
{ {
require_once(FOOTERF); require_once(FOOTERF);
exit; exit;
} }
}
}
require_once(HEADERF); require_once(HEADERF);
} }
break;
case 'download' :
if ($sql->db_Select('download','download_name',"download_id={$id} "))
{
$row = $sql->db_Fetch();
$subject = $row['download_name'];
$title = COMLAN_106;
$field = $id;
require_once(HEADERF);
}
else
{
header("location:".e_BASE."index.php");
exit;
}
break;
default : // Hope its a plugin table
$e_comment = $cobj->get_e_comment();
if ($table == $e_comment[$table]['eplug_comment_ids'])
{
if ($sql->db_Select($table,$e_comment[$table]['db_title'],$e_comment[$table]['db_id']."={$id} "))
{
$row = $sql->db_Fetch();
$subject = $row[$e_comment[$table]['db_title']];
$title = $e_comment[$table]['plugin_name'];
$field = $id;
require_once(HEADERF);
}
else
{
header("location:".e_BASE."index.php");
exit;
}
}
else
{ // Error - emit some debug code
require_once(HEADERF);
echo "Comment error: {$table} Field: {$e_comment['db_id']} ID {$id} Title: {$e_comment['db_title']}<br />";
echo "<pre>";
var_dump($e_comment);
echo "</pre>";
}
}
}
} }
if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == "news") if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == "news")
{ {
echo "<span class='smalltext'><b>".$pref['trackbackString']."</b> ".$e107->http_path.e_PLUGIN."trackback/trackback.php?pid={$id}</span>"; echo "<span class='smalltext'><b>".$pref['trackbackString']."</b> ".$e107->http_path.e_PLUGIN."trackback/trackback.php?pid={$id}</span>";
} }
$field = ($field ? $field : ($id ? $id : ""));
$field = ($field ? $field : ($id ? $id : "")); // ID of associated source item
$width = (isset($width) && $width ? $width : ""); $width = (isset($width) && $width ? $width : "");
$cobj->compose_comment($table, $action, $field, $width, $subject, $rate=FALSE); $cobj->compose_comment($table, $action, $field, $width, $subject, $rate=FALSE);
if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == "news"){ if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == "news")
{
if($sql->db_Select("trackback", "*", "trackback_pid={$id}")) if($sql->db_Select("trackback", "*", "trackback_pid={$id}"))
{ {
$tbArray = $sql -> db_getList(); $tbArray = $sql -> db_getList();

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/download.php,v $ | $Source: /cvs_backup/e107_0.8/download.php,v $
| $Revision: 1.18 $ | $Revision: 1.19 $
| $Date: 2007-11-21 22:52:45 $ | $Date: 2008-05-25 08:26:11 $
| $Author: e107steved $ | $Author: e107steved $
| |
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
@ -399,6 +399,8 @@ if ($action == "view")
$dl = $sql -> db_Fetch(); $dl = $sql -> db_Fetch();
$comment_edit_query = 'comment.download.'.$id;
$load_template = 'download_template'; $load_template = 'download_template';
if (!isset($DOWNLOAD_VIEW_TABLE)) eval($template_load_core); if (!isset($DOWNLOAD_VIEW_TABLE)) eval($template_load_core);
if(!defined("DL_IMAGESTYLE")){ define("DL_IMAGESTYLE","border:0px");} if(!defined("DL_IMAGESTYLE")){ define("DL_IMAGESTYLE","border:0px");}

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/comment_shortcodes.php,v $ | $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/comment_shortcodes.php,v $
| $Revision: 1.5 $ | $Revision: 1.6 $
| $Date: 2008-05-24 12:45:34 $ | $Date: 2008-05-25 08:26:11 $
| $Author: e107steved $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@ -110,7 +110,8 @@ if ($pref['allowCommentEdit'] && USER && $comrow['user_id'] == USERID && $comrow
} }
else else
{ {
return "<a href='".e_SELF."?".$comment_edit_query.".edit.".$comrow['comment_id']."'><img src='".e_IMAGE."packs/".$imode."/generic/newsedit.png' alt='".COMLAN_318."' title='".COMLAN_318."' style='border: 0;' /></a>"; // return "<a href='".e_SELF."?".$comment_edit_query.".edit.".$comrow['comment_id']."'><img src='".e_IMAGE."packs/".$imode."/generic/newsedit.png' alt='".COMLAN_318."' title='".COMLAN_318."' style='border: 0;' /></a>";
return "<a href='".e_BASE."comment.php?".$comment_edit_query.".edit.".$comrow['comment_id']."'><img src='".e_IMAGE."packs/".$imode."/generic/newsedit.png' alt='".COMLAN_318."' title='".COMLAN_318."' style='border: 0;' /></a>";
} }
} }
else else

View File

@ -12,8 +12,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/comment_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/comment_class.php,v $
| $Revision: 1.11 $ | $Revision: 1.12 $
| $Date: 2008-05-24 15:14:36 $ | $Date: 2008-05-25 08:26:11 $
| $Author: e107steved $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@ -32,7 +32,7 @@ require_once(e_FILE."shortcode/batch/comment_shortcodes.php");
class comment { class comment {
/** /**
* Enter description here... * Display the comment editing form
* *
* @param unknown_type $action * @param unknown_type $action
* @param unknown_type $table * @param unknown_type $table
@ -47,7 +47,8 @@ class comment {
{ {
//rating : boolean, to show rating system in comment //rating : boolean, to show rating system in comment
global $pref, $sql, $tp; global $pref, $sql, $tp;
if(isset($pref['comments_disabled']) && $pref['comments_disabled'] == TRUE){ if(isset($pref['comments_disabled']) && $pref['comments_disabled'] == TRUE)
{
return; return;
} }
@ -65,7 +66,8 @@ class comment {
if ($pref['nested_comments']) if ($pref['nested_comments'])
{ {
$text .= "<tr>\n<td style='width:20%'>".COMLAN_324."</td>\n<td style='width:80%'>\n<input class='tbox comment subject' type='text' name='subject' size='61' value='".$tp -> toForm($subject)."' maxlength='100' />\n</td>\n</tr>"; $text .= "<tr>\n<td style='width:20%'>".COMLAN_324."</td>\n<td style='width:80%'>\n
<input class='tbox comment subject' type='text' name='subject' size='61' value='".$tp -> toForm($subject)."' maxlength='100' />\n</td>\n</tr>";
$text2 = ""; $text2 = "";
} }
else else
@ -78,7 +80,7 @@ class comment {
$eaction = 'edit'; $eaction = 'edit';
$id = $_GET['comment_id']; $id = $_GET['comment_id'];
} }
else if (strstr(e_QUERY, "edit")) elseif (strstr(e_QUERY, "edit"))
{ {
$eaction = "edit"; $eaction = "edit";
$tmp = explode(".", e_QUERY); $tmp = explode(".", e_QUERY);
@ -96,9 +98,9 @@ class comment {
} }
if(isset($eaction) && $eaction == "edit") if(isset($eaction) && $eaction == "edit")
{ { // Get existing comment
$id=intval($id); $id=intval($id);
$sql -> db_Select("comments", "*", "comment_id='$id' "); $sql -> db_Select("comments", "*", "comment_id='{$id}' ");
$ecom = $sql -> db_Fetch(); $ecom = $sql -> db_Fetch();
if (isset($ecom['comment_author'])) if (isset($ecom['comment_author']))
{ // Old comment DB format { // Old comment DB format
@ -111,18 +113,18 @@ class comment {
} }
if($prid != USERID || !USER) if($prid != USERID || !USER)
{ { // Editing not allowed
echo "<div style='text-align: center;'>".COMLAN_329."</div>"; echo "<div style='text-align: center;'>".COMLAN_329."</div>";
require_once(FOOTERF); require_once(FOOTERF);
exit; exit;
} }
$caption = COMLAN_318; $caption = COMLAN_318;
$comval = $tp -> toFORM($ecom['comment_comment']); $comval = $tp -> toForm($ecom['comment_comment']);
$comval = preg_replace("#\[ ".COMLAN_319.".*\]#si", "", $comval); $comval = preg_replace("#\[ ".COMLAN_319.".*\]#si", "", $comval);
} }
else else
{ { // New comment - blank form
$caption = COMLAN_9; $caption = COMLAN_9;
$comval = ""; $comval = "";
} }
@ -136,16 +138,17 @@ class comment {
if(!is_object($rater)){ $rater = new rater; } if(!is_object($rater)){ $rater = new rater; }
$rate = $rater -> composerating($table, $itemid, $enter=TRUE, USERID, TRUE); $rate = $rater -> composerating($table, $itemid, $enter=TRUE, USERID, TRUE);
$rate = "<tr><td style='width:20%; vertical-align:top;'>".COMLAN_327.":</td>\n<td style='width:80%;'>".$rate."</td></tr>\n"; $rate = "<tr><td style='width:20%; vertical-align:top;'>".COMLAN_327.":</td>\n<td style='width:80%;'>".$rate."</td></tr>\n";
} } //end rating area
//end rating area
if (ANON == TRUE && USER == FALSE) if (ANON == TRUE && USER == FALSE)
{ { // Box for author name (anonymous comments - if allowed)
$text .= "<tr>\n<td style='width:20%; vertical-align:top;'>".COMLAN_16."</td>\n<td style='width:80%'>\n<input class='tbox comment author' type='text' name='author_name' size='61' value='$author_name' maxlength='100' />\n</td>\n</tr>"; $text .= "<tr>\n<td style='width:20%; vertical-align:top;'>".COMLAN_16."</td>\n<td style='width:80%'>\n<input class='tbox comment author' type='text' name='author_name' size='61' value='{$author_name}' maxlength='100' />\n</td>\n</tr>";
} }
$text .= $rate."<tr> \n $text .= $rate."<tr> \n
<td style='width:20%; vertical-align:top;'>".COMLAN_8.":</td>\n<td id='commentform' style='width:80%;'>\n<textarea class='tbox comment' id='comment' name='comment' cols='62' rows='7' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>$comval</textarea>\n<br /> <td style='width:20%; vertical-align:top;'>".COMLAN_8.":</td>\n<td id='commentform' style='width:80%;'>\n<textarea class='tbox comment' id='comment' name='comment' cols='62' rows='7' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>$comval</textarea>\n<br />
".display_help('helpb',"comment")."</td></tr>\n<tr style='vertical-align:top'> \n<td style='width:20%'>".$text2."</td>\n<td id='commentformbutton' style='width:80%;'>\n". (isset($action) && $action == "reply" ? "<input type='hidden' name='pid' value='$id' />" : '').(isset($eaction) && $eaction == "edit" ? "<input type='hidden' name='editpid' value='$id' />" : "").(isset($content_type) && $content_type ? "<input type='hidden' name='content_type' value='$content_type' />" : ''). "<input class='button' type='submit' name='".$action."submit' value='".(isset($eaction) && $eaction == "edit" ? COMLAN_320 : COMLAN_9)."' />\n</td>\n</tr>\n</table>\n</form></div>"; ".display_help('helpb',"comment")."</td></tr>\n<tr style='vertical-align:top'> \n<td style='width:20%'>".$text2."</td>\n
<td id='commentformbutton' style='width:80%;'>\n
". (isset($action) && $action == "reply" ? "<input type='hidden' name='pid' value='{$id}' />" : '').(isset($eaction) && $eaction == "edit" ? "<input type='hidden' name='editpid' value='{$id}' />" : "").(isset($content_type) && $content_type ? "<input type='hidden' name='content_type' value='{$content_type}' />" : ''). "<input class='button' type='submit' name='".$action."submit' value='".(isset($eaction) && $eaction == "edit" ? COMLAN_320 : COMLAN_9)."' />\n</td>\n</tr>\n</table>\n</form></div>";
if($tablerender) if($tablerender)
{ {
@ -162,7 +165,7 @@ class comment {
} }
} }
else else
{ { // Comment entry not allowed - point to signup link
echo "<br /><div style='text-align:center'><b>".COMLAN_6." <a href='".e_SIGNUP."'>".COMLAN_321."</a> ".COMLAN_322."</b></div>"; echo "<br /><div style='text-align:center'><b>".COMLAN_6." <a href='".e_SIGNUP."'>".COMLAN_321."</a> ".COMLAN_322."</b></div>";
} }
} }
@ -502,19 +505,21 @@ class comment {
/** /**
* Enter description here... * Enter description here...
* *
* @param unknown_type $table * @param unknown_type $table - the source table for the associated item
* @param unknown_type $action * @param unknown_type $action - usually 'comment' or 'reply'
* @param unknown_type $id * @param unknown_type $id - ID of item associated with comments (e.g. news ID)
* @param unknown_type $width * @param unknown_type $width - appears to not be used
* @param unknown_type $subject * @param unknown_type $subject
* @param unknown_type $rate * @param unknown_type $rate
*/ */
function compose_comment($table, $action, $id, $width, $subject, $rate=FALSE, $return=FALSE, $tablerender=TRUE){ function compose_comment($table, $action, $id, $width, $subject, $rate=FALSE, $return=FALSE, $tablerender=TRUE)
{
//compose comment : single call function will render the existing comments and show the form_comment //compose comment : single call function will render the existing comments and show the form_comment
//rate : boolean, to show/hide rating system in comment, default FALSE //rate : boolean, to show/hide rating system in comment, default FALSE
global $pref, $sql, $ns, $e107cache, $tp, $totcc; global $pref, $sql, $ns, $e107cache, $tp, $totcc;
if(isset($pref['comments_disabled']) && $pref['comments_disabled'] == TRUE){ if(isset($pref['comments_disabled']) && $pref['comments_disabled'] == TRUE)
{
return; return;
} }
@ -597,6 +602,9 @@ class comment {
return (!$return) ? "" : $ret; return (!$return) ? "" : $ret;
} }
function recalc_user_comments($id) function recalc_user_comments($id)
{ {
global $sql; global $sql;
@ -678,7 +686,7 @@ class comment {
$fl = new e_file; $fl = new e_file;
$omit = array('^\.$','^\.\.$','^\/$','^CVS$','thumbs\.db','.*\._$','.bak$'); $omit = array('^\.$','^\.\.$','^\/$','^CVS$','thumbs\.db','.*\._$','.bak$');
$files = $fl->get_files(e_PLUGIN, $fmask = 'e_comment.php', $omit, $recurse_level = 1, $current_level = 0); $files = $fl->get_files(e_PLUGIN, 'e_comment.php', $omit, 1, 0);
foreach($files as $file){ foreach($files as $file){
unset($e_comment, $key); unset($e_comment, $key);
@ -754,7 +762,7 @@ class comment {
SELECT c.*, u.*, ue.* FROM #comments AS c SELECT c.*, u.*, ue.* FROM #comments AS c
LEFT JOIN #user AS u ON c.comment_author_id = u.user_id LEFT JOIN #user AS u ON c.comment_author_id = u.user_id
LEFT JOIN #user_extended AS ue ON c.comment_author_id = ue.user_extended_id LEFT JOIN #user_extended AS ue ON c.comment_author_id = ue.user_extended_id
WHERE c.comment_id!='' ".$qry1." ORDER BY c.comment_datestamp DESC LIMIT ".intval($from1).",".intval($amount1)." "; WHERE c.comment_id!='' AND c.comment_blocked = 0 ".$qry1." ORDER BY c.comment_datestamp DESC LIMIT ".intval($from1).",".intval($amount1)." ";
if ($comment_total = $sql->db_Select_gen($query)) if ($comment_total = $sql->db_Select_gen($query))
{ {

View File

@ -4,8 +4,8 @@
| e107 website system - Language File. | e107 website system - Language File.
| |
| $Source: /cvs_backup/e107_0.8/e107_languages/English/lan_comment.php,v $ | $Source: /cvs_backup/e107_0.8/e107_languages/English/lan_comment.php,v $
| $Revision: 1.4 $ | $Revision: 1.5 $
| $Date: 2007-12-25 12:43:05 $ | $Date: 2008-05-25 08:26:11 $
| $Author: e107steved $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@ -30,6 +30,7 @@ define("COMLAN_102", "Replying to: ");
define("COMLAN_103", "Article"); define("COMLAN_103", "Article");
define("COMLAN_104", "Review"); define("COMLAN_104", "Review");
define("COMLAN_105", "Content"); define("COMLAN_105", "Content");
define("COMLAN_106", "Download");
define("COMLAN_145", "Registered: "); define("COMLAN_145", "Registered: ");
define("COMLAN_194", "Guest"); define("COMLAN_194", "Guest");
define("COMLAN_195", "Registered member"); define("COMLAN_195", "Registered member");

View File

@ -12,9 +12,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/content/content.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/content/content.php,v $
| $Revision: 1.18 $ | $Revision: 1.19 $
| $Date: 2008-02-20 21:42:25 $ | $Date: 2008-05-25 08:26:11 $
| $Author: lisa_ $ | $Author: e107steved $
+---------------------------------------------------------------+ +---------------------------------------------------------------+
*/ */
@ -1062,9 +1062,11 @@ function show_content_item(){
global $pref, $content_pref, $custom, $plugindir, $plugintable, $array, $content_shortcodes, $datequery, $order, $nextprevquery, $from, $number, $row, $qs, $gen, $sql, $aa, $tp, $rs, $cobj, $e107, $e107cache, $eArrayStorage, $ns, $rater, $ep, $row, $authordetails, $mainparent; global $pref, $content_pref, $custom, $plugindir, $plugintable, $array, $content_shortcodes, $datequery, $order, $nextprevquery, $from, $number, $row, $qs, $gen, $sql, $aa, $tp, $rs, $cobj, $e107, $e107cache, $eArrayStorage, $ns, $rater, $ep, $row, $authordetails, $mainparent;
global $CONTENT_CONTENT_TABLE_TEXT, $CONTENT_CONTENT_TABLE_PAGENAMES, $CONTENT_CONTENT_TABLE_SUMMARY, $CONTENT_CONTENT_TABLE_CUSTOM_TAGS, $CONTENT_CONTENT_TABLE_PARENT, $CONTENT_CONTENT_TABLE_INFO_PRE, $CONTENT_CONTENT_TABLE_INFO_POST, $CM_AUTHOR, $CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA, $CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA; global $CONTENT_CONTENT_TABLE_TEXT, $CONTENT_CONTENT_TABLE_PAGENAMES, $CONTENT_CONTENT_TABLE_SUMMARY, $CONTENT_CONTENT_TABLE_CUSTOM_TAGS, $CONTENT_CONTENT_TABLE_PARENT, $CONTENT_CONTENT_TABLE_INFO_PRE, $CONTENT_CONTENT_TABLE_INFO_POST, $CM_AUTHOR, $CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA, $CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA;
global $CONTENT_CONTENT_TABLE_PREV_PAGE, $CONTENT_CONTENT_TABLE_NEXT_PAGE; global $CONTENT_CONTENT_TABLE_PREV_PAGE, $CONTENT_CONTENT_TABLE_NEXT_PAGE;
global $comment_edit_query;
$mainparent = $aa -> getMainParent(intval($qs[1])); $mainparent = $aa -> getMainParent(intval($qs[1]));
$content_pref = $aa -> getContentPref($mainparent, true); $content_pref = $aa -> getContentPref($mainparent, true);
$comment_edit_query = 'comment.pcontent.'.$qs[1];
show_content_search_menu("item", $mainparent); //show navigator/search/order menu show_content_search_menu("item", $mainparent); //show navigator/search/order menu
$array = $aa -> getCategoryTree("", $mainparent, TRUE); $array = $aa -> getCategoryTree("", $mainparent, TRUE);