kunzite (kunzite1) wrote in component_help,
kunzite
kunzite1
component_help

  • Mood:

recent entries component

note: this is not valid functional code, i need help
anyway, snappybrat asked about a recent entries component and ive got some of the logic done. some of it might not be required, but, im not sure. so, if you other programmers could take a look at it, thatd be cool. and i realized a little bit later that on the lj portal, you can set up these little boxes that do just that, so, yeah, and also the new digital megaplex layout (the layout that xevinx currently has) has a sidebar with recent entries. just some thingies you might wanna look at. oh, they also asked for there to be a scrollbar, so, i guess if it shows more than 5 entries, there should be a scrollbar. and, the person adding this component to their page should also be able to choose the max number of entries linked to.
print_comp_header("recent entries");
var YearMonth latestYMonth = $p->get_latest_month(); # get latest month with posts
var int latestMonth = $latestYMonth.month; # get month number
var int numEntries; # declare int for number of entries in month

# somehow get the array of entries from recentpage class so we can play with it

$numEntries = size($Entry); # get number of entries in month

var int i = $numEntries - 1; # iteration variable to step thru the array
# decremented for use in array

foreach $i ($numEntries - 1 .. 0){
"""<a href="$Entry[$i].permalink.url">""";
if($Entry[$i] != ""){
"""$Entry[$i].subject"""; # if theres a subject, print it
} else {
"""$*text_nosubject"""; # if there isnt a subject, print the "no subject" variable
}
"""</a><br />"""; # close link and make new line
}
print_comp_footer();

recent entries
xmas shopping
oops
nikki
melissa's movie nite
my amazon.com wishlist
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 2 comments