?

Log in

No account? Create an account

Previous Entry | Next Entry

On my own personal Livejournal one of the options that has been coded into it is the ability to create a "Suppress List" that I can type in the user name of specific LJ users and when I view my communities filter on my journal I don't see entries posted by those people. It helps me when I know that certain people make posts in communities that I have friended but that I have no interest in seeing.

I was curious if there was a way to do this in Expressive? It's a shot in the dark mostly, but I figured it never hurts to ask, and since I use Expressive for a lot of my other journals it could be helpful.

Comments

( 15 comments — Leave a comment )
av8rmike
Oct. 11th, 2007 01:46 am (UTC)
If you were to share the code you already have, it'd be easy.
lollobrigida
Oct. 11th, 2007 04:37 am (UTC)
Well it's not actually code that I know of, or at least where to look for. It's an option in my "extras" portion of my S2 customize window.

I use the Robber's Daughter layout that was created by Roniabirk.

Here is the "link" to the stylesheet if that helps? Or maybe you can tell me where to look, or what to look for and I can try to track it down?

http://lollobrigida.livejournal.com/res/18237450/stylesheet?1192052849
av8rmike
Oct. 11th, 2007 01:36 pm (UTC)
Sorry, I meant share the S2 theme layer code. I did a little hunting around and found the s2styles post and opal_help post, however, I agree with kunzite1. It's a bad idea to force users to create a custom layout layer just for the additional property sheet in the Customize area. I'll look into coding it into print_entry() for use in a theme layer.
lollobrigida
Oct. 12th, 2007 07:26 pm (UTC)
That would be fantastic! I just know that I've been setting up a lot of RP journals for Expressive because it gives quick-reply option and a wide page format, so having the option to kill posts from communities would just be a complete timesaver.

Also looking at those links you provided, I *think* I know where I'd put that once it's figured out if it would work for Expressive, because I've used the sorted tag-list option in a few of my journals.
lollobrigida
Oct. 12th, 2007 07:29 pm (UTC)
For that whole create a custom "layout" option? How difficult is that to do? I mean I'd like to be able to apply this option if it's sorted out to more than a dozen journals, and if creating a custom layout would be a simpler option in the long run? I'd be open to trying to sort that out as well if I could be pointed into the right direction as to where to learn how to do that?
av8rmike
Oct. 12th, 2007 08:26 pm (UTC)
Well, it's no harder than setting up a theme layer, you just select "top-level layer" on the layer creation page. However, you'll have to copy & paste in the entire Expressive code and give it a unique name. You'll also have to make it public in order for your other journals to use it. Then, you'd add the kill list property someplace, like into the existing "text" propgroup:
property string kill_list {
    des = "List of users to suppress on friends page";
    example = "fool idiot dolt";
    note = "in format: fool idiot dolt";
    maxlength = 256;
}
set kill_list = "";
Find this section in RecentPage::print_body():
    foreach var Entry e ($.entries) {
        $this->print_entry($e);
        if ($e->viewer_sees_ebox()) {
            """<div style="margin-top: 20px; margin-bottom: 30px;">""";
            $e->print_ebox();
            "</div>";
        }
    }
and replace it with:
    foreach var Entry e ($.entries) {
        if (not($*kill_list->contains($e.poster.username))){
            $this->print_entry($e);
        }
        if ($e->viewer_sees_ebox()) {
            """<div style="margin-top: 20px; margin-bottom: 30px;">""";
            $e->print_ebox();
            "</div>";
        }
    }
Finally, find this section in print_module_pagesummary():
        foreach var Entry e ($cp.entries) {
            $link = "";
            var string poster = $e.poster + "";
and add these lines:
        foreach var Entry e ($cp.entries) {
            $link = "";
            var string poster = $e.poster + "";
            if ($*kill_list->contains($e.poster.username)) {
                continue;
            }
This code will keep the "killed" entries from appearing in the page summary in the sidebar. I haven't actually tried compiling all this, so it's quite possible I've made an error or forgotten some key detail. ;)
lollobrigida
Oct. 12th, 2007 09:02 pm (UTC)
Hmmmm... well I'm trying it out, but I just got this when I compiled -

Error compiling layer:

Compile error: line 918, column 17: Unknown property
S2::NodeVarRef, S2/NodeVarRef.pm, 171
S2::NodeTerm, S2/NodeTerm.pm, 170
S2::NodeTerm, S2/NodeTerm.pm, 66
S2::NodeExpr, S2/NodeExpr.pm, 46
S2::NodeIfStmt, S2/NodeIfStmt.pm, 79
S2::NodeStmtBlock, S2/NodeStmtBlock.pm, 101
S2::NodeForeachStmt, S2/NodeForeachStmt.pm, 101
S2::NodeStmtBlock, S2/NodeStmtBlock.pm, 101
S2::NodeIfStmt, S2/NodeIfStmt.pm, 92
S2::NodeStmtBlock, S2/NodeStmtBlock.pm, 101
S2::NodeFunction, S2/NodeFunction.pm, 230
S2::Checker, S2/Checker.pm, 353
S2::Compiler, S2/Compiler.pm, 34


Context

914: var RecentPage cp = $p as RecentPage;
915: foreach var Entry e ($cp.entries) {
916: $link = "";
917: var string poster = $e.poster + "";
918: if ($*kill_list->contains($e.poster.username)) {
919: continue;
920: }
921: var string journal = $e.journal + "";
922: var string subject = ($e.subject != "") ? striphtml($e.subject) : """$*text_nosubject""";
av8rmike
Oct. 12th, 2007 09:31 pm (UTC)
It's complaining about the $*kill_list property. Did you put it into one of the existing propgroups? Can you make the source viewable and give me the layer ID #?
lollobrigida
Oct. 12th, 2007 09:40 pm (UTC)
474027 that is the layoutID of the one I'm trying to play with.

I took ALL the code you linked me to and shoved that into the layout saved and compiled. It was fine, and changed it all to Expressive which is what I wanted. I added in the first section and saved and compiled and that worked no problem. Then I went in and found the sections you told me to replace, replaced them and saved and compiled and then that error. So I'm not sure what a prop group is, but maybe I did?
av8rmike
Oct. 13th, 2007 02:25 am (UTC)
I think I see what happened. The part that has property string kill_list { and the "set" line at the end has to go inside a "propgroup", which are near the top of the layer and are the "pages" of the customization section. Find the section that starts propgroup text { and paste the kill_list section in it somewhere. It should compile, and you'll see the text area for the kill list in the customization pages.
lollobrigida
Oct. 17th, 2007 10:00 pm (UTC)
Sorry for the delay on getting back to you! I did this and it seems to have worked, the only downside I've got right now? Is that it maxes out at 256 characters and the box itself is a single row, so it only allows me to block like 17 names at the most. Is there any way to make the input box bigger? or allow it to take more characters?
av8rmike
Oct. 18th, 2007 01:56 am (UTC)
You must have a lot of people you want to kill. Remind me not to get on your bad side. ;)
Take out the line in the property that says maxlength = 256; and replace it with:
cols = 40;
rows = 10;
moveablehistory
Nov. 15th, 2007 04:10 am (UTC)
Hey-

I use this code in a theme layer, and it works for me.

function FriendsPage::print_body 
{
         var int count = 0;
         var string[] myarray;
         
    var string killfile_list = " exampleone exampletwo ";
    foreach var Entry e ($.entries) {
         if( not $killfile_list->contains(" $e.poster.username ")){
            $this->print_entry($e);
         }
    }


}
lollobrigida
Nov. 15th, 2007 04:11 am (UTC)
Oh that's a different way to do it too! Thanks! I already have it solved with making a new layout completely but this is good to know as well!
moveablehistory
Nov. 16th, 2007 03:14 pm (UTC)
I may have given you bad code - av8rmike clears it up here.
( 15 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