How to offset Lilina’s display timezone

One of my US friends ask me how to offset the timestamp of Lilina RSS aggregator. He lives in the east coast but his web host is in the west.

In fact, it’s very easy to do that, and I do think Lilina should add such support.

1) Add the following line in "conf.php"

  1. <?php
  2. $TIMEZONE_OFFSET = 12;
  3. ?>

The value is the timezone offset between your host and your home. (In my case, it’s 12 hours)

2) In "index.php"

Find the following lines:

  1. <?php
  2. if ($x['date_timestamp'] == '') 
  3.     $x['date_timestamp'] = create_time($x['title'] . $x['link']);
  4. ?>

Add this line:

  1. <?php
  2. else
  3.     $x['date_timestamp'] += $TIMEZONE_OFFSET * 60 * 60;
  4. ?>

3) In "lib.php"

Find the function "create_time", then change the line

  1. <?php
  2.     if ($time_table[$md5] <= 0) $time_table[$md5] = time()
  3. ?>

to

  1. <?php
  2.     if ($time_table[$md5] <= 0) $time_table[$md5] = time() + $TIMEZONE_OFFSET * 60 * 60;
  3. ?>

Upload all these three files to your server and test it, it should work well now.

Popularity: 32%

Related entries:

  • No Related Posts

One Response to “How to offset Lilina’s display timezone”

  1. xpoint Says:

    谢谢,刚好用的上。

Leave a comment

(required)

(required)


Information for comment users
Line and paragraph breaks are implemented automatically. Your e-mail address is never displayed. Please consider what you're posting.

Use the buttons below to customise your comment.


RSS feed for comments on this post | TrackBack URI

 

Creative Commons License
This work is licensed under a Creative Commons License.

让我们干了这杯酒,好男儿胸怀象大海,经历了人生百态世间的冷暖,这笑容温暖纯真