kunzite (kunzite1) wrote in component_help,
kunzite
kunzite1
component_help

for narflet

she wanted a working version of replypage::print_body() ... i havent tested this, but it might work. i had some external functions that woulda been tricky to port over to another layer, so, i did my best to integrate them into this function. it wouldnt fit in a comment, so, i made an entry.
###############################
# REPLYPAGE::PRINT_BODY START #
###############################
# COMMENT STYLE
function ReplyPage::print_body() {
   var string replyForm               = "Reply Form";         # heading for reply form
   var string thread_prefix           = "Thread started by "; # how to start the title of the component box containing a thread of comments
   var string anonymous_title         = "Anonymous";          # what do display in place of a name on the component title when it's an anonymous post
   var string anonymous_header        = "<i>(Anonymous)</i>"; # what do display in place of a username in the comment header when it's an anonymous post
   var string ip_open_bracket         = "[";   # opening bracket for around the IP address, placed after the username
   var string ip_close_bracket        = "]";   # closing bracket for around the IP address
   var string link_open_bracket       = "[";   # opening bracket for around the reply/parent/thread links
   var string link_close_bracket      = "]";   # closing bracket for around the reply/parent/thread links
   var string link_seperator          = " | "; # link seperator for between the reply/parent/thread links
   var string permalink_open_bracket  = "(";   # opening bracket for around the reply/parent/thread links
   var string permalink_close_bracket = ")";   # closing bracket for around the reply/parent/thread links
   var string from                    = "$*text_comment_from";    # set from the core property, currently "From:"
   var string date                    = "$*text_comment_date";    # set from the core property, currently "Date:"
   var string select                  = "$*text_multiform_check"; # set from the core property, currently "Select:"
   var string ipaddr                  = "$*text_comment_ipaddr";  # set from the core property, currently "IP address:"
   var string parent                  = "$*text_comment_parent";  # set from the core property, currently "Parent"
   var string reply                   = "$*text_comment_reply";   # set from the core property, currently "Reply"
   var string thread                  = "$*text_comment_thread";  # set from the core property, currently "Thread"
   var string header_bgcolor          = ("$*comments_bgcolor");   # background color for the header section based on screened status
   if ($.replyto.depth==0) {
      print_entry($this, $.entry, new Color, new Color, false);
   } else {
      print_entry($this, $.entry, new Color, new Color, false);
       var EntryLite comment = $.replyto;
      print_entry_header(($comment_prefix)+(defined $comment.poster?$comment.poster.name:$anonymous_title));
"""
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td class="dkLine" width="1"><img src="http://www.livejournal.com/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
<td class="entryHolderBg" width="100%">
""";
      # start the box which contains the comment information. This takes care of the indentation.
"""
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td><img src="http://www.livejournal.com/palimg/component/clear.gif" width="0" height="1"></td>
<td width="100%">	
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td width="1" class="medLine"><img src="http://www.livejournal.com/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
<td class="medLine"><img src="http://www.livejournal.com/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
<td width="1" class="medLine"><img src="http://www.livejournal.com/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
</tr>
<tr>
<td width="1" class="medLine"><img src="http://www.livejournal.com/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
<td class="entry">
""";
        # start the header section
        """
        <div style="background-color: $header_bgcolor; color: $*entry_fgcolor; margin-top: 4px;">
        <table cellpadding="2" cellspacing="0" summary="0" width="100%" bgcolor="$header_bgcolor">""";
                
                # start the first row of the header
                """
                <tr valign="top">""";
                      # place the userpic, which spans the 3 rows.
                      if (defined $comment.userpic) { """ <td rowspan="3" align="center">$comment.userpic</td> """; }
                      # after the userpic place the user who posted the comment
                      """<td align="left" style="white-space: nowrap"><strong>$from</strong>""";
                      if (defined $comment.poster) {
		      # print poster name
		      """$comment.poster""";
                      } else { """ $anonymous_header"""; }
                      """</td>""";
                      """
                      <td align="right"><strong>$permalink_open_bracket<a href="$comment.permalink_url">$*text_permalink</a>$permalink_close_bracket</strong></td>""";
 
                # start the second row
                """
                </tr><tr valign="top">""";
                      # first place the date, spanning two columns (under the username and linkbar)
                      """
                      <td colspan="2" align="left" style="white-space: nowrap"><strong>$date</strong> """; print $comment.time->date_format("long")+" - "+$comment.time->time_format(); """</td>
                      """;

                
                # start the third row
                """
                </tr><tr valign="top">""";
                      # place the subject line spanning all columns, with the subject icon before the actual subject
                      """
                      <td colspan="3" style="width: 95%"><div class="subject"> """;
                      if ($comment.subject!="") {"""$comment.subject""";}
                      """</div></td>
                </tr>""";
                      
        # end the header section
        """
        </table>
        </div>""";
        # place the text 
        """
        <div style="margin-left: 5px">$comment.text</div>""";
      # end the box containg the comment information
"""
</td>
<td width="1" class="medLine"><img src="http://www.livejournal.com/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
</tr>
<tr>
<td width="1" class="medLine"><img src="http://www.livejournal.com/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
<td class="medLine"><img src="http://www.livejournal.com/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
<td width="1" class="medLine"><img src="http://www.livejournal.com/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
</tr>
</table>
</td>
</tr>
</table>
<div><img src="http://www.livejournal.com/palimg/component/clear.gif" width="1" height="3" alt="" border="0" /></div>
""";
"""</td><td width="1" class="dkLine"><img src="$*SITEROOT/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></td></tr><tr><td width="1" colspan=" """;
if($comment.userpic.url != ""){
"""4""";
} else {
"""3""";
""" " class="dkLine"><img src="$*SITEROOT/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></td></tr></table>""";
}
#  """ <div><img src="$*SITEROOT/palimg/component/clear.gif" width="3" height="3" alt="" border="0"></div> """;
       print_spacer();
   }
   print_system_box_top();
   """<a name="replyform"></a><font size="+1">$replyForm</font><br/>""";
       $.form->print();
"""</td><td width="1" class="dkLine"><img src="$*SITEROOT/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></td></tr><tr><td width="1" colspan="3" class="dkLine"><img src="$*SITEROOT/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></td></tr></table>""";
   """<div><img src="$*SITEROOT/palimg/component/clear.gif" width="1" height="3" alt="" border="0"></div>""";
}
#############################
# REPLYPAGE::PRINT_BODY END #
#############################
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 9 comments