FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Installation Issues » Forcing New Line at Beginning of Signature for News Group Post?
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Forcing New Line at Beginning of Signature for News Group Post? [message #159627] Sat, 13 June 2009 09:06 Go to next message
jm2morri is currently offline  jm2morri   Canada
Messages: 225
Registered: January 2009
Location: Stratford, Ontario, Canad...
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
I have noticed that if a user doesn't end there message with a blank line that the signature that gets appended to the message when uploaded to an nntp server doesn't start on a new line.

I think this should be forced in. Can someone point me to the file that I'd need to add that in? I imagine it would be relatively easy to do if I knew where to do it.

James.
Re: Forcing New Line at Beginning of Signature for News Group Post? [message #159629 is a reply to message #159627] Sat, 13 June 2009 09:58 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3654
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
Will this help:

Index: imsg_edt.inc.t
===================================================================
RCS file: /forum21/install/forum_data/src/imsg_edt.inc.t,v
retrieving revision 1.177
diff -u -r1.177 imsg_edt.inc.t
--- imsg_edt.inc.t      29 Apr 2009 20:34:12 -0000      1.177
+++ imsg_edt.inc.t      13 Jun 2009 13:57:43 -0000
@@ -544,7 +544,7 @@
                                define('sql_p', '{SQL_TABLE_PREFIX}');

                                $lock = $nntp->get_lock();
-                               $nntp->post_message($mtf->subject, $body.$nntp_adm->custom_sig, $from, $mtf->id, $replyto_id, $attach);
+                               $nntp->post_message($mtf->subject, $body."\n".$nntp_adm->custom_sig, $from, $mtf->id, $replyto_id, $attach);
                                $nntp->close_connection();
                                $nntp->release_lock($lock);
                        } else {


Please let me know so we can update the CVS repository.
Re: Forcing New Line at Beginning of Signature for News Group Post? [message #159632 is a reply to message #159629] Sat, 13 June 2009 16:31 Go to previous messageGo to next message
jm2morri is currently offline  jm2morri   Canada
Messages: 225
Registered: January 2009
Location: Stratford, Ontario, Canad...
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
naudefj wrote on Sat, 13 June 2009 09:58
Will this help:

Index: imsg_edt.inc.t
===================================================================
RCS file: /forum21/install/forum_data/src/imsg_edt.inc.t,v
retrieving revision 1.177
diff -u -r1.177 imsg_edt.inc.t
--- imsg_edt.inc.t      29 Apr 2009 20:34:12 -0000      1.177
+++ imsg_edt.inc.t      13 Jun 2009 13:57:43 -0000
@@ -544,7 +544,7 @@
                                define('sql_p', '{SQL_TABLE_PREFIX}');

                                $lock = $nntp->get_lock();
-                               $nntp->post_message($mtf->subject, $body.$nntp_adm->custom_sig, $from, $mtf->id, $replyto_id, $attach);
+                               $nntp->post_message($mtf->subject, $body."\n".$nntp_adm->custom_sig, $from, $mtf->id, $replyto_id, $attach);
                                $nntp->close_connection();
                                $nntp->release_lock($lock);
                        } else {


Please let me know so we can update the CVS repository.



Maybe. Do I need to do anything after I make that change? Like rebuild something or other?

James.

Re: Forcing New Line at Beginning of Signature for News Group Post? [message #159633 is a reply to message #159632] Sat, 13 June 2009 16:42 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3654
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
Yes, you need to rebuild your themes.
Re: Forcing New Line at Beginning of Signature for News Group Post? [message #159634 is a reply to message #159633] Sat, 13 June 2009 16:48 Go to previous messageGo to next message
jm2morri is currently offline  jm2morri   Canada
Messages: 225
Registered: January 2009
Location: Stratford, Ontario, Canad...
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
naudefj wrote on Sat, 13 June 2009 16:42
Yes, you need to rebuild your themes.


The patch works perfectly for me. Just what the doctor ordered.

James.
Re: Forcing New Line at Beginning of Signature for News Group Post? [message #159755 is a reply to message #159634] Fri, 19 June 2009 19:29 Go to previous messageGo to next message
jm2morri is currently offline  jm2morri   Canada
Messages: 225
Registered: January 2009
Location: Stratford, Ontario, Canad...
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
jm2morri wrote on Sat, 13 June 2009 16:48
naudefj wrote on Sat, 13 June 2009 16:42
Yes, you need to rebuild your themes.


The patch works perfectly for me. Just what the doctor ordered.

James.



Oops, I spoke too soon. The signature delimiter needs to be "-- ", in other words "dash" "dash" "space". With this patch the "space" is missing.

I'm working on trying to fix that but no joy so far.

James.
Re: Forcing New Line at Beginning of Signature for News Group Post? [message #159756 is a reply to message #159755] Fri, 19 June 2009 19:47 Go to previous messageGo to next message
jm2morri is currently offline  jm2morri   Canada
Messages: 225
Registered: January 2009
Location: Stratford, Ontario, Canad...
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
I _think_ what might be going on here is in the file src/imsg_edt.inc around line 787 in 2.8:

$body = $mtf->body . (($mtf->msg_opt & 1 && $mtf->sig) ? "\n-- \n" . $mtf->sig : '');
$body = plain_text($body, '{TEMPLATE: post_html_quote_start_p1}', '{TEMPLATE: post_html_quote_start_p2}', '{TEMPLATE: post_html_quote_end}');


I don't really know what I'm doing, but my thought is that the function plain_text() is removing trailing spaces from lines (which would normally be OK). But it would then remove the space behind the two dashes and thus nntp clients don't recognise the signature.

I think the easiest solution would be to convert to plain text and then prepend the signature. So basically flip the two lines, more or less.

Any comments?

James.

Re: Forcing New Line at Beginning of Signature for News Group Post? [message #159762 is a reply to message #159756] Sat, 20 June 2009 21:54 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3654
Registered: December 2004
Karma: 17
Senior Member
Administrator
Core Developer
add to buddy list
ignore all messages by this user
Why don't you try it and let us know if it solves the problem? Just remember to plain_text() the signature as well.

Should I back-out the patch against imsg_edt.inc.t?
Re: Forcing New Line at Beginning of Signature for News Group Post? [message #159772 is a reply to message #159762] Mon, 22 June 2009 07:50 Go to previous message
jm2morri is currently offline  jm2morri   Canada
Messages: 225
Registered: January 2009
Location: Stratford, Ontario, Canad...
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
naudefj wrote on Sat, 20 June 2009 21:54
Why don't you try it and let us know if it solves the problem? Just remember to plain_text() the signature as well.

Should I back-out the patch against imsg_edt.inc.t?


Hi Frank,

I figured out what was going on. I have added a prefix of "-- " to the newsgroup signature. But then that goes through the plain_text() filter and the trailing space is removed.

But that is not the right way to do it. In nntp any signature should always start with the standard "-- " so I changed the line in imsg_edt.inc.t to

$nntp->post_message($mtf->subject, $body." \n-- \n".$nntp_adm->custom_sig, $from, $mtf->id, $replyto_id, $attach);


So that it is always generated with this signature. I suppose a more generic solution would be to only add the "-- " if there was a signature but for me there always will be so it's not a problem.

Then the news group sig that the admin enters doesn't need to worry about this and it all works fine.

Cheers,

James.
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Still no Umlaut in Dates with 2.8.1
Next Topic: Admin control center broken after upgrade
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Jun 24 18:38:34 EDT 2018

Total time taken to generate the page: 0.00658 seconds