[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Poco Forums • View topic - Inserting multilines (eg.. phrases)

Inserting multilines (eg.. phrases)

Scripting questions and ideas

Moderators: Eric, Tomas, robin, Michael

Inserting multilines (eg.. phrases)

Postby Sapiem » Sun Aug 06, 2006 2:38 am

Hello, and sorry to people that only understand english, I'll try to explain it in english...

I just said that I try to share with all this script that I make that avoid the trouble of make more than one file to random multiline text inside templates or signatures, for example phrases...

Poco let us call one file but not recognize break-lines. In the forum somebody said that we need more than one file to put multilines, But with this script, you don't need more than only one file, just we need declare one "keyword" (in this case we use "$$$MyJumpOfLine$$$") which we will replace by code when the email will be send, so we must include this script in Outgoing filters (Pre-Sent)

This script works with both styles and plain emails.

For example, create a file named "phrases.txt" with this 2 lines:


"phrases number 1"$$$MyJumpOfLine$$$Author 1
"phrases number 2"$$$MyJumpOfLine$$$Author 2


After that, we can add even in Templates or Signatures:


%random%:"phrases.txt"



(phrases.txt asumme will be in the same directory of Poco.exe)


This will show in each new email at the end one line from phrases.txt

At design or write time, you will see the keyword $$$MyJumpOfLine$$$, don't worry, it will be replaced at send time, and you should se that after in the Sent mailbox


Start Script (I named it "Replace Phrases.poc")--------------------------

ReadRawBody $a %message
StringPos #posi1 "$$$MyJumpOfLine$$$" $a
if #posi1 = 0 then Sale
Set $b " "
AppendBody $b " "
ReadHeader $Estilo "Content-Type:" %message
if "text/html" = $Estilo then Rico
AppendBody $b " "
GoTo Sigue
:Rico
AppendBody $b "<br>"
:Sigue
InsertString $a #posi1 $b
SubStrings $a "$$$MyJumpOfLine$$$"
AssignBody %message $a
:Sale


End Script ------------------------------


Don't forget add it at 1st in the Pre-Sent filters...!!!

I hope that all enjoy it, I use it a lot without any trouble...

I apreciate your opinions, and new ideas for this or other scripts or needs, I want to share all free...
Sapiem
Drop-in Visitor
 
Posts: 13
Joined: Mon May 29, 2006 10:01 am

Return to PocoScript Help and How-To

Who is online

Users browsing this forum: No registered users and 1 guest

cron