From 2a4e8972e0edfa3156d9ce54d68ce0e54c0ec289 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 18 Apr 2016 20:38:38 -0700 Subject: module updates --- include/api.php | 39 ++++++------- include/help.php | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++ include/importdoc.php | 2 +- include/nav.php | 2 +- include/photos.php | 40 ++++++++++++++ 5 files changed, 212 insertions(+), 21 deletions(-) create mode 100644 include/help.php (limited to 'include') diff --git a/include/api.php b/include/api.php index fd644947c..e64c86695 100644 --- a/include/api.php +++ b/include/api.php @@ -772,13 +772,15 @@ require_once('include/api_auth.php'); $_REQUEST['silent']='1'; //tell wall_upload function to return img info instead of echo $_FILES['userfile'] = $_FILES['media']; - require_once('mod/wall_attach.php'); - $posted = wall_attach_post($a); - - //now that we have the img url in bbcode we can add it to the status and insert the wall item. + + $mod = new Zotlabs\Module\Wall_attach(); + $mod->post(); + + $_REQUEST['body']=$txt."\n\n".$posted; - require_once('mod/item.php'); - item_post($a); + + $mod = new Zotlabs\Module\Item(); + $mod->post(); // this should output the last post (the one we just posted). return api_status_show($a,$type); @@ -871,9 +873,9 @@ require_once('include/api_auth.php'); // upload each image if we have any $_REQUEST['silent']='1'; //tell wall_upload function to return img info instead of echo - require_once('mod/wall_attach.php'); + $mod = new Zotlabs\Module\Wall_attach(); App::$data['api_info'] = $user_info; - $media = wall_attach_post($a); + $media = $mod->post(); if(strlen($media)>0) $_REQUEST['body'] .= "\n\n" . $media; @@ -884,9 +886,9 @@ require_once('include/api_auth.php'); $_FILES['userfile'] = $_FILES['media']; // upload each image if we have any $_REQUEST['silent']='1'; //tell wall_upload function to return img info instead of echo - require_once('mod/wall_attach.php'); + $mod = new Zotlabs\Module\Wall_attach(); App::$data['api_info'] = $user_info; - $media = wall_attach_post($a); + $media = $mod->post(); if(strlen($media)>0) $_REQUEST['body'] .= "\n\n" . $media; @@ -896,8 +898,8 @@ require_once('include/api_auth.php'); // call out normal post function - require_once('mod/item.php'); - item_post($a); + $mod = new Zotlabs\Module\Item(); + $mod->post(); // this should output the last post (the one we just posted). return api_status_show($a,$type); @@ -926,14 +928,14 @@ require_once('include/api_auth.php'); $_FILES['userfile'] = $_FILES['media']; // upload the image if we have one $_REQUEST['silent']='1'; //tell wall_upload function to return img info instead of echo - require_once('mod/wall_upload.php'); - $media = wall_upload_post($a); + $mod = new Zotlabs\Module\Wall_upload(); + $media = $mod->post(); if(strlen($media)>0) $_REQUEST['body'] .= "\n\n".$media; } - require_once('mod/item.php'); - $x = item_post($a); + $mod = new Zotlabs\Module\Item(); + $x = $mod->post(); json_return_and_die($x); } @@ -1423,9 +1425,8 @@ require_once('include/api_auth.php'); $_REQUEST['profile_uid'] = api_user(); $_REQUEST['type'] = 'wall'; $_REQUEST['api_source'] = true; - - require_once('mod/item.php'); - item_post($a); + $mod = new Zotlabs\Module\Item(); + $mod->post(); } } else diff --git a/include/help.php b/include/help.php new file mode 100644 index 000000000..13473164d --- /dev/null +++ b/include/help.php @@ -0,0 +1,150 @@ +"; + foreach ($r1 as $entry) { + $allowcid .= "<" . $entry['abook_xchan'] . ">"; + } + foreach ($r2 as $entry) { + $allowcid .= "<" . $entry['abook_xchan'] . ">"; + } + + q("UPDATE `photo` SET allow_cid = '%s' WHERE resource_id = '%s' AND uid = %d",dbesc($allowcid),dbesc($resource_id),intval($profile['uid'])); + + } else { + q("UPDATE `photo` SET allow_cid = '' WHERE profile = 1 AND uid = %d",intval($profile['uid'])); //Reset permissions on default profile picture to public + } + } + + return; + } -- cgit v1.2.3