Hi There,
I just downloaded Coppermine, and I'm enjoying a lot. But, at the very first contact, I noticed that I can't write multiline comments in the pictures...
So, I searched the forum, and found a topic with a guy asking this same question.
The comment field originally is single line, but when you edit the comment, it becames "multi lined".
If you edit your comment and type a new "multi lined" comment, the comment is inserted normally in the database, with the correct line breaks, although, the comment is displayed as a single line.
So, as I didn't found any solution for this, I made myself this modification,
Now, the comment field is always multiline (<textarea>) for adding / editing and the comment is displayed as they really are (with the line breaks...)
Files to edit:
displayimage.php
/themes/<YOUR THEME>/theme.php
1) Open file displayimage.php
1.1) Find:
'{MSG_BODY}' => &$comment_body,
1.2) Replace with:
'{MSG_BODY}' => nl2br(&$comment_body),
1.3) Find:
'{MSG_BODY_RAW}' => $row['msg_body'],
1.4) Replace with:
'{MSG_BODY_RAW}' => str_replace("<br />","\n",$row['msg_body']),
2) Open file /themes/<YOUR THEME>/theme.php
2.1) Find:
<input type="text" class="textinput" id="message" name="msg_body" onselect="storeCaret_post(this);" onclick="storeCaret_post(this);" onkeyup="storeCaret_post(this);" maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
2.2) Replace with:
<textarea class="textinput" id="message" name="msg_body" onselect="storeCaret_post(this);" onclick="storeCaret_post(this);" onkeyup="storeCaret_post(this);" maxlength="{MAX_COM_LENGTH}" style="width: 100%;" rows="2"></textarea>
Notice: If you use / allow your users to use more than one theme, so you have to do step 2) for each theme!...
Hope you enjoy and find this useful, as it was for me.
Comments and improvements are welcome!
PS: Sorry for my bad english!!
Thanks for your contribution.
@all: Marelo was refering to the mod Line breaks in comments (http://forum.coppermine-gallery.net/index.php?topic=11370.0)
My pleasure! At your service! ;)
This hack didn't work with my coppermine like this .. I had to change your
'{MSG_BODY}' => nl2br(&$comment_body),
into
'{MSG_BODY}' => nl2br($comment_body),
without the " & " : no more errors;
btw thx alot for this trippy hack dood 8)
Hi there^^
Well, I applied the "hack" as I would like my visitors to write multi-line comments but unfortunately nothing changed ... T_T I still have a single-line field which does noch create line breaks or anything else. Have I done anything wrong?
I would really really like to add this feature so I would appreciate your help very much!^^
how are we suppossed to help without a link and a non-admin user account?
Oh, I'm very sorry GauGau ^^""""
... besides I managed to have the files working *jumps happily* ^0^ I just made there real stupid mistake to upload the files into the 2nd one of my two galleries and therefore the 1st one did not show any changes ... of course ^^""""""""""""""
Sorry for causing you so much trouble... (well, girls and technical stuff ^,^ ... you know ^.~)
Next time I will check both galleries of mine first, BEFORE posting *sneaks away*
Anyway, thanks for your quick answer^^
Hello,
Anyone have an idea about how to add the multiline comment mod to 1.4? There is no instance of 'MSG' or '$comment' in displayimage.php, and the classic theme.php file is empty, so I'm a bit lost. Any help is appreciated.
EDIT: sorry, there are a couple instances of '$comments' in displayimage.php, but I'm not sure if/how they would apply to this mod. Thanks.
Here's the mod converted to a plugin for 1.4. Use the plugin manager from config to upload and install the attached file.
Updated to 1.1
Hello, how goes with this new plugin manager?
Hi Nibbler.
I'm getting double space in all line breaks :/
Im getting this:
This is a comment
with only one break
and I think the correct is:
This is a comment
with only one break
PS: I'm talking with cpg 1.4.2 (in all themes) + Multiline Plugin.
Tnx
That's odd. I've updated the plugin to v1.1
Now works perfect! :)
Tnx
Marelo and Nibbler; thanks for this nifty little plugin. Just found it and I'm using it now, works fine. One of those you just didn't know you needed until you found it :)
created a separate thread for Nibbler's plugin: http://forum.coppermine-gallery.net/index.php?topic=25283.0
All questions regarding the plugin should go there.
Does this work with 1.4.5?
Should do.
And indeed it does, the one from http://forum.coppermine-gallery.net/index.php?topic=25283.0 though
Hi Nibbler,
You said: "Here's the mod converted to a plugin for 1.4. Use the plugin manager from config to upload and install the attached file."
I can't find the plugin mgr in config. Where is it exactly ?
thanks.
pluginmgr.php
thank you.
Coppermine manual: , section "4.14.3 The Plugin Manager (http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#plugin_manager)" ::)
Quote from: Nibbler on November 26, 2005, 04:44:23 PM
Here's the mod converted to a plugin for 1.4. Use the plugin manager from config to upload and install the attached file.
Updated to 1.1
Hi Nibbler
In the first time I've installed yuor multiline comments V 1.0 plugin in cpg 1.4 whit Stramm modpack and all works fine
After I've installed a multiline comments V 1.1 and I've found a little incompatibility whit the subscribe/unscribe comments control of Stramm modpack:
in the write comment box below the pics, the clickable text (subscribe/unscribe) is disappeared
How to fix it?
Sorry for my poor english
best regards
You can't install more than one plugin that affects the same template or theme function. You'd need to merge the functionality of the two plugins manually.
Quote from: Nibbler on August 21, 2006, 12:38:31 PM
You can't install more than one plugin that affects the same template or theme function. You'd need to merge the functionality of the two plugins manually.
... no Nibbler, sorry, I've uninstalled the 1.0 version and after I've installed the 1.1 and the clickable text (subscribe/unscribe) is disappeared
angeldevil, I already told you that the 1.0 version of this plugin worked for you cause it's already modified to work with the modpack (as it's included into the modpack). To make version 1.1 compatible you'd have to have a look at codebase.php and add placeholders necessary for the modpack... it's like working with templates.
Quote from: Stramm on August 22, 2006, 07:22:48 AM
angeldevil, I already told you that the 1.0 version of this plugin worked for you cause it's already modified to work with the modpack (as it's included into the modpack). To make version 1.1 compatible you'd have to have a look at codebase.php and add placeholders necessary for the modpack... it's like working with templates.
OK but I,ve tryed without successful
TNX
thank you - I installed this and it worked great :)