Alexander Nicolaysen Sørnes : comment: Set default subject when replying

Chris Morgan cmorgan at winehq.org
Tue Oct 23 18:31:16 CDT 2007


Module: appdb
Branch: master
Commit: d5b029fc613cf880c815450e9bfdde326617a3a4
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=d5b029fc613cf880c815450e9bfdde326617a3a4

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Tue Oct 23 13:25:44 2007 +0200

comment: Set default subject when replying

---

 include/comment.php |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/include/comment.php b/include/comment.php
index e6646d7..8a5d1ba 100644
--- a/include/comment.php
+++ b/include/comment.php
@@ -232,19 +232,13 @@ class Comment {
         // body
         echo htmlify_urls($this->sBody), "<br /><br />\n";
     
-        // only add RE: once
-        if(eregi("RE:", $this->sSubject))
-            $sSubject = $this->sSubject;
-        else
-            $sSubject = "RE: ".$this->sSubject;
-
         $oVersion = new version($this->iVersionId);
         $oM = new objectManager("comment", "Post new ocmment");
         $oM->setReturnTo($oVersion->objectMakeUrl());
         // reply post buttons
         echo "	[<a href=\"".$oM->makeUrl("add")."&amp;iVersionId=$this->iVersionId\"><small>post new</small></a>] \n";
-        echo "	[<a href=\"".$oM->makeUrl("add")."&amp;iVersionId=$this->iVersionId&amp;sSubject=".
-                urlencode("$sSubject")."&amp;iThread=$this->iCommentId\"><small>reply to this</small></a>] \n";
+        echo "	[<a href=\"".$oM->makeUrl("add")."&amp;iVersionId=$this->iVersionId".
+                "&amp;iThread=$this->iCommentId\"><small>reply to this</small></a>] \n";
 
         echo "</td></tr>\n";
 
@@ -605,6 +599,17 @@ class Comment {
                 echo html_frame_start($oRow->subject,500);
                 echo htmlify_urls($oRow->body), "<br /><br />\n";
                 echo html_frame_end();
+
+                /* Set default reply subject */
+                if(!$this->sSubject)
+                {
+                    // Only add RE: once
+                    if(eregi("RE:", $oRow->subject))
+                        $this->sSubject = $oRow->subject;
+                    else
+                        $this->sSubject = "RE: ".$oRow->subject;
+                }
+
             }
         }
 




More information about the wine-cvs mailing list