every breath is a victory (moveablehistory) wrote in component_help,
every breath is a victory
moveablehistory
component_help

  • Music:

modifying page summaries

I'm revamping my layout for the_lj_reboot, and so far all of the tutorials here have been very helpful, but I have come across a small problem: I'm using masterslacker's page summary tutorial, and I've managed to get my summary to look like this →





What I really want is this:





I've tried tables - which didn't work out so well, ack - and css things like float:left, etc, but to no avail. Any help would be greatly appreciated. :)

My code at present is as follows:


# Change the way RecentPage and FriendsPage summaries print. (FriendsPage inherits from RecentPage)
function RecentPage::lay_print_summary() {

   # print the header of the component and determine the size of the entries array
   print_comp_header($*page_summary_text);
   var int size = size $.entries - 1;
   if ($size<0) { return; }

   # loop on the entries
   foreach var int pos (0..$size) {

      # Get the Entry and start the summary line
      var Entry e = $.entries[$pos];
      var string subject = ($e.subject!=""?$e->plain_subject():"<i>(no subject)</i>");
      """<div>""";

      # On the Friends page print: <poster_name> : <journal_name> : <security_icon> <subject> [+<comment_count>]
      if ($.view=="friends") {
         """$e.poster """;
         if ($e.journal.username!=$e.poster.username) { """: $e.journal : """; }
         if (defined $e.security_icon) { """$e.security_icon """; }
         """<a href="#$e.journal.username$e.itemid">$subject</a>""";
         if ($e.comments.count>0) { """ <a href="$e.comments.read_url">[+$e.comments.count]</a>"""; }

      # On the Recent page print: <date> <time> : <security_icon> <subject> [+<comment_count>]
      }else{ # recent page
         """$e.mood_icon<br/>"""; if (defined $e.security_icon) { """$e.security_icon """; }
         """<a href="#item$e.itemid">$subject</br></a>""";
         print $e.time->date_format()+" "+$e.time->time_format()+" :" ;
         if ($e.comments.count>0) { """ <a href="$e.comments.read_url">[+$e.comments.count]</a>"""; 
	}

      # Close if..else loop and end the summary line
      }
      """</div>""";

      # If it's not the last summary line, print a seperator bar
      if ($size!=$pos) { 
        """
        <div class="medLine"><img src="http://www.livejournal.com/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></div>
        <div class="ltLine"><img src="http://www.livejournal.com/palimg/component/clear.gif" width="1" height="1" alt="" border="0" /></div>
        """; 
      }

   # End the loop for entries
   }

   # Print the component footer when done.
   print_comp_footer();
}



and my layerid is #7383625.

Thanks!

edit: solved. thank you!
Subscribe

  • Ok, I'm no CSS expert...

    ...but I simply changed my sidebar from the right to the left and it doesn't appear 'wrong' when you go to read comments. The only problem is, I'd…

  • Hello? LJ? Bueller?

    It's been over a month since the sidebar of component has been whacked OUT (pushed down under the entry when you go to comment), so how come there…

  • Sidebar as Topbar

    Name: marilla_pm67 Account: Permanent I would like to modify a layout I already have : - This is the live preview - This is the…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 3 comments