Update of /cvsroot/phpslash/phpslash-dev/include/modules/comment
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15436/phpslash-dev/include/modules/comment
Modified Files:
Comment.class index.php
Log Message:
comment submitter's IP or domain should display if not comment Admin.
Index: Comment.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-dev/include/modules/comment/Comment.class,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Comment.class 24 Jun 2003 19:38:36 -0000 1.1
--- Comment.class 26 Oct 2004 19:43:47 -0000 1.2
***************
*** 41,45 ****
$this->perm = $perm;
$this->db = pslNew("slashDB");
! $this->order = $ary['order'];
$this->auth = $auth;
--- 41,45 ----
$this->perm = $perm;
$this->db = pslNew("slashDB");
! $this->order = $ary['asc'];
$this->auth = $auth;
***************
*** 273,285 ****
$ip_ary = explode(".", $ary['ip']);
! if( !$this->perm->have_perm("commentAdmin") ) {
! if( is_numeric($ip_ary[sizeof($ip_ary)-1]) ) {
! $ip_ary[sizeof($ip_ary)-1] = "--";
! } else {
! $ip_ary[0] = "--";
! }
}
- $ary['ip'] = implode(".", $ip_ary);
-
$this->ctempl->set_var(array(
'COMMENT_ID' => $ary['comment_id'],
--- 273,286 ----
$ip_ary = explode(".", $ary['ip']);
! if( !$this->perm->have_perm("comment") ) {
! if( is_numeric($ip_ary[sizeof($ip_ary)-1]) ) {
! $ip_ary[sizeof($ip_ary)-1] = "--";
! } else {
! $ip_ary[0] = "--";
! }
! $ary['ip'] = implode(".", $ip_ary);
! } else {
! $ary['ip'] = '--';
}
$this->ctempl->set_var(array(
'COMMENT_ID' => $ary['comment_id'],
***************
*** 691,695 ****
$fdate = date("Y-m-d H:i:s",time());
$timestamp = time();
! $ip = gethostbyaddr($ary['ip']);
$q = "INSERT INTO psl_comment
(comment_id,
--- 692,696 ----
$fdate = date("Y-m-d H:i:s",time());
$timestamp = time();
! $ip = @gethostbyaddr($ary['ip']);
$q = "INSERT INTO psl_comment
(comment_id,
***************
*** 1167,1181 ****
if ($this->db->next_record()) {
! $ary['action_url'] = $this->psl['rooturl'] . "/comment.php";
if($this->db->Record['author_realname']) {
! debug("here", "good");
! $ary['name'] = clean($this->db->f("author_realname"));
! $ary['email'] = clean($this->db->f("url"));
} else {
! debug("here", "why");
! $ary['name'] = clean($this->db->f("name"));
$ary['email'] = clean($this->db->f("email"));
! }
! $ary['subject'] = clean($this->db->f("subject"));
$ary['comment_text'] = clean($this->db->f("comment_text"));
// $ary['story_id'] = $story_id;
--- 1168,1180 ----
if ($this->db->next_record()) {
! $ary['action_url'] = $this->psl['rooturl'] . "/index.php";
if($this->db->Record['author_realname']) {
! $ary['name'] = clean($this->db->f("author_realname"));
! $ary['email'] = clean($this->db->f("url"));
} else {
! $ary['name'] = clean($this->db->f("name"));
$ary['email'] = clean($this->db->f("email"));
! }
! $ary['subject'] = clean($this->db->f("subject"));
$ary['comment_text'] = clean($this->db->f("comment_text"));
// $ary['story_id'] = $story_id;
Index: index.php
===================================================================
RCS file: /cvsroot/phpslash/phpslash-dev/include/modules/comment/index.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** index.php 26 Jun 2003 18:59:35 -0000 1.3
--- index.php 26 Oct 2004 19:43:57 -0000 1.4
***************
*** 47,52 ****
// when you are previewing a comment before submitting
! $ary['ip'] = gethostbyaddr($HTTP_SERVER_VARS['REMOTE_ADDR']); /* add the poster's IP addr */
!
$ary['replying_to'] = $cmt->formatComment($ary);
$content .= $cmt->getForm($ary);
--- 47,51 ----
// when you are previewing a comment before submitting
! $ary['ip'] = @gethostbyaddr($_SERVER['REMOTE_ADDR']); /* add the poster's IP addr */
$ary['replying_to'] = $cmt->formatComment($ary);
$content .= $cmt->getForm($ary);
***************
*** 56,66 ****
case "Submit Comment":
! $content .= "<BR>Click <A HREF=\"" . $return_link . "\">here</A> to go back<BR>\n";
if ($ary['parent_id']) {
! $content .= "<A HREF=\"" . $_PSL['rooturl'] . "/comment.php?submit=view&story_id=$ary[story_id]&comment_id=$ary[parent_id]&mode=flat\">".pslgetText("View Parent Comment")."</A>\n";
}
!
$content .= getTitlebar("100%", "Submitted Comment");
! $ary['ip'] = $HTTP_SERVER_VARS['REMOTE_ADDR']; /* add the poster's IP addr */
$id = $cmt->update($ary);
--- 55,65 ----
case "Submit Comment":
! // $content .= "<BR>Click <A HREF=\"" . $return_link . "\">here</A> to go back<BR>\n";
if ($ary['parent_id']) {
! $content .= "<a href=\"" . $_PSL['rooturl'] . "/index.php?submit=view&story_id=$ary[story_id]&comment_id=$ary[parent_id]&mode=flat\">".pslgetText("View Parent Comment")."</a><br>\n";
}
! $content .= "<a href=\"" . $_PSL['rooturl'] . "/index.php?submit=view&story_id=".$ary[story_id] ."\">".pslgetText("View All Comments")."</a><br>\n";
$content .= getTitlebar("100%", "Submitted Comment");
! $ary['ip'] = $_SERVER['REMOTE_ADDR']; /* add the poster's IP addr */
$id = $cmt->update($ary);
***************
*** 135,139 ****
}
! $ary['action_url'] = $_PSL['phpself'];
$ary['siteowner'] = $_PSL['site_owner'];
--- 134,138 ----
}
! $ary['action_url'] = $_SERVER['REQUEST_URI'];
$ary['siteowner'] = $_PSL['site_owner'];
|