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, $allow_exec=false)
 
 item_store_update ($arr, $allow_exec=false)
 
 send_status_notifications ($post_id, $item)
 
 get_item_contact ($item, $contacts)
 
 tag_deliver ($uid, $item_id)
 
 tgroup_check ($uid, $item)
 
 check_item_source ($uid, $item)
 
 mail_store ($arr)
 
 consume_feed ($xml, $importer, &$contact, &$hub, $datedir=0, $pass=0)
 
 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 
)

can_comment_on_post($observer_xchan,$item);

This function examines the comment_policy attached to an item and decides if the current observer has sufficient privileges to comment. This will normally be called on a remote site where perm_is_allowed() will not be suitable because the post owner does not have a local channel_id. Generally we should look at the item - in particular the author['book_flags'] and see if ABOOK_FLAG_SELF is set. If it is, you should be able to use perm_is_allowed( ... 'post_comments'), and if it isn't you need to call can_comment_on_post()

Referenced by Conversation\add_thread(), and item_post().

check_item_source (   $uid,
  $item 
)

check_item_source($uid,$item)

Parameters
$uid
$itemChecks to see if this item owner is referenced as a source for this channel and if the post matches the rules for inclusion in this channel. Returns true if we should create a second delivery chain and false if none of the rules apply, or if the item is private.

Referenced by tag_deliver().

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.

decode_tags (   $t)

Referenced by get_item_elements().

delete_item_lowlevel (   $item)

Referenced by drop_item().

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().

get_feed_for (   $channel,
  $observer_hash,
  $params 
)

Referenced by get_public_feed().

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

Referenced by onepoll_run(), and 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,
  $allow_exec = false 
)

Referenced by item_post(), and 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().

mail_store (   $arr)

Referenced by process_mail_delivery().

map_scope (   $scope)
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(), tagger_content(), and thing_init().

posted_date_widget (   $url,
  $uid,
  $wall 
)
posted_dates (   $uid,
  $wall 
)
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 
)
termtype (   $t)

Referenced by encode_item_terms().

tgroup_check (   $uid,
  $item 
)

Referenced by consume_feed(), and process_delivery().

title_is_body (   $title,
  $body 
)

Referenced by get_atom_elements().

zot_feed (   $uid,
  $observer_xchan,
  $mindate 
)

Referenced by zotfeed_init().