Jarrod Lombardo (jaberwockynmt) wrote in lj_nifty,
Jarrod Lombardo

Calendar Hack

I didn't like how the calendar for my journal archive displayed. People could figure out how many posts I had written on a specific day. If there were more posts on a day than they could see, they might make guesses about what they couldn't see and why they couldn't see it. I was a little uncomfortable about that and many other people I've talked to are very uncomfortable about it. I decided to figure out how to make the number of posts per day go away but have the calendar still work.

Before and After:

Just add the below code block to your layer (paid account required for this) and it should work for you:
function YearWeek::print() {
   """<tr valign="top" style="height: 2em;">\n""";
   if ($.pre_empty > 0) {
      """<td class="emptyday" colspan="$.pre_empty"> </td>\n""";
   foreach var YearDay d ($.days) {
       """<td style="border: 1px solid;">\n""";
       """<div style="text-align: center;">""";
       if ($d.num_entries > 0) {
           """<div style="text-align: center;"><a href="$d.url">$d.day</a></div>\n""";
       } else {
   if ($.post_empty > 0) {
      """<td colspan="$.post_empty"> </td>\n""";

Update: kunzite1 wrote another version of the code in the comments below.

Update: I understand that this will not block other paid account users from seeing the information by using a different style, but that extra step does mean that a casual observer will not see the number of posts per day and also that free account users (who are the majority of users, I believe) won't be able to see the number of posts per day. People will still be able to click on days and get 0 posts if there are no posts they have access to on that day.
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded