howto_user (howto_user) wrote in s2howto,

[paidaccount] [tranquility ii] Hiding particular users' posts on the Friends page

Paid Accounts Only
The following tutorial requires creating and editing a custom theme layer, which in turn requires a paid, permanent, or early adopter account. Please read What are the paid account benefits? and How do I buy a paid account? to learn about the paid account benefits and how to buy a paid account.

This tutorial requires the creation of a theme layer. If you already have a theme layer, you will need to edit it and add the code below. If you do not have a theme layer, you will need to create one by following the instructions in the Theme Layer tutorial.

This tutorial will add a Usenet-style "killfile" to the Friends page, which will hide particular users' posts on your Friends page.

If your theme layer or layout already has code to print the Friends page, modify it to include the code described below. Otherwise, add the following code to your theme layer:

function FriendsPage::print_body ()
    var string kill_list = " exampleusername1 exampleusername2 exampleusername3 ";

	# print all entries
	print "<div id=\"entries\">\n";
	foreach var Entry e ( $.entries ) {
		if( not $kill_list->contains(" $e.poster.username ")){
	print "</div>";

	var string range = "most recent entries";
	if ( $.nav.skip > 0 ) {
		$range = "$.nav.skip entries back";

	print "<div id=\"footer\"><p>";
	print "<b>viewing:</b> $range<br />";
	# go forward/backward if possible
	if ( $.nav.forward_url != "" or $.nav.backward_url != "" ) {
		var string sep;
		var string back;
		var string forward;
		if ( $.nav.backward_url != "" ) {
			$back = "<a href=\"$.nav.backward_url\" title=\"go earlier\">earlier</a>";
		if ( $.nav.forward_url != "" ) {
			$forward = "<a href=\"$.nav.forward_url\" title=\"go later\">later</a>";
		if ( $back != "" and $forward != "" ) { 
			$sep = " | ";
		print "<b>go</b>: $back$sep$forward<br />";
	print "</p></div>";

Replace "exampleusername1," "exampleusername2," and "exampleusername3" with the usernames of the users you wish to ignore, making sure to keep a space between each username. Now, the entries by these users are not printed.

Compile your layer, and it's ready to use. You will need to apply your theme layer via the Customize interface in order for your changes to take effect.

Compiled by pocketnovel and camomiletea. Based on tutorials by miome, teine, and lithiana.

Tags: - tranquility ii, hiding entries, killfile, paid accounts only

Comments for this post were disabled by the author