New Patch - New Albums Since Last Visit

paulmona
paulmona's picture

Joined: 2002-08-17
Posts: 5
Posted: Sat, 2002-08-17 20:39

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

 
paulmona
paulmona's picture

Joined: 2002-08-17
Posts: 5
Posted: Sat, 2002-08-17 20:41

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

 
paulmona
paulmona's picture

Joined: 2002-08-17
Posts: 5
Posted: Sat, 2002-08-17 21:37

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

 
coda454

Joined: 2002-08-15
Posts: 2
Posted: Thu, 2002-08-22 04:01

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

 
Rick

Joined: 2002-08-20
Posts: 5
Posted: Fri, 2002-08-23 11:10

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?

 
ajoyprabhu

Joined: 2002-09-26
Posts: 65
Posted: Wed, 2002-10-02 18:15

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

 
mariealline

Joined: 2002-10-24
Posts: 88
Posted: Sat, 2002-10-26 13:33

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

Quote:
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

 
dtdgoomba

Joined: 2002-11-04
Posts: 185
Posted: Tue, 2002-11-19 14:07
 
dtdgoomba

Joined: 2002-11-04
Posts: 185
Posted: Tue, 2002-11-19 14:07

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

 
dtdgoomba

Joined: 2002-11-04
Posts: 185
Posted: Tue, 2002-11-19 14:09

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).

 
dtdgoomba

Joined: 2002-11-04
Posts: 185
Posted: Thu, 2002-11-21 16:28

Anyone get this error or understand what happened? Did something not match even though I have 1.3.1?

 
dtdgoomba

Joined: 2002-11-04
Posts: 185
Posted: Mon, 2002-11-25 04:54

Anyone have any updates?