Skip to content

Commit

Permalink
Merge pull request #613 from bramley/plugin_link_click
Browse files Browse the repository at this point in the history
Allow additional processing of a link click by plugins.
  • Loading branch information
suelaP committed Dec 6, 2019
2 parents 346b5fb + 939a3ee commit aa05aa3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
35 changes: 24 additions & 11 deletions public_html/lists/admin/defaultplugin.php
Expand Up @@ -280,15 +280,15 @@ public function pageTitleHover($page)
return $this->name.' : '.$page;
}

/**
/**
* deleteSent - wipe DB entries marking a campaign sent for subscribers
* this is used in DEV mode only.
*/
public function deleteSent()
{
}

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

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

/**
/**
* displayConfig
* purpose: display input for a config variable in the backend
* parameters:
Expand Down Expand Up @@ -399,7 +399,7 @@ public function adminmenu()
//###########################################################
// Frontend

/**
/**
* return snippet for the Subscribe page
*/
public function displaySubscriptionChoice($pageData, $userID = 0)
Expand All @@ -412,7 +412,7 @@ public function validateSubscriptionPage($pageData)
return;
}

/**
/**
* parse the text of the thankyou page
* parameters:
* pageid -> id of the subscribe page
Expand Down Expand Up @@ -445,7 +445,7 @@ public function displayMessages($msg, &$status)
//###########################################################
// Message

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

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

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

/**
/**
* messageStatus
* @param int $id messageid
* @param string $status message status
Expand Down Expand Up @@ -710,7 +710,7 @@ public function messageHeaders($mail)
return array();
}

/**
/**
* parseFinalMessage
* purpose: create the actual message, based on the text and html content as prepared by phplist
* parameters:
Expand Down Expand Up @@ -1086,6 +1086,19 @@ public function validateEmailAddress($emailAddress)
return true;
}

/**
* Allow additional processing of a link click.
*
* @param string $msgtype H or T
* @param int $fwdid id of row in linktrack_forward table
* @param int $messageid id of row in message table
* @param int $userid id of row in user table
* @param string $url url of row in linktrack_forward table
*/
public function linkClick($msgtype, $fwdid, $messageid, $userid, $url)
{
}

//#####################################
// Static functions to manage the collection of plugins

Expand Down
3 changes: 3 additions & 0 deletions public_html/lists/lt.php
Expand Up @@ -265,6 +265,9 @@
}
}

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

0 comments on commit aa05aa3

Please sign in to comment.