kunzite (kunzite1) wrote in component_help,
kunzite
kunzite1
component_help

[theme] - [component] - [customizing the entry page]

##############################
# CUSTOMIZING THE ENTRY PAGE #
# uniquewonders, kunzite1    #
# component-help/1001214     #
# overrides:                 #
#  Page::print_custom_head() #
#  EntryPage::print_body()   #
#  print_comment_bottom()    #
##############################
function Page::print_custom_head() {
"""
<style media="screen" type="text/css">
.holderBg {
  background-color: $*comp_bgcolor;
}
</style>
""";
}

function EntryPage::print_body() {
  var string comments_header    = "Comments";
  var string mass_action_header = "Mass Action";

  var string ctl = palimg_modify("component/curve-top-left.gif",     [PalItem(0, $*inside_border), PalItem(1, $*outside_border), PalItem(2, $*comp_bgcolor)]);
  var string ctr = palimg_modify("component/curve-top-right.gif",    [PalItem(0, $*inside_border), PalItem(1, $*outside_border), PalItem(2, $*comp_bgcolor)]);
  var string cbl = palimg_modify("component/curve-bottom-left.gif",  [PalItem(0, $*inside_border), PalItem(1, $*outside_border), PalItem(2, $*comp_bgcolor)]);
  var string cbr = palimg_modify("component/curve-bottom-right.gif", [PalItem(0, $*inside_border), PalItem(1, $*outside_border), PalItem(2, $*comp_bgcolor)]);

  var string box_open = """
      <table cellspacing="0" cellpadding="0" border="0" width="100%">
        <tr>
          <td valign="top" rowspan="3" colspan="3" width="5"><img src="$ctl" width="5" height="5" alt="" border="0" /></td>
          <td class="dkLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
          <td valign="top" rowspan="3" colspan="3" width="5"><img src="$ctr" width="5" height="5" alt="" border="0" /></td>
        </tr>
        <tr>
          <td class="ltLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
        </tr>
        <tr>
          <td class="holderBg"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td>
        </tr>
        <tr>
          <td class="dkLine" width="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
          <td class="ltLine" width="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
          <td class="holderBg" width="3"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td>
          <td class="entryHolderBg" width="100%">""";

  var string box_close = """
          </td>
          <td class="holderBg" width="3"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td>
          <td class="ltLine" width="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
          <td class="dkLine" width="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
        </tr>
        <tr>
          <td valign="top" rowspan="3" colspan="3" width="5"><img src="$cbl" width="5" height="5" alt="" border="0" /></td>
          <td class="holderBg"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td>
          <td valign="top" rowspan="3" colspan="3" width="5"><img src="$cbr" width="5" height="5" alt="" border="0" /></td>
        </tr>
        <tr>
          <td class="ltLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
        </tr>
        <tr>
          <td class="dkLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
        </tr>
      </table>""";

  # this should be the same as comment_box_close in comment_box_bottom()
  var string comment_box_close = """
      </td>
      <td class="dkLine" width="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
    </tr>
  </table>
  <table cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td valign="top" rowspan="3" width="5"><img src="$cbl" width="5" height="5" alt="" border="0" /></td>
      <td class="compBg"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td>
      <td valign="top" rowspan="3" width="5"><img src="$cbr" width="5" height="5" alt="" border="0" /></td>
    </tr>
    <tr>
      <td class="ltLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
    </tr>
    <tr>
      <td class="dkLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
    </tr>
    <tr>
      <td><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td>
    </tr>
  </table>""";

  set_handler("unscreen_comment_#", [
                                     [ "style_bgcolor", "cmtbar#", "$*comments_bgcolor", ],
                                    ]);
  set_handler("screen_comment_#", [
                                   [ "style_bgcolor", "cmtbar#", "$*comments_screened_bgcolor", ],
                                  ]);

  print_entry($this, $.entry, null Color, null Color, $.viewing_thread);

  if($.entry.comments.enabled and $.comment_pages.total_subitems > 0) {
    if($.multiform_on) {
      $this->print_multiform_start();
    }

    print $box_open;
    """<b>$comments_header</b>""";
    if($.comment_pages.total_subitems > 0) {
      $.comment_pages->print();
    }
    print $box_close;

    print_spacer();

    if($.comment_pages.total_subitems > 0) {
      $this->print_comments($.comments);
      print $comment_box_close;
    }

    print $box_open;
    """<b>""";
    $.entry.comments->print();
    """</b>""";
    if($.comment_pages.total_subitems > 0) {
      $.comment_pages->print();
    }
    print $box_close;

    print_spacer();

    if($.multiform_on) {
      print $box_open;
      """
  <b>
    <h2>$mass_action_header</h2>
    <div style="margin-left: 30px;">""";
      $this->print_multiform_actionline();
      $this->print_multiform_end();
      """
    </div>
  </b>""";
      print $box_close;

      print_spacer();
    }
  }
}

function print_comment_bottom() {

  var string ctl = palimg_modify("component/curve-top-left.gif",     [PalItem(0, $*inside_border), PalItem(1, $*outside_border), PalItem(2, $*comp_bgcolor)]);
  var string ctr = palimg_modify("component/curve-top-right.gif",    [PalItem(0, $*inside_border), PalItem(1, $*outside_border), PalItem(2, $*comp_bgcolor)]);
  var string cbl = palimg_modify("component/curve-bottom-left.gif",  [PalItem(0, $*inside_border), PalItem(1, $*outside_border), PalItem(2, $*comp_bgcolor)]);
  var string cbr = palimg_modify("component/curve-bottom-right.gif", [PalItem(0, $*inside_border), PalItem(1, $*outside_border), PalItem(2, $*comp_bgcolor)]);

  # this should be the same as comment_box_close in EntryPage::print_body()
  var string comment_box_close = """
      </td>
      <td class="dkLine" width="1"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
    </tr>
  </table>
  <table cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td valign="top" rowspan="3" width="5"><img src="$cbl" width="5" height="5" alt="" border="0" /></td>
      <td class="compBg"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td>
      <td valign="top" rowspan="3" width="5"><img src="$cbr" width="5" height="5" alt="" border="0" /></td>
    </tr>
    <tr>
      <td class="ltLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
    </tr>
    <tr>
      <td class="dkLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" border="0" /></td>
    </tr>
    <tr>
      <td><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td>
    </tr>
  </table>""";
  print $comment_box_close;

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

    Error

    Anonymous comments are disabled in this journal

    default userpic
  • 14 comments