fixes to photo linked items, shut up poller until I can get to that

This commit is contained in:
friendica 2012-10-25 00:10:53 -07:00
parent 939543b26d
commit ebb75340ec
2 changed files with 43 additions and 32 deletions

View File

@ -63,9 +63,14 @@ function poller_run($argv, $argc){
// expire any expired accounts // expire any expired accounts
q("UPDATE user SET `account_expired` = 1 where `account_expired` = 0 q("UPDATE account
AND `account_expires_on` != '0000-00-00 00:00:00' SET account_flags = account_flags | %d
AND `account_expires_on` < UTC_TIMESTAMP() "); where not account_flags & %d
and account_expires != '0000-00-00 00:00:00'
and account_expires < UTC_TIMESTAMP() ",
intval(ACCOUNT_EXPIRED),
intval(ACCOUNT_EXPIRED)
);
$abandon_days = intval(get_config('system','account_abandon_days')); $abandon_days = intval(get_config('system','account_abandon_days'));
if($abandon_days < 1) if($abandon_days < 1)
@ -145,6 +150,9 @@ function poller_run($argv, $argc){
: '' : ''
); );
// FIXME
return;
$contacts = q("SELECT `contact`.`id` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid` $contacts = q("SELECT `contact`.`id` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid`
WHERE ( `rel` = %d OR `rel` = %d ) AND `poll` != '' WHERE ( `rel` = %d OR `rel` = %d ) AND `poll` != ''
AND NOT `network` IN ( '%s', '%s' ) AND NOT `network` IN ( '%s', '%s' )

View File

@ -399,39 +399,40 @@ function photos_post(&$a) {
$visibility = 0; $visibility = 0;
if($p[0]['desc'] !== $desc || strlen($rawtags)) if($p[0]['desc'] !== $desc || strlen($rawtags))
$visibility = 1; $visibility = 1;
if(! $item_id) { if(! $item_id) {
// Create item container // Create item container
$item_flags = ITEM_WALL|ITEM_ORIGIN|ITEM_THREAD_TOP;
$item_restrict = (($visibility) ? ITEM_HIDDEN : ITEM_VISIBLE);
$title = ''; $title = '';
$uri = item_message_id(); $uri = item_message_id();
$arr = array(); $arr = array();
$arr['aid'] = $a->data['channel']['channel_account_id'];
$arr['uid'] = $page_owner_uid; $arr['uid'] = $page_owner_uid;
$arr['uri'] = $uri; $arr['uri'] = $uri;
$arr['parent_uri'] = $uri; $arr['parent_uri'] = $uri;
$arr['type'] = 'photo'; $arr['item_flags'] = $item_flags;
$arr['wall'] = 1; $arr['item_restrict'] = $item_restrict;
$arr['resource_type'] = 'photo';
$arr['resource_id'] = $p[0]['resource_id']; $arr['resource_id'] = $p[0]['resource_id'];
$arr['contact-id'] = $owner_record['id']; $arr['owner_xchan'] = $a->data['channel']['channel_hash'];
$arr['owner-name'] = $owner_record['name']; $arr['author_xchan'] = $a->data['channel']['channel_hash']; // FIXME for AUTH guests
$arr['owner-link'] = $owner_record['url'];
$arr['owner-avatar'] = $owner_record['thumb'];
$arr['author-name'] = $owner_record['name'];
$arr['author-link'] = $owner_record['url'];
$arr['author-avatar'] = $owner_record['thumb'];
$arr['title'] = $title; $arr['title'] = $title;
$arr['allow_cid'] = $p[0]['allow_cid']; $arr['allow_cid'] = $p[0]['allow_cid'];
$arr['allow_gid'] = $p[0]['allow_gid']; $arr['allow_gid'] = $p[0]['allow_gid'];
$arr['deny_cid'] = $p[0]['deny_cid']; $arr['deny_cid'] = $p[0]['deny_cid'];
$arr['deny_gid'] = $p[0]['deny_gid']; $arr['deny_gid'] = $p[0]['deny_gid'];
$arr['visible'] = $visibility;
$arr['origin'] = 1;
$arr['body'] = '[url=' . $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $p[0]['resource_id'] . ']' $arr['body'] = '[url=' . $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $p[0]['resource_id'] . ']'
. '[img]' . $a->get_baseurl() . '/photo/' . $p[0]['resource_id'] . '-' . $p[0]['scale'] . '.'. $ext . '[/img]' . '[img]' . $a->get_baseurl() . '/photo/' . $p[0]['resource_id'] . '-' . $p[0]['scale'] . '[/img]'
. '[/url]'; . '[/url]';
$item_id = item_store($arr); $item_id = item_store($arr);
@ -807,35 +808,37 @@ function photos_post(&$a) {
$basename = basename($filename); $basename = basename($filename);
$uri = item_message_id(); $uri = item_message_id();
// Create item container // Create item container
$item_flags = ITEM_WALL|ITEM_ORIGIN|ITEM_THREAD_TOP;
$item_restrict = (($visibility) ? ITEM_HIDDEN : ITEM_VISIBLE);
$title = '';
$uri = item_message_id();
$arr = array(); $arr = array();
$arr['aid'] = $a->data['channel']['channel_account_id'];
$arr['uid'] = $page_owner_uid; $arr['uid'] = $page_owner_uid;
$arr['uri'] = $uri; $arr['uri'] = $uri;
$arr['parent_uri'] = $uri; $arr['parent_uri'] = $uri;
$arr['type'] = 'photo'; $arr['item_flags'] = $item_flags;
$arr['wall'] = 1; $arr['item_restrict'] = $item_restrict;
$arr['resource_id'] = $photo_hash; $arr['resource_type'] = 'photo';
$arr['contact-id'] = $owner_record['id']; $arr['resource_id'] = $hoto_hash;
$arr['owner-name'] = $owner_record['name']; $arr['owner_xchan'] = $a->data['channel']['channel_hash'];
$arr['owner-link'] = $owner_record['url']; $arr['author_xchan'] = $a->data['channel']['channel_hash']; // FIXME for AUTH guests
$arr['owner-avatar'] = $owner_record['thumb']; $arr['title'] = $title;
$arr['author-name'] = $owner_record['name'];
$arr['author-link'] = $owner_record['url'];
$arr['author-avatar'] = $owner_record['thumb'];
$arr['title'] = '';
$arr['allow_cid'] = $str_contact_allow; $arr['allow_cid'] = $str_contact_allow;
$arr['allow_gid'] = $str_group_allow; $arr['allow_gid'] = $str_group_allow;
$arr['deny_cid'] = $str_contact_deny; $arr['deny_cid'] = $str_contact_deny;
$arr['deny_gid'] = $str_group_deny; $arr['deny_gid'] = $str_group_deny;
$arr['visible'] = $visible;
$arr['origin'] = 1;
$arr['body'] = '[url=' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo_hash . ']'
$arr['body'] = '[url=' . $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $photo_hash . ']'
. '[img]' . $a->get_baseurl() . "/photo/{$photo_hash}-{$smallest}.".$ph->getExt() . '[/img]' . '[img]' . $a->get_baseurl() . "/photo/{$photo_hash}-{$smallest}.".$ph->getExt() . '[/img]'
. '[/url]'; . '[/url]';
$item_id = item_store($arr); $item_id = item_store($arr);
if($item_id) { if($item_id) {