Skip to content

Commit aa05aa3

Browse files
authored
Merge pull request #613 from bramley/plugin_link_click
Allow additional processing of a link click by plugins.
2 parents 346b5fb + 939a3ee commit aa05aa3

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

public_html/lists/admin/defaultplugin.php

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,15 @@ public function pageTitleHover($page)
280280
return $this->name.' : '.$page;
281281
}
282282

283-
/**
283+
/**
284284
* deleteSent - wipe DB entries marking a campaign sent for subscribers
285285
* this is used in DEV mode only.
286286
*/
287287
public function deleteSent()
288288
{
289289
}
290290

291-
/**
291+
/**
292292
* write a value to the general config to be retrieved at a later stage
293293
* parameters: name -> name of the variable
294294
* value -> value of the variablesiable, can be a scalar, array or object
@@ -309,7 +309,7 @@ public function writeConfig($name, $value)
309309
return 1;
310310
}
311311

312-
/**
312+
/**
313313
* read a value from the general config to be retrieved at a later stage
314314
* parameters: name -> name of the variable
315315
* returns value
@@ -334,7 +334,7 @@ public function getConfig($name)
334334
return $result;
335335
}
336336

337-
/**
337+
/**
338338
* displayConfig
339339
* purpose: display input for a config variable in the backend
340340
* parameters:
@@ -399,7 +399,7 @@ public function adminmenu()
399399
//###########################################################
400400
// Frontend
401401

402-
/**
402+
/**
403403
* return snippet for the Subscribe page
404404
*/
405405
public function displaySubscriptionChoice($pageData, $userID = 0)
@@ -412,7 +412,7 @@ public function validateSubscriptionPage($pageData)
412412
return;
413413
}
414414

415-
/**
415+
/**
416416
* parse the text of the thankyou page
417417
* parameters:
418418
* pageid -> id of the subscribe page
@@ -445,7 +445,7 @@ public function displayMessages($msg, &$status)
445445
//###########################################################
446446
// Message
447447

448-
/**
448+
/**
449449
* add a tab to the "Send a Message page" for options to be set in the plugin
450450
* @param messageid ID of the message being displayed (should always be > 0)
451451
* @param messagedata associative array of all data from the db for this message
@@ -456,7 +456,7 @@ public function sendMessageTab($messageid = 0, $messagedata = array())
456456
return '';
457457
}
458458

459-
/**
459+
/**
460460
* If adding a TAB to the Send a Message page, what is the TAB's name
461461
* parameters: none
462462
* @return short title (less than about 10 characters)
@@ -467,7 +467,7 @@ public function sendMessageTabTitle($messageid = 0)
467467
return '';
468468
}
469469

470-
/**
470+
/**
471471
* If adding a TAB to the Send a Message page, try to insert the tab before the one returned here by title
472472
* parameters: none
473473
* returns: tab title to insert before
@@ -585,7 +585,7 @@ public function messageStatusLimitReached($recentlySent)
585585
return '';
586586
}
587587

588-
/**
588+
/**
589589
* messageStatus
590590
* @param int $id messageid
591591
* @param string $status message status
@@ -710,7 +710,7 @@ public function messageHeaders($mail)
710710
return array();
711711
}
712712

713-
/**
713+
/**
714714
* parseFinalMessage
715715
* purpose: create the actual message, based on the text and html content as prepared by phplist
716716
* parameters:
@@ -1086,6 +1086,19 @@ public function validateEmailAddress($emailAddress)
10861086
return true;
10871087
}
10881088

1089+
/**
1090+
* Allow additional processing of a link click.
1091+
*
1092+
* @param string $msgtype H or T
1093+
* @param int $fwdid id of row in linktrack_forward table
1094+
* @param int $messageid id of row in message table
1095+
* @param int $userid id of row in user table
1096+
* @param string $url url of row in linktrack_forward table
1097+
*/
1098+
public function linkClick($msgtype, $fwdid, $messageid, $userid, $url)
1099+
{
1100+
}
1101+
10891102
//#####################################
10901103
// Static functions to manage the collection of plugins
10911104

public_html/lists/lt.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@
265265
}
266266
}
267267

268+
foreach ($plugins as $pi) {
269+
$pi->linkClick($msgtype, $fwdid, $messageid, $userid, $url);
270+
}
268271
//print "Location $url"; exit;
269272
header('Location: '.$url, true, 303); //# use 303, because Location only uses 302, which gets indexed
270273
exit;

0 commit comments

Comments
 (0)