Page 2 of 2

PostPosted: 6:21pm, Wed 10 Sep, 2008
by Guest
This is a great mod
but you may want to include the phplist variable $table_prefix so non-standard installs don't have problems. thanks again
Code: Select all
if (isset($_GET['duplicate'])) {
  $result = Sql_query("insert into ".$table_prefix."message (id,subject,fromfield,tofield,replyto,message,textmessage,footer,entered,modified,embargo,repeatuntil,status,htmlformatted,sendformat,template,owner) select NULL,subject,fromfield,tofield,replyto,message,textmessage,footer,now(),now(),now(),now(),'draft',htmlformatted,sendformat,template,owner from ".$table_prefix."message where id=".intval($_GET['duplicate']));
}

But HOW do you install it?

PostPosted: 5:59pm, Thu 25 Sep, 2008
by kyleknapp
Okay, I've been hoping for a feature like this for as long as I've been using PHPList. Yay!

Now, PLEASE! Can someone explain how to install the patch???

I'm guessing the lines that look like
Code: Select all
@@ -269,7 +276,8 @@

are some kind of notation explaining how to position the code segments within the messages.php file, but they don't make any sense to me.

Anybody help?

PostPosted: 4:43pm, Thu 02 Oct, 2008
by kyleknapp
nudge....

PostPosted: 9:04pm, Mon 06 Oct, 2008
by Guest
Yes - it's not clear how to install this patch - just paste it to the bottom of messages.php?

PostPosted: 3:14pm, Thu 16 Oct, 2008
by rolan
I have uploaded the patch and an already patched version 2.10.5 of messages.php to

http://www.omnistep.com/phplist/

You can go there to download it.

I would attach it to this message but the forum seems to be having problems accepting zip and tgz files.

~Rolan

PostPosted: 9:42pm, Wed 12 Nov, 2008
by kyleknapp
It works!

I'm using PHPlist 2.10.5, so I just replaced messages.php from the ZIP file and ta-da! Thanks Rolan!

I still don't understand how the patch file works, though. And I'm guessing I'll need it next time I upgrade.:? Maybe if I open messages.php, both patched and uppatched versions, in my text editor, I can compare them and figure out where the patched lines of code go...

will this work in 2.10.8?

PostPosted: 2:58pm, Mon 02 Feb, 2009
by mckeephoto
I can't seem to get this to work in 2.10.8. I am copying and pasting and removing the stuff between the @@ @@ and the s% and +.

Or is that stuff important. No one mentioned how to do the patch itself and I am a bit of a newbie to php.

But, I guess, first of all, will it work with 2.10.8?

PostPosted: 3:21pm, Mon 02 Feb, 2009
by kyleknapp
Ditto that. I'm still using 2.10.5, and don't dare upgrade.

C'mon, guys - I REALLY appreciate your expertise and hard work (thanks Rolan for offering this mod), BUT can't someone just take a few minutes to explain to us HOW to install the patch? :?

Re: [mod] How to copy a message

PostPosted: 7:10pm, Thu 25 Jun, 2009
by houseofcakes
Hi,
I was looking for instructions myself and true to php programmer style, they won't/don't tell you (my brother just pulled the same thing on me. . . not fair! :P), because who told them the answers when they were learning?

Unfortunately, not all of us have the programmer's mind :(

Rather than give you the answer and face the wrath. . . I will post a "clue."

I *think* I figured it out reading this: http://docs.phplist.com/HowtoSubmitAPatch

I ran it local on my machine and then uploaded the patched version as I didn't trust myself to run it via SSH.

It worked for me for 2.10.8

This is a GREAT patch! GREAT. Did I say GREAT?
*pats self on back for job well done*

Instructions to install on 2.11.5

PostPosted: 7:09pm, Sun 09 Dec, 2012
by solmar
I have adapted the old Flug's code for version 2.11.5. A link to "duplicate this message" is something one expects to find in the standard interface, so I hope it will be included in the core functions of Phplist.

In admin/messages.php...

1) Find at about line 90:

print "<hr /><br />\n";
}

Add immediately after:

if (isset($_GET['duplicate'])) {
$result = Sql_query("insert into phplist_message (id,subject,fromfield,tofield,replyto,message,textmessage,footer,entered,modified,embargo,repeatuntil,status,htmlformatted,sendformat,template,owner) select NULL,subject,fromfield,tofield,replyto,message,textmessage,footer,now(),now(),now(),now(),'draft',htmlformatted,sendformat,template,owner from phplist_message where id=".intval($_GET['duplicate']));
}


If you have put the code in the right position, the next lines are:

if (isset($_GET['resend'])) {
$resend = sprintf('%d',$_GET['resend']);


2) At about line 330 update the following code

if ($msg['status'] == 'inprocess') {
$statusdiv .= '<br/>'.
PageLink2('messages&suspend='.$msg['id'],$GLOBALS['I18N']->get('Suspend Sending'));

...and make it as follows:

if ($msg['status'] == 'inprocess' || $msg['status'] == 'submitted') {
$statusdiv .= '<br/>'.
PageLink2('messages&suspend='.$msg['id'],$GLOBALS['I18N']->get('Suspend Sending'));



3) At about line 360 update the following code

## only draft messages should be deletable, the rest isn't
$deletelink = sprintf('<a href="javascript:deleteRec(\'%s\');">'.$GLOBALS['I18N']->get("delete").'</a>',
PageURL2("messages$url_keep","","delete=".$msg["id"]));


...as follows:

## only draft messages should be deletable, the rest isn't
$deletelink = sprintf('<a href="javascript:deleteRec(\'%s\');">'.$GLOBALS['I18N']->get("delete").'</a><br />%s',
PageURL2("messages$url_keep","","delete=".$msg["id"]), PageLink2("messages",'Duplicate','type=draft&duplicate='.$msg["id"]));