diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-09-09 22:02:28 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-09-09 22:02:28 -0700 |
commit | 3a69413f863ebc80ff64542bdb4ca684eb87a310 (patch) | |
tree | 71942231edccc058e6ff431422a66f0a116babe3 | |
parent | 2e6041d1b6097f3f6c6d840461119f76105a4cde (diff) | |
download | volse-hubzilla-3a69413f863ebc80ff64542bdb4ca684eb87a310.tar.gz volse-hubzilla-3a69413f863ebc80ff64542bdb4ca684eb87a310.tar.bz2 volse-hubzilla-3a69413f863ebc80ff64542bdb4ca684eb87a310.zip |
more preparation for activities
-rw-r--r-- | boot.php | 2 | ||||
-rw-r--r-- | database.sql | 1 | ||||
-rw-r--r-- | include/items.php | 8 | ||||
-rw-r--r-- | mod/item.php | 7 | ||||
-rw-r--r-- | update.php | 4 |
5 files changed, 19 insertions, 3 deletions
@@ -2,7 +2,7 @@ set_time_limit(0); -define ( 'BUILD_ID' , 1002 ); +define ( 'BUILD_ID' , 1003 ); define ( 'EOL', "<br />\r\n"); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/database.sql b/database.sql index de6b2fe83..8f349ab21 100644 --- a/database.sql +++ b/database.sql @@ -146,6 +146,7 @@ CREATE TABLE IF NOT EXISTS `item` ( `contact-id` int(10) unsigned NOT NULL DEFAULT '0', `type` char(255) NOT NULL, `wall` tinyint(1) NOT NULL DEFAULT '0', + `gravity` tinyint(1) NOT NULL DEFAULT '0', `parent` int(10) unsigned NOT NULL DEFAULT '0', `parent-uri` char(255) CHARACTER SET ascii NOT NULL, `created` datetime NOT NULL, diff --git a/include/items.php b/include/items.php index 7c1ef70df..e37ed28d1 100644 --- a/include/items.php +++ b/include/items.php @@ -306,6 +306,14 @@ function post_remote($a,$arr) { //print_r($arr); + + if($arr['gravity']) + $arr['gravity = intval($arr['gravity']); + elseif($arr['parent-uri'] == $arr['uri']) + $arr['gravity'] = 0; + else($arr['verb'] == ACTIVITY_POST) + $arr['gravity'] = 6; + if(! x($arr,'type')) $arr['type'] = 'remote'; $arr['wall'] = ((intval($arr['wall'])) ? 1 : 0); diff --git a/mod/item.php b/mod/item.php index a203bb8e5..f86467376 100644 --- a/mod/item.php +++ b/mod/item.php @@ -112,18 +112,21 @@ function item_post(&$a) { if(! strlen($verb)) $verb = ACTIVITY_POST ; + + $gravity = (($parent) ? 6 : 0 ); $notify_type = (($parent) ? 'comment-new' : 'wall-new' ); $uri = item_new_uri($a->get_hostname(),$profile_uid); - $r = q("INSERT INTO `item` (`uid`,`type`,`wall`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`, + $r = q("INSERT INTO `item` (`uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`, `author-name`, `author-link`, `author-avatar`, `created`, `edited`, `changed`, `uri`, `title`, `body`, `location`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`) - VALUES( %d, '%s', %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )", + VALUES( %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )", intval($profile_uid), dbesc($post_type), intval($wall), + intval($gravity), intval($contact_id), dbesc($contact_record['name']), dbesc($contact_record['url']), diff --git a/update.php b/update.php index 5ae473be6..1fe58486b 100644 --- a/update.php +++ b/update.php @@ -18,3 +18,7 @@ function update_1001() { q("ALTER TABLE `item` ADD `wall` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `type` "); q("ALTER TABLE `item` ADD INDEX ( `wall` )"); } + +function update_1002() { + q("ALTER TABLE `item` ADD `gravity` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `wall` "); +} |