?

Log in

No account? Create an account

Previous Entry | Next Entry

Hello....

  • Feb. 22nd, 2008 at 9:09 AM
Could anyone help me with this bit of scripting?



I have this in my custom layer:

function Entry::print_linkbar() {
    var Link link;
    var string url = "";
    var string text = "";

    print """<div class="asset-meta">\n""";
    print """<ul class="asset-meta-list">\n""";

    $.comments->print();

    $link = $this->get_link("edit_entry");
    if (defined $link) {
        $url = $link.url;
        $text = $*text_edit_entry != "" ? $*text_edit_entry : $link.caption;
        print safe """<li class="asset-meta-comments item asset-meta-no-comments"><a href="$url">$text</a></li>""";
    }
    println "\n</ul>\n</div>\n";
}




And it works wonderfully well to show ONLY the comment number, reply, and edit entry links.

But I would so much like to add the 'add to memories' link to this. Can you please help me alter the current script to add that link?

Thank you so much for all you do.

Comments

( 4 comments — Leave a comment )
av8rmike
Feb. 22nd, 2008 02:13 pm (UTC)
The HTML in your post needs to be "escaped", because the HTML editor will try to format it. Use the link in the community's sidebar for posting code segments. Otherwise, I have no idea what you changed.
rakshi
Feb. 22nd, 2008 02:24 pm (UTC)
I followed instructions and reposted the code. I hope that works. Sorry.

Rak
av8rmike
Feb. 22nd, 2008 02:55 pm (UTC)
Since you took out the hash array and the foreach block, you'll have to copy & paste the "$link" section with a new array key for each (heh) link you would want to add:
function Entry::print_linkbar() {
    var Link link;
    var string url = "";
    var string text = "";

    print """<div class="asset-meta">\n""";
    print """<ul class="asset-meta-list">\n""";

    $.comments->print();

    $link = $this->get_link("edit_entry");
    if (defined $link) {
        $url = $link.url;
        $text = $*text_edit_entry != "" ? $*text_edit_entry : $link.caption;
        print safe """<li class="asset-meta-comments item asset-meta-no-comments"><a href="$url">$text</a></li>""";
    }
    $link = $this->get_link("mem_add");
    if (defined $link) {
        $url = $link.url;
        $text = $*text_mem_add != "" ? $*text_mem_add : $link.caption;
        print safe """<li class="asset-meta-comments item asset-meta-no-comments"><a href="$url">$text</a></li>""";
    }
    println "\n</ul>\n</div>\n";
}
rakshi
Feb. 22nd, 2008 03:47 pm (UTC)
Worked PERFECTLY!!

I'm so grateful to you... and to this marvelous community.

Thank you!
( 4 comments — Leave a comment )

Latest Month

March 2016
S M T W T F S
  12345
6789101112
13141516171819
20212223242526
2728293031  

S2 Help Communities

Tags

Powered by LiveJournal.com
Designed by chasethestars