Merge remote-tracking branch 'upstream/develop' into 1502-contacts-in-scrape
This commit is contained in:
commit
a26d04574d
35 changed files with 28475 additions and 27903 deletions
19
mod/item.php
19
mod/item.php
|
@ -22,6 +22,7 @@ require_once('library/langdet/Text/LanguageDetect.php');
|
|||
require_once('include/tags.php');
|
||||
require_once('include/files.php');
|
||||
require_once('include/threads.php');
|
||||
require_once('include/text.php');
|
||||
|
||||
function item_post(&$a) {
|
||||
|
||||
|
@ -824,21 +825,12 @@ function item_post(&$a) {
|
|||
if(count($r)) {
|
||||
$post_id = $r[0]['id'];
|
||||
logger('mod_item: saved item ' . $post_id);
|
||||
add_thread($post_id);
|
||||
|
||||
// update filetags in pconfig
|
||||
file_tag_update_pconfig($uid,$categories_old,$categories_new,'category');
|
||||
|
||||
// Store the fresh generated item into the cache
|
||||
$cachefile = get_cachefile(urlencode($datarray["guid"])."-".hash("md5", $datarray['body']));
|
||||
|
||||
if (($cachefile != '') AND !file_exists($cachefile)) {
|
||||
$s = prepare_text($datarray['body']);
|
||||
$stamp1 = microtime(true);
|
||||
file_put_contents($cachefile, $s);
|
||||
$a->save_timestamp($stamp1, "file");
|
||||
logger('mod_item: put item '.$r[0]['id'].' into cachefile '.$cachefile);
|
||||
}
|
||||
put_item_in_cache($datarray);
|
||||
|
||||
if($parent) {
|
||||
|
||||
|
@ -947,7 +939,8 @@ function item_post(&$a) {
|
|||
dbesc(datetime_convert()),
|
||||
intval($parent)
|
||||
);
|
||||
update_thread($parent);
|
||||
if ($post_id != $parent)
|
||||
update_thread($parent);
|
||||
|
||||
$datarray['id'] = $post_id;
|
||||
$datarray['plink'] = $a->get_baseurl().'/display/'.urlencode($datarray['guid']);
|
||||
|
@ -990,7 +983,9 @@ function item_post(&$a) {
|
|||
|
||||
create_tags_from_item($post_id);
|
||||
create_files_from_item($post_id);
|
||||
update_thread($post_id);
|
||||
|
||||
if ($post_id == $parent)
|
||||
add_thread($post_id);
|
||||
|
||||
// This is a real juggling act on shared hosting services which kill your processes
|
||||
// e.g. dreamhost. We used to start delivery to our native delivery agents in the background
|
||||
|
|
|
@ -815,7 +815,9 @@ die("ss");
|
|||
$o .= conversation($a,$items,$mode,$update);
|
||||
|
||||
if(!$update) {
|
||||
if(!get_config('system', 'old_pager')) {
|
||||
if(get_pconfig(local_user(),'system','infinite_scroll')) {
|
||||
$o .= scroll_loader();
|
||||
} elseif(!get_config('system', 'old_pager')) {
|
||||
$o .= alt_pager($a,count($items));
|
||||
} else {
|
||||
$o .= paginate($a);
|
||||
|
|
22
mod/poco.php
22
mod/poco.php
|
@ -135,9 +135,9 @@ function poco_init(&$a) {
|
|||
if(x($_GET,'updatedSince') AND !$global)
|
||||
$ret['updatedSince'] = false;
|
||||
|
||||
$ret['startIndex'] = (string) $startIndex;
|
||||
$ret['itemsPerPage'] = (string) $itemsPerPage;
|
||||
$ret['totalResults'] = (string) $totalResults;
|
||||
$ret['startIndex'] = (int) $startIndex;
|
||||
$ret['itemsPerPage'] = (int) $itemsPerPage;
|
||||
$ret['totalResults'] = (int) $totalResults;
|
||||
$ret['entry'] = array();
|
||||
|
||||
|
||||
|
@ -153,7 +153,8 @@ function poco_init(&$a) {
|
|||
'network' => false,
|
||||
'gender' => false,
|
||||
'tags' => false,
|
||||
'address' => false
|
||||
'address' => false,
|
||||
'generation' => false
|
||||
);
|
||||
|
||||
if((! x($_GET,'fields')) || ($_GET['fields'] === '@all'))
|
||||
|
@ -168,6 +169,15 @@ function poco_init(&$a) {
|
|||
if(is_array($r)) {
|
||||
if(count($r)) {
|
||||
foreach($r as $rr) {
|
||||
if (!isset($rr['generation'])) {
|
||||
if ($global)
|
||||
$rr['generation'] = 3;
|
||||
elseif ($system_mode)
|
||||
$rr['generation'] = 1;
|
||||
else
|
||||
$rr['generation'] = 2;
|
||||
}
|
||||
|
||||
if (($rr['about'] == "") AND isset($rr['pabout']))
|
||||
$rr['about'] = $rr['pabout'];
|
||||
|
||||
|
@ -198,7 +208,7 @@ function poco_init(&$a) {
|
|||
|
||||
$entry = array();
|
||||
if($fields_ret['id'])
|
||||
$entry['id'] = $rr['id'];
|
||||
$entry['id'] = (int)$rr['id'];
|
||||
if($fields_ret['displayName'])
|
||||
$entry['displayName'] = $rr['name'];
|
||||
if($fields_ret['aboutMe'])
|
||||
|
@ -207,6 +217,8 @@ function poco_init(&$a) {
|
|||
$entry['currentLocation'] = $rr['location'];
|
||||
if($fields_ret['gender'])
|
||||
$entry['gender'] = $rr['gender'];
|
||||
if($fields_ret['generation'])
|
||||
$entry['generation'] = (int)$rr['generation'];
|
||||
if($fields_ret['urls']) {
|
||||
$entry['urls'] = array(array('value' => $rr['url'], 'type' => 'profile'));
|
||||
if($rr['addr'] && ($rr['network'] !== NETWORK_MAIL))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue