-// Show the link on the read-a-message screen
-function spamcop_show_link() {
- global $spamcop_enabled, $spamcop_method;
-
- if (! $spamcop_enabled)
- return;
-
- /* GLOBALS */
- sqgetGlobalVar('passed_id', $passed_id, SQ_GET);
- sqgetGlobalVar('mailbox', $mailbox, SQ_GET);
- sqgetGlobalVar('startMessage', $startMessage, SQ_GET);
- /* END GLOBALS */
-
- echo "<br>\n";
-
- if ($spamcop_method == 'web_form') {
-?><script language="javascript" type="text/javascript">
-document.write('<a href="../plugins/spamcop/spamcop.php?passed_id=<?PHP echo urlencode($passed_id); ?>&js_web=1&mailbox=<?PHP echo urlencode($mailbox); ?>" target="_blank">');
-document.write("<?PHP echo _("Report as Spam"); ?>");
-document.write("</a>");
-</script><noscript>
-<a href="../plugins/spamcop/spamcop.php?passed_id=<?PHP echo urlencode($passed_id); ?>&mailbox=<?PHP echo urlencode($mailbox); ?>&startMessage=<?PHP echo urlencode($startMessage); ?>">
-<?PHP echo _("Report as Spam"); ?></a>
-</noscript><?PHP
- } else {
-?><a href="../plugins/spamcop/spamcop.php?passed_id=<?PHP echo urlencode($passed_id); ?>&mailbox=<?PHP echo urlencode($mailbox); ?>&startMessage=<?PHP echo urlencode($startMessage); ?>">
-<?PHP echo _("Report as Spam"); ?></a>
-<?PHP
- }
+/**
+ * Shows spamcop link on the read-a-message screen
+ * @access private
+ */
+function spamcop_show_link(&$links) {
+ include_once(SM_PATH . 'plugins/spamcop/functions.php');
+ spamcop_show_link_function($links);