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"
- < ?php
- $TIMEZONE_OFFSET = 12;
- ?>
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:
- < ?php
- if ($x['date_timestamp'] == '')
- $x['date_timestamp'] = create_time($x['title'] . $x['link']);
- ?>
Add this line:
- < ?php
- else
- $x['date_timestamp'] += $TIMEZONE_OFFSET * 60 * 60;
- ?>
3) In "lib.php"
Find the function "create_time", then change the line
- < ?php
- if ($time_table[$md5] <= 0) $time_table[$md5] = time()
- ?>
to
- < ?php
- if ($time_table[$md5] <= 0) $time_table[$md5] = time() + $TIMEZONE_OFFSET * 60 * 60;
- ?>
Upload all these three files to your server and test it, it should work well now.
More entries about : Lilina, RSS Aggregator, Timezone, Personal Portal
Maybe you are also interested in the following entries:
Why use do {} while(0) in macro?