aboutsummaryrefslogtreecommitdiffstats
path: root/include/attach.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/attach.php')
-rw-r--r--include/attach.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/attach.php b/include/attach.php
index e15f08bd4..172840b96 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -1438,6 +1438,22 @@ logger('attach_hash: ' . $attachHash);
return $hash;
}
+function find_folder_hash_by_path($channel_id, $path) {
+
+ $filename = end(explode('/', $path));
+
+ $r = q("SELECT hash FROM attach WHERE uid = %d AND filename = '%s' LIMIT 1",
+ intval($channel_id),
+ dbesc($filename)
+ );
+
+ $hash = '';
+ if($r && $r[0]['hash']) {
+ $hash = $r[0]['hash'];
+ }
+ return $hash;
+}
+
/**
* @brief Returns the filename of an attachment in a given channel.
*