aboutsummaryrefslogblamecommitdiffstats
path: root/doc/html/item_8php.html
blob: f914ddf0363feea9de1cf2eaab3c921675274991 (plain) (tree)





























                                                                                                                         
                                                             

















































































































































































































































































































                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                                                                                                                     









                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>The Red Project: mod/item.php File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="r!-64.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">The Red Project
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('item_8php.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">item.php File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a693cd09805755ab85bbb5ecae69a48c3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="item_8php.html#a693cd09805755ab85bbb5ecae69a48c3">item_post</a> (&amp;$a)</td></tr>
<tr class="separator:a693cd09805755ab85bbb5ecae69a48c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a764bbb2e9a885a86fb23d0b5e4a09221"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="item_8php.html#a764bbb2e9a885a86fb23d0b5e4a09221">item_content</a> (&amp;$a)</td></tr>
<tr class="separator:a764bbb2e9a885a86fb23d0b5e4a09221"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abd0e603a6696051af16476eb968d52e7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="item_8php.html#abd0e603a6696051af16476eb968d52e7">handle_tag</a> ($a, &amp;$body, &amp;$inform, &amp;$str_tags, $profile_uid, $tag)</td></tr>
<tr class="separator:abd0e603a6696051af16476eb968d52e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7b63a9d0cd02096e17dcf11f4afa7c10"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="item_8php.html#a7b63a9d0cd02096e17dcf11f4afa7c10">fix_attached_photo_permissions</a> ($uid, $xchan_hash, $body, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny)</td></tr>
<tr class="separator:a7b63a9d0cd02096e17dcf11f4afa7c10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3daae7944f737bd30412a0d042207c0f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="item_8php.html#a3daae7944f737bd30412a0d042207c0f">fix_attached_file_permissions</a> ($channel, $observer_hash, $body, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny)</td></tr>
<tr class="separator:a3daae7944f737bd30412a0d042207c0f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a3daae7944f737bd30412a0d042207c0f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">fix_attached_file_permissions </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$channel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$observer_hash</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$body</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$str_contact_allow</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$str_group_allow</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$str_contact_deny</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$str_group_deny</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Referenced by <a class="el" href="item_8php.html#a693cd09805755ab85bbb5ecae69a48c3">item_post()</a>.</p>

</div>
</div>
<a class="anchor" id="a7b63a9d0cd02096e17dcf11f4afa7c10"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">fix_attached_photo_permissions </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$uid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$xchan_hash</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$body</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$str_contact_allow</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$str_group_allow</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$str_contact_deny</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$str_group_deny</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Referenced by <a class="el" href="item_8php.html#a693cd09805755ab85bbb5ecae69a48c3">item_post()</a>.</p>

</div>
</div>
<a class="anchor" id="abd0e603a6696051af16476eb968d52e7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">handle_tag </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&amp;&#160;</td>
          <td class="paramname"><em>$body</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&amp;&#160;</td>
          <td class="paramname"><em>$inform</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&amp;&#160;</td>
          <td class="paramname"><em>$str_tags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$profile_uid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$tag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function removes the tag $tag from the text $body and replaces it with the appropiate link.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramtype">unknown_type</td><td class="paramname">$body</td><td>the text to replace the tag in </td></tr>
    <tr><td class="paramtype">unknown_type</td><td class="paramname">$inform</td><td>a comma-seperated string containing everybody to inform </td></tr>
    <tr><td class="paramtype">unknown_type</td><td class="paramname">$str_tags</td><td>string to add the tag to </td></tr>
    <tr><td class="paramtype">unknown_type</td><td class="paramname">$profile_uid</td><td></td></tr>
    <tr><td class="paramtype">unknown_type</td><td class="paramname">$tag</td><td>the tag to replace</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>boolean true if replaced, false if not replaced </dd></dl>

<p>Referenced by <a class="el" href="item_8php.html#a693cd09805755ab85bbb5ecae69a48c3">item_post()</a>.</p>

</div>
</div>
<a class="anchor" id="a764bbb2e9a885a86fb23d0b5e4a09221"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">item_content </td>
          <td>(</td>
          <td class="paramtype">&amp;&#160;</td>
          <td class="paramname"><em>$a</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a693cd09805755ab85bbb5ecae69a48c3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">item_post </td>
          <td>(</td>
          <td class="paramtype">&amp;&#160;</td>
          <td class="paramname"><em>$a</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This is the POST destination for most all locally posted text stuff. This function handles status, wall-to-wall status, local comments, and remote coments that are posted on this site (as opposed to being delivered in a feed). Also processed here are posts and comments coming through the statusnet/twitter API. All of these become an "item" which is our basic unit of information. Posts that originate externally or do not fall into the above posting categories go through <a class="el" href="items_8php.html#a8ef003b2bc2dc4816bdcf5800aec1049">item_store()</a> instead of this function. </p>
<p>Is this a reply to something?</p>
<p>fix naked links by passing through a callback to see if this is a red site (already known to us) which will get a zrl, otherwise link with url</p>
<p>When a photo was uploaded into the message using the (profile wall) ajax uploader, The permissions are initially set to disallow anybody but the owner from seeing it. This is because the permissions may not yet have been set for the post. If it's private, the photo permissions should be set appropriately. But we didn't know the final permissions on the post until now. So now we'll look for links of uploaded messages that are in the post and set them to the same permissions as the post itself.</p>
<p>Fold multi-line [code] sequences</p>
<p>Look for any tags and linkify them</p>

<p>Referenced by <a class="el" href="include_2api_8php.html#a450d8732b7b608f7ac929aee61572b95">api_statuses_mediap()</a>, <a class="el" href="include_2api_8php.html#ae0fa388479cace9c5a7a45b571ab42f8">api_statuses_repeat()</a>, <a class="el" href="include_2api_8php.html#ad4d1634df6b35126552324683caaffa2">api_statuses_update()</a>, and <a class="el" href="oexchange_8php.html#a2d8b785cd7d041a4e6274f5af370cf26">oexchange_content()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->