[mod] How to copy a message

3rd party code for phpList

Postby Guest » 6:21pm, Wed 10 Sep, 2008

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']));
}
Guest
 

But HOW do you install it?

Postby kyleknapp » 5:59pm, Thu 25 Sep, 2008

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?
kyleknapp
PL Geek
 
Posts: 67
Joined: 6:39pm, Tue 29 Aug, 2006
Location: Omaha, NE

Postby kyleknapp » 4:43pm, Thu 02 Oct, 2008

nudge....
kyleknapp
PL Geek
 
Posts: 67
Joined: 6:39pm, Tue 29 Aug, 2006
Location: Omaha, NE

Postby Guest » 9:04pm, Mon 06 Oct, 2008

Yes - it's not clear how to install this patch - just paste it to the bottom of messages.php?
Guest
 

Postby rolan » 3:14pm, Thu 16 Oct, 2008

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
rolan
phpList newbie
 
Posts: 4
Joined: 11:49pm, Mon 19 Nov, 2007

Postby kyleknapp » 9:42pm, Wed 12 Nov, 2008

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...
kyleknapp
PL Geek
 
Posts: 67
Joined: 6:39pm, Tue 29 Aug, 2006
Location: Omaha, NE

will this work in 2.10.8?

Postby mckeephoto » 2:58pm, Mon 02 Feb, 2009

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?
mckeephoto
PL Nut
 
Posts: 27
Joined: 5:16pm, Thu 29 Jan, 2009

Postby kyleknapp » 3:21pm, Mon 02 Feb, 2009

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? :?
kyleknapp
PL Geek
 
Posts: 67
Joined: 6:39pm, Tue 29 Aug, 2006
Location: Omaha, NE

Re: [mod] How to copy a message

Postby houseofcakes » 7:10pm, Thu 25 Jun, 2009

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*
houseofcakes
PL Nut
 
Posts: 17
Joined: 4:35pm, Wed 17 Jun, 2009

Instructions to install on 2.11.5

Postby solmar » 7:09pm, Sun 09 Dec, 2012

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"]));
solmar
PL Nut
 
Posts: 20
Joined: 5:16pm, Thu 26 Jun, 2008

Previous

Return to Contributions: Plug-ins, Add-ons, Mods

Who is online

Users browsing this forum: No registered users and 3 guests

cron