?

Log in

No account? Create an account

Previous Entry | Next Entry

Questions about Poe...

  • Mar. 22nd, 2008 at 6:15 PM
Hello! I decided yesterday to overhaul my layout, and i've got it looking mostly the way I want, but a couple things are still eluding me. I was up all night poking at it and my brain is fried; I did look through tags, but right now I'm suspecting the problem is me and not the code. Any help would be greatly appreciated.

1. Change the colour of the links list after each entry. For some reason I do not understand, this code is not working (nor is anything else I've tried):
.asset-meta-list a:link,
.asset-meta-list a:visited {
color : #26482A;
}

2. Get rid of the empty space at the bottom of the layout. There's a bunch of unnecessary padding there and I can't figure out where it's coded. Basically, go from this to this.

[ETA] 3. On my friends' page view, because there is no subtitle, the header jumps up and scalps the boys in my design. Any way to fix this/give the header a fixed height?

Also, not really a help question, but is it just me or has Poe disappeared from the list of layout options on the customize page? Hrm..

So I don't feel like a drain, there are several old posts here with people asking how to achieve the spiffy date format in Expressive. None of them were answered; I don't know if anyone's since figured it out and just never posted, but I figured it out for my layout so I thought I'd share in case anyone else wanted to use it. :) Be gentle; I'm self-taught and my code's always a little messy.

First I changed the way some of the date stuff prints (in a theme layer):

function lang_posted_by_date_and_time(EntryLite e, bool showposter, bool showdate, bool showtime) : string {
    var string posted = "";
    var string dayfmt_ent = "%%day%%";      # Day format to use for entries.
    var string datefmt_ent = $*lang_fmt_date_med;        # Date format to use for entries.
                             # Default is $*lang_fmt_date_med (%%mon%%. %%dayord%%, %%yyyy%%)
    var string timefmt_ent = "%%h%%:%%min%% %%a%%m";        # Time format to use for entries.
                             # Default is %%h%%:%%min%% %%A%%M
    var string datefmt_com = "med";        # Date format to use for comments.
                             # Default is $*lang_fmt_date_med (%%mon%%. %%dayord%%, %%yyyy%%)
    var string timefmt_com = "short";        # Date format to use for comments.
                             # Default is "short", which looks like entry time default with lowercase "am/pm".

    if ($showdate and $showtime) { # Show both on entries and comments, with "at" in entries
        if ($e.depth > 0) { # If $e is a comment
            $posted = $e->time_display($datefmt_com, $timefmt_com);
        } else {
            var string date_time = "%%day%%, " + $*lang_fmt_date_med + " at %%h%%:%%min%% %%a%%m";
            $posted = $e->time_display($date_time, "none");
        }
    } else {
        if ($showdate) { # Only showing date
            $posted = $e->time_display($datefmt_ent, "none");
        } else { # Only showing time (date is already shown in subject)
            $posted = $e->time_display("none", $timefmt_ent);
        }
    }
    return $posted;
}


Then I changed the way the entry prints to put the subject and date in the same table, and arrange the date the way I wanted it (you can just assert the colours directly here, or I guess you could assign them classes and change the colours in your CSS). Note that this code also moves your user-icon to the right side of the entry, under the date. (The short version would be just using what's in red in place of the datetime stamp.)

function print_entry(Page p, EntryLite e, Color bgcolor, Color fgcolor, bool hide_text) {
# Moves the user-pic next to entry header
    var bool showposter = false;
    if (not $e.poster->equals($e.journal)) { $showposter = true; }

    var Comment c;
    var Entry en;
    if ($e isa Comment) {
        $c = $e as Comment;
    } else {
        $en = $e as Entry;
    }

    var string id = "";
    if (defined $c) {
        $id = " id=\"asset-$e.journal.username-$c.talkid\"";
    } else {
        $id = " id=\"asset-$e.journal.username-$en.itemid\"";
    }

    """
    <div$id class="post-asset asset">
      <div class="asset-inner">
        <div class="asset-header">
          <div class="asset-header-inner">
           <div class="asset-header-content">
              <div class="asset-header-content-inner">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="43"><td align="left" valign="top">
                <span class="asset-name page-header2">""";

    if (defined $en) {
        if (defined $en.security_icon) {
            """<span class="lj-entry-securityicon">$en.security_icon</span> """;
        }
    }

    var string subject  = "";
    var string datetime = "";
    var string myday = "";
    var string mydate = "";
    var string mytime = "";


    if ($e.subject != "") {
        $subject  = striphtml($e.subject);
    } else {
        $subject  = $*text_nosubject;
    }

    $datetime = lang_posted_by_date_and_time($e, $showposter, true, true);
    $myday = $e.time->date_format("%%day%%");
    $mydate = $e.time->date_format($*lang_fmt_date_med);
    $mytime = $e.time->date_format("%%h%%:%%min%% %%a%%m");



    """<a href="$e.permalink_url">$subject</a>
</span></td>
<td align="right">

<font style=\"font-size:22px; font-family:Georgia; color: #47714C; line-height:8px; letter-spacing:6px;\">$myday </font><br><font style=\"font-size:14px; color:#000000; font-family:Georgia; line-height:8px; letter-spacing:2px\">$mydate</font><br><font style=\"font-size:12px; color:#FFFFFF; font-family:Georgia;\">$mytime</font>

</td></table></div></div></div></div> <!-- end asset-header -->
        <div class="asset-content">
            <div class="asset-body">""";

# Print the user-pic inside of .asset-header but before .asset-header-content
    var bool showuserpic = $*opt_userpic_main;
    if ($p.view == "friends") {
        $showuserpic = $*opt_userpic_friends;
    }
    if ($p.view == "entry") {
        $showuserpic = $*opt_userpic_entrypage;
    }

    var string userpic = ($showuserpic and defined $e.userpic) ? ($e.userpic + "<br />") : "";
    if ($showuserpic) {
        if ($bgcolor) {
            """<span class="user-icon" style="border: 1px; padding: 2px; background-color: $bgcolor;">$userpic""";
        } else {
            """<span class="user-icon">$userpic""";
        }
    }

    var string posted = "";
    if ($p.view == "friends") {
        if (not $e.poster->equals($e.journal)) {
           $posted = $posted + colored_ljuser($e.poster, $bgcolor, $fgcolor) + "<br />";
        }
        $posted = $posted + colored_ljuser($e.journal, $bgcolor, $fgcolor);
    } else {
        if (not $e.poster->equals($e.journal)) {
            $posted = $posted + $e.poster;
        }
    }
    print "$posted";

    if ($showuserpic) {
        print "</span>";
    }

    $e->print_text();
    "</div>\n";

    if (defined $en) {
        $en->print_metadata();
    }

    "</div>\n";
    $p->print_reply_container({"target" => "entrycomment", "class" => "quickreply"});

    $e->print_linkbar();

    """<div class="asset-footer"></div>\n</div>\n</div>\n""";
    if ($*entry_footer != "") {

        println safe $*entry_footer;
    }
}


I'm sure there's a lot of redundancy there that someone more skilled in code can chop, but it works, so I'm happy. :)

Comments

( 2 comments — Leave a comment )
av8rmike
Mar. 23rd, 2008 01:07 am (UTC)
Yeah, that's a lot of stuff to cover. First of all, your two images about the padding at the bottom aren't loading, but I'm not seeing any padding in your journal. For #1: The base stylesheet is weird in that it has the column ID with some of the color specifiers. In other words, try this instead:

#alpha .asset-meta-list a,
#alpha .asset-meta-list a:visited {
color : #26482A;
}

For #3, I would add height: 210px; to the .layout-wt #header-inner{} section. That will fix the image size in all page views.

Finally, thanks for doing the "spiffy date format"! Although, it's not quite the most elegant way to do it. I'm not sure why you're using a <table> in the header, and the <font> tag is pretty much obsolote. If you want, I can try to streamline it for you.
av8rmike
Mar. 23rd, 2008 01:12 am (UTC)
Oh, and about the "Poe" theme: Apparently, there was only supposed to be the "Nevermore" theme in Mixit, not both. Poe as a theme was removed a long time ago, according to janinedog (Source here).
( 2 comments — Leave a comment )

Latest Month

March 2016
S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728293031  

S2 Help Communities

Tags

Powered by LiveJournal.com
Designed by chasethestars