The Red Matrix
 All Classes Namespaces Files Functions Variables Pages
items.php File Reference

Functions

 collect_recipients ($item, &$private)
 
 can_comment_on_post ($observer_xchan, $item)
 
 red_zrl_callback ($matches)
 
 post_activity_item ($arr)
 
 get_public_feed ($channel, $params)
 
 get_feed_for ($channel, $observer_hash, $params)
 
 construct_verb ($item)
 
 construct_activity_object ($item)
 
 construct_activity_target ($item)
 
 limit_body_size ($body)
 
 title_is_body ($title, $body)
 
 get_item_elements ($x)
 
 import_author_xchan ($x)
 
 encode_item ($item)
 
 map_scope ($scope)
 
 encode_item_xchan ($xchan)
 
 encode_item_terms ($terms)
 
 termtype ($t)
 
 decode_tags ($t)
 
 activity_sanitise ($arr)
 
 array_sanitise ($arr)
 
 encode_item_flags ($item)
 
 encode_mail ($item)
 
 get_mail_elements ($x)
 
 get_profile_elements ($x)
 
 get_atom_elements ($feed, $item)
 
 encode_rel_links ($links)
 
 item_store ($arr, $force_parent=false)
 
 item_store_update ($arr, $force_parent=false)
 
 send_status_notifications ($post_id, $item)
 
 get_item_contact ($item, $contacts)
 
 tag_deliver ($uid, $item_id)
 
 tgroup_check ($uid, $item)
 
 mail_store ($arr)
 
 dfrn_deliver ($owner, $contact, $atom, $dissolve=false)
 
 consume_feed ($xml, $importer, &$contact, &$hub, $datedir=0, $pass=0)
 
 local_delivery ($importer, $data)
 
 new_follower ($importer, $contact, $datarray, $item, $sharing=false)
 
 lose_follower ($importer, $contact, $datarray, $item)
 
 lose_sharer ($importer, $contact, $datarray, $item)
 
 atom_author ($tag, $name, $uri, $h, $w, $type, $photo)
 
 atom_entry ($item, $type, $author, $owner, $comment=false, $cid=0)
 
 fix_private_photos ($s, $uid, $item=null, $cid=0)
 
 has_permissions ($obj)
 
 compare_permissions ($obj1, $obj2)
 
 enumerate_permissions ($obj)
 
 item_getfeedtags ($item)
 
 item_getfeedattach ($item)
 
 item_expire ($uid, $days)
 
 drop_items ($items)
 
 drop_item ($id, $interactive=true)
 
 delete_item_lowlevel ($item)
 
 first_post_date ($uid, $wall=false)
 
 posted_dates ($uid, $wall)
 
 posted_date_widget ($url, $uid, $wall)
 
 fetch_post_tags ($items, $link=false)
 
 zot_feed ($uid, $observer_xchan, $mindate)
 
 items_fetch ($arr, $channel=null, $observer_hash=null, $client_mode=CLIENT_MODE_NORMAL, $module= 'network')
 

Function Documentation

activity_sanitise (   $arr)
array_sanitise (   $arr)

Referenced by get_profile_elements().

atom_author (   $tag,
  $name,
  $uri,
  $h,
  $w,
  $type,
  $photo 
)

Referenced by atom_entry().

atom_entry (   $item,
  $type,
  $author,
  $owner,
  $comment = false,
  $cid = 0 
)

Referenced by get_feed_for().

can_comment_on_post (   $observer_xchan,
  $item 
)

Referenced by Item\__construct().

collect_recipients (   $item,
$private 
)

Referenced by notifier_run().

compare_permissions (   $obj1,
  $obj2 
)

Referenced by fix_private_photos().

construct_activity_object (   $item)

Referenced by atom_entry().

construct_activity_target (   $item)

Referenced by atom_entry().

construct_verb (   $item)

Referenced by atom_entry().

consume_feed (   $xml,
  $importer,
$contact,
$hub,
  $datedir = 0,
  $pass = 0 
)

consume_feed - process atom feed and update anything/everything we might need to update

$xml = the (atom) feed to consume - RSS isn't as fully supported but may work for simple feeds.

$importer = the contact_record (joined to user_record) of the local user who owns this relationship. It is this person's stuff that is going to be updated. $contact = the person who is sending us stuff. If not set, we MAY be processing a "follow" activity from an external network and MAY create an appropriate contact record. Otherwise, we MUST have a contact record. $hub = should we find a hub declation in the feed, pass it back to our calling process, who might (or might not) try and subscribe to it. $datedir sorts in reverse order $pass - by default ($pass = 0) we cannot guarantee that a parent item has been imported prior to its children being seen in the stream unless we are certain of how the feed is arranged/ordered. With $pass = 1, we only pull parent items out of the stream. With $pass = 2, we only pull children (comments/likes).

So running this twice, first with pass 1 and then with pass 2 will do the right thing regardless of feed ordering. This won't be adequate in a fully-threaded model where comments can have sub-threads. That would require some massive sorting to get all the feed items into a mostly linear ordering, and might still require recursion.

Add new birthday event for this person

$bdtext is just a readable placeholder in case the event is shared with others. We will replace it during presentation to our $importer to contain a sparkle link and perhaps a photo.

decode_tags (   $t)

Referenced by get_item_elements().

delete_item_lowlevel (   $item)

Referenced by drop_item().

dfrn_deliver (   $owner,
  $contact,
  $atom,
  $dissolve = false 
)

Referenced by terminate_friendship().

drop_items (   $items)

Referenced by item_post().

encode_item (   $item)

Referenced by notifier_run(), and zot_feed().

encode_item_flags (   $item)

Referenced by encode_item().

encode_item_terms (   $terms)

Referenced by encode_item().

encode_item_xchan (   $xchan)

Referenced by encode_item(), and encode_mail().

encode_mail (   $item)

Referenced by notifier_run().

encode_rel_links (   $links)

Referenced by get_atom_elements().

enumerate_permissions (   $obj)
first_post_date (   $uid,
  $wall = false 
)

Referenced by posted_dates().

fix_private_photos (   $s,
  $uid,
  $item = null,
  $cid = 0 
)

Referenced by atom_entry().

get_atom_elements (   $feed,
  $item 
)

If there's a copy of the body content which is guaranteed to have survived mangling in transit, use it.

Referenced by consume_feed(), and local_delivery().

get_feed_for (   $channel,
  $observer_hash,
  $params 
)

Referenced by get_public_feed().

get_item_contact (   $item,
  $contacts 
)
get_item_elements (   $x)

Referenced by zot_import().

get_mail_elements (   $x)

Referenced by zot_import().

get_profile_elements (   $x)

Referenced by zot_import().

get_public_feed (   $channel,
  $params 
)

Referenced by feed_init().

has_permissions (   $obj)

Referenced by fix_private_photos().

import_author_xchan (   $x)
item_expire (   $uid,
  $days 
)

Referenced by expire_run().

item_getfeedattach (   $item)
item_getfeedtags (   $item)
item_store_update (   $arr,
  $force_parent = false 
)

Referenced by update_imported_item().

items_fetch (   $arr,
  $channel = null,
  $observer_hash = null,
  $client_mode = CLIENT_MODE_NORMAL,
  $module = 'network' 
)

Referenced by get_feed_for().

limit_body_size (   $body)

Referenced by get_atom_elements().

local_delivery (   $importer,
  $data 
)
lose_follower (   $importer,
  $contact,
  $datarray,
  $item 
)

Referenced by consume_feed().

lose_sharer (   $importer,
  $contact,
  $datarray,
  $item 
)

Referenced by consume_feed().

mail_store (   $arr)

Referenced by process_mail_delivery().

map_scope (   $scope)
new_follower (   $importer,
  $contact,
  $datarray,
  $item,
  $sharing = false 
)

Referenced by consume_feed().

post_activity_item (   $arr)

post_activity_item($arr)

post an activity
Parameters
array$arrIn its simplest form one needs only to set $arr['body'] to post a note to the logged in channel's wall. Much more complex activities can be created. Permissions are checked. No filtering, tag expansion or other processing is performed.
Returns
array 'success' => true or false 'activity' => the resulting activity if successful

Referenced by api_channel_stream(), poke_init(), and tagger_content().

posted_date_widget (   $url,
  $uid,
  $wall 
)

Referenced by channel_aside(), and network_init().

posted_dates (   $uid,
  $wall 
)

Referenced by posted_date_widget().

red_zrl_callback (   $matches)

red_zrl_callback preg_match function when fixing 'naked' links in mod item.php Check if we've got a hubloc for the site and use a zrl if we do, a url if we don't.

send_status_notifications (   $post_id,
  $item 
)

Referenced by item_store(), and item_store_update().

tag_deliver (   $uid,
  $item_id 
)

Referenced by item_store(), and item_store_update().

termtype (   $t)

Referenced by encode_item_terms().

tgroup_check (   $uid,
  $item 
)
title_is_body (   $title,
  $body 
)

Referenced by get_atom_elements().

zot_feed (   $uid,
  $observer_xchan,
  $mindate 
)

Referenced by zotfeed_init().