Notify the site admins (or whoever has access to approve links) when a new link has been suggested.

Comments

BradM’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev

I've made some progress with this, so hopefully someone here with more coding experience can help. I've hacked the module to send a PM whenever a link is submitted. The only problem is, the new PM is not assigned an ID in the 'privatemsg' table (it sits at 0) so even though the admin is told there is a new message, it does not actually show up in their inbox, even though all the data (aside from a proper ID) is added to the privatemsg table.

Basically, I added these 2 lines of code:

$msg = "TITLE: " . $v['title'] . "<BR>URL: " . $v['url'] . "<BR>DESCRIPTION: " . $v['description'];
db_query("INSERT INTO {privatemsg} (author, recipient, subject, message, timestamp, newmsg, hostname, format) VALUES ('%d', '%d', '%s', '%s', '%d', '%d', '%s', '%d')", 0, 1, 'link to validate', $msg, time(), 1, getenv("REMOTE_ADDR"), 3);

I placed the code in the linksdb_suggest_form_submit function, just above this line of code:

drupal_set_message(t("Thank you for your suggestion.  The site staff will review it shortly and if approved will be on the site soon."));

Any idea of why it isn't generating a proper ID in the privatemsg table?

Brad

nancydru’s picture

Status: Active » Fixed

In the 6.x-2.0 version of Web Links module, which I am creating a conversion for, you could use the Subscriptions module.

nancydru’s picture

A conversion function to the Web Links module is available for both 5.x and 6.x. That module provides this feature in 6.x-2.0-beta2 and -dev.

nancydru’s picture

Status: Fixed » Closed (fixed)