Hi list,
I was hoping someone could help with two questions:
1. Is it possible to configure gallery so that the comment box is contained with the album page - and not in a pop-up?
2. Is there a way to set cookies so that whenever a user comes back to make a comment, s/he won't have to input his or her name and email? That way, once a user fills out her name and email, she'll never have to do it again.
Thanks!
Posts: 89
This is something I've been wanting to do for a while now. Your message motivated me to work on it, and I've spent the last hour or so trying to get things to work. My install is a bit more complicated because we only allow registered users to post comments.
I ended up running into lot of conflicts between util.php and view_photo.php trying to get the array to work and reload the correct page.
I would be happy to send you my code though if you want to try and use it. Maybe we can get someone with a bit more knowledge to help us out.
Posts: 21
that would be great, thank you. my email address is
this is a silly question, but how does a user register? i don't see that option in my gallery. i would prefer only registered users to comment as well.
thank you,
wynn
Posts: 89
Check out <!-- BBCode Start --><A HREF="http://gallery.menalto.com/modules.php?op=modload&name=phpBB_14&file=index&action=viewtopic&topic=522&5067" TARGET="_blank">this</A><!-- BBCode End --> link for info on allowing users to self register. John did a great job with the hack and it works great for Gallery in stand-alone. I'm using gallery running under Invisionboard control, so my setup is a bit different.
Remember that any registered user will be able to create galleries and upload images (that's the default).
I'm going to clean up my code a little and try and make it more universal so that what I have will work with any Gallery instance. I'll post a link when I'm done, and hopefully in the meantime beckett or someone else will take a look at doing this.
Posts: 3473
I knew I was avoiding this thread for a reason. :roll: But do you mean just to move the add comment stuff into the view_photo page? Here's the quick and dirty way, or at least how I would approach it:
Why not just make the "Add Comment" link in view_photo.php point instead of the popup, just to the page you're on itself, wth a "flag variable" (<a href=<?php echo $PHP_SELF . "?addComment=1" ?>>), then wherever you want the add comment box to appear put:
<?php
if ($addComment) {
?>
HTML CODE FROM add_comment.php GOES HERE.....
<?php
}
?>
So now the box only appears when the addComment=1 bit is tacked on to the end of the URL. Then re-submit (change the form to reload view_photo.php) and move the add_comment submittal code (minus the dismissAndReload() and the return statements of course) somewhere else near the top of your view_photo.php page. Whiz bang, now it's all handled in the view_photo.php page. It's not high-quality code, but it should do the trick.
As for the "remember me next time I visit" bit, I dunno. I'd recommend you delve into PostNuke or something, and see if you can see how they do it. Why re-invent the wheel, right?
-Beckett (
)
Posts: 260
Hey,
have you skicrave or dooka managed to work out smth in the end?
Is there some code available yet, for a standalone version of Gallery?
Keep us updated.
cheers
p
Posts: 89
Honestly, I hadn't worked on it in a while. Your post inspired me to get going on it again, but after reviewing what beckett posted, I don't think that will work the way we want. I want the add comments info to always be in the vew_photo.php file right below the comments that have been left. Beckett's solution requires the user to click the add comments link, and then places the form in the page.
I got it working fine so that it saves the comment without any problems, but there is one line of code that is causing problems. When it builds the form, it points to add_comment.php due to this line:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE> <?php echo makeFormIntro("add_comment.php", array("name" => "theform", "method" => "POST")); ?> </TD></TR></TABLE><!-- BBCode End -->
We need to get it so that it's points to the same page the user was on. How do we get teh variable string for the photo and album the user is viewing?
Posts: 3473
makeAlbumUrl($gallery->session->albumName,$id)