diff options
author | friendica <info@friendica.com> | 2014-05-18 18:21:20 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-05-18 18:21:20 -0700 |
commit | 466fe725bc056ad7ed2c3bf24783b65565293472 (patch) | |
tree | 89fa59a2450ed62ce390110b56dca091169b7c60 /include/apps.php | |
parent | 68ca4ef19e0617904d8557e95ec74d09af833d00 (diff) | |
download | volse-hubzilla-466fe725bc056ad7ed2c3bf24783b65565293472.tar.gz volse-hubzilla-466fe725bc056ad7ed2c3bf24783b65565293472.tar.bz2 volse-hubzilla-466fe725bc056ad7ed2c3bf24783b65565293472.zip |
start to build out the apps
Diffstat (limited to 'include/apps.php')
-rw-r--r-- | include/apps.php | 62 |
1 files changed, 56 insertions, 6 deletions
diff --git a/include/apps.php b/include/apps.php index 09aee0389..ac6f34ee5 100644 --- a/include/apps.php +++ b/include/apps.php @@ -119,10 +119,8 @@ function translate_system_apps(&$arr) { } function app_render($app) { - - - - +//debugging + return print_r($app,true); } @@ -177,8 +175,11 @@ function app_store($arr) { $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']) : ''); + $darray['app_addr'] = ((x($arr,'addr')) ? escape_tags($arr['addr']) : ''); + $darray['app_price'] = ((x($arr,'price')) ? escape_tags($arr['price']) : ''); + $darray['app_page'] = ((x($arr,'page')) ? escape_tags($arr['page']) : ''); - $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 )", + $r = q("insert into app ( app_id, app_sig, app_author, app_name, app_desc, app_url, app_photo, app_version, app_channel, app_addr, app_price, app_page ) values ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s' )", dbesc($darray['app_id']), dbesc($darray['app_sig']), dbesc($darray['app_author']), @@ -187,7 +188,10 @@ function app_store($arr) { dbesc($darray['app_url']), dbesc($darray['app_photo']), dbesc($darray['app_version']), - intval($darray['app_channel']) + intval($darray['app_channel']), + dbesc($darray['app_addr']), + dbesc($darray['app_price']), + dbesc($darray['app_page']) ); if($r) $ret['success'] = true; @@ -201,4 +205,50 @@ function app_update($arr) { +} + + +function app_encode($app) { + + $ret = array(); + + if($app['app_id']) + $ret['guid'] = $app['app_id']; + + if($app['app_id']) + $ret['guid'] = $app['app_id']; + + if($app['app_sig']) + $ret['sig'] = $app['app_sig']; + + if($app['app_author']) + $ret['author'] = $app['app_author']; + + if($app['app_name']) + $ret['name'] = $app['app_name']; + + if($app['app_desc']) + $ret['desc'] = $app['app_desc']; + + if($app['app_url']) + $ret['url'] = $app['app_url']; + + if($app['app_photo']) + $ret['photo'] = $app['app_photo']; + + if($app['app_version']) + $ret['version'] = $app['app_version']; + + if($app['app_addr']) + $ret['addr'] = $app['app_addr']; + + if($app['app_price']) + $ret['price'] = $app['app_price']; + + if($app['app_page']) + $ret['page'] = $app['app_page']; + + $j = json_encode($ret); + return '[app]' . base64_encode($j) . '[/app]'; + }
\ No newline at end of file |