*
* 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 item_store() instead of this function.
*/
use Friendica\App;
use Friendica\Core\Config;
require_once 'include/items.php';
function item_post(App $a) {
-
if (!local_user() && !remote_user() && !x($_REQUEST, 'commenter')) {
return;
}
$parent = $r[0]['id'];
// multi-level threading - preserve the info but re-parent to our single level threading
- //if(($parid) && ($parid != $parent))
$thr_parent = $parent_uri;
if ($parent_item['contact-id'] && $uid) {
* been supplied via a form.
*/
/// @TODO use x($_REQUEST, 'foo') here
- if (($api_source)
+ if ($api_source
&& !array_key_exists('contact_allow', $_REQUEST)
&& !array_key_exists('group_allow', $_REQUEST)
&& !array_key_exists('contact_deny', $_REQUEST)
* Robert Johnson should be first in the $tags array
*/
$fullnametagged = false;
- /// @TODO $tagged is initialized above if() block and is not filled, maybe old-lost code?
+ /// @TODO $tagged is initialized above if () block and is not filled, maybe old-lost code?
foreach ($tagged as $nextTag) {
if (stristr($nextTag, $tag . ' ')) {
$fullnametagged = true;
killme();
}
- // Fill the cache field
- put_item_in_cache($datarray);
-
- $datarray = store_conversation($datarray);
-
- unset($datarray['edit']);
- unset($datarray['self']);
- unset($datarray['api_source']);
-
if ($orig_post) {
$fields = array(
'title' => $datarray['title'],
$post_id = 0;
}
+ unset($datarray['edit']);
+ unset($datarray['self']);
+ unset($datarray['api_source']);
+
$post_id = item_store($datarray);
$datarray["id"] = $post_id;
}
// select someone by attag or nick and the name passed in the current network
- if(!DBM::is_result($r) && ($network != ""))
+ if (!DBM::is_result($r) && ($network != ""))
$r = q("SELECT `id`, `url`, `nick`, `name`, `alias`, `network` FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `network` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1",
dbesc($name),
dbesc($name),
}
// select someone by attag or nick and the name passed in
- if(!DBM::is_result($r)) {
+ if (!DBM::is_result($r)) {
$r = q("SELECT `id`, `url`, `nick`, `name`, `alias`, `network` FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1",
dbesc($name),
dbesc($name),
}
// select someone from this user's contacts by name
- if(!DBM::is_result($r)) {
+ if (!DBM::is_result($r)) {
$r = q("SELECT `id`, `url`, `nick`, `name`, `alias`, `network` FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
dbesc($name),
intval($profile_uid)