Custumizing the new spam button in the comment link bar

Apr 23, 2011 00:38

Hi everyone.

LJ recently added a "spam" button in the comment linkbar. I use a tutorial to display my own images instead of the standard LJ buttons, but after the change there's the link text "spam" right in between my custom linkbar images:



Has anyone figured out how to either hide the new spam button/link completely or how to change it to a custom image, too? Any help with this is highly appreciated.

This is my code for the comment linkbar:

#===============================================
#
# POST COMMENT LINKBAR #
#
#===============================================

function Comment::print_linkbar() {

var string link_separator = " ";

# Initialize array/hashes.
var string[] link_keyseq = [""];
var string{} link_url = {"" => ""};
var string{} link_caption = {"" => ""};
var string{} link_image = {"" => ""};

var string print = "";

# 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_caption{$link_key} = $link.caption;
$link_image{$link_key} = $link.icon.url;
$link_keyseq[size($link_keyseq)] = $link_key;
}

##### START CONFIGURATION. THIS IS WHERE YOU SET YOUR OPTIONS. #####

### Images used as links. If you'd rather use your own, replace $*edit_comment_img, etc. with your URLs.

$link_image = {
"edit_comment" => "http://i409.photobucket.com/albums/pp174/london-fan/House%20related%2016x16%20icons/Icons%20for%20myself/scalpell216x16.gif",
"delete_comment" => "http://i409.photobucket.com/albums/pp174/london-fan/House%20related%2016x16%20icons/Icons%20for%20myself/poisonbottle.gif",
"screen_comment" => "http://i409.photobucket.com/albums/pp174/london-fan/House%20related%2016x16%20icons/Icons%20for%20myself/screenTVoff.gif",
"unscreen_comment" => "http://i409.photobucket.com/albums/pp174/london-fan/House%20related%2016x16%20icons/Icons%20for%20myself/screenTVon-cuddy.gif",
"freeze_thread" => "http://i409.photobucket.com/albums/pp174/london-fan/House%20related%2016x16%20icons/Icons%20for%20myself/frozenyogurtwithsprinkles.gif",
"unfreeze_thread" => "http://i409.photobucket.com/albums/pp174/london-fan/House%20related%2016x16%20icons/Icons%20for%20myself/redmug16x16.gif",
"watch_thread" => "http://i409.photobucket.com/albums/pp174/london-fan/House%20related%2016x16%20icons/Icons%20for%20myself/domepumps216x16.gif",
"watching_parent" => "http://i409.photobucket.com/albums/pp174/london-fan/House%20related%2016x16%20icons/Icons%20for%20myself/whiteboardsquare16x16.gif",
"unwatch_thread" => "http://i409.photobucket.com/albums/pp174/london-fan/House%20related%2016x16%20icons/Icons%20for%20myself/sneakers16x16.gif",
};

##### END CONFIGURATION. #####

##### DO NOT EDIT ANY OF THE FOLLOWING CODE UNLESS YOU KNOW WHAT YOU'RE DOING! #####

# Loop through linkbar and add links to print var.
foreach var string link_key ($link_keyseq)
{
if($link_url{$link_key} != "")
{
$print = $print + """""";
if($link_image{$link_key} != "")
{
var string id = "";
if($link_key->contains("screen"))
{
$id = "sus_";
}

if($link_key->contains("freeze"))
{
$id = "fuf_";
}
$id = "$id$.talkid";
$print = $print + """$link_caption{$link_key}""";
} else {
$print = $print + "$link_caption{$link_key}";
}

$print = $print + "
$link_separator";
}
}

# Hack off last separator.
$print = $print->substr(0, $print->length() - $link_separator->length());

# We're done! Let's print it!
print $print;
}

Edit:

Okay, I've kept going through the source codes and I figured it out for my layout code. I've got no idea if this solution works with all other tutorials.

The property pertaining to the new button is:

set text_multiform_opt_spam = "Spam";

Add it to your properties and delete the text between the quotation marks to remove the spam button/link completely. There will be a very small empty space, though.

If you just want to change the image you need to add the following code in the section where you edit all your comment linkbar image urls (for example "edit_comment" => "your image url",):

"spam_comment" => "your image url",

If you also add the property mentioned above you can change the "hover over image" link text there!

Hope that helps!

status: closed, /topic-comment: linkbar, *account level: paid/perm

Previous post Next post
Up