?

Log in

No account? Create an account

Previous Entry | Next Entry

Protected entry lock in Summary module?

  • Dec. 7th, 2006 at 11:27 PM

I would really like to have the little lock icon for protected entries next to the subject when listed in the summary module, but I'm not sure what code I need to wedge into the summary module code I looked up in expressive's source.

I have a paid account, a theme layer already happily filled with many other customizations, I just need a little help. Thanks in advance.

Comments

( 2 comments — Leave a comment )
av8rmike
Dec. 11th, 2006 03:25 am (UTC)
I basically stole the lines in green from MonthDay::print_subjectlist(). If you want to style the icon, you'll have to enclose it in its own SPAN element.
function print_module_pagesummary(string title) {
    var Page p = get_page();

    var string link = "";
    var string[] links = [];
    if ($p isa RecentPage) {
        var RecentPage cp = $p as RecentPage;
        foreach var Entry e ($cp.entries) {
            $link = "";
            var string poster = $e.poster + "";
            var string journal = $e.journal + "";
            var string subject = ($e.subject != "") ? striphtml($e.subject) : """<i class="nosubject">$*text_nosubject</i>""";
            if ((not($e.poster->equals($e.journal))) and ($p.journal.journal_type != "C")) {
                $link = $link + $journal + " :: ";
            }
            if (($p.view == "friends") or ($p.journal.journal_type == "C")) {
                $link = $link + $poster + " : ";
            }
            $link = $link + """<a href="#asset-$e.journal.username-$e.itemid">$subject</a>""";
            if ($e.security_icon) {
                $link = $link + """$e.security_icon&nbsp;""";
            }
            $link = $link + """ <a href="$e.permalink_url">[+$e.comments.count]</a>""";
            $links[size $links] = $link;
        }
    } elseif ($p isa EntryPage) {
        var EntryPage cp = $p as EntryPage;
        foreach var Comment c ($cp.comments) {
            var string poster  = (defined $c.poster) ? ($c.poster + "") : """<i class="noposter">$*text_poster_anonymous</i>""";
            var string subject = ($c.subject != "") ? $c.subject : """<i class="nosubject">$*text_nosubject</i>""";
            var int count = num_comments_in_thread($c.replies);
            $links[size $links] = """$poster : <a href="#comment-$c.talkid">$subject</a> <a href="$c.permalink_url">[+$count]</a>""";
        }
    }

    if (size($links) < 1) { return; }
    open_module("archive", $title, "");
    print_module_list($links,"");
    close_module();
}
diziara
Dec. 11th, 2006 05:33 am (UTC)
Awesomeness. Thank you much for the help. :) I wanted the lock before the subject, so I just moved the green bits above the line before them, and that fixed it. Also, I was able to add a span so I could make the lock match the others in my style. Yay.
( 2 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