diff options
author | tuscanhobbit <tuscanhobbit@users.noreply.github.com> | 2014-06-24 12:13:54 +0200 |
---|---|---|
committer | tuscanhobbit <tuscanhobbit@users.noreply.github.com> | 2014-06-24 12:13:54 +0200 |
commit | 4c78c3bdee5ac6c70f4de7886734e6ef06b37a26 (patch) | |
tree | d47a527d6e537ac94eed911afee6056fa1005d92 /include/attach.php | |
parent | cc4001fce7934b49e6e7888a602b9bb9c33cf37f (diff) | |
download | volse-hubzilla-4c78c3bdee5ac6c70f4de7886734e6ef06b37a26.tar.gz volse-hubzilla-4c78c3bdee5ac6c70f4de7886734e6ef06b37a26.tar.bz2 volse-hubzilla-4c78c3bdee5ac6c70f4de7886734e6ef06b37a26.zip |
Oops I left some debug stuff around
Diffstat (limited to 'include/attach.php')
-rw-r--r-- | include/attach.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/attach.php b/include/attach.php index bf58566fe..f5eaaa448 100644 --- a/include/attach.php +++ b/include/attach.php @@ -834,20 +834,26 @@ function get_cloudpath($arr) { return $path; } +/** + * @brief Returns path to parent folder in cloud/. + * + * @param $arr + * @return string with the folder path + */ function get_parent_cloudpath($channel_id, $channel_name, $attachHash) { //Build directory tree and redirect $parentHash = $attachHash; do { - $parentHash = findFolderHashByAttachHash($channel_id, $parentHash); + $parentHash = find_folder_hash_by_attach_hash($channel_id, $parentHash); if ($parentHash) { - $parentName = findFilenameByHash($channel_id, $parentHash); + $parentName = find_filename_by_hash($channel_id, $parentHash); $parentFullPath = $parentName."/".$parentFullPath; } } while ($parentHash); $parentFullPath = z_root() . "/cloud/" . $channel_name . "/" . $parentFullPath; - goaway($parentFullPath); + return $parentFullPath; } -function findFolderHashByAttachHash($channel_id, $attachHash) { +function find_folder_hash_by_attach_hash($channel_id, $attachHash) { $r = q("select * from attach where uid = %d and hash = '%s' limit 1", intval($channel_id), dbesc($attachHash) ); @@ -859,7 +865,7 @@ function findFolderHashByAttachHash($channel_id, $attachHash) { } return $hash; } -function findFilenameByHash($channel_id, $attachHash) { +function find_filename_by_hash($channel_id, $attachHash) { $r = q("select * from attach where uid = %d and hash = '%s' limit 1", intval($channel_id), dbesc($attachHash) ); |