aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-05-18 02:00:06 -0700
committerfriendica <info@friendica.com>2014-05-18 02:00:06 -0700
commit2b44af445515a5e1beea14d3d47025a411d39e7b (patch)
tree5bd7b96501b16c38dfb33a3486bd74c985a189fb
parente79e8f4adde06315ab71877ec50a07d22fe2ec5b (diff)
downloadvolse-hubzilla-2b44af445515a5e1beea14d3d47025a411d39e7b.tar.gz
volse-hubzilla-2b44af445515a5e1beea14d3d47025a411d39e7b.tar.bz2
volse-hubzilla-2b44af445515a5e1beea14d3d47025a411d39e7b.zip
more app work
-rw-r--r--include/apps.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/include/apps.php b/include/apps.php
index 58af045f1..09aee0389 100644
--- a/include/apps.php
+++ b/include/apps.php
@@ -158,3 +158,47 @@ function app_decode($s) {
$x = base64_decode($s);
return json_decode($x,true);
}
+
+
+function app_store($arr) {
+
+ $darray = array();
+ $ret = array('success' => false);
+
+ $darray['app_url'] = ((x($arr,'url')) ? $arr['url'] : '');
+ $darray['app_channel'] = ((x($arr,'uid')) ? $arr['uid'] : 0);
+ if((! $darray['url']) || (! $darray['app_channel']))
+ return $ret;
+
+ $darray['app_id'] = ((x($arr,'guid')) ? $arr['guid'] : random_string());
+ $darray['app_sig'] = ((x($arr,'sig')) ? $arr['sig'] : '');
+ $darray['app_author'] = ((x($arr,'author')) ? $arr['author'] : get_observer_hash());
+ $darray['app_name'] = ((x($arr,'name')) ? escape_tags($arr['name']) : t('Unknown'));
+ $darray['app_desc'] = ((x($arr,'desc')) ? escape_tags($arr['desc']) : '');
+ $darray['app_photo'] = ((x($arr,'photo')) ? $arr['photo'] : z_root() . '/' . get_default_profile_photo(80));
+ $darray['app_version'] = ((x($arr,'version')) ? escape_tags($arr['version']) : '');
+
+ $r = q("insert into app ( app_id, app_sig, app_author, app_name, app_desc, app_url, app_photo, app_version, app_channel) values ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d )",
+ dbesc($darray['app_id']),
+ dbesc($darray['app_sig']),
+ dbesc($darray['app_author']),
+ dbesc($darray['app_name']),
+ dbesc($darray['app_desc']),
+ dbesc($darray['app_url']),
+ dbesc($darray['app_photo']),
+ dbesc($darray['app_version']),
+ intval($darray['app_channel'])
+ );
+ if($r)
+ $ret['success'] = true;
+
+ return $ret;
+}
+
+
+function app_update($arr) {
+
+
+
+
+} \ No newline at end of file