Alright, a very preliminary patch is available for this functionality. I've done some limited testing and it seems to work. It won't flag anything new if you haven't visited the gallery. It only tells you new since your last visit and you have to visit once for us to know when you visited last. This way on your first visit it doesn't flag anything as new because it's all new. If any album then gets added and you come back a week later it will then flag the album in question as new. That make any sense? You can find it here:
http://www.spider.org/gallery
There are two files. One file is the patch, newsince.patch for the following files:
/view_album.php
/session.php
/classes/Album.php
I'm going to modify /albums.php too but haven't added that yet.
The next file is new_since_last_visit.gif which is just a small red logo to display when the album is new, copy it to /images or create your own and modify the following line in classes/Album.php after you've applied the patch to point to your own image.
return print "<IMG SRC="/images/new_since_last_visit.gif"><br>";
Finally to apply this patch do the following in your gallery root directory.
patch -p1 < /path/to/newsince.patch
Remember to backup the files that will be patched. I haven't added any comments to what I've added. I will when I fidle next.
Oh! This was all done on gallery v1.3.1 if you're using a previous version it may or maynot work.
Enjoy.
Paul
Posts: 5
I've found a bug that seems to happen when the PHPSESSID cookie expires, I'm fixing it and will post when it's fixed. Doh!
Paul
Posts: 5
Alright, this has been fixed and things seem to be working now. The problem was how I was dealing with cookies and specifically the session cookie. All fixed and the patch has been updated.
Paul
Posts: 2
does this work when you just add photos? or does it have to be an album? also i am running WinXp how do i add the patch? :smile: BTW great job and good idea
Posts: 5
Sorry, but I can;t seem to get it to work, I have applied the patch etc and it doesnt seem to say anything is new. I'll have to have a look through my cookies and see if they are being set I think..
UPDATE: No cookies are being set at all for that site
ANOTHER UPDATE: Ok, cool, its working, anyway of showing the NEW SINCE in the root of the folder tree or previous albums?
Posts: 65
RE: Patches. Is there a way to MANUALLY cut and paste the lines in? Of so, can someone tell us Win2K/XP users?
Thanks a ton in advance!
Ajoy
Posts: 88
I am not understanding at all how this patch is to be applied. Where do you upload the newsince.patch or where in the files and what files to place the code? I am lost!
I sure hope someone can help with this!
Thank you,
Marie Alline
Posts: 185
Posts: 185
Test: I keep getting failed headers from gallery.menalto when I post here
EDIT: Hmm, I guess it was b/c I had that code below inside those bb code tags which I shouldn't have done. I was trying to hightlight the error I got
Posts: 185
I tried -p0 b/c for other files that was the only way it would work but this is what I get. I'm not a big fan of the word FAILED...
The only other patch I've applied is the counters.patch and iptoadmin.patch (which didn't work b/c I didn't read that it was 1.3.2 that it works with).
I am using 1.3.1
-------
sudo patch -p1 < newsince.patch
patching file classes/Album.php
patching file session.php
Hunk #1 FAILED at 35.
1 out of 1 hunk FAILED -- saving rejects to file session.php.rej
patching file view_album.php
Hunk #1 succeeded at 436 (offset 12 lines).
Posts: 185
Anyone get this error or understand what happened? Did something not match even though I have 1.3.1?
Posts: 185
Anyone have any updates?