aboutsummaryrefslogtreecommitdiffstats
path: root/mod/thing.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/thing.php')
-rw-r--r--mod/thing.php41
1 files changed, 15 insertions, 26 deletions
diff --git a/mod/thing.php b/mod/thing.php
index 289e968ca..b4b8ad027 100644
--- a/mod/thing.php
+++ b/mod/thing.php
@@ -1,4 +1,8 @@
-<?php /** @file */
+<?php
+/**
+ * @file mod/thing.php
+ * @brief
+ */
require_once('include/items.php');
require_once('include/contact_selectors.php');
@@ -9,9 +13,6 @@ function thing_init(&$a) {
if(! local_channel())
return;
-
-
-
$account_id = $a->get_account();
$channel = $a->get_channel();
@@ -26,19 +27,18 @@ function thing_init(&$a) {
$hash = random_string();
-
$verbs = obj_verbs();
- /**
+ /**
* verbs: [0] = first person singular, e.g. "I want", [1] = 3rd person singular, e.g. "Bill wants"
* We use the first person form when creating an activity, but the third person for use in activities
- * FIXME: There is no accounting for verb gender for languages where this is significant. We may eventually
+ * @FIXME There is no accounting for verb gender for languages where this is significant. We may eventually
* require obj_verbs() to provide full conjugations and specify which form to use in the $_REQUEST params to this module.
*/
$translated_verb = $verbs[$verb][1];
- /**
+ /*
* The site administrator can do things that normals cannot.
* This is restricted because it will likely cause
* an activitystreams protocol violation and the activity might
@@ -50,14 +50,14 @@ function thing_init(&$a) {
if(! $translated_verb) {
if(is_site_admin())
$translated_verb = $verb;
- }
-
- /**
+ }
+
+ /*
* Things, objects: We do not provide definite (a, an) or indefinite (the) articles or singular/plural designators
* That needs to be specified in your thing. e.g. Mike has "a carrot", Greg wants "balls", Bob likes "the Boston Red Sox".
*/
- /**
+ /*
* Future work on this module might produce more complex activities with targets, e.g. Phillip likes Karen's moustache
* and to describe other non-thing objects like channels, such as Karl wants Susan - where Susan represents a channel profile.
*/
@@ -65,8 +65,6 @@ function thing_init(&$a) {
if((! $name) || (! $translated_verb))
return;
-
-
if($term_hash) {
$t = q("select * from obj left join term on obj_obj = term_hash where term_hash != '' and obj_type = %d and term_hash = '%s' limit 1",
intval(TERM_OBJ_THING),
@@ -115,7 +113,6 @@ function thing_init(&$a) {
$local_photo_type = $arr[3];
}
-
$r = q("select * from term where uid = %d and otype = %d and type = %d and term = '%s' limit 1",
intval(local_channel()),
intval(TERM_OBJ_THING),
@@ -159,14 +156,12 @@ function thing_init(&$a) {
info( t('Thing added'));
-
if($activity) {
$arr = array();
$links = array(array('rel' => 'alternate','type' => 'text/html', 'href' => $term['url']));
if($local_photo)
$links[] = array('rel' => 'photo', 'type' => $local_photo_type, 'href' => $local_photo);
-
$objtype = ACTIVITY_OBJ_THING;
$obj = json_encode(array(
@@ -186,7 +181,6 @@ function thing_init(&$a) {
$arr['item_wall'] = 1;
$arr['item_thread_top'] = 1;
-
$ulink = '[zrl=' . $channel['xchan_url'] . ']' . $channel['channel_name'] . '[/zrl]';
$plink = '[zrl=' . $term['url'] . ']' . $term['term'] . '[/zrl]';
@@ -214,14 +208,14 @@ function thing_init(&$a) {
else
$arr['allow_cid'] = '<' . get_observer_hash() . '>';
}
-
+
$ret = post_activity_item($arr);
}
}
function thing_content(&$a) {
-
+
if(argc() == 2) {
$r = q("select * from obj left join term on obj_obj = term_hash where term_hash != '' and obj_type = %d and term_hash = '%s' limit 1",
@@ -251,12 +245,10 @@ function thing_content(&$a) {
}
$thing_hash = '';
-
if(argc() == 3 && argv(1) === 'edit') {
$thing_hash = argv(2);
-
$r = q("select * from obj left join term on obj_obj = term_hash where term_hash != '' and obj_type = %d and term_hash = '%s' limit 1",
intval(TERM_OBJ_THING),
dbesc($thing_hash)
@@ -267,7 +259,6 @@ function thing_content(&$a) {
return '';
}
-
$o .= replace_macros(get_markup_template('thing_edit.tpl'),array(
'$thing_hdr' => t('Edit Thing'),
'$multiprof' => feature_enabled(local_channel(),'multi_profiles'),
@@ -302,7 +293,6 @@ function thing_content(&$a) {
return '';
}
-
$x = q("delete from obj where obj_obj = '%s' and obj_type = %d and obj_channel = %d",
dbesc($thing_hash),
intval(TERM_OBJ_THING),
@@ -312,6 +302,7 @@ function thing_content(&$a) {
dbesc($thing_hash),
intval(local_channel())
);
+
return $o;
}
@@ -330,6 +321,4 @@ function thing_content(&$a) {
));
return $o;
-
-
}