# Comments
"""
<div class="clear"> </div>
<div class="comments">""";
### start custom code ###
# Set the basic order in which the links are supposed to appear, from left to right. Available links are:
# edit_entry = edit the entry
# edit_tags = edit the tags assigned to the entry
# mem_add = add to your memories (of the user currently logged in)
# mem_as_comm = add to memories of the community (the "authas"-link, can only be used by owner/moderators of community)
# watch_comments = track/untrack the post
# tell_friend = mail link to friend
# permalink = link to the entry
# comments = read/post comments link
# | = all links before this symbol are printed aligned to the left, all others aligned to the right (standard)
# to print all links aligned right (standard), set "|" first
var string[] link_order = ["edit_entry", "|", "mem_add", "watch_comments", "comments"];
# Set the urls to the images you want to use, or leave the quotes empty.
# read/post comment links can not be set to images here (see Step 7)
var string{} link_images = { "edit_entry" => "IMAGE URL",
"edit_tags" => "IMAGE URL",
"mem_add" => "IMAGE URL",
"mem_as_comm" => "IMAGE URL",
"tell_friend" => "IMAGE URL",
"watch_comments" => "IMAGE URL",
"unwatch_comments" => "IMAGE URL",
"permalink" => "IMAGE URL",
};
# Set the separator that should appear between the individual links or images
# separator between read/post comment links can not be set here (see Step 6)
var string link_separator = " | ";
# Set the name of the community that the "mem_as_comm" link should work for
var string community = "";
# link texts (in case there is no image specified)
var string{} link_text = { "edit_entry" => $*text_edit_entry,
"edit_tags" => $*text_edit_tags,
"mem_add" => $*text_mem_add,
"mem_as_comm" => "+",
"tell_friend" => $*text_tell_friend,
"watch_comments" => $*text_watch_comments,
"unwatch_comments" => $*text_unwatch_comments,
"permalink" => $*text_permalink,
};
# helper var to decide if separator is printed before link or not
var bool i = false;
# Step through the links in the order the user wants
"""<div class="leftlinks">""";
foreach var string link ($link_order)
{
if ($link == "") { continue; } # skip emtpy quotes
if ($link == "|") # close leftlinks div and open standard-aligned div
{
"""</div><div>""";
$i = false;
continue;
}
# special case comment links
if ($link == "comments")
{
if ($e.comments.enabled)
{
if ($i == true) { """$link_separator""";}
$e.comments->print();
$i = true;
}
else { " "; }
}
else
{
# get the url of the link
var string url;
if ($link == "permalink") { $url = $e.permalink_url; }
else
{
var Link url_temp;
$url_temp = ($link == "mem_as_comm") ? $e->get_link("mem_add") : $e->get_link($link);
if (isnull $url_temp)
{
if ($link == "watch_comments")
{
$url_temp = $e->get_link("unwatch_comments");
$link = "unwatch_comments";
}
else { continue; }
}
$url = $url_temp.url;
if ($link == "mem_as_comm") { $url = """$url?authas=$community"""; }
}
# get the link image or text
var string text;
if (clean_url($link_images{$link}) == "") { $text = $link_text{$link}; }
else { $text = """<img src="$link_images{$link}">"""; }
# print separator, link and text/image
if ($i == true) { """$link_separator""";}
"""<a href="$url" title="$link_text{$link}">$text</a>""";
$i = true;
}
}
"</div>";
### end custom code ###
"""
</div>
</div>
</div>
<div class="separator"></div>
<div class="clear"> </div>""";
}