diff options
-rw-r--r-- | include/zot.php | 26 | ||||
-rw-r--r-- | mod/item.php | 101 | ||||
-rw-r--r-- | version.inc | 2 |
3 files changed, 57 insertions, 72 deletions
diff --git a/include/zot.php b/include/zot.php index abaa5c9ab..909c4a2e8 100644 --- a/include/zot.php +++ b/include/zot.php @@ -469,6 +469,7 @@ function import_xchan($arr) { dbesc($arr['url']), dbesc($xchan_hash) ); + update_modtime($xchan_hash); } } else { @@ -490,6 +491,7 @@ function import_xchan($arr) { dbesc($arr['photo_updated']), dbesc($arr['name_updated']) ); + update_modtime($xchan_hash); } @@ -544,6 +546,7 @@ function import_xchan($arr) { intval($r[0]['hubloc_id']) ); } + update_modtime($xchan_hash); continue; } @@ -570,7 +573,7 @@ function import_xchan($arr) { dbesc($location['callback']), dbesc($location['sitekey']) ); - + update_modtime($xchan_hash); } // get rid of any hubs we have for this channel which weren't reported. @@ -581,6 +584,7 @@ function import_xchan($arr) { $r = q("delete from hubloc where hubloc_id = %d limit 1", intval($x['hubloc_id']) ); + update_modtime($xchan_hash); } } } @@ -1152,6 +1156,7 @@ function import_directory_profile($hash,$profile) { ); } + update_modtime($arr['xprof_hash']); return; } @@ -1187,4 +1192,21 @@ function import_directory_keywords($hash,$keywords) { dbesc($x) ); } -}
\ No newline at end of file +} + + +function update_modtime($hash) { + $r = q("select * from updates where ud_hash = '%s' limit 1", + dbesc($hash) + ); + if($r) + q("update updates set ud_date = '%s' where ud_hash = '%s' limit 1", + dbesc(datetime_convert()), + dbesc($hash) + ); + else + q("insert into updates (ud_hash, ud_date) values ( '%s', '%s' )", + dbesc($hash), + dbesc(datetime_convert()) + ); +} diff --git a/mod/item.php b/mod/item.php index 8298d3dc0..45c5944ce 100644 --- a/mod/item.php +++ b/mod/item.php @@ -242,10 +242,10 @@ function item_post(&$a) { $str_contact_deny = perms2str($_REQUEST['contact_deny']); } - $title = escape_tags(trim($_REQUEST['title'])); $location = notags(trim($_REQUEST['location'])); $coord = notags(trim($_REQUEST['coord'])); $verb = notags(trim($_REQUEST['verb'])); + $title = escape_tags(trim($_REQUEST['title'])); $body = escape_tags(trim($_REQUEST['body'])); $private = ( @@ -291,13 +291,25 @@ function item_post(&$a) { // expire_quantity, e.g. '3' // expire_units, e.g. days, weeks, months if(x($_REQUEST,'expire_quantity') && (x($_REQUEST,'expire_units'))) { - $expire = datetime_convert(date_default_timezone_get(),'UTC', 'now + ' . $_REQUEST['expire_quantity'] . ' ' . $_REQUEST['expire_units']); + $expire = datetime_convert('UTC','UTC', 'now + ' . $_REQUEST['expire_quantity'] . ' ' . $_REQUEST['expire_units']); if($expires <= datetime_convert()) $expires = '0000-00-00 00:00:00'; } } + + $post_type = notags(trim($_REQUEST['type'])); + + $content_type = notags(trim($_REQUEST['content_type'])); + if(! $content_type) + $content_type = 'text/bbcode'; + + +// BBCODE alert: the following functions assume bbcode input +// and will require alternatives for alternative content-types (text/html, text/markdown, text/plain, etc.) +// we may need virtual or template classes to implement the possible alternatives + // Work around doubled linefeeds in Tinymce 3.5b2 // First figure out if it's a status post that would've been // created using tinymce. Otherwise leave it alone. @@ -308,60 +320,6 @@ function item_post(&$a) { } - // get contact info for poster - - -/* - $author = null; - $self = false; - $contact_id = 0; - - if((local_user()) && (local_user() == $profile_uid)) { - $self = true; - $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1", - intval($_SESSION['uid']) - ); - } - elseif(remote_user()) { - if(is_array($_SESSION['remote'])) { - foreach($_SESSION['remote'] as $v) { - if($v['uid'] == $profile_uid) { - $contact_id = $v['cid']; - break; - } - } - } - if($contact_id) { - $r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1", - intval($contact_id) - ); - } - } - - if(count($r)) { - // FIXME - $author = $r[0]; - $contact_id = $author['id']; - } - - // get contact info for owner - - if($profile_uid == local_user()) { - $contact_record = $author; - } - else { - $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1", - intval($profile_uid) - ); - if(count($r)) - $contact_record = $r[0]; - } - -*/ - - $post_type = notags(trim($_REQUEST['type'])); - - /** * * When a photo was uploaded into the message using the (profile wall) ajax @@ -445,18 +403,6 @@ function item_post(&$a) { } } - if(strlen($categories)) { - $cats = explode(',',$categories); - foreach($cats as $cat) { - $post_tags[] = array( - 'uid' => $profile_uid, - 'type' => TERM_CATEGORY, - 'otype' => TERM_OBJ_POST, - 'term' => trim($cat), - 'url' => '' - ); - } - } // logger('post_tags: ' . print_r($post_tags,true)); @@ -489,6 +435,23 @@ function item_post(&$a) { } } +// BBCODE end alert + + + if(strlen($categories)) { + $cats = explode(',',$categories); + foreach($cats as $cat) { + $post_tags[] = array( + 'uid' => $profile_uid, + 'type' => TERM_CATEGORY, + 'otype' => TERM_OBJ_POST, + 'term' => trim($cat), + 'url' => '' + ); + } + } + + $item_flags = ITEM_UNSEEN; $item_restrict = ITEM_VISIBLE; @@ -504,7 +467,6 @@ function item_post(&$a) { if($webpage) $item_restrict = $item_restrict | ITEM_WEBPAGE; - if(! strlen($verb)) @@ -542,6 +504,7 @@ function item_post(&$a) { $datarray['changed'] = datetime_convert(); $datarray['uri'] = $uri; $datarray['parent_uri'] = $parent_uri; + $datarray['mimetype'] = $content_type; $datarray['title'] = $title; $datarray['body'] = $body; $datarray['app'] = $app; diff --git a/version.inc b/version.inc index 60f2e885b..c87ab6357 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2013-03-13.251 +2013-03-14.252 |