I noticed that Gallery doesn't translate newlines and new paragraphs from user comments correctly. A quick fix to anyone who wishes to do this:
in util.php within the function viewComments($index):
add the nl2br() function around the comment output. So
$commentdraw["comment"] = $comment->getCommentText(); becomes
$commentdraw["comment"] = nl2br($comment->getCommentText());
I'd like to suggest that in newer releases of Gallery, Captions and User Comments have this mod or something similar built-in.
Enjoy, for anyone who needs this.
Shazam
<!-- BBCode Start --><A HREF="http://www.g3D.com" TARGET="_blank">g3D</A><!-- BBCode End -->
Posts: 33
Thank you for pointing that out. It's simple but very useful. Actually I would love to see some more restrictions on using html in caption/description/title, just like what is done in those forum scripts (phpBB, vBB, etc.). There is a BBTag class made by yabb. It can be found in FreshMeat. Hopefully new G2 will include this feature.
After taking a closer look of current gallery, I noticed that although this is a great script, there are still a lot left to do. I just can't wait to see what G2 can do. But I guess we still need to wait until next year :???:
Posts: 1301
Whooops...got parse error, but it was my bad, not yours! :lol:
Works great! Thanks!
Quick question: This would be helpful in the addition of captions as well (I've just been adding break tags) - I just have to find where to add it. If you have that figured out too, I'd love to know.
Posts: 185
Hey Pixel, what was your line parse error? I got one too when I put in 1.3.3 on my local box and upgraded my remote one. I got a fatal error
Call to a member function on a non-object in /home/sites/goombalooza/docs/gallery/util.php on line 74
I got rid of the nl2br( ) around that field and it works fine now. I don't think any of the patches i used affected that comment line.
anyway, if anyone can help, i was trying to look for a nl2br function, or is a php function that just isn't working for me? it's php v 4.23
Posts: 1301
ACK! That was back in August....I have no idea what the error was, but most likely it was a typo on my part (often is when I'm in a hurry and stick in an extra space or something).
I really don't recall what it was now....sorry!
Gaile
Posts: 185
i figured that may happen since it was a while ago. I was checking the diff in that function from 1.3.2 to 1.3.3 and saw that, when i revert that line, it's ok. just curious..