[tutorial] Hiding particular users' post on your Friends page

Dec 21, 2008 20:47


This tutorial is to set up a kill file to your journal. It works on posts, not comments. I used this tutorial as reference.

It can only be used by Paid/Permanent users, as you'll need a theme layer to make it work.

I'm going to assume that you know how to set up a theme layer and styles. If you don't, you might want to have a look at these two tutorials: What are layers and styles? and My first theme layer. They were composed for another layout, but these things work across the board :)
Hiding particular users' post on your Friends page

In your theme layer, copy the following code:

function FriendsPage::print_body { # Configuration var string kill_list = " exampleusername1 exampleusername2 exampleusername3 "; # Code if ($*sticky_post!="" and $*exact_view == "recent_first") { var string corners1 = ""; var string corners1_2 = ""; var string corners2 = ""; if ($*active_theme == "x4") { $corners1 = """"""; $corners2 = """"""; } elseif ($*active_theme == "x5") { $corners1_2 = """"""; $corners2 = """"""; } """
$corners1 """ + ($*sticky_subject!="" ? $*sticky_subject : "Sticky post") +"""$corners1_2
$*sticky_post $corners2
"""; } foreach var Entry e ($.entries) { if( not $kill_list->contains(" $e.poster.username ")){ _print_entry($e); } } if ($.nav.backward_url != "" or $.nav.forward_url != "") { """ """; } }
In green are the things you can customise, here the usernames of the people you want to block. Separate them with a space only.

In red are the lines I added. If you already have FriendsPage::print_body in your theme layer, you will need to merge the functions.

Save and compile; it's done!

Feel free to ask questions :)

Last modified on 2008-12-21.

friends page, tutorial, killfile

Previous post Next post
Up