| unique.wonders. ( @ 2008-03-07 23:08:00 |
TUTORIAL: [Entries] Custom Entries
!!! Recently Updated !!!
Preview
» link
Difficulty Level

Related Tutorials
Instructions
» Copy and paste the code located in the box.
» If you already have some of these properties somewhere in your code, do not copy/paste them again.
» Read the code for further instructions on how to change settings and data. Instructions are in green. Settings and data you can change are in red.
» Spot the blue lines if you need to insert some related tutorials.
» Enjoy! :)
» If you already have some of these properties somewhere in your code, do not copy/paste them again.
» Read the code for further instructions on how to change settings and data. Instructions are in green. Settings and data you can change are in red.
» Spot the blue lines if you need to insert some related tutorials.
» Enjoy! :)
Known Issues
» If scrollbars are activated, random vertical scrollbars and extra space below metatada may appear. This issue is not fixable. An alternate solution it to cut off large content. Activate the scrollbars then, in the code, turn overflow: auto into overflow: hidden. People using Firefox or any other smart browser can also use the following CSS instead:
.entry img {
max-width: 500px;
}
.entry img {
max-width: 500px;
}
Thanks & Credit
» Credit goes to
kunzite1 and
xtomxfallsx for writing the original version of this tutorial, and to
daimones for making scrollbars work.
» Heartfelt thanks to
hollywoodism,
leanasidhe,
sam42 and
bellemelange for beta-testing this and giving precious feedback.
» Heartfelt thanks to
####################################################
# CUSTOM ENTRIES (V5) #
# overrides: #
# Entry::print_metadata() #
# CommentInfo::print_readlink #
# CommentInfo::print_postlink #
# CommentInfo::print() #
# Entry::lay_print_linkbar() #
# print_entry() #
# source: #
# component_help/1196581.html #
####################################################
#===============================================
#
# PROPERTIES PERTAINING TO ENTRIES #
#
#===============================================
### SUBJECT PROPERTY ###
# Text to be used when there is no subject. You can't use HTML.
# See below if you want to activate it.
set text_nosubject = "(no subject)";
### SECURITY ICON PROPERTIES ###
# Alternative text for security icons. You can't use HTML.
# Can also be used to replace the icons. See below.
set text_icon_alt_protected = "[protected post]";
set text_icon_alt_private = "[private post]";
set text_icon_alt_groups = "[custom friends groups post]";
### USERPIC PROPERTIES ###
# Display userpics on the recent page: true or false?
# Display userpics on the reply page and entry page: true or false?
# See below for other pages.
set show_entry_userpic = true;
set show_entrypage_userpic = true;
### METADATA PROPERTIES ###
# Text for metadata labels. You can't use HTML.
# See below to edit the label for Current Tags.
# See below if you want to use images instead of text.
set text_meta_location = "Current Location:";
set text_meta_mood = "Current Mood:";
set text_meta_music = "Current Music:";
set text_meta_groups = "Custom Friends Groups:";
### COMMENT LINKS PROPERTIES ###
# You can't use HTML.
# See below if you want to use images instead.
set text_post_comment = "Leave a comment";
set text_post_comment_friends = "Leave a comment";
set text_max_comments = "Maximum comments reached";
set text_read_comments = "1 comment // # comments";
set text_read_comments_friends = "1 comment // # comments";
set text_month_screened_comments = "w/ Screened";
set comment_divider = "or";
### PERMALINK PROPERTY ###
# Text for the permalink. You can't use HTML.
# See below if you want to deactivate it.
set text_permalink = "Link";
### LINKBAR PROPERTIES ###
# Alternative text for the linkbar icons. You can't use HTML.
# If you want to hide a link, delete what's between the quotes.
# You also have to delete the image URL (see further down).
# See further down if you want text to replace images.
set text_edit_entry = "Edit Entry";
set text_edit_tags = "Edit Tags";
set text_tell_friend = "Tell a Friend";
set text_mem_add = "Add to Memories";
set text_watch_comments = "Track This";
set text_unwatch_comments = "Untrack This";
set text_flag = "Flag";
set text_entry_prev = "Previous Entry";
set text_entry_next = "Next Entry";
#===============================================
#
# METADATA #
#
#===============================================
# Activate tags. Do not change this.
set tags_aware = true;
function Entry::print_metadata()
{
var string[] metadata = [];
var string{} meta_images = {};
var string{} meta_labels = {};
##### START CONFIGURATION. THIS IS WHERE YOU SET YOUR OPTIONS. #####
### PRESENTATION OPTION ###
# Order of the metadata. Move the names to change the order. Do not change the syntax (quotes and commas).
$metadata =
[
"location",
"mood",
"music",
"tags",
"groups"
];
# Mood icon on the left of all the metadata: true or false?
var bool wrap_metadata = false;
### LABEL OPTIONS ###
# Text used as labels. Edit the one for tags. Include punctuation if you want some.
# If you decide you'd rather have an image (see below), it will serve as a caption.
# The other labels must be edited in properties (see above).
$meta_labels =
{
"tags" => "Current Tags:",
"location" => $*text_meta_location,
"mood" => $*text_meta_mood,
"music" => $*text_meta_music,
"groups" => $*text_meta_groups,
};
# If you'd rather use images, enter their URLs between the quotes on the right. Leave blank if you prefer text.
$meta_images =
{
"tags" => "",
"location" => "",
"mood" => "",
"music" => "",
"groups" => "",
};
### TAG OPTIONS ###
# Set this to true if you want the tags header to link to Edit Entry Tags.
var bool show_edit_tags_link = false;
# Character used as a separator between tags. Include punctuation and space.
var string tags_separator = ", ";
### LOCATION OPTIONS ###
# Set this to true to delinkify location.
var bool vanilla_location = true;
### GROUPS OPTIONS ###
# Set this to true to delinkify groups.
var bool vanilla_groups= true;
### STYLING OPTIONS FOR METADATA LABELS ###
# Opening. You can use HTML of course.
var string meta_label_open = """<strong>""";
# Closing. You can use HTML of course.
var string meta_label_close = """</strong> """;
### STYLING OPTIONS FOR METADATA VALUES ###
# Opening. You can use HTML.
var string meta_val_open= "";
# Closing. You can use HTML.
var string meta_val_close = """<br />""";
##### END CONFIGURATION. #####
##### DO NOT EDIT ANY OF THE FOLLOWING CODE UNLESS YOU KNOW WHAT YOU'RE DOING! #####
var string currents_open = """<div class="entryMetadata">""";
var string currents_close= """</div>""";
var bool have_meta = (size($.metadata) > 0); # do we have meta?
var bool have_tags = ((size($.tags) > 0) and $*tags_aware); # do we have tags?
var int tcount = 0;
var string currents = "";
var string image = "";
var string k = "";
var string label = "";
var string meta = "";
var string tag = "";
var string val = "";
var Tag t = new Tag;
var Link edit_tags = $this->get_link("edit_tags"); # helper var to see if remote user can edit tags
### Metadata in a Box ###
### Insert all the variables here. ###
### Print metadata if we should.
if ($have_meta or $have_tags)
{
### Metadata in a Box ###
### Replace this line with $currents = $currents_open + $meta_box_open + $currents; ###
$currents = $currents_open + $currents;
if ($wrap_metadata and defined $.mood_icon) {
var Image i = $.mood_icon;
$currents = $currents + """<table><tr><td><img src="$i.url" width="$i.width" height="$i.height" alt="$*text_meta_mood $.metadata{"mood"}" title="$*text_meta_mood $.metadata{"mood"}" /></td><td>""";
}
# Step through metadata.
foreach $k ($metadata)
{
$label = $meta_labels{$k} != "" ? $meta_labels{$k} : lang_metadata_title($k); # get label
$image = $meta_images{$k} != "" ? $meta_images{$k} : ""; # get image
$val = $.metadata{$k}; # get value
# If we have an image, get it.
if ($image != "") {
$label = """<img src="$image" alt="$label" title="$label" border="0" />""";
}
# Delinkify location if user said so.
if (($k=="location") and $vanilla_location) {
$val = striphtml($val);
}
# Delinkify groups if user said so.
if (($k=="groups ") and $vanilla_groups ) {
$val = striphtml($val);
}
if ($k=="mood") {
if (defined $.mood_icon)
{
var Image i = $.mood_icon;
if (not $wrap_metadata) {
$val = """<img src="$i.url" width="$i.width" height="$i.height" alt="$*text_meta_mood $.metadata{"mood"}" title="$*text_meta_mood $.metadata{"mood"}" /> $val""";
}
}
}
## If tags.
if (($k=="tags") and ($have_tags==true)) {
# If remote user can edit tags and users wants a link, give them a link.
if($edit_tags.url != "" and $show_edit_tags_link) {
$label = """<a href="$edit_tags.url">$label</a>""";
}
# Build the tags list.
foreach $t ($.tags) {
$tag = """<a href="$t.url">$t.name</a>""";
$val = $val + $tag;
$tcount++;
# If we haven't hit the last tag, add a separator.
if ($tcount < size($.tags)) {
$val = $val + "$tags_separator";
}
}
} # End of tags.
# If we have a val, build meta.
if ($val != "") {
$meta = $meta_label_open + $label + $meta_label_close + $meta_val_open + $val + $meta_val_close;
} else {
$meta = "";
}
# add meta to currents
$currents = $currents + $meta;
} # End of metadata.
# Print metadata.
if ($wrap_metadata and defined $.mood_icon) {
$currents = $currents + """</td></tr></table>""";
}
### Metadata in a Box ###
### Replace this line with $currents = $currents + $meta_box_close + $currents_close; ###
$currents = $currents + $currents_close;
println "$currents";
}
}
#===============================================
#
# READ COMMENTS LINK #
#
#===============================================
function CommentInfo::print_readlink()
{
##### START CONFIGURATION. THIS IS WHERE YOU SET YOUR OPTIONS. #####
### Enter your image URL if you want to replace the text link by an image link.
var string img_url = "";
### Enter the width and height of your image URL if you want to replace the text link by an image link.
var int img_width = 0;
var int img_height = 0;
### Set to true if you want to print the number of comments in front of your image.
var bool img_count = false;
##### END CONFIGURATION. #####
##### DO NOT EDIT ANY OF THE FOLLOWING CODE UNLESS YOU KNOW WHAT YOU'RE DOING! #####
if ($.show_readlink) {
var Page p = get_page();
var string url = $.read_url;
var string text = get_plural_phrase($.count, "text_read_comments" + ($p.view == "friends" ? "_friends" : ""));
if ($.screened) {
$text = $text + " " + $*text_month_screened_comments;
}
if ($url != "") {
"""<a href="$url">""";
}
if ($img_url != "") {
if($img_count) {
print $.count;
}
"""<img src="$img_url" width="$img_width" height="$img_height" alt="$text" title="$text" border="0" />""";
} else {
print $text;
}
if ($url != "") {
"""</a>""";
}
}
}
#===============================================
#
# POST COMMENT LINK #
#
#===============================================
function CommentInfo::print_postlink()
{
##### START CONFIGURATION. THIS IS WHERE YOU SET YOUR OPTIONS. #####
### Enter your image URL if you want to replace the text link by an image link.
var string img_url = "";
### Enter the width and height of your image URL if you want to replace the text link by an image link.
var int img_width = 0;
var int img_height = 0;
##### END CONFIGURATION. #####
##### DO NOT EDIT ANY OF THE FOLLOWING CODE UNLESS YOU KNOW WHAT YOU'RE DOING! #####
if($.show_postlink) {
var Page p = get_page();
var string url = $.post_url;
var string text = get_plural_phrase(0, "text_post_comment" + ($p.view == "friends" ? "_friends" : ""));
if ($.maxcomments) {
print safe "$*text_max_comments";
}
else
{
if ($img_url != "") {
if ($p.view == "entry") {
$p->print_reply_link({"target" => "topcomment", "img_url" =>$img_url, "alt" => $*text_post_comment, "title" => $*text_post_comment});
}
else
{
"""<a href="$url"><img src="$img_url" width="$img_width" height="$img_height" alt="$text" title="$text" border="0" /></a>""";
}
} else {
if ($p.view == "entry") {
$p->print_reply_link({"target" => "topcomment", "linktext" => $*text_post_comment});
}
else
{
"""<a href="$url">$text</a>""";
}
}
}
}
}
#===============================================
#
# PRINT COMMENT LINKS #
#
#===============================================
function CommentInfo::print()
{
##### START CONFIGURATION. THIS IS WHERE YOU SET YOUR OPTIONS. #####
### Enter your image URL if you want to replace the text divider by an image.
var string img_url = "";
### Enter the width and height of your image URL if you want to replace the text divider by an image.
var int img_width = 0;
var int img_height = 0;
##### END CONFIGURATION. #####
##### DO NOT EDIT ANY OF THE FOLLOWING CODE UNLESS YOU KNOW WHAT YOU'RE DOING! #####
if ($.show_readlink) {
$this->print_readlink();
if ($.show_postlink) {
if ($img_url != "") {
""" <img src="$img_url" width="$img_width" height="$img_height" alt="$*comment_divider" title="$*comment_divider" border="0" /> """;
} else {
""" $*comment_divider """;
}
}
}
if ($.show_postlink) {
$this->print_postlink();
}
}
#===============================================
#
# PRINT ENTRY LINKBAR #
#
#===============================================
function Entry::lay_print_linkbar() : bool
{
var Page p = get_page();
if (($*show_entrynav_icons and $p.view == "entry") or ($*show_recentnav_icons and ($p.view == "recent" or $p.view == "friends")))
{
##### START CONFIGURATION. THIS IS WHERE YOU SET YOUR OPTIONS. #####
# Position of the linkbar (edit, edit tags, etc.): in its usual place on the side (side) or at the bottom (bottom)?
# !!! THIS OPTION MUST MATCH WHAT YOU'LL CHOOSE IN PRINT ENTRY !!!
var string linkbar_position = "bottom";
### Separator between links in the linkbar. You can edit this. HTML is allowed.
### Note: if you've chosen to have the linkbar in its usual position, this will automatically be set to line-break (<br>) so do not need add it.
var string linkbar_separator = """ """;
### Images used as links. If you'd rather use your own, replace $*edit_img, etc. with your URLs.
### If you want to use text delete what's between the quotes on the right side of the arrows.
### If you want to hide a link, also delete what's between the quotes.
### Make sure you delete the text in Linkbar Properties too (see above).
var string{} linkbar_images =
{
"edit_entry" => "$*edit_img",
"edit_tags" => "$*tags_img",
"mem_add" => "$*mem_img",
"tell_friend" => "$*tellfriend_img",
"flag" => "$*flag_img",
"watch_comments" => "$*track_img",
"unwatch_comments" => "$*untrack_img",
"nav_prev" => "$*backarrow2",
"nav_next" => "$*forwardarrow2",
};
##### END CONFIGURATION. #####
##### DO NOT EDIT ANY OF THE FOLLOWING CODE UNLESS YOU KNOW WHAT YOU'RE DOING! #####
var string{} linkbar_captions =
{
"edit_entry"=> $*text_edit_entry,
"edit_tags"=> $*text_edit_tags,
"mem_add"=> $*text_mem_add,
"tell_friend"=> $*text_tell_friend,
"flag" => $*text_flag,
"watch_comments"=> $*text_watch_comments,
"unwatch_comments" => $*text_unwatch_comments,
"nav_prev"=> $*text_entry_prev,
"nav_next"=> $*text_entry_next,
};
# Set separator to br if linkbar is in its usual position.
$linkbar_separator = ($linkbar_position == "side") ? "<br/>" : $linkbar_separator;
# Get Page handle.
var Page p = get_page();
# Initialize array/hashes.
var string[] link_keyseq = [""];
var string{} link_url = {"" => ""};
var string url = "";
var string text = "";
var string icon = "";
var string linkbar = "";
var bool show_interentry = ($p.view == "entry" or $p.view == "reply");
var int keyseq_index = 0;
if ($show_interentry) {
# If show interentry, put previous entry link first
$link_keyseq[$keyseq_index++] = "nav_prev";
# Get previous entry link information
var Link prev = $this->get_link("nav_prev");
$link_url{"nav_prev"} = $prev.url;
# Get next entry link information
var Link next = $this->get_link("nav_next");
$link_url{"nav_next"} = $next.url;
}
# Gather current linkbar
foreach var string link_key ($.link_keyseq) {
var Link link = $this->get_link($link_key);
$link_url{$link_key} = $link.url;
$link_keyseq[$keyseq_index++] = $link_key; # add this to new link_keyseq array
}
if ($show_interentry) {
# If show interentry, put next entry link last
$link_keyseq[$keyseq_index++] = "nav_next";
}
foreach var string link_key ($link_keyseq) {
$url = $link_url{$link_key};
$text = $linkbar_captions{$link_key};
$icon = $linkbar_images{$link_key};
if ($url != "") {
$linkbar = $linkbar + """<a href="$url">""";
if ($icon != "") {
$linkbar = $linkbar + """<img src="$icon" alt="$text" title="$text" border="0" class="linkbar-img" />""";
} elseif ($text != "") {
$linkbar = $linkbar + "$text";
}
$linkbar = $linkbar + "</a>$linkbar_separator";
}
}
# Hack off last separator.
$linkbar = $linkbar->substr(0, $linkbar->length() - $linkbar_separator->length());
print $linkbar;
return true;
} else {
return false;
}
}
#===============================================
#
# PRINT ENTRIES #
#
#===============================================
function print_entry(Page p, Entry e, Color bgcolor, Color fgcolor, bool hide_text)
{
##### START CONFIGURATION. THIS IS WHERE YOU SET YOUR OPTIONS. #####
### SECURITY ICONS ###
# Show an icon on public entries: true or false?
var bool show_public_icon = false;
# Image URLs for security icons. Replace with your own URLs if you want to.
# If you want to use text, delete what's between the quotes on the right side of the arrows.
var string{} sec_urls =
{
"public" => "http://pics.livejournal.com/kunzite1/pic/000f5p4c",
"protected"=> "$*IMGDIR/icon_protected.gif",
"custom" => "$*IMGDIR/icon_groups.gif",
"private" => "$*IMGDIR/icon_private.gif",
};
# Text used as captions for the images or as text if you don't use images. Edit the one for public entries.
# The rest must be edited in properties.
var string{} sec_alts =
{
"public" => "[public post]",
"protected" => $*text_icon_alt_protected,
"custom" => $*text_icon_alt_groups,
"private" => $*text_icon_alt_private,
};
### USERPIC OPTIONS ###
# Position of userpics: inside or outside?
var string icon_position = "outside";
# Position of userpics: right or left?
var string icon_side = "left";
# User friends colors: true or false?
var bool use_friends_colors = false;
# If userpics are inside, have a border: true or false?
var bool show_border = false;
# Show userpic on friends page/day page: true or false?
# Options for other pages must be edited in properties.
var bool show_friends_userpic = true;
var bool show_day_userpic = false;
### SUBJECT OPTION ###
# When there is no subject display (no subject) text: true or false?
var bool use_nosubject = false;
### METADATA OPTIONS ###
# Position of the metadata: top or bottom?
var string meta_position = "bottom";
# When the userpic's inside and the entry's very short, force the metadata to print below the icon rather next to it: true or false?
var bool meta_wrap = false;
### LINKBAR OPTIONS ###
# Position of the linkbar (edit, edit tags, etc.): in its usual place on the side (side) or at the bottom (bottom)?
# !!! THIS OPTION MUST MATCH WHAT YOU'VE CHOSEN IN PRINT LINKBAR !!!
var string linkbar_position = "bottom";
### PERMALINK OPTION ###
# Display a permalink: true or false?
var bool show_permalink = true;
### SCROLLBAR OPTIONS ###
# Implement horizontal scrollbars: true or false?
# These will make sure your layout doesn't stretch horizontally when large content is posted.
var bool show_hscroll = false;
##### END CONFIGURATION. #####
##### DO NOT EDIT ANY OF THE FOLLOWING CODE UNLESS YOU KNOW WHAT YOU'RE DOING! #####
### Build anchor for the page summary.
var string id = ($p.view == "friends" ? $e.journal.username : "item") + $e.itemid;
$id = """<a name="$id" id="$id"></a>""";
### Build the entry header.
var string entry_header = "";
# Only show public icon if user wants to.
var string show_public = $show_public_icon ? "public" : "";
var string security = ($e.security != "") ? $e.security : $show_public;
### Spiffy Date ###
### Replace these lines with the ones from the tutorial. ###
# Add security icon/text to the entry header.
if ($sec_urls{$security} != "") {
$entry_header = $entry_header + """<img src="$sec_urls{$security}" alt="$sec_alts{$security}" title="$sec_alts{$security}" style="vertical-align: middle;" /> """;
} else {
$entry_header = $entry_header + """$sec_alts{$security} """;
}
# Add date and time to the entry header.
$entry_header = $entry_header + $e.time->time_format();
$entry_header = $entry_header + " ";
$entry_header = $entry_header + ($e.new_day ? "<b>" : "");
$entry_header = $entry_header + $e.time->date_format("long");
$entry_header = $entry_header + ($e.new_day ? "</b>" : "");
### End entry header.
### Spiffy Date ###
### End of code replacement. ###
### Variables for userpics and usernames.
var bool show_poster = ($p.view == "friends" or $p.journal.journal_type == "C");
var bool show_userpic = false;
var bool have_meta = false;
var string padding_pos = "";
var string iconborder = "";
var string icon_data = "";
$padding_pos = (($icon_side == "left") or ($icon_side == "right")) ? (($icon_side == "left") ? "right" : "left") : "";
$icon_data = "";
var bool show_recent_userpic = $*show_entry_userpic; # show userpic on recent page?
var bool show_entry_userpic = $*show_entrypage_userpic; # show userpic on entry page?
var bool show_reply_userpic = $*show_entrypage_userpic; # show userpic on reply page?
$show_userpic = (defined $e.userpic and
(
(($p.view == "recent") and $show_recent_userpic ) or
(($p.view == "friends") and $show_friends_userpic ) or
(($p.view == "day") and $show_day_userpic ) or
(($p.view == "entry") and $show_entry_userpic ) or
(($p.view == "reply") and $show_reply_userpic )
)
);
$have_meta = (( size($e.metadata) > 0) or ((size($e.tags) > 0) and $*tags_aware));
var string friends_background = ($use_friends_colors) ? " background-color: $bgcolor; border: 1px solid $fgcolor;" : "";
### Variable for linkbar.
var string linkbar_side = $icon_side;
### Variable for scrollbar.
var string scrolling = $show_hscroll ? "style='table-layout: fixed;'" : "";
### Print the anchor for the page summary.
print $id;
### Print the entry header.
print_entry_header($entry_header);
### Start the table holding the rest of the entries.
"""
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
<td width="1" class="dkLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" /></td>
<td class="entryHolderBg" width="100%">
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
""";
## Build the userpic and username if they exist/should be shown.
if ($show_poster or $show_userpic) {
# Start inside userpic section.
if ($icon_position == "inside") {
if ($show_border) {
$iconborder = " border: thin solid $*entry_fgcolor;";
}
$icon_data = $icon_data + """<div style="text-align: center; padding: 2px; float: $icon_side; margin-$padding_pos: 4px; margin-bottom: 4px;$iconborder">""";
if ($show_userpic) {
if ($show_poster and $show_userpic) {
$icon_data = $icon_data + """<div style="padding: 3px;$friends_background"><a href="$*SITEROOT/allpics.bml?user=$e.poster.username"><img border="0" src="$e.userpic.url" width="$e.userpic.width" height="$e.userpic.height" alt="$e.poster.name" title="$e.poster.name" /></a></div>""";
} else {
$icon_data = $icon_data + """<div style="padding: 3px;"><img border="0" src="$e.userpic.url" width="$e.userpic.width" height="$e.userpic.height" alt="" /></div>""";
}
}
if ($show_poster) {
$icon_data = $icon_data + """<div class="ljuser">$e.journal""";
if ($e.journal.username != $e.poster.username) {
$icon_data = $icon_data + "<br />$e.poster";
}
$icon_data = $icon_data + """</div>""";
}
$icon_data = $icon_data + """</div>""";
} # End userpic inside section.
else {
# Start outside userpic section.
$icon_data = $icon_data + """
<td valign="top" style="padding-$padding_pos: 8px;">
<table cellspacing="0" cellpadding="0" align="center">""";
if ($show_userpic) {
$icon_data = $icon_data + """<tr>""";
if ($show_poster and $show_userpic) {
$icon_data = $icon_data + """<td><div style="padding-top: 3px; padding-left: 3px; padding-right: 3px; padding-bottom: 3px;$friends_background;" align="center"><a href="$*SITEROOT/allpics.bml?user=$e.poster.username"><img border="0" src="$e.userpic.url" width="$e.userpic.width" height="$e.userpic.height" alt="$e.poster.name" title="$e.poster.name" /></a></div></td>""";
} else {
$icon_data = $icon_data + """<td align="center" class="userpic"><img src="$e.userpic.url" width="$e.userpic.width" height="$e.userpic.height" alt="" /></td>""";
}
$icon_data = $icon_data + """</tr>""";
}
if ($show_poster) {
$icon_data = $icon_data + """<tr><td align="center" class="ljuser">$e.journal""";
if ($e.journal.username!=$e.poster.username) {
$icon_data = $icon_data + """<div align="center" class="ljuser">$e.poster</div>""";
}
$icon_data = $icon_data + """</td></tr>""";
}
$icon_data = $icon_data + """
</table>
</td>""";
}
# End userpic outside section.
}
## End userpic and username section.
## Print the userpic/username section if outside and left.
if ($icon_position == "outside" and $icon_side == "left") {
print $icon_data;
}
### Prints linkbar now if outside right.
if ($linkbar_position == "side" and $linkbar_side == "left") {
"""<td valign="top" style="padding-right: 8px;">"""; $e->lay_print_linkbar(); """</td>""";
}
## Start the entry text area.
"""<td width="100%" valign="top">""";
"""
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
<td width="100%">
<table cellspacing="0" cellpadding="0" width="100%"$scrolling>
<tr>
<td width="1" class="medLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" /></td>
<td class="medLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" /></td>
<td width="1" class="medLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" /></td>
</tr><tr>
<td width="1" class="medLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" /></td>
<td class="entry">
""";
# Print the subject.
var string subject ="";
var string nosubject = $use_nosubject ? $*text_nosubject : "";
$subject = $e.subject!="" ? $e.subject : $nosubject;
if ($subject !="") {
"""<div class="entryHeader">""";
if ($p.view != "entry") { """<a href="$e.permalink_url">$subject</a>"""; } else { print $subject; }
"""</div>
<div class="entryDash"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" /></div>
</td>
<td width="1" class="medLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" /></td>
</tr>
<tr>
<td width="1" class="medLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" /></td>
<td class="entry">""";
}
# Add <div> around entry text and metadata to implement scrollbars.
if ($show_hscroll) {
"""<div style="width: 100%; overflow: auto;">""";
} else {
"""<div>""";
}
# Print the userpic/username section if inside.
if ($icon_position == "inside") {
print $icon_data;
}
# Print the metadata section if it's at the top.
if ($have_meta) {
if($meta_position == "top") {
$e->print_metadata();
print "<div><br /></div>";
}
}
# Print the entry text.
$e->print_text();
# Print the metadata section if it's at the bottom.
if ($have_meta) {
if($meta_position == "bottom") {
if ($meta_wrap) {
print """<div style="clear: both;"><br /></div>""";
} else {
print "<div><br /></div>";
}
$e->print_metadata();
}
}
# Close <div> around entry text and metadata.
"""</div>""";
## End of the entry text area
print_content_bottom();
## Print the comments links and the Quick Reply container.
"""
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="50%" align="left" valign="center"><div class="entryComments">"""; $e.comments->print(); """</div></td>
""";
### Var for permalink. If we have a linkbar, set the alignment to center, otherwise set it to right.
var string permalink_align;
if ($linkbar_position == "bottom") {
$permalink_align = "center";
} else {
$permalink_align = "right";
}
## Print a permanent link to the entry if the user wants to.
if ($show_permalink) {
"""
<td align="$permalink_align" valign="center">
<div class="entryComments"><span style="white-space:nowrap;"><b>( <a href="$e.permalink_url" class="commentLinks">$*text_permalink</a> )<b></span></div>
</td>
""";
}
### Print the linkbar if bottom position.
if ($linkbar_position == "bottom") {
"""<td width="50%" align="right" valign="center"><div class="entryComments">"""; $e->lay_print_linkbar(); """</div></td>""";
}
### Close the comments area.
"""</tr>
</table>
""";
### Quick Reply container.
$p->print_reply_container({"target" => "topcomment"});
### Prints linkbar now if outside right.
if ($linkbar_position == "side" and $linkbar_side == "right") {
"""<td valign="top" style="padding-left: 8px;">"""; $e->lay_print_linkbar(); """</td>""";
}
### Prints icon now if outside right.
if ($icon_position == "outside" and $icon_side == "right") {
print $icon_data;
}
### End the entry component and put a spacer after it so that entry components are separated.
"""
</tr>
</table>""";
### Round Layout ###
### Replace the following code with the one from the Round Entries tutorial. ###
var int cs;
$cs = 5;
if (($linkbar_position == "bottom") or ($icon_position == "inside")) { $cs = 4; }
"""</td>
<td width="1" class="dkLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" /></td>
</tr><tr>
<td width="1" colspan="$cs" class="dkLine"><img src="$*PALIMGROOT/component/clear.gif" width="1" height="1" alt="" /></td>
</tr>
</table>""";
""" <div><img src="$*PALIMGROOT/component/clear.gif" width="3" height="3" alt="" /></div> """;
### Round Layout ###
### End of the replacement. ###
}