I'm posting this by request, and also because I've done something fun with shadows on the spiffy date format.
All of this comes from the tutorials created by the gurus at
component_help - thanks, folks!
Screenshot here:
http://pics.livejournal.com/crazypills/pic/0000cb7a/ layerinfo "source_viewable" = 1;
layerinfo "type" = "theme";
layerinfo "name" = "crazypills theme";
function Page::print_custom_head() {
"""
""";
}
#######################################################################################################################
function CommentInfo::print() {
if (not $.enabled) { return; }
if ($.count > 0 or $.screened) {
$this->print_readlink();
"""
""";
}
$this->print_postlink();
}
#######################################################################################################################
### Override the print_my_entries so we can make a custom titles and/or title sub components
function print_my_entries(Page p, string title) {
# Because we are going to override the Page title, and there is no function to draw the component borders for such
# a thing, we need to do it all by hand. For the curved corner pieces, we need to match the color to the rest of your
# component. To do this, we need to set a variable to be used since it cannot be obtained from the stylesheet.
var Color header = $*header_bgcolor;
var Color headerMinus5 = $header->darker(50);
var Color headerPlus3 = $header->lighter(30);
var string corner_color = "/p0"+$headerPlus3->substr(1,6)+"1"+$headerMinus5->substr(1,6)+"2"+$header->substr(1,6);
# Start the column for the body. Do not delete this line
"""""";
# Start the new title component.
"""
""";
# Now we put the actual title content in. You can put whatever you want here. As an example, I've the following lines
# will insert the Title on all pages and Subtitle only on the recent page, and centered in the component. If you don't
# want something centered, remove the and tags surrounding it it.
# Also, as an example, the blue line shows how to add an image above your title, but it is commented since it is incomplete.
# If you'd like to an an image above the title, decomment the line by removing the # in front it and complete the URL.
# If you are curious, the different "views" for condition checking are {recent, friends, day, reply, entry, month, year}.
"""
""";
# print the Full Title of the page [Journal title and Page specific title]:
"""
"""; print $p->title(); """ """;
# print the Journal Subtitle if it exists, and if we're on the recent page :
if ($p.global_subtitle!="" and $p.view=="recent") {
"""
"""; print $p.global_subtitle; """ """;
}
# Close off the title component and place a spacer after it.
"""
""";
print_spacer();
# Now we are finished up with our custom title, and we can print the rest of the page.
$p->print_body();
} # end of Function print_my_entries
#######################################################################################################################
### 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) {
# Print the anchor to be used in the page summary.
if ($p.view=="friends") {
"""""";
} else { # for recent, day, entry pages.
"""""";
}
var string noscroll ;
if ($p.view == "recent" or $p.view == "friends") {
$noscroll = "class=\"fixed\"" ;
}
var string content_top = """
""";
# Print the header for the entry. For specifications of available formats or how to construct
# your own formats, you can see:
http://www.livejournal.com/doc/s2/siteapi.core1.html#siteapi.core1.dateformats print_entry_header(
"
"+$e.time->date_format("%%day%%")+"
"+$e.time->date_format("%%day%%")+"
"+$e.time->date_format("long")+"
"+$e.time->date_format("long")+"
"+$e.time->time_format()+"
"+$e.time->time_format()+""
);
print_system_box_top();
"""""";
# Check to see if we need to display a usericon and/or journal names, and if so, then print them
# Cases - 1. We are viewing a friends page, so we need to display icons if they exist and journal/poster names
# 2. We are viewing a recent/day/entry page, so we display only the icon if it exists and the user has set recent userpics on.
# The code in red is the logic to decide whether or not to show the userpics. You can modify it as you see fit.
if ($p.view=="friends" or ($*show_entry_userpic and defined $e.userpic) or $e.journal.journal_type=="C") {
# Start the table that will hold the icon and/or names
"""
""";
# Display the icon if it exists
if (defined $e.userpic) { """
""";
# If we are on the friends view, then we want to print the extra border around the image that have the colors
# which are custom defined. If you don't like the colors or the border on the friends view, then you can just
# remove the blue segments. By default the recent/day/entry pages have a border around the usericons. If a user
# has a non-rectangular image, this may look strange, so you can replace the 1 with a 0 to remove the border.
#
"""
""";
"""
"""; }
# Display the journal and possibly poster name if we are viewing the friends page or any page on a community
# This code will print the journal the entry was made on, and if the poster is different, will print the poster under it.
# I made the names centered under the image, but if you want to keep them left aligned as in the original, then
# remove the blue segments
if ($p.view=="friends" or $e.journal.journal_type=="C") { """
$e.journal""";
if ($e.journal.username!=$e.poster.username) {"""
$e.poster""";
} """
""";
}
"""
"""; }
# Start the main entry text area
print $content_top;
# If the subject is not empty, then print it followed by the line to seperate it from the entry text
# You can modify the lines in red if you want to adjust the way your subject prints, but the other lines must remain as is.
if ($e.subject!="") { """
$e.subject
"""; }
"""
""";
# Print the entry text.
""" $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
"""
""";
# and then we print the mood label, followed by a mood icon if one exists, followed by the mood text.
# If you want the mood icon to be after the mood text, then you need to change the order of the two lines in red.
""" $*text_meta_mood : """;
if (defined $e.mood_icon) { """ $e.mood_icon """; }
print $e.metadata{"mood"};
"""
""";
# if ($e.metadata{"music"}=="") { """
"""; }
}
# 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"}=="") { """
"""; }
# then print the actual music label and the music
""" $*text_meta_music : """; print $e.metadata{"music"};
# """
""";
}
# Close off the entry text area
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.
"""
""";
# First we print the comment links if the entry allows comments
if ($e.comments.enabled) {
$e.comments->print();
}
"""
""";
"""
""";
# Then the entry related buttons
"""
""";
# The easiest way to do this, which will work for all account types, is as follows, and will display actual buttons.
# If you'd like text instead of buttons, then remove the following line in blue, decomment the lines in pink,
# and edit as you see fit. Note that using the print_linkbar function will also add next and previous buttons to the
# Entry page (with comments), and I've reflected that in the pink lines below.
if($e.security != ""){ print $e.security_icon; }
$e->print_linkbar();
"""
""";
# End the entry component and put a spacer after it so that entry components are seperated.
"""""";
print_system_box_bottom();
"""
""";
} # end of Function print_entry
#######################################################################################################################
set first_position = "free_text_order";
set second_position = "none";
set third_position = "none";
set fourth_position = "none";
set fifth_position = "none";
set sixth_position = "none";
set show_free_text = true;
function print_free_text(Page p) {
print_nav_comp($p); # navigation component
print_calendar($p); # calendar
print_comp_header("Crazy Independence");
"""
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
-- Robert Heinlein
""";
print_comp_footer();
# Start Music / Movie / Book Components
var string k1Mheader = "Currently Listening To"; # title of component
var string k1Mheight = "350px"; # height of component
var Color k1Mborder = "#000000"; # bordercolor for images
var Color k1Mbg;
var string[] k1Msrc;
var string[] k1Malt;
var string[] k1Mtitle;
var string[] k1Murl;
# set one
$k1Msrc[0] = "
http://images.amazon.com/images/P/B0002S94RK.01.LZZZZZZZ.jpg";
$k1Malt[0] = "Beautifully Human: Words & Sounds 2 - Jill Scott";
$k1Mtitle[0] = "Beautifully Human: Words & Sounds 2 - Jill Scott";
$k1Murl[0] = "
http://www.amazon.com/exec/obidos/tg/detail/-/B0002S94RK/";
# set two
$k1Msrc[1] = "
http://images.amazon.com/images/P/B0001CNQ9O.01.LZZZZZZZ.jpg";
$k1Malt[1] = "Bargrooves: Frosted";
$k1Mtitle[1] = "Bargrooves: Frosted";
$k1Murl[1] = "
http://www.amazon.com/exec/obidos/ASIN/B0001CNQ9O/";
# set three
$k1Msrc[2] = "
http://images.amazon.com/images/P/B00007HMLQ.01.LZZZZZZZ.jpg";
$k1Malt[2] = "Mr Jones [IMPORT] - Tom Jones";
$k1Mtitle[2] = "Mr Jones [IMPORT] - Tom Jones";
$k1Murl[2] = "
http://www.amazon.com/exec/obidos/tg/detail/-/B00007HMLQ/";
# set four
$k1Msrc[3] = "
http://images.amazon.com/images/P/B00025L4I0.01.LZZZZZZZ.jpg";
$k1Malt[3] = "Nip/Tuck";
$k1Mtitle[3] = "Nip/Tuck";
$k1Murl[3] = "
http://www.amazon.com/exec/obidos/tg/detail/-/B00025L4I0/";
# set five
$k1Msrc[4] = "
http://images.amazon.com/images/P/B0001CCYBK.01.LZZZZZZZ.jpg";
$k1Malt[4] = "Ethnomixicology - Outernationalists";
$k1Mtitle[4] = "Ethnomixicology - Outernationalists";
$k1Murl[4] = "
http://www.amazon.com/exec/obidos/tg/detail/-/B0001CCYBK/";
# copy sets as necessary
# make sure that the index numbers (bolded numbers) are the same in each group
# this program will step thru them in numerical order
print_comp_header($k1Mheader);
"""
""";
foreach var int i (0 .. (size($k1Msrc) - 1)){
$k1Mbg = ($i % 2 == 0) ? $*main_bgcolor : $*comp_bgcolor;
"""
""";
if($k1Murl[$i] != "") { """
"""; }
"""
""";
if($k1Murl[$i] != "") { """"""; }
"""
$k1Mtitle[$i]
""";
}
"""
""";
print_comp_footer();
var string k1Fheader = "Some Favorite Films"; # title of component
var string k1Fheight = "400px"; # height of component
var Color k1Fborder = "#000000"; # bordercolor for images
var Color k1Fbg;
var string[] k1Fsrc;
var string[] k1Falt;
var string[] k1Ftitle;
var string[] k1Furl;
# set one
$k1Fsrc[0] = "
http://images.amazon.com/images/P/B00005JNB0.01.LZZZZZZZ.jpg";
$k1Falt[0] = "Open Water";
$k1Ftitle[0] = "Open Water";
$k1Furl[0] = "
http://www.amazon.com/exec/obidos/ASIN/B00005JNB0/";
# set two
$k1Fsrc[1] = "
http://images.amazon.com/images/P/B00005V3Z4.01.LZZZZZZZ.jpg";
$k1Falt[1] = "Donnie Darko";
$k1Ftitle[1] = "Donnie Darko";
$k1Furl[1] = "
http://www.amazon.com/exec/obidos/tg/detail/-/B00005V3Z4/";
# set three
$k1Fsrc[2] = "
http://images.amazon.com/images/P/B00005JMJG.01.LZZZZZZZ.jpg";
$k1Falt[2] = "Eternal Sunshine of the Spotless Mind";
$k1Ftitle[2] = "Eternal Sunshine of the Spotless Mind";
$k1Furl[2] = "
http://www.amazon.com/exec/obidos/tg/detail/-/B00005JMJG/";
# set four
$k1Fsrc[3] = "
http://images.amazon.com/images/P/B0000640VJ.01.LZZZZZZZ.jpg";
$k1Falt[3] = "The Royal Tenenbaums";
$k1Ftitle[3] = "The Royal Tenenbaums";
$k1Furl[3] = "
http://www.amazon.com/exec/obidos/tg/detail/-/B0000640VJ/";
# set five
$k1Fsrc[4] = "
http://images.amazon.com/images/P/B00003W8NM.01.LZZZZZZZ.jpg";
$k1Falt[4] = "Fight Club";
$k1Ftitle[4] = "Fight Club";
$k1Furl[4] = "
http://www.amazon.com/exec/obidos/tg/detail/-/B00003W8NM/";
# copy sets as necessary
# make sure that the index numbers (bolded numbers) are the same in each group
# this program will step thru them in numerical order
print_comp_header($k1Fheader);
"""
""";
foreach var int i (0 .. (size($k1Fsrc) - 1)){
$k1Fbg = ($i % 2 == 0) ? $*main_bgcolor : $*comp_bgcolor;
"""
""";
if($k1Furl[$i] != "") { """
"""; }
"""
""";
if($k1Furl[$i] != "") { """"""; }
"""
$k1Ftitle[$i]
""";
}
"""
""";
# comment this section if this is in the non-print_free_text section of the page_layout function when using the components on both sides tutorial
print_comp_footer();
print_links($p); # links
# $p->lay_print_summary(); # summary component
# print_comp_header("Free text 2");
# """
# Free text 2
# """;
# print_comp_footer();
# print_comp_header("Free text 3");
# """
# Free text 3
# """;
# print_comp_footer();
# print_comp_header("Free text 4");
# """
# Free text 4
# """;
# print_comp_footer();
# print_comp_header("Free text 5");
# """
# Free text 5
# """;
# print_comp_footer();
# print_comp_header("Free text 6");
# """
# Free text 6
# """;
# print_comp_footer();
}