I AM NOT SHOUTING, I AM JUST STUCK THIS WAY (tricky_disco) wrote in component_help,
I AM NOT SHOUTING, I AM JUST STUCK THIS WAY
tricky_disco
component_help

*sigh* I give up...

I've tried everything I can think of, gone through miles and miles of LJ codes (old and new) and am still getting nowhere.

As I posted earlier this week, I am having two major probs..



This is my comment header.

The default entry text and the default header are the same colour, which makes the text in the comment header disappear. I remember that in one of my earlier layouts, I was able to specify exactly which colour I wanted for what line of text in there, but for the life of me, I cannot find it. :(

This is the code I'm using:

function EntryPage::print_comment(Comment comment) {



      # define variables used for text layout.

      # If you want to change anything about the text in the layout, change what's in red.

      var string comment_prefix = "Comment by ";  # how to start the title of the component box containing a single comment

      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 = " ";  # space for between 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 = ($comment.screened?"$*comments_screened_bgcolor":"$*comments_bgcolor");  # background color for the header section based on screened status



      # place the anchor for the parent/thread links

      """ <a name="$comment.anchor"></a> """;



      # if we are at a first level comment (ie. directly to an entry), we want to start the component box with the title.

      if ($comment.depth==1) {

        print_entry_header((size $comment.replies >0?$thread_prefix:$comment_prefix)+(defined $comment.poster?$comment.poster.name:$anonymous_title));

        print_comment_top();

      }



      # start the box which contains the comment information. This takes care of the indentation.

      print_comment_content_top($comment);



        # 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" width="100%" style="white-space: nowrap"><strong>$from</strong>""";

                      if (defined $comment.poster) { """$comment.poster"""; } else { """ $anonymous_header"""; }

                      if (viewer_is_owner() and $comment.metadata{"poster_ip"}!="") { """ $ip_open_bracket$ipaddr$comment.metadata{"poster_ip"}$ip_close_bracket"""; }

                      """</td>""";

                      # after the poster, place the linkbar (delete button, screen/unscreen buttons)

                      """

                      <td align="right" style="white-space: nowrap">"""; $comment->print_linkbar(); """</td>""";

                      # after the linkbar place the permanent link to the comment.

                      """

                      <td align="right"><strong>$link_open_bracket<a href="$comment.permalink_url">$*text_permalink</a>$link_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>

                      """;

                      # if the viewer is the owner of the page, place the select box for the multi action selector (delete/screen/unscreen)

                      if (viewer_is_owner()) { """<td align="right" style="white-space: nowrap"><label for="ljcomsel_$comment.talkid">$select</label>"""; $comment->print_multiform_check(); """</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"><div class="subject"> """;

                      if (defined $comment.subject_icon) {"""$comment.subject_icon """;}

                      if ($comment.subject!="") {"""$comment.subject""";}

                      """</div></td>

                </tr>""";

                      

        # end the header section

        """

        </table>

        </div>""";



Then there are my funky metadata boxes....

The box on the right is for the music/tags, but in this case no music or tag was printed and thus it shouldn't show up. Instead I just get this ugly box with some screwed-up border action going on.

When both music and mood are printed, it should look like this:


I honestly wouldn't mind having all of the data in one box, but aligned the same way it does in the two seperate boxes.

This is what my mood/music code looks like:

# Print Mood and/or Music Fields:



  if($e.metadata{"mood"} or $e.metadata{"music"}) {

"""<table align="left" border="0" cellpadding="0" cellspacing="0" width="80px" height="80px">$free_text_header_box_open""";

  

# If we have a mood to print

if ($e.metadata{"mood"}!="") {

    """<b> $*text_meta_mood </b> """;

"""<br/>""";

if (defined $e.mood_icon) { """ $e.mood_icon """; }

"""<br>""";

  

    

    print $e.metadata{"mood"};

"""$free_text_header_box_close</table>""";

  

    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

"""<table align="center" border="0" cellpadding="0" cellspacing="0" width="140px" height="80px">$free_text_header_box_open""";

    """<b> $*text_meta_music </b><br/>"""; print $e.metadata{"music"};

"<br/><br/>";



  }

# Tags



  if ((size $e.tags > 0) and $*tags_aware) {



    var string tags_header          = "file as";



    var string tags_joiner          = ":";



    var int    tcount               = 0;



    var string entry_tag_manage_url = "$*SITEROOT/edittags.bml?journal=$p.journal.username&itemid=$e.itemid";



    """<b>$tags_header$tags_joiner</b> """;



    foreach var Tag t ($e.tags) {



      """<a rel="tag" href="$t.url">$t.name</a>""";



      $tcount++;



      if ($tcount != size $e.tags) { ", "; }



    }



  



    # """<br/><br/></center>""";

  }

"""$free_text_header_box_close</table>""";

}



  

   #""" $e.text """;

  

  # Close off the entry text area

  """</div>""";

  print_content_bottom();


I've been messing with and trying to figure out these for days now, but am not getting any further :( I know there's got to be someone out there that knows what I am doing wrong,...help?

(Wow, it took me 4+ hours to post this thing....)
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 2 comments