View Full Version : jump to last read comic
Would it be possible to do something cunning with cookies so that when visiting the 'latest.php' page, it jumps to the last comic that i read? so that if, say, I don't visit for a week, i don't have to go backwards through the comics untill i reach the point where i can pick up the story?
Or have some kind of 'mark this comic' button that set's a cookie with the url of the episode that your looking at, and auto-redirects you there upon your next visit?
Kikuichimonji
05-21-2006, 04:15 AM
You could just bookmark the last comic you read. That's what I do for webcomics.
yeah i know, but that means that every time that i read the comic i'd have to:
delete the old bookmark
set a new bookmark
move the bookmark so that it's in the 'comics' folder
which is a bit too much faffing tbh. call me lazy, but i'd rather the server did it for me if it can
Meister
05-21-2006, 04:28 AM
You could write down the number of the last episode you read.
Crazy, I know. :p
henke37
05-21-2006, 05:37 AM
If I weren't so lazy I would dig out the sources of the viewer and make a patch for said feature so a lazy admin only have to patch the script.
shiney
05-21-2006, 06:13 AM
But aren't you the lazy one here?
You could write down the number of the last episode you read.
Crazy, I know. :p
aww, man! but then i'd have to wright stuff :(
pohatufan1
05-21-2006, 11:01 AM
wright
I believe I see where your problem lies.
Flarecobra
05-21-2006, 12:11 PM
Now, I don't know that much about the scripts used for auto-updates, but I think that there's no way for that to be done in realistic terms, aside from writing down the 3 numbers of the last read comic, or like they said, bookmarking them.
Skyshot
05-21-2006, 01:18 PM
Or you just view your browser's history. Ctrl+H. Some, if not all, browsers will even let you set how far back the history goes.
Now, I don't know that much about the scripts used for auto-updates, but I think that there's no way for that to be done in realistic terms, aside from writing down the 3 numbers of the last read comic, or like they said, bookmarking them.
I also don't know that much about scripting, but...
example comic url:
http://www.nuklearpower.com/daily.php?date=060518
on each page, you could grab the url and strip all but the number off, ie in this case 060518
then, simply set a variable, say LastViewed, to this number in a cookie.
then on latest.php (or lastviewed.php, or whatever) it could simply be:
'get LastViewed from cookie;
redirect to www.nuklearpower.com/daily.php?date=(LastViewed)'.
Tada! one bookmarkable page that would redirect you to the last comic you were reading.
now, if anyone knows php as opposed to crap (which is what the above is writtern in), we'd be cooking on gas.
dojindog
05-21-2006, 02:06 PM
Umm... when I completely re-read 8-bit I just saved over my bookmark each time just tell it to overwrite it
Edit: But it goes to the newest if you save it on the old newest comic *scratches head* you understand that... cuz I sure as heck didn't!
Meister
05-22-2006, 04:46 AM
It's not a bad idea per se, but if we weigh the effort to patch the code up against the effort of taking out a post-it and a pencil*, I'm afraid the latter comes out on top.
*For treehuggers: opening Notepad.
but the patch would only have to be done once, whereas the pencil/paper option would have to be done repeatedly :p
plus, as a web-site, it's your obligation to pander to my every whim.
j/k no worries -- thanx for concidering it :)
Iyeru
05-22-2006, 02:39 PM
It's a good thing that a link to the "Latest Comic" is on every page both top and bottom on each comic. -_-
Otherwise what good would that err... uhh... what was I talking about again?
henke37
05-23-2006, 02:31 AM
In file comic.php:
Find first occourance of "} else {", insert the following code before it.
} elseif($_GET['date']=='lastread') {
$arrComic = $sql->query_first("SELECT date, title, newstitle, extension FROM comicdata WHERE date = '". strip_tags(addslashes($_COOKIE['lastread'])) . "' AND islive = '1' ORDER BY date DESC LIMIT 1");
header("Cache-Control: no-cache, must-revalidate"); // Prevents cacheing, which could break the function
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
} elseif($_GET['date']=='random') {
arrComic = $sql->query_first("SELECT date, title, newstitle, extension FROM comicdata where islive = '1' ORDER BY ORDER BY rand()+date*0 DESC LIMIT 1");
header("Cache-Control: no-cache, must-revalidate"); // Prevents cacheing, which could break the function
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
Find:
// Comic Found
Insert after it:
setcookie('lastread',$arrComic['date'],time()+60*60*24*14);//replace 14 for how long in days the cookie should be valid
Also add a link somewhere in the template to "comic.php?date=lastread". To comply with the license, toss in "//Patched with lastread patch made by henke37" in the big comment block in the begining of the file.
Now with a jump to a random comic. Link to "comic.php?date=random"
vBulletin® v3.7.1, Copyright ©2000-2010, Jelsoft Enterprises Ltd.