.·:*Stir Crazy*:·. (sssexygirl) wrote in component_help,
.·:*Stir Crazy*:·.
sssexygirl
component_help

mood music code that works for me

for elfwench


scroll down in your code until you see this tutorial:


### Override the printing of entries. This affects the Recent/Day pages, Friends pages, and Entry pages.
function print_entry(Page p, Entry e, Color bgcolor, Color fgcolor, bool hide_text)

then scroll down until you see this statement:

# If the subject is not empty, then print it followed by the line to seperate it from the entry text
  if ($e.subject!="") { """
        <div class="entryHeader">$e.subject</div>
        <div class="entryDash"><img src="http://www.livejournal.com/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></div>
      </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">
  """; }
  if ($e.text->length() > $maxLength) {

     """<div style="height: 250px; width 545px; overflow: auto;">""";
  } else {
     """<div style="width: 545px; overflow: auto;">""";
  }

erase the code between these sections only and insert new code here between these two sections only.
INSERT CODE HERE

#""" $e.text """;
 
  # Close off the entry text area
  """</div>""";
  print_content_bottom();

  # This is where the fun stuff is!
  # Now we begin the area underneath the entry that holds the comments, link, and entry related buttons.
  """  and it continues on with the rest of the tutorial


add the code in blue, to the spot where i labled insert code here:

------------------------------------------------------------------------
NEW CODE

  var Color  header        = $*header_bgcolor;
  var Color  headerMinus5  = $header->darker(50);
  var Color  headerPlus3   = $header->lighter(30);
  var Color  ltLineColor   = $*header_bgcolor->lighter(30);
  var Color  dkLineColor   = $*header_bgcolor->darker(50);
  var string ltLineString  = $ltLineColor.as_string;
  var string medLineString = $*header_bgcolor.as_string;
  var string dkLineString  = $dkLineColor.as_string;
 
  var string corner_color  = "/p0"+$headerPlus3->substr(1,6)+"1"+$headerMinus5->substr(1,6)+"2"+$header->substr(1,6);
  var string flatbox_open  = """<tr><td colspan=7><table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td valign="top" rowspan="3" colspan="3" width="5"><img src="$*PALIMGROOT/component/curve-top-left.gif$corner_color" 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="$*PALIMGROOT/component/curve-top-right.gif$corner_color" 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="tabBg"><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="tabBg" width="3"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td><td class="tabBg" width="100%"><div align="center" class="compFont">""";
  var string flatbox_close = """</div><td class="tabBg" 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="$*PALIMGROOT/component/curve-bottom-left.gif$corner_color" width="5" height="5" alt="" border="0" /></td><td class="tabBg"><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="$*PALIMGROOT/component/curve-bottom-right.gif$corner_color" 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></td></tr><tr><td colspan=5><img src="$*PALIMGROOT/component/clear.gif" width="1" height="3" alt="" border="0" /></td></tr>""";

 


  # Print the entry text.
  # If you want the entry text to be after the mood and music, then you need to do two things:
  #  - decomment the pink lines by removing the #'s from in front of them
  #  - comment out the blue lines by putting a # in front of them
  """ $e.text """;

  # Print Mood and/or Music Fields:
  # If we have a mood to print

  if ($e.metadata{"mood"}!="") {
    # first we need a spacer after the entry text
    """<br/><br/>""";

   if($e.metadata{"mood"} != "" or $e.metadata{"music"} != "") {   """<table>$flatbox_open""";


    # and then we print the mood label and the mood
    """<b> $*text_meta_mood : </b>"""; print $e.metadata{"mood"};
    # followed by the mood icon if one exists. If you don't want the mood icons to show, remove the line below
    if (defined $e.mood_icon) { """ $e.mood_icon """; }
    """<br/>""";
     #if ($e.metadata{"music"}=="") { """<br/>"""; }


  }
  # If we have music to print
  if ($e.metadata{"music"}!="") {
    # If we didn't print a spacer because the mood was empty, then print one
    if ($e.metadata{"mood"}=="") { """<br/><br/>"""; }
    # then print the actual music label and the music
    """<b> $*text_meta_music : </b>"""; print $e.metadata{"music"};
    # """<br/><br/>""";

  }

   """$flatbox_close</table>""";}



and leave the rest of the tutorial alone. if this does not help notifiy me and i will help you
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 1 comment