function webform_protected_downloads_get_node_from_hash in Webform Protected Downloads 6
Same name and namespace in other branches
- 7 webform_protected_downloads.module \webform_protected_downloads_get_node_from_hash()
Retrieve the webform node based on the given hash
Parameters
string $hash :
Return value
void
1 call to webform_protected_downloads_get_node_from_hash()
- webform_protected_downloads_download_page in ./
webform_protected_downloads.page.inc - Displays the download page
File
- ./
webform_protected_downloads.module, line 714 - This file contains hook declarations and functions for the Webform Protected Downloads module.
Code
function webform_protected_downloads_get_node_from_hash($hash) {
$result = db_query("SELECT nid FROM {wpd_access_hashes} LEFT JOIN {webform_submissions} USING(sid) WHERE hash = '%s'", $hash);
$row = db_fetch_object($result);
return $row->nid ? $row->nid : FALSE;
}