?

Log in

No account? Create an account

Previous Entry | Next Entry

Okay, I'm on a paid account and right now I'm using the Fleur Brown theme for my LJ.

Now, the one thing I can't figure out is how to add a memory link that will allow me to add memories directly to a community I'm the mod of.

In my old layout I used
print """< a href="$mem.url" >$*text_memories< /a >
< a href="$mem.url&authas=$p.journal.username" >+< /a >""";

Right now, I don't have many things I want to change for the layout so I haven't created my own theme layer but I know how I'd have to go about that if its necessary. I just have no idea where I would have to put the code I'd need.

Any help would be greatly appreciated.

Comments

( 6 comments — Leave a comment )
kunzite1
Mar. 9th, 2007 04:01 am (UTC)
function Entry::print_linkbar() {
  var Link   link;
  var bool   can_edit     = false;
  var bool   is_comm      = $.journal.journal_type == "C";
  var string mem_add_comm = "add to ${.journal.username}'s memories";
  var string url          = "";
  var string text         = "";

  $link     = $this->get_link("edit_entry");
  $can_edit = defined ($link);

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

  $.comments->print();

  var string{} link_caption = {
    "edit_entry"       => $*text_edit_entry,
    "edit_tags"        => $*text_edit_tags,
    "mem_add"          => $*text_mem_add,
    "watch_comments"   => $*text_watch_comments,
    "unwatch_comments" => $*text_unwatch_comments,
  };

  foreach var string link_key ($.link_keyseq) {
    $link = $this->get_link($link_key);
    if (defined $link) {
      $url  = $link.url;
      $text = $link_caption{$link_key} != "" ? $link_caption{$link_key} : $link.caption;
      print safe """<li class="asset-meta-comments item asset-meta-no-comments"><a href="$url">$text</a></li>""";
      if (($link_key == "mem_add") and $can_edit and $is_comm) {
        $url  = $url + "&authas=$.journal.username";
        $text = $mem_add_comm;
        print safe """<li class="asset-meta-comments item asset-meta-no-comments"><a href="$url">$text</a></li>""";
      }
    }
  }
  print """<li class="asset-meta-comments item asset-meta-no-comments"><a href="$.permalink_url">$*text_permalink</a></li>""";
  println "\n</ul>\n</div>\n";
}
mamoru22
Mar. 9th, 2007 10:33 am (UTC)
Thank you for doing this. :)

Sadly, it doesn't seem to work. I've added the code and now I only have the one memory button that tries to add the memories to the comm it has been posted to.

Which, was maybe what it sounded like I needed, but I actually meant something that would allow me to add all posts I can find on my flist to one specific community.

And to still have the possibility to add it also to my LJ.
mamoru22
Mar. 9th, 2007 10:39 am (UTC)
Also, I don't know if I should replace journal.username with the username I want it to be added to but each time I tried this the compiler gave me this error:
"Can't find member 'sga_newsletter' in UserLite"
kunzite1
Mar. 9th, 2007 11:48 am (UTC)
ahh... and after getting the username from your other comment, i came up with this:
function Entry::print_linkbar() {
  var string comm_username = "sga_newsletter";

  var Link   link;
  var string mem_add_comm  = "add to ${comm_username}'s memories";
  var string url           = "";
  var string text          = "";

  $link     = $this->get_link("edit_entry");
  $can_edit = defined ($link);

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

  $.comments->print();

  var string{} link_caption = {
    "edit_entry"       => $*text_edit_entry,
    "edit_tags"        => $*text_edit_tags,
    "mem_add"          => $*text_mem_add,
    "watch_comments"   => $*text_watch_comments,
    "unwatch_comments" => $*text_unwatch_comments,
  };

  foreach var string link_key ($.link_keyseq) {
    $link = $this->get_link($link_key);
    if (defined $link) {
      $url  = $link.url;
      $text = $link_caption{$link_key} != "" ? $link_caption{$link_key} : $link.caption;
      print safe """<li class="asset-meta-comments item asset-meta-no-comments"><a href="$url">$text</a></li>""";
      if ($link_key == "mem_add") {
        $url  = $url + "&authas=${comm_username}";
        $text = $mem_add_comm;
        print safe """<li class="asset-meta-comments item asset-meta-no-comments"><a href="$url">$text</a></li>""";
      }
    }
  }
  print """<li class="asset-meta-comments item asset-meta-no-comments"><a href="$.permalink_url">$*text_permalink</a></li>""";
  println "\n</ul>\n</div>\n";
}
mamoru22
Mar. 9th, 2007 10:40 pm (UTC)
Oh, thank you so much!

It's working like a charm and its a total lifesaver!

You rock!
kunzite1
Mar. 10th, 2007 12:57 am (UTC)
good to know that it worked. :D
( 6 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