Tom (xtomxfallsx) wrote in component_help,
Tom
xtomxfallsx
component_help

Customizing The Reply Page

Note: Do not bother commenting on this post to ask for help. I will not respond. Make a new post instead.
This basically goes along with Customizing The Entries (v4.0), It lets you place the icon in various places within the entry on the Reply Page. You can change it to inside or outside and left or right. These variables are independent of the variables in CTE4, so you will have to set the side and position in both places in your code.

##############################
# CUSTOMIZING THE REPLY PAGE #
# By xtomxfallsx             #
# component_help/956033      #
# overrides:                 #
#  ReplyPage::print_body()   #
##############################

function ReplyPage::print_body() {
  var string icon_side = "right";    # userpics on the left or right side?
  var string icon_pos  = "inside";   # userpics inside or outside entries?

  # No need to edit anything below this line
  # ----------------------------------------
  var string time      = $.replyto.time->time_format();
  var string posttime  = "$time " + $.replyto.time->date_format("med");
  var string subject   = ($.replyto.subject) ? "$.replyto.subject" : "";
  var string poster    = (defined $.replyto.poster) ? $.replyto.poster->as_string() : "<i>(Anonymous)</i>";
  var string icon_marg = ($icon_side == "right") ? "left" : "right";
  var string icon_bord = ($icon_pos == "inside") ? """ style="border: thin solid $*entry_fgcolor;" """ : "";
  var string pic       = "";
  var string icon_data = "";

  if (not $.entry.comments.enabled) {
    print "<h2>$*text_reply_nocomments_header</h2><p>$*text_reply_nocomments</p>";
    return;
  }

  if ($.entry.security) {
    $posttime = $.entry.security_icon + " &nbsp; " + $posttime;
  }

  if (defined $.replyto.userpic) {
    $pic = """
    <div align="center">
		  <a href="$*SITEROOT/allpics.bml?user=$.replyto.poster.username">
		   <img src="$.replyto.userpic.url" width="$.replyto.userpic.width" height="$.replyto.userpic.height" alt="$.replyto.poster.name" title="$.replyto.poster.name"$icon_bord />
		  </a>
    </div>""";
  }

  $icon_data = $icon_data + """
  <div style="float: $icon_side; margin-$icon_marg: 4px; padding: 4px;">
    $pic
    <div align="center">$poster</div>
  </div>""";

  print_entry_header($posttime);
  """
  <table cellspacing="0" cellpadding="0" border="0" width="100%">
    <tr>
      <td class="dkLine" width="1">
        <img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" />
      </td>""";
    # if icon position is outside left, stick it here
    if ($icon_pos == "outside" and $icon_side == "left") { """
      <td valign="top" align="center" class="entryHolderBg">
        $pic
        <div>$poster</div>
      </td>""";
    } """
      <td class="entryHolderBg" valign="top" width="100%">
        <table cellspacing="0" cellpadding="0" border="0" width="100%">
          <tr>
            <td width="1" class="medLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
            <td class="medLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
            <td width="1" class="medLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
          </tr>""";
        if ($subject != "") { """
          <tr>
            <td width="1" class="medLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
            <td class="entry">
              <div class="entryHeader">
                $subject
              </div>""";
            if ($.replyto.text != "") { """
              <div class="entryDash"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></div>""";
            }
            """
            </td>
            <td width="1" class="medLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
          </tr>""";
        } """
          <tr>
            <td width="1" class="medLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
            <td class="entry">""";
              # if icon position is inside left or right, stick it here
              if ($icon_pos == "inside") { print $icon_data; } """
              <div>
                $.replyto.text
              </div>
            </td>
            <td width="1" class="medLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
          </tr> <!-- end e.text -->
          <tr>
            <td width="1" class="medLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
            <td class="medLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
            <td width="1" class="medLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
          </tr>
        </table>
        <div class="entryComments">
          <a href=\"$.entry.comments.read_url\">$*text_reply_back</a>
        </div>
      </td>""";
    # if icon position is outside right, stick it here
    if ($icon_pos == "outside" and $icon_side == "right") { """
      <td valign="top" align="center" class="entryHolderBg">
        $pic
        <div>$poster</div>
      </td>""";
    } """
      <td class="dkLine" width="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
    </tr>
    <tr>
      <td colspan="3" class="dkLine" width="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
    </tr>
  </table>
  <div><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></div>""";

  print_system_box_top();
    "<h2>Reply</h2>";
    $.form->print();
  print_system_box_bottom();

}
Tags: admin: deprecated, user: xtomxfallsx
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic
  • 4 comments