"view comments" v.1.4.2

sexdrvn

Joined: 2003-12-30
Posts: 57
Posted: Fri, 2004-03-26 09:38

I am sure this would be a great add-on for this version.
to be ablt to view all comments made for pics in a perticular album.

there are working examples such as http://www.tnatech.com/gallery

but same code can't seem to work in 1.4.2

has anyone developed this code for new version...

(maybe we can get it for the next update as a feature to turn off/on)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2004-03-26 16:26

In albums.php find this:

print lastCommentString($lastCommentDate, $displayCommentLegend);

and add these lines below:

if ($lastCommentDate > 0) { ?>
<br><span class=error>*</span><a href=<?php echo makeGalleryUrl("view_comments.php", array("set_albumName" 
=> $tmpAlbumName)) ?>>[View comments for this album]</a>
<?php }

before the ?>
This will only display the link if there is comments for the album or subalbum. Take out the span and * if you wish and change the text of the link and square brackets if you wish as well.

Dave

 
sexdrvn

Joined: 2003-12-30
Posts: 57
Posted: Fri, 2004-03-26 21:22

Floridave,

Thanks for the reply I have added the code where you said to, but i get no change on the page after making the change in the code...
is there something else that needs to be edited somewhere for it to display..??? I can see your source code and it looks like that should work like yours, but there must be something else missing in it to get it to display.

Again thanks for the reply.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2004-03-26 21:38

sexdrvn,
In config.php verify:

$gallery->app->comments_indication = "both";
$gallery->app->comments_indication_verbose = "yes";

Dave

 
sexdrvn

Joined: 2003-12-30
Posts: 57
Posted: Sat, 2004-03-27 02:39

Floridave,

We are defiantely making progress...
adding that $gallery->app->comments_indication = "both";
string let it appear in the main page.
BUT the only thing not working at this point is that when you click on the link it takes you no where???

you forgive my ignorance, my PHP language experience is very limited.

I can see the link, it just doesn't go anywhere.

we are getting there.

I can't thank you enough for thus far..

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2004-03-27 05:15

OOOPS :oops:

Need to mod one more file:
view_comments.php find this line

// Hack check
if (!$gallery->user->isAdmin() && !$gallery->user->isOwnerOfAlbum($gallery->album)) {

and change to:

// Hack changed to allow all that can read album to read comment
if (!$gallery->user->canReadAlbum($gallery->album)) {

Dave

 
sexdrvn

Joined: 2003-12-30
Posts: 57
Posted: Sat, 2004-03-27 17:43

That worked!!!! WooooHoooo!

I thank you Soooo much, I have been wanting that to work for some time.

 
sexdrvn

Joined: 2003-12-30
Posts: 57
Posted: Sat, 2004-03-27 17:45

So I guess for those looking to do the same thing in their Gallery v1.4.2 all the steps put together to get "view comments" in the main page is the following code, I hope this will benefit others as well.

In albums.php find this:
Code:

Quote:
print lastCommentString($lastCommentDate, $displayCommentLegend);

and add these lines below:
Code:

Quote:
if ($lastCommentDate > 0) { ?>
<br><span class=error>*</span><a href=<?php echo makeGalleryUrl("view_comments.php", array("set_albumName"
=> $tmpAlbumName)) ?>>[View comments for this album]</a>
<?php }

before the ?>

In config.php verify:
Code:

Quote:
$gallery->app->comments_indication = "both";
$gallery->app->comments_indication_verbose = "yes";

Need to mod one more file:
view_comments.php find this line Code:

Quote:
// Hack check
if (!$gallery->user->isAdmin() && !$gallery->user->isOwnerOfAlbum($gallery->album)) {

and change to:
Code:

Quote:
// Hack changed to allow all that can read album to read comment
if (!$gallery->user->canReadAlbum($gallery->album)) {

 
somethinclever

Joined: 2004-03-09
Posts: 8
Posted: Tue, 2004-04-06 17:53

is there a way for this to work on sub albums?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2004-04-06 21:11

Sure,
Look in view_album.php insted of albums.php and make the mod.

Dave

 
sexdrvn

Joined: 2003-12-30
Posts: 57
Posted: Wed, 2004-04-21 10:44

After installing and updating my gallery and overwritting the files I needed to get it all back to normal i get this error when click on the view comments link.

is there something we need to change on this line to get it to work???

Quote:
Fatal error: Call to undefined function: myalbumname() in /home/eclipse/public_html/gallery/view_comments.php on line 151

 
sexdrvn

Joined: 2003-12-30
Posts: 57
Posted: Wed, 2004-04-21 10:44

After installing and updating my gallery to 1.4.3 and overwritting the files I needed to get it all back to normal i get this error when click on the view comments link.

is there something we need to change on this line to get it to work???

Quote:
Fatal error: Call to undefined function: myalbumname() in /home/eclipse/public_html/gallery/view_comments.php on line 151

 
sexdrvn

Joined: 2003-12-30
Posts: 57
Posted: Wed, 2004-04-21 10:44

After installing and updating my gallery to 1.4.3 and overwritting the files I needed to get it all back to normal i get this error when click on the view comments link.

is there something we need to change on this line to get it to work???

Quote:
Fatal error: Call to undefined function: myalbumname() in /home/eclipse/public_html/gallery/view_comments.php on line 151

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2004-04-21 21:16

sexdrvn,
I don't see a funtion called myalbumname on line 151 of view_comments.php of version 1.4.3 RC3
view_comments.php should have a id like: $Id: view_comments.php,v 1.27 at the top.

The only thing I changed in 1.4.3RC3-view_comments was

// Hack check changed to allow all that can read album to read comment
if (!$gallery->user->canReadAlbum($gallery->album)) {

Perhaps your ftp client did not overwrite all the files on your server?

Dave

 
sexdrvn

Joined: 2003-12-30
Posts: 57
Posted: Thu, 2004-04-22 06:29

Well i guess that was my fault
I replaced all the files changed in previous back over the newer ones to get view comments back.
I still had the old ver viewcomments.php file.

when i reloaded the new and made your line change, errors went away.

its up and running again, thanks.

I wish i new more php, guess after I finish school I could pick up another class in programming. add that to my studies...
:wink: