Last read post - server version

 

UPDATE: We’ve moved

This is a modification of THBMans excellent LastReadPost greasemonkey script, updated to store the read status on a central server for use on multiple machines. It’s quick and dirty and hasn’t been tested much, but so far seems to work. You’ll need a server with php and mySQL to use this.To setup:

  1. Run lastreadpost.sql in your target database
  2. Put lrp.txt on your web server renamed to lrp.php. Edit the server, database, username, and password variable as needed
  3. Install the greasemonkey script from http://osakanyc.com/files/lastreadpostserver.user.js

Enjoy, and let me know of any feedback and/or bugs.

14 Comments

  1. Collin said,

    August 29, 2006 at 3:11 pm

    Would it be possible to fix the post history? It’s only catching new topics at the moment, and not replies as well :)

  2. matt said,

    August 30, 2006 at 10:27 am

    I’ll take a look. That whole feature is still rather murky to me, and is in desperate need of a rewrite to really work well again.

  3. Collin said,

    August 30, 2006 at 11:59 pm

    Hmm, it also seems to ignore the ctrl+shift+click to delete a recorded post. (e.g. stop tracking new replies)

  4. Collin said,

    August 31, 2006 at 12:47 am

    Aha! I figured out the problem with the deleting on ctrl+shift - the “remove” action in lrp.php is missing this:

    $key = mysql_real_escape_string($_GET['key']);

    Also, on the not storing replies issue, I’m using the quickreply, not the full reply window, if that matters :)

  5. Collin said,

    August 31, 2006 at 1:18 am

    I think I figured out the rest of the issues also :)

    http://geekforhire.org/files/lastreadpostserver.user.js.patch

  6. matt said,

    September 6, 2006 at 10:25 am

    Cool, looking good. Thanks! ;)

    I applied the patch to the full script hosted here and bumped the version to 0.5.

  7. Collin said,

    September 9, 2006 at 9:36 pm

    Found another minor issue - VARCHAR(255) isn’t always long enough for the history, and if it’s too long it just truncates post keys, which breaks the menu :)

    I swapped mine out for TEXT (though I had to remove the primary key to do that) and it works fine again :)

  8. matt said,

    September 10, 2006 at 12:02 am

    Yeah… that’s the major rewrite I was talking about.

    The history was written for the GM properties in the standalone version. When I ported the storage to a database I didn’t know what that feature was (actually it was broken completely in the version of the script the port was based on) so I just turned the property into a 1 column 1 row table. Turns out the history is concated in that field. I knew when I fixed the history that 255 wasn’t going to cut it for active posters, and hesitated to release it.

    TEXT will buy some time, but the whole table needs to be reworked to have eash entry in a row at the minimum.

  9. Collin said,

    September 16, 2006 at 5:41 pm

    I’ve made some more changes that address the length issue for the most part - setHistory now truncates it to 15 entries, and also strips out any invalid keys (for instance if you stop tracking a post in your history).

    I also tweaked the JS so if it gets invalid entries it still prints the menu - before it would die if it ran into, say, a string instead of a link. (usually due to the stop tracking issue earlier, but not always)

    http://geekforhire.org/files/lrps.zip :)

  10. matt said,

    December 2, 2006 at 6:35 pm

    After much delay, I’ve update the files here and bumped the version to 0.6 for the Js and 0.2 for the php.

  11. Adam Hughes said,

    December 15, 2006 at 12:54 pm

    In the savePostValues function, you need to escape the post title, otherwise the title can get truncated and won’t show up correctly in the green box.

    I posted in a topic that was something like “C# - blah blah” and it just showed up in the box as “C”.

  12. matt said,

    December 20, 2006 at 11:18 am

    New version of the js (0.7). I added the escape to the thread title and fixed a problem with navigating to earlier pages in a thread overwriting the last read value.

  13. OsakaNYC » LastReadPost (server edition) moving said,

    January 4, 2007 at 3:14 pm

    [...] In order to make it a bit easier to track what is going on with LastReadPost (server edition), I’m moving it over to google hosted projects.  Issue tracking, download management, version control… all those things that make keeping track of a project easier. [...]

  14. matt said,

    January 4, 2007 at 3:15 pm

    As noted above, the new URL for this project is http://code.google.com/p/lastreadpost/

Post a Comment