aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-26 03:42:05 -0800
committerfriendica <info@friendica.com>2013-01-26 03:42:05 -0800
commit3e0040d7c3823e606d222dc4a8225bcb7d08a044 (patch)
treed56e87e37c2d73616ed3ca881f4a252613609426 /include
parent91126d8dd33bdfa86ab1013561833b0c3c224a14 (diff)
downloadvolse-hubzilla-3e0040d7c3823e606d222dc4a8225bcb7d08a044.tar.gz
volse-hubzilla-3e0040d7c3823e606d222dc4a8225bcb7d08a044.tar.bz2
volse-hubzilla-3e0040d7c3823e606d222dc4a8225bcb7d08a044.zip
photos cont.
Diffstat (limited to 'include')
-rw-r--r--include/photos.php46
1 files changed, 45 insertions, 1 deletions
diff --git a/include/photos.php b/include/photos.php
index 6609a6fa8..0d0750c22 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -274,4 +274,48 @@ function photos_album_widget($channelx,$observer,$albums = null) {
));
}
return $o;
-} \ No newline at end of file
+}
+
+function photos_album_exists($channel_id,$album) {
+ $r = q("SELECT id from photo where album = '%s' and uid = %d limit 1",
+ dbesc($album),
+ intval($channel_id)
+ );
+ return (($r) ? true : false);
+}
+
+function photos_album_rename($channel_id,$oldname,$newname) {
+ return q("UPDATE photo SET album = '%s' WHERE album = '%s' AND uid = %d",
+ dbesc($newname),
+ dbesc($oldname),
+ intval($channel_id)
+ );
+}
+
+
+function photos_album_get_db_idstr($channel_id,$album,$remote_xchan = '') {
+
+ if($remote_xchan) {
+ $r = q("SELECT distinct resource_id as from photo where xchan = '%s' and uid = %d and album = '%s' ",
+ dbesc($remote_xchan),
+ intval($channel_id),
+ dbesc($album)
+ );
+ }
+ else {
+ $r = q("SELECT distinct resource_id from photo where uid = %d and album = '%s' ",
+ intval($channel_id),
+ dbesc($album)
+ );
+ }
+ if($r) {
+ $arr = array();
+ foreach($r as $rr) {
+ $arr[] = "'" . dbesc($rr['resource_id']) . "'" ;
+ }
+ $str = implode(',',$arr);
+ return $str;
+ }
+ return false;
+
+}