From 72b7b19937ad2ac4f3b875968ae48060f5dcfc95 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 18 Aug 2015 20:00:11 -0700 Subject: update to_do --- doc/to_do_code.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/to_do_code.bb b/doc/to_do_code.bb index f3c347b53..7ee342ed4 100644 --- a/doc/to_do_code.bb +++ b/doc/to_do_code.bb @@ -7,6 +7,7 @@ We need much more than this, but here are areas where developers can help. Pleas [li]forum widget with unread counts (requires the DB schema changes from v3/hubzilla to be viable)[/li] [li]Create bug tracker module[/li] [li]translation plugins - moses or apertium[/li] +[li]plugins - provide 'disable' which is softer than 'uninstall' for those plugins which create additional DB tables[/li] [li]Infinite scroll improvements (i.e. embedded page links) see http://scrollsample.appspot.com/items [/li] [li]Finish the anti-spam bayesian engine[/li] [li]implement an email permission denied bounce message from the sys channel[/li] -- cgit v1.2.3 From c96f121d4189e758392fb7796f7d87f37597cc78 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 18 Aug 2015 22:14:16 -0700 Subject: add photo_detail api call --- include/api.php | 157 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 89 insertions(+), 68 deletions(-) diff --git a/include/api.php b/include/api.php index 6eede68f4..2c25b8700 100644 --- a/include/api.php +++ b/include/api.php @@ -631,6 +631,27 @@ require_once('include/items.php'); } api_register_func('api/red/photos','api_photos', true); + function api_photo_detail(&$a,$type) { + if (api_user()===false) return false; + if(! $_REQUEST['photo_id']) return false; + $scale = ((array_key_exists('scale',$_REQUEST)) ? intval($_REQUEST['scale']) : 0); + $r = q("select * from photo where uid = %d and resource_id = '%s' and scale = %d limit 1", + intval(local_channel()), + dbesc($_REQUEST['photo_id']), + intval($scale) + ); + if($r) { + $data = dbunescbin($r[0]['data']); + if(array_key_exists('os_storage',$r[0]) && intval($r[0]['os_storage'])) + $data = file_get_contents($data); + $r[0]['data'] = base64_encode($data); + json_return_and_die($r[0]); + } + killme(); + } + + api_register_func('api/red/photo', 'api_photo_detail', true); + function api_group_members(&$a,$type) { if(api_user() === false) @@ -686,7 +707,7 @@ require_once('include/items.php'); api_register_func('api/red/xchan','api_red_xchan',true); - function api_statuses_mediap(&$a, $type) { + function api_statuses_mediap(&$a, $type) { if (api_user() === false) { logger('api_statuses_update: no user'); return false; @@ -696,7 +717,7 @@ require_once('include/items.php'); $_REQUEST['type'] = 'wall'; $_REQUEST['profile_uid'] = api_user(); $_REQUEST['api_source'] = true; - + $txt = requestdata('status'); require_once('library/HTMLPurifier.auto.php'); @@ -711,13 +732,13 @@ require_once('include/items.php'); } $txt = html2bbcode($txt); - $a->argv[1] = $user_info['screen_name']; + $a->argv[1] = $user_info['screen_name']; $_REQUEST['silent']='1'; //tell wall_upload function to return img info instead of echo $_FILES['userfile'] = $_FILES['media']; require_once('mod/wall_attach.php'); $posted = wall_attach_post($a); - + //now that we have the img url in bbcode we can add it to the status and insert the wall item. $_REQUEST['body']=$txt."\n\n".$posted; require_once('mod/item.php'); @@ -1164,14 +1185,14 @@ require_once('include/items.php'); $sql_extra = 'AND `item`.`id` <= '.intval($max_id); require_once('include/security.php'); - $r = q("select * from item where item_restrict = 0 + $r = q("select * from item where item_restrict = 0 and allow_cid = '' and allow_gid = '' and deny_cid = '' and deny_gid = '' - and item_private = 0 + and item_private = 0 and uid = " . $sys['channel_id'] . " $sql_extra AND id > %d group by mid - order by received desc LIMIT %d OFFSET %d ", + order by received desc LIMIT %d OFFSET %d ", intval($since_id), intval($count), intval($start) @@ -1382,17 +1403,17 @@ require_once('include/items.php'); $diasp_url = str_replace('/channel/','/u/',$myurl); if (get_config('system','use_fulltext_engine')) - $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where (MATCH(`author-link`) AGAINST ('".'"%s"'."' in boolean mode) or MATCH(`tag`) AGAINST ('".'"%s"'."' in boolean mode) or MATCH(tag) AGAINST ('".'"%s"'."' in boolean mode))) ", - dbesc(protect_sprintf($myurl)), - dbesc(protect_sprintf($myurl)), - dbesc(protect_sprintf($diasp_url)) - ); - else - $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where ( `author-link` like '%s' or `tag` like '%s' or tag like '%s' )) ", - dbesc(protect_sprintf('%' . $myurl)), - dbesc(protect_sprintf('%' . $myurl . ']%')), - dbesc(protect_sprintf('%' . $diasp_url . ']%')) - ); + $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where (MATCH(`author-link`) AGAINST ('".'"%s"'."' in boolean mode) or MATCH(`tag`) AGAINST ('".'"%s"'."' in boolean mode) or MATCH(tag) AGAINST ('".'"%s"'."' in boolean mode))) ", + dbesc(protect_sprintf($myurl)), + dbesc(protect_sprintf($myurl)), + dbesc(protect_sprintf($diasp_url)) + ); + else + $sql_extra .= sprintf(" AND `item`.`parent` IN (SELECT distinct(`parent`) from item where ( `author-link` like '%s' or `tag` like '%s' or tag like '%s' )) ", + dbesc(protect_sprintf('%' . $myurl)), + dbesc(protect_sprintf('%' . $myurl . ']%')), + dbesc(protect_sprintf('%' . $diasp_url . ']%')) + ); if ($max_id > 0) $sql_extra .= ' AND `item`.`id` <= '.intval($max_id); @@ -1486,10 +1507,10 @@ require_once('include/items.php'); // ); $arr = array( - 'uid' => api_user(), - 'since_id' => $since_id, - 'start' => $start, - 'records' => $count); + 'uid' => api_user(), + 'since_id' => $since_id, + 'start' => $start, + 'records' => $count); if ($user_info['self']==1) $arr['wall'] = 1; @@ -1498,7 +1519,7 @@ require_once('include/items.php'); $r = items_fetch($arr,get_app()->get_channel(),get_observer_hash()); - + $ret = api_format_items($r,$user_info); @@ -1516,80 +1537,80 @@ require_once('include/items.php'); - /** - * Star/unstar an item - * param: id : id of the item - * - * api v1 : https://web.archive.org/web/20131019055350/https://dev.twitter.com/docs/api/1/post/favorites/create/%3Aid - */ - function api_favorites_create_destroy(&$a, $type){ + /** + * Star/unstar an item + * param: id : id of the item + * + * api v1 : https://web.archive.org/web/20131019055350/https://dev.twitter.com/docs/api/1/post/favorites/create/%3Aid + */ + function api_favorites_create_destroy(&$a, $type){ logger('favorites_create_destroy'); - if (api_user()===false) + if (api_user()===false) return false; - $action = str_replace(".".$type,"",argv(2)); - if (argc() > 3) { - $itemid = intval(argv(3)); - } else { - $itemid = intval($_REQUEST['id']); - } + $action = str_replace(".".$type,"",argv(2)); + if (argc() > 3) { + $itemid = intval(argv(3)); + } else { + $itemid = intval($_REQUEST['id']); + } - $item = q("SELECT * FROM item WHERE id = %d AND uid = %d", - intval($itemid), + $item = q("SELECT * FROM item WHERE id = %d AND uid = %d", + intval($itemid), intval(api_user()) ); - if (! $item) + if (! $item) return false; - switch($action){ - case "create": + switch($action){ + case "create": - $flags = $item[0]['item_flags'] | ITEM_STARRED; + $flags = $item[0]['item_flags'] | ITEM_STARRED; - break; - case "destroy": + break; + case "destroy": - $flags = $item[0]['item_flags'] | (~ ITEM_STARRED); - break; - default: - return false; - } + $flags = $item[0]['item_flags'] | (~ ITEM_STARRED); + break; + default: + return false; + } - $r = q("UPDATE item SET item_flags = %d where id = %d and uid = %d", - intval($flags), + $r = q("UPDATE item SET item_flags = %d where id = %d and uid = %d", + intval($flags), intval($itemid), intval(api_user()) ); if(! $r) return false; - $item = q("SELECT * FROM item WHERE id = %d AND uid = %d", - intval($itemid), + $item = q("SELECT * FROM item WHERE id = %d AND uid = %d", + intval($itemid), intval(api_user()) ); xchan_query($item,true); - $user_info = api_get_user($a); - $rets = api_format_items($item,$user_info); - $ret = $rets[0]; + $user_info = api_get_user($a); + $rets = api_format_items($item,$user_info); + $ret = $rets[0]; - $data = array('$status' => $ret); - switch($type){ - case "atom": - case "rss": - $data = api_rss_extra($a, $data, $user_info); - } + $data = array('$status' => $ret); + switch($type){ + case "atom": + case "rss": + $data = api_rss_extra($a, $data, $user_info); + } - return api_apply_template("status", $type, $data); - } + return api_apply_template("status", $type, $data); + } - api_register_func('api/favorites/create', 'api_favorites_create_destroy', true); - api_register_func('api/favorites/destroy', 'api_favorites_create_destroy', true); + api_register_func('api/favorites/create', 'api_favorites_create_destroy', true); + api_register_func('api/favorites/destroy', 'api_favorites_create_destroy', true); @@ -1600,7 +1621,7 @@ require_once('include/items.php'); $user_info = api_get_user($a); // params - $count = (x($_REQUEST,'count')?$_REQUEST['count']:20); + $count = (x($_REQUEST,'count')?$_REQUEST['count']:20); $page = (x($_REQUEST,'page')?$_REQUEST['page']-1:0); if($page < 0) $page = 0; -- cgit v1.2.3 From a4caaefd32ca68f45f7526dde61d17e8ca3dc3af Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 19 Aug 2015 16:50:32 -0700 Subject: event integration improvements --- include/event.php | 11 +++++++++++ include/zot.php | 15 +++++++++++++-- mod/editpost.php | 6 ++++++ mod/events.php | 26 +++++++++++++++++++++++++- 4 files changed, 55 insertions(+), 3 deletions(-) diff --git a/include/event.php b/include/event.php index 1ae0d06ef..5eaeca813 100644 --- a/include/event.php +++ b/include/event.php @@ -850,6 +850,17 @@ function event_store_item($arr, $event) { $item_arr['item_origin'] = $item_origin; $item_arr['item_thread_top'] = $item_thread_top;; + $attach = array(array( + 'href' => z_root() . '/events/ical/' . urlencode($event['event_hash']), + 'length' => 0, + 'type' => 'text/calendar', + 'title' => t('event') . '-' . $event['event_hash'], + 'revision' => '' + )); + + $item_arr['attach'] = $attach; + + if(array_key_exists('term', $arr)) $item_arr['term'] = $arr['term']; diff --git a/include/zot.php b/include/zot.php index bae20b4f0..17330838b 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1688,7 +1688,7 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $ $result[] = array($d['hash'],'update ignored',$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>',$arr['mid']); } else { - update_imported_item($sender,$arr,$channel['channel_id']); + update_imported_item($sender,$arr,$r[0],$channel['channel_id']); $result[] = array($d['hash'],'updated',$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>',$arr['mid']); if(! $relay) add_source_route($item_id,$sender['hash']); @@ -1825,9 +1825,20 @@ function remove_community_tag($sender, $arr, $uid) { * @param array $item * @param int $uid (unused) */ -function update_imported_item($sender, $item, $uid) { +function update_imported_item($sender, $item, $orig, $uid) { + $x = item_store_update($item); + + // If we're updating an event that we've saved locally, we store the item info first + // because event_addtocal will parse the body to get the 'new' event details + + if($orig['resource_type'] === 'event') { + $res = event_addtocal($orig['id'],$uid); + if(! $res) + logger('update event: failed'); + } + if(! $x['item_id']) logger('update_imported_item: failed: ' . $x['message']); else diff --git a/mod/editpost.php b/mod/editpost.php index 235ae9def..daca7c154 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -32,6 +32,12 @@ function editpost_content(&$a) { return; } + if($itm[0]['resource_type'] === 'event' && $itm[0]['resource_id']) { + goaway(z_root() . '/events/event/' . $itm[0]['resource_id']); + } + + + $plaintext = true; // if(feature_enabled(local_channel(),'richtext')) // $plaintext = false; diff --git a/mod/events.php b/mod/events.php index c2bacfe44..08527b930 100755 --- a/mod/events.php +++ b/mod/events.php @@ -8,7 +8,7 @@ require_once('include/items.php'); function events_post(&$a) { - logger('post: ' . print_r($_REQUEST,true)); + logger('post: ' . print_r($_REQUEST,true), LOGGER_DATA); if(! local_channel()) return; @@ -282,6 +282,10 @@ function events_content(&$a) { $mode = 'edit'; $event_id = argv(2); } + if(argc() > 2 && argv(1) == 'ical') { + $mode = 'ical'; + $event_id = argv(2); + } if(argc() > 2 && argv(1) === 'add') { $mode = 'add'; $item_id = intval(argv(2)); @@ -306,6 +310,26 @@ function events_content(&$a) { killme(); } + + if($mode === 'ical') { + $r = q("select * from event where event_hash = '%s' and uid = %d limit 1", + dbesc($event_id), + intval(local_channel()) + ); + if($r) { + header('Content-type: text/calendar'); + header('content-disposition: attachment; filename="' . t('event') . '-' . $event_id . '.ics"' ); + echo ical_wrapper($r); + killme(); + } + else { + notice( t('Event not found.') . EOL ); + return; + } + } + + + if($mode == 'view') { -- cgit v1.2.3 From 863a9797544a80671c179355ff31c73032e88fb7 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 19 Aug 2015 17:16:19 -0700 Subject: check perms on ical attachments --- mod/events.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mod/events.php b/mod/events.php index 08527b930..7894f960b 100755 --- a/mod/events.php +++ b/mod/events.php @@ -312,9 +312,12 @@ function events_content(&$a) { if($mode === 'ical') { - $r = q("select * from event where event_hash = '%s' and uid = %d limit 1", - dbesc($event_id), - intval(local_channel()) + + require_once('include/security.php'); + $sql_extra = permissions_sql(local_channel()); + + $r = q("select * from event where event_hash = '%s' $sql_extra limit 1", + dbesc($event_id) ); if($r) { header('Content-type: text/calendar'); -- cgit v1.2.3 From 69920fb7173887f83052e682d5273b16e9c34c49 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 19 Aug 2015 19:17:17 -0700 Subject: fix photo location --- include/photo/photo_driver.php | 3 ++- include/photos.php | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 426eb6aac..553e77ed1 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -238,10 +238,12 @@ abstract class photo_driver { if(! $this->is_valid()) return FALSE; + if((! function_exists('exif_read_data')) || ($this->getType() !== 'image/jpeg')) return; $exif = @exif_read_data($filename,null,true); + if($exif) { $ort = $exif['IFD0']['Orientation']; @@ -281,7 +283,6 @@ abstract class photo_driver { break; } - // logger('exif: ' . print_r($exif,true)); return $exif; } diff --git a/include/photos.php b/include/photos.php index 7437d6aa9..cb7fabc98 100644 --- a/include/photos.php +++ b/include/photos.php @@ -166,7 +166,7 @@ function photo_upload($channel, $observer, $args) { return $ret; } - $exif = $ph->orient($src); + $exif = $ph->orient(($args['os_path']) ? $args['os_path'] : $src); @unlink($src); @@ -579,6 +579,16 @@ function getGps($exifCoord, $hemi) { return floatval($flip * ($degrees + ($minutes / 60) + ($seconds / 3600))); } +function getGpstimestamp($exifCoord) { + + $hours = count($exifCoord) > 0 ? gps2Num($exifCoord[0]) : 0; + $minutes = count($exifCoord) > 1 ? gps2Num($exifCoord[1]) : 0; + $seconds = count($exifCoord) > 2 ? gps2Num($exifCoord[2]) : 0; + + return sprintf('%02d:%02d:%02d',$hours,$minutes,$seconds); +} + + function gps2Num($coordPart) { $parts = explode('/', $coordPart); -- cgit v1.2.3 From 419b4ecfde2c636da41a07033b279d3aaf21b067 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 19 Aug 2015 21:17:24 -0700 Subject: use consistent terminology --- include/group.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/group.php b/include/group.php index 81e9b98f2..0875b10f9 100644 --- a/include/group.php +++ b/include/group.php @@ -229,7 +229,7 @@ function mini_group_select($uid,$group = '') { logger('mini_group_select: ' . print_r($grps,true), LOGGER_DATA); $o = replace_macros(get_markup_template('group_selection.tpl'), array( - '$label' => t('Default privacy group for new contacts'), + '$label' => t('Add new connections to this collection (privacy group)'), '$groups' => $grps )); return $o; -- cgit v1.2.3 From 5786fd2221f1812620084420c0dca578d83a1a2f Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 20 Aug 2015 01:12:35 -0700 Subject: extra encoding on mail titles --- include/items.php | 2 +- include/text.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/items.php b/include/items.php index d8c551cea..0079e0e55 100755 --- a/include/items.php +++ b/include/items.php @@ -3492,7 +3492,7 @@ function mail_store($arr) { $arr['to_xchan'] = ((x($arr,'to_xchan')) ? notags(trim($arr['to_xchan'])) : ''); $arr['created'] = ((x($arr,'created') !== false) ? datetime_convert('UTC','UTC',$arr['created']) : datetime_convert()); $arr['expires'] = ((x($arr,'expires') !== false) ? datetime_convert('UTC','UTC',$arr['expires']) : NULL_DATE); - $arr['title'] = ((x($arr,'title')) ? notags(trim($arr['title'])) : ''); + $arr['title'] = ((x($arr,'title')) ? trim($arr['title']) : ''); $arr['parent_mid'] = ((x($arr,'parent_mid')) ? notags(trim($arr['parent_mid'])) : ''); $arr['body'] = ((x($arr,'body')) ? trim($arr['body']) : ''); diff --git a/include/text.php b/include/text.php index cc084f6f1..f27a9ce68 100644 --- a/include/text.php +++ b/include/text.php @@ -1305,7 +1305,7 @@ function theme_attachments(&$item) { $title = htmlspecialchars($r['title'], ENT_COMPAT,'UTF-8'); if(! $title) $title = t('unknown.???'); - $title .= ' ' . $r['length'] . ' ' . t('bytes'); + $title .= ' ' . (($r['length']) ? $r['length'] . ' ' . t('bytes') : ''); require_once('include/identity.php'); if(is_foreigner($item['author_xchan'])) -- cgit v1.2.3 From fd7b668a16e34b5953a85b0b547e97ae36c2dd0c Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 20 Aug 2015 02:07:51 -0700 Subject: add carriage return to newlines for exported events (rfc2445:4.1) --- include/event.php | 62 +++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/include/event.php b/include/event.php index 5eaeca813..2e24c81e2 100644 --- a/include/event.php +++ b/include/event.php @@ -63,9 +63,9 @@ function ical_wrapper($ev) { return ''; $o .= "BEGIN:VCALENDAR"; - $o .= "\nVERSION:2.0"; - $o .= "\nMETHOD:PUBLISH"; - $o .= "\nPRODID:-//" . get_config('system','sitename') . "//" . PLATFORM_NAME . "//" . strtoupper(get_app()->language). "\n"; + $o .= "\r\nVERSION:2.0"; + $o .= "\r\nMETHOD:PUBLISH"; + $o .= "\r\nPRODID:-//" . get_config('system','sitename') . "//" . PLATFORM_NAME . "//" . strtoupper(get_app()->language). "\r\n"; if(array_key_exists('start', $ev)) $o .= format_event_ical($ev); else { @@ -73,7 +73,7 @@ function ical_wrapper($ev) { $o .= format_event_ical($e); } } - $o .= "\nEND:VCALENDAR\n"; + $o .= "\r\nEND:VCALENDAR\r\n"; return $o; } @@ -85,23 +85,23 @@ function format_event_ical($ev) { $o = ''; - $o .= "\nBEGIN:VEVENT"; + $o .= "\r\nBEGIN:VEVENT"; - $o .= "\nCREATED:" . datetime_convert('UTC','UTC', $ev['created'],'Ymd\\THis\\Z'); - $o .= "\nLAST-MODIFIED:" . datetime_convert('UTC','UTC', $ev['edited'],'Ymd\\THis\\Z'); - $o .= "\nDTSTAMP:" . datetime_convert('UTC','UTC', $ev['edited'],'Ymd\\THis\\Z'); + $o .= "\r\nCREATED:" . datetime_convert('UTC','UTC', $ev['created'],'Ymd\\THis\\Z'); + $o .= "\r\nLAST-MODIFIED:" . datetime_convert('UTC','UTC', $ev['edited'],'Ymd\\THis\\Z'); + $o .= "\r\nDTSTAMP:" . datetime_convert('UTC','UTC', $ev['edited'],'Ymd\\THis\\Z'); if($ev['start']) - $o .= "\nDTSTART:" . datetime_convert('UTC','UTC', $ev['start'],'Ymd\\THis' . (($ev['adjust']) ? '\\Z' : '')); + $o .= "\r\nDTSTART:" . datetime_convert('UTC','UTC', $ev['start'],'Ymd\\THis' . (($ev['adjust']) ? '\\Z' : '')); if($ev['finish'] && ! $ev['nofinish']) - $o .= "\nDTEND:" . datetime_convert('UTC','UTC', $ev['finish'],'Ymd\\THis' . (($ev['adjust']) ? '\\Z' : '')); + $o .= "\r\nDTEND:" . datetime_convert('UTC','UTC', $ev['finish'],'Ymd\\THis' . (($ev['adjust']) ? '\\Z' : '')); if($ev['summary']) - $o .= "\nSUMMARY:" . format_ical_text($ev['summary']); + $o .= "\r\nSUMMARY:" . format_ical_text($ev['summary']); if($ev['location']) - $o .= "\nLOCATION:" . format_ical_text($ev['location']); + $o .= "\r\nLOCATION:" . format_ical_text($ev['location']); if($ev['description']) - $o .= "\nDESCRIPTION:" . format_ical_text($ev['description']); - $o .= "\nUID:" . $ev['event_hash'] ; - $o .= "\nEND:VEVENT\n"; + $o .= "\r\nDESCRIPTION:" . format_ical_text($ev['description']); + $o .= "\r\nUID:" . $ev['event_hash'] ; + $o .= "\r\nEND:VEVENT\r\n"; return $o; } @@ -111,31 +111,31 @@ function format_todo_ical($ev) { $o = ''; - $o .= "\nBEGIN:VTODO"; - $o .= "\nCREATED:" . datetime_convert('UTC','UTC', $ev['created'],'Ymd\\THis\\Z'); - $o .= "\nLAST-MODIFIED:" . datetime_convert('UTC','UTC', $ev['edited'],'Ymd\\THis\\Z'); - $o .= "\nDTSTAMP:" . datetime_convert('UTC','UTC', $ev['edited'],'Ymd\\THis\\Z'); + $o .= "\r\nBEGIN:VTODO"; + $o .= "\r\nCREATED:" . datetime_convert('UTC','UTC', $ev['created'],'Ymd\\THis\\Z'); + $o .= "\r\nLAST-MODIFIED:" . datetime_convert('UTC','UTC', $ev['edited'],'Ymd\\THis\\Z'); + $o .= "\r\nDTSTAMP:" . datetime_convert('UTC','UTC', $ev['edited'],'Ymd\\THis\\Z'); if($ev['start']) - $o .= "\nDTSTART:" . datetime_convert('UTC','UTC', $ev['start'],'Ymd\\THis' . (($ev['adjust']) ? '\\Z' : '')); + $o .= "\r\nDTSTART:" . datetime_convert('UTC','UTC', $ev['start'],'Ymd\\THis' . (($ev['adjust']) ? '\\Z' : '')); if($ev['finish'] && ! $ev['nofinish']) - $o .= "\nDUE:" . datetime_convert('UTC','UTC', $ev['finish'],'Ymd\\THis' . (($ev['adjust']) ? '\\Z' : '')); + $o .= "\r\nDUE:" . datetime_convert('UTC','UTC', $ev['finish'],'Ymd\\THis' . (($ev['adjust']) ? '\\Z' : '')); if($ev['summary']) - $o .= "\nSUMMARY:" . format_ical_text($ev['summary']); + $o .= "\r\nSUMMARY:" . format_ical_text($ev['summary']); if($ev['event_status']) { - $o .= "\nSTATUS:" . $ev['event_status']; + $o .= "\r\nSTATUS:" . $ev['event_status']; if($ev['event_status'] === 'COMPLETED') - $o .= "\nCOMPLETED:" . datetime_convert('UTC','UTC', $ev['event_status_date'],'Ymd\\THis\\Z'); + $o .= "\r\nCOMPLETED:" . datetime_convert('UTC','UTC', $ev['event_status_date'],'Ymd\\THis\\Z'); } if(intval($ev['event_percent'])) - $o .= "\nPERCENT-COMPLETE:" . $ev['event_percent']; + $o .= "\r\nPERCENT-COMPLETE:" . $ev['event_percent']; if(intval($ev['event_sequence'])) - $o .= "\nSEQUENCE:" . $ev['event_sequence']; + $o .= "\r\nSEQUENCE:" . $ev['event_sequence']; if($ev['location']) - $o .= "\nLOCATION:" . format_ical_text($ev['location']); + $o .= "\r\nLOCATION:" . format_ical_text($ev['location']); if($ev['description']) - $o .= "\nDESCRIPTION:" . format_ical_text($ev['description']); - $o .= "\nUID:" . $ev['event_hash'] ; - $o .= "\nEND:VTODO\n"; + $o .= "\r\nDESCRIPTION:" . format_ical_text($ev['description']); + $o .= "\r\nUID:" . $ev['event_hash'] ; + $o .= "\r\nEND:VTODO\r\n"; return $o; } @@ -146,7 +146,7 @@ function format_ical_text($s) { require_once('include/bbcode.php'); require_once('include/html2plain.php'); - return(wordwrap(str_replace(',','\\,',html2plain(bbcode($s))),72,"\n ",true)); + return(wordwrap(str_replace(',','\\,',html2plain(bbcode($s))),72,"\r\n ",true)); } -- cgit v1.2.3 From a322254f2aa02f662667eeb0bdd4e8646cd029c2 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 20 Aug 2015 04:51:03 -0700 Subject: do ical export before checking logged in channel --- include/event.php | 2 +- mod/events.php | 44 +++++++++++++++++++++----------------------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/include/event.php b/include/event.php index 2e24c81e2..95808452d 100644 --- a/include/event.php +++ b/include/event.php @@ -146,7 +146,7 @@ function format_ical_text($s) { require_once('include/bbcode.php'); require_once('include/html2plain.php'); - return(wordwrap(str_replace(',','\\,',html2plain(bbcode($s))),72,"\r\n ",true)); + return(wordwrap(str_replace(array(',',';','\\'),array('\\,','\\;','\\\\'),html2plain(bbcode($s))),72,"\r\n ",true)); } diff --git a/mod/events.php b/mod/events.php index 7894f960b..630b8191f 100755 --- a/mod/events.php +++ b/mod/events.php @@ -228,6 +228,27 @@ function events_post(&$a) { function events_content(&$a) { + if(argc() > 2 && argv(1) == 'ical') { + $event_id = argv(2); + + require_once('include/security.php'); + $sql_extra = permissions_sql(local_channel()); + + $r = q("select * from event where event_hash = '%s' $sql_extra limit 1", + dbesc($event_id) + ); + if($r) { + header('Content-type: text/calendar'); + header('content-disposition: attachment; filename="' . t('event') . '-' . $event_id . '.ics"' ); + echo ical_wrapper($r); + killme(); + } + else { + notice( t('Event not found.') . EOL ); + return; + } + } + if(! local_channel()) { notice( t('Permission denied.') . EOL); return; @@ -282,10 +303,6 @@ function events_content(&$a) { $mode = 'edit'; $event_id = argv(2); } - if(argc() > 2 && argv(1) == 'ical') { - $mode = 'ical'; - $event_id = argv(2); - } if(argc() > 2 && argv(1) === 'add') { $mode = 'add'; $item_id = intval(argv(2)); @@ -311,25 +328,6 @@ function events_content(&$a) { } - if($mode === 'ical') { - - require_once('include/security.php'); - $sql_extra = permissions_sql(local_channel()); - - $r = q("select * from event where event_hash = '%s' $sql_extra limit 1", - dbesc($event_id) - ); - if($r) { - header('Content-type: text/calendar'); - header('content-disposition: attachment; filename="' . t('event') . '-' . $event_id . '.ics"' ); - echo ical_wrapper($r); - killme(); - } - else { - notice( t('Event not found.') . EOL ); - return; - } - } -- cgit v1.2.3 From 20fc4ee0214adc9a19942ccc09077a2ec3da198c Mon Sep 17 00:00:00 2001 From: jeroenpraat Date: Thu, 20 Aug 2015 20:57:08 +0200 Subject: Another Spanish strings update --- view/es/messages.po | 106 ++++++++++++++++++++++++++-------------------------- view/es/strings.php | 104 +++++++++++++++++++++++++-------------------------- 2 files changed, 105 insertions(+), 105 deletions(-) diff --git a/view/es/messages.po b/view/es/messages.po index 9a561aebc..7d133cb39 100644 --- a/view/es/messages.po +++ b/view/es/messages.po @@ -14,7 +14,7 @@ msgstr "" "Project-Id-Version: Redmatrix\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-08-14 00:04-0700\n" -"PO-Revision-Date: 2015-08-17 16:39+0000\n" +"PO-Revision-Date: 2015-08-20 11:57+0000\n" "Last-Translator: Manuel Jiménez Friaza \n" "Language-Team: Spanish (http://www.transifex.com/Friendica/red-matrix/language/es/)\n" "MIME-Version: 1.0\n" @@ -268,7 +268,7 @@ msgstr "nunca" #: ../../include/datetime.php:268 msgid "less than a second ago" -msgstr "hace menos de un segundo" +msgstr "hace un instante" #: ../../include/datetime.php:271 msgid "year" @@ -330,7 +330,7 @@ msgstr "segundos" #, php-format msgctxt "e.g. 22 hours ago, 1 minute ago" msgid "%1$d %2$s ago" -msgstr "hace %1$d %2$s" +msgstr "Hace %1$d y %2$s" #: ../../include/datetime.php:519 #, php-format @@ -543,7 +543,7 @@ msgstr "timeago.prefixFromNow" #: ../../include/js_strings.php:28 msgid "ago" -msgstr "hace" +msgstr "de su publicación" #: ../../include/js_strings.php:29 msgid "from now" @@ -555,7 +555,7 @@ msgstr "menos de un minuto" #: ../../include/js_strings.php:31 msgid "about a minute" -msgstr "hace como un minuto" +msgstr "alrededor de un minuto" #: ../../include/js_strings.php:32 #, php-format @@ -564,12 +564,12 @@ msgstr "%d minutos" #: ../../include/js_strings.php:33 msgid "about an hour" -msgstr "hace como una hora" +msgstr "alrededor de una hora" #: ../../include/js_strings.php:34 #, php-format msgid "about %d hours" -msgstr "hace %d minutos" +msgstr "alrededor de %d horas" #: ../../include/js_strings.php:35 msgid "a day" @@ -582,7 +582,7 @@ msgstr "%d días" #: ../../include/js_strings.php:37 msgid "about a month" -msgstr "hace como un mes" +msgstr "alrededor de un mes" #: ../../include/js_strings.php:38 #, php-format @@ -591,7 +591,7 @@ msgstr "%d meses" #: ../../include/js_strings.php:39 msgid "about a year" -msgstr "hace un año" +msgstr "alrededor de un año" #: ../../include/js_strings.php:40 #, php-format @@ -888,7 +888,7 @@ msgstr "Pulsar para abrir/cerrar" #: ../../include/text.php:1665 ../../mod/events.php:457 msgid "Link to Source" -msgstr "Enlace a la fuente" +msgstr "Ir al mensaje original" #: ../../include/text.php:1686 ../../include/text.php:1757 msgid "default" @@ -1483,7 +1483,7 @@ msgstr "Configuración de visualización" #: ../../include/widgets.php:517 msgid "Connected apps" -msgstr "Apps conectadas" +msgstr "Aplicaciones conectadas" #: ../../include/widgets.php:523 msgid "Export channel" @@ -1630,7 +1630,7 @@ msgstr "Para ver o comentar la conversación, visita %s" #: ../../include/enotify.php:196 #, php-format msgid "[Red:Notify] %s posted to your profile wall" -msgstr "[Red:aviso] %s escribió en su muro" +msgstr "[Red:Notify] %s escribió en su muro" #: ../../include/enotify.php:198 #, php-format @@ -1765,7 +1765,7 @@ msgstr "No se ha podido verificar las entradas guardadas." #: ../../mod/like.php:394 #, php-format msgid "%1$s likes %2$s's %3$s" -msgstr "a %1$s le gusta el/la %3$s de %2$s" +msgstr "a %1$s le gusta el %3$s de %2$s" #: ../../include/diaspora.php:2494 msgid "Please choose" @@ -1781,7 +1781,7 @@ msgstr "En desacuerdo" #: ../../include/diaspora.php:2500 msgid "Abstain" -msgstr "Se abstiene" +msgstr "Abstención" #: ../../include/follow.php:28 msgid "Channel is blocked on this site." @@ -1833,11 +1833,11 @@ msgstr "Guardar en carpeta" #: ../../include/ItemObject.php:151 msgid "I will attend" -msgstr "Asistiré" +msgstr "Participaré" #: ../../include/ItemObject.php:151 msgid "I will not attend" -msgstr "No asistiré" +msgstr "No participaré" #: ../../include/ItemObject.php:151 msgid "I might attend" @@ -1867,7 +1867,7 @@ msgstr "Ver todo" msgctxt "noun" msgid "Like" msgid_plural "Likes" -msgstr[0] "Le gusta" +msgstr[0] "Me gusta" msgstr[1] "Me gusta" #: ../../include/ItemObject.php:184 ../../include/conversation.php:1704 @@ -1875,7 +1875,7 @@ msgstr[1] "Me gusta" msgctxt "noun" msgid "Dislike" msgid_plural "Dislikes" -msgstr[0] "No le gusta" +msgstr[0] "No me gusta" msgstr[1] "No me gusta" #: ../../include/ItemObject.php:212 @@ -1888,7 +1888,7 @@ msgstr "Eliminar estrella" #: ../../include/ItemObject.php:214 msgid "Toggle Star Status" -msgstr "Invertir estado de estrella" +msgstr "Activa o desactiva el estado de preferido" #: ../../include/ItemObject.php:218 msgid "starred" @@ -1908,7 +1908,7 @@ msgstr "Añadir etiqueta" #: ../../include/ItemObject.php:254 ../../mod/photos.php:959 msgid "I like this (toggle)" -msgstr "me gusta (conmutar)" +msgstr "me gusta (cambiar)" #: ../../include/ItemObject.php:254 ../../include/taxonomy.php:310 msgid "like" @@ -1916,7 +1916,7 @@ msgstr "Me gusta" #: ../../include/ItemObject.php:255 ../../mod/photos.php:960 msgid "I don't like this (toggle)" -msgstr "No me gusta (conmutar)" +msgstr "No me gusta (cambiar)" #: ../../include/ItemObject.php:255 ../../include/taxonomy.php:311 msgid "dislike" @@ -1961,7 +1961,7 @@ msgstr "mediante Muro-a-Muro" #: ../../include/ItemObject.php:312 ../../include/conversation.php:716 #, php-format msgid "from %s" -msgstr "de %s" +msgstr "desde %s" #: ../../include/ItemObject.php:315 ../../include/conversation.php:719 #, php-format @@ -2176,7 +2176,7 @@ msgstr "%s - pulsar para cerrar sesión" #: ../../include/nav.php:137 msgid "Remote authentication" -msgstr "Autenticación remota" +msgstr "Acceder desde su servidor" #: ../../include/nav.php:137 msgid "Click to authenticate to your home hub" @@ -2543,12 +2543,12 @@ msgstr "canal" #: ../../include/conversation.php:167 ../../mod/like.php:396 #, php-format msgid "%1$s doesn't like %2$s's %3$s" -msgstr "a %1$s no le gusta el/la %3$s de %2$s" +msgstr "a %1$s no le gusta el %3$s de %2$s" #: ../../include/conversation.php:204 #, php-format msgid "%1$s is now connected with %2$s" -msgstr "%1$s ahora es conectada con %2$s" +msgstr "%1$s ahora está conectado con %2$s" #: ../../include/conversation.php:239 #, php-format @@ -2589,17 +2589,17 @@ msgstr "Abstenerse" #: ../../include/conversation.php:574 ../../mod/photos.php:998 msgctxt "title" msgid "Attending" -msgstr "Asistir" +msgstr "Participar" #: ../../include/conversation.php:574 ../../mod/photos.php:998 msgctxt "title" msgid "Not attending" -msgstr "No asistir" +msgstr "No participar" #: ../../include/conversation.php:574 ../../mod/photos.php:998 msgctxt "title" msgid "Might attend" -msgstr "Quizá asista" +msgstr "Quizá participe" #: ../../include/conversation.php:692 #, php-format @@ -2616,7 +2616,7 @@ msgstr "Archivado bajo:" #: ../../include/conversation.php:735 msgid "View in context" -msgstr "Mostrar en contexto" +msgstr "Mostrar en su contexto" #: ../../include/conversation.php:846 msgid "remove" @@ -2644,7 +2644,7 @@ msgstr "Ver fotos" #: ../../include/conversation.php:944 msgid "Matrix Activity" -msgstr "Actvidad de Matrix" +msgstr "Actividad en la red" #: ../../include/conversation.php:946 msgid "Edit Contact" @@ -2730,7 +2730,7 @@ msgstr "Guardar en carpeta:" #: ../../include/conversation.php:1146 msgid "Where are you right now?" -msgstr "¿Donde estás ahora?" +msgstr "¿Donde está ahora?" #: ../../include/conversation.php:1147 ../../mod/editpost.php:47 #: ../../mod/mail.php:175 ../../mod/mail.php:290 @@ -2965,14 +2965,14 @@ msgctxt "noun" msgid "Attending" msgid_plural "Attending" msgstr[0] "Asistir" -msgstr[1] "Asistir" +msgstr[1] "Participar" #: ../../include/conversation.php:1710 msgctxt "noun" msgid "Not Attending" msgid_plural "Not Attending" msgstr[0] "No asistir" -msgstr[1] "No asistir" +msgstr[1] "No participar" #: ../../include/conversation.php:1713 msgctxt "noun" @@ -3000,7 +3000,7 @@ msgctxt "noun" msgid "Abstain" msgid_plural "Abstains" msgstr[0] "se abstiene" -msgstr[1] "se abstienen" +msgstr[1] "Abstenerse" #: ../../include/items.php:413 ../../mod/like.php:270 #: ../../mod/subthread.php:49 ../../mod/group.php:68 ../../mod/profperm.php:23 @@ -3414,7 +3414,7 @@ msgstr "Recordatorios de eventos" #: ../../include/identity.php:1128 msgid "Events this week:" -msgstr "Eventos esta semana:" +msgstr "Eventos de esta semana:" #: ../../include/identity.php:1141 ../../include/identity.php:1258 #: ../../include/apps.php:138 ../../mod/profperm.php:112 @@ -3473,7 +3473,7 @@ msgstr "Religión:" #: ../../include/identity.php:1216 ../../mod/directory.php:315 msgid "About:" -msgstr "Sobre usted:" +msgstr "Sobre mí:" #: ../../include/identity.php:1218 msgid "Hobbies/Interests:" @@ -3521,7 +3521,7 @@ msgstr "Trabajo/empleo:" #: ../../include/identity.php:1240 msgid "School/education:" -msgstr "Escuela/educación:" +msgstr "Estudios:" #: ../../include/identity.php:1260 msgid "Like this thing" @@ -4346,32 +4346,32 @@ msgstr "Acción anterior revocada." #: ../../mod/like.php:398 #, php-format msgid "%1$s agrees with %2$s's %3$s" -msgstr "%1$s está de acuerdo con %2$s de %3$s" +msgstr "%1$s está de acuerdo con %3$s de %2$s" #: ../../mod/like.php:400 #, php-format msgid "%1$s doesn't agree with %2$s's %3$s" -msgstr "%1$s no están de acuerdo con %2$s de %3$s" +msgstr "%1$s no está de acuerdo con %3$s de %2$s" #: ../../mod/like.php:402 #, php-format msgid "%1$s abstains from a decision on %2$s's %3$s" -msgstr "%1$s se abstiene de pronunciarse sobre %2$s de %3$s" +msgstr "%1$s se abstiene en %3$s de %2$s" #: ../../mod/like.php:404 #, php-format msgid "%1$s is attending %2$s's %3$s" -msgstr "%1$s asistirá a %2$s de %3$s" +msgstr "%1$s participará en el %3$s de %2$s" #: ../../mod/like.php:406 #, php-format msgid "%1$s is not attending %2$s's %3$s" -msgstr "%1$s no asistirá a %2$s de %3$s" +msgstr "%1$s no participará en el %3$s de %2$s" #: ../../mod/like.php:408 #, php-format msgid "%1$s may attend %2$s's %3$s" -msgstr "%1$s podrá asistir a %2$s de %3$s" +msgstr "%1$s tal vez participe en el %3$s de %2$s" #: ../../mod/like.php:492 msgid "Action completed." @@ -4626,11 +4626,11 @@ msgstr "Etiqueta:" #: ../../mod/siteinfo.php:160 msgid "Last background fetch: " -msgstr "Último fondo elegido:" +msgstr "Última actualización en segundo plano:" #: ../../mod/siteinfo.php:163 msgid "Running at web location" -msgstr "Corriendo en un sitio web" +msgstr "Corriendo en el sitio web" #: ../../mod/siteinfo.php:164 msgid "" @@ -4843,7 +4843,7 @@ msgstr "El elemento no es editable" #: ../../mod/editpost.php:48 msgid "Delete item?" -msgstr "¿Borrar este elemento?" +msgstr "¿Borrar el elemento?" #: ../../mod/editpost.php:115 ../../mod/editlayout.php:142 #: ../../mod/editwebpage.php:187 ../../mod/editblock.php:144 @@ -6082,7 +6082,7 @@ msgstr "Trabajo" #: ../../mod/profiles.php:711 msgid "School/education" -msgstr "Educación" +msgstr "Estudios" #: ../../mod/profiles.php:717 msgid "This is your default profile." @@ -6543,7 +6543,7 @@ msgstr "Error del protocolo OpenID. Ningún ID recibido como respuesta." #: ../../mod/openid.php:72 ../../mod/openid.php:180 ../../mod/post.php:286 #, php-format msgid "Welcome %s. Remote authentication successful." -msgstr "Bienvenido %s. La identificación remota se ha llevado a cabo correctamente." +msgstr "Bienvenido %s. La identificación desde su servidor se ha llevado a cabo correctamente." #: ../../mod/tagger.php:96 #, php-format @@ -7960,7 +7960,7 @@ msgstr "acepte una solicitud de amistad" #: ../../mod/settings.php:1099 msgid "joining a forum/community" -msgstr "se una a un foro o comunidad" +msgstr "unirse a un foro o comunidad" #: ../../mod/settings.php:1100 msgid "making an interesting profile change" @@ -8467,7 +8467,7 @@ msgstr "Falló la autenticación." #: ../../mod/rmagic.php:84 msgid "Remote Authentication" -msgstr "Autenticación Remota" +msgstr "Acceso desde su servidor" #: ../../mod/rmagic.php:85 msgid "Enter your channel address (e.g. channel@example.com)" @@ -8563,7 +8563,7 @@ msgstr "Por favor, inicia sesión." msgid "" "Remote authentication blocked. You are logged into this site locally. Please" " logout and retry." -msgstr "La autenticación remota está bloqueada. Ha iniciado sesión localmente. Por favor, salga de la sesión y vuelva a intentarlo." +msgstr "La autenticación desde su servidor está bloqueada. Ha iniciado sesión localmente. Por favor, salga de la sesión y vuelva a intentarlo." #: ../../mod/new_channel.php:109 msgid "Add a Channel" @@ -8667,7 +8667,7 @@ msgstr "se añadió su canal" #: ../../mod/ping.php:355 msgid "posted an event" -msgstr "Se publicó un evento" +msgstr "publicó un evento" #: ../../mod/layouts.php:176 msgid "Comanche page description language help" @@ -8908,7 +8908,7 @@ msgstr "Elija un esquema" #: ../../view/theme/redbasic/php/config.php:104 msgid "Narrow navbar" -msgstr "Limita la barra de navegación" +msgstr "Estrechar la barra de navegación" #: ../../view/theme/redbasic/php/config.php:105 msgid "Navigation bar background color" diff --git a/view/es/strings.php b/view/es/strings.php index aa23c3895..02a9047ad 100644 --- a/view/es/strings.php +++ b/view/es/strings.php @@ -60,7 +60,7 @@ $a->strings["Miscellaneous"] = "Varios"; $a->strings["YYYY-MM-DD or MM-DD"] = "YYYY-MM-DD o MM-DD"; $a->strings["Required"] = "Obligatorio"; $a->strings["never"] = "nunca"; -$a->strings["less than a second ago"] = "hace menos de un segundo"; +$a->strings["less than a second ago"] = "hace un instante"; $a->strings["year"] = "año"; $a->strings["years"] = "años"; $a->strings["month"] = "mes"; @@ -75,7 +75,7 @@ $a->strings["minute"] = "minuto"; $a->strings["minutes"] = "minutos"; $a->strings["second"] = "segundo"; $a->strings["seconds"] = "segundos"; -$a->strings["__ctx:e.g. 22 hours ago, 1 minute ago__ %1\$d %2\$s ago"] = "hace %1\$d %2\$s"; +$a->strings["__ctx:e.g. 22 hours ago, 1 minute ago__ %1\$d %2\$s ago"] = "Hace %1\$d y %2\$s"; $a->strings["%1\$s's birthday"] = "Cumpleaños de %1\$s"; $a->strings["Happy Birthday %1\$s"] = "Feliz cumpleaños %1\$s"; $a->strings["Directory Options"] = "Opciones del directorio"; @@ -116,18 +116,18 @@ $a->strings["Please enter a link URL"] = "Por favor, introduzca una dirección d $a->strings["Unsaved changes. Are you sure you wish to leave this page?"] = "Cambios no guardados. ¿Está seguro que desea abandonar la página?"; $a->strings["timeago.prefixAgo"] = "timeago.prefixAgo"; $a->strings["timeago.prefixFromNow"] = "timeago.prefixFromNow"; -$a->strings["ago"] = "hace"; +$a->strings["ago"] = "de su publicación"; $a->strings["from now"] = "desde ahora"; $a->strings["less than a minute"] = "menos de un minuto"; -$a->strings["about a minute"] = "hace como un minuto"; +$a->strings["about a minute"] = "alrededor de un minuto"; $a->strings["%d minutes"] = "%d minutos"; -$a->strings["about an hour"] = "hace como una hora"; -$a->strings["about %d hours"] = "hace %d minutos"; +$a->strings["about an hour"] = "alrededor de una hora"; +$a->strings["about %d hours"] = "alrededor de %d horas"; $a->strings["a day"] = "un día"; $a->strings["%d days"] = "%d días"; -$a->strings["about a month"] = "hace como un mes"; +$a->strings["about a month"] = "alrededor de un mes"; $a->strings["%d months"] = "%d meses"; -$a->strings["about a year"] = "hace un año"; +$a->strings["about a year"] = "alrededor de un año"; $a->strings["%d years"] = "%d años"; $a->strings[" "] = " "; $a->strings["timeago.numbers"] = "timeago.numbers"; @@ -202,7 +202,7 @@ $a->strings["bytes"] = "bytes"; $a->strings["remove category"] = "eliminar categoría"; $a->strings["remove from file"] = "eliminar del archivo"; $a->strings["Click to open/close"] = "Pulsar para abrir/cerrar"; -$a->strings["Link to Source"] = "Enlace a la fuente"; +$a->strings["Link to Source"] = "Ir al mensaje original"; $a->strings["default"] = "por defecto"; $a->strings["Page layout"] = "Disposición de página"; $a->strings["You can create your own with the layouts tool"] = "Puede crear la suya propia con la herramienta de disposiciones"; @@ -338,7 +338,7 @@ $a->strings["Channel settings"] = "Configuración del canal"; $a->strings["Additional features"] = "Características adicionales"; $a->strings["Feature/Addon settings"] = "Configuración de característica/complemento"; $a->strings["Display settings"] = "Configuración de visualización"; -$a->strings["Connected apps"] = "Apps conectadas"; +$a->strings["Connected apps"] = "Aplicaciones conectadas"; $a->strings["Export channel"] = "Exportar canal"; $a->strings["Connection Default Permissions"] = "Permisos predeterminados de conexión"; $a->strings["Premium Channel Settings"] = "Configuración del canal premium"; @@ -370,7 +370,7 @@ $a->strings["%1\$s, %2\$s commented on [zrl=%3\$s]your %4\$s[/zrl]"] = "%1\$s, % $a->strings["[Red:Notify] Comment to conversation #%1\$d by %2\$s"] = "[Red notifica] Comentario en la conversación #%1\$d por %2\$s"; $a->strings["%1\$s, %2\$s commented on an item/conversation you have been following."] = "%1\$s, %2\$s comentó sobre un elemento/conversación que ha estado siguiendo."; $a->strings["Please visit %s to view and/or reply to the conversation."] = "Para ver o comentar la conversación, visita %s"; -$a->strings["[Red:Notify] %s posted to your profile wall"] = "[Red:aviso] %s escribió en su muro"; +$a->strings["[Red:Notify] %s posted to your profile wall"] = "[Red:Notify] %s escribió en su muro"; $a->strings["%1\$s, %2\$s posted to your profile wall at %3\$s"] = "%1\$s, %2\$s publicó en su muro de perfil en %3\$s"; $a->strings["%1\$s, %2\$s posted to [zrl=%3\$s]your wall[/zrl]"] = "%1\$s, %2\$s publicó en [zrl=%3\$s]su muro[/zrl]"; $a->strings["[Red:Notify] %s tagged you"] = "[Red notifica] %s le etiquetó"; @@ -398,11 +398,11 @@ $a->strings["No recipient provided."] = "No se ha especificado ningún destinata $a->strings["[no subject]"] = "[sin asunto]"; $a->strings["Unable to determine sender."] = "No ha sido posible de determinar el remitente. "; $a->strings["Stored post could not be verified."] = "No se ha podido verificar las entradas guardadas."; -$a->strings["%1\$s likes %2\$s's %3\$s"] = "a %1\$s le gusta el/la %3\$s de %2\$s"; +$a->strings["%1\$s likes %2\$s's %3\$s"] = "a %1\$s le gusta el %3\$s de %2\$s"; $a->strings["Please choose"] = "Por favor selecciona"; $a->strings["Agree"] = "De acuerdo"; $a->strings["Disagree"] = "En desacuerdo"; -$a->strings["Abstain"] = "Se abstiene"; +$a->strings["Abstain"] = "Abstención"; $a->strings["Channel is blocked on this site."] = "El canal está bloqueado en éste sitio."; $a->strings["Channel location missing."] = "Falta la dirección del canal "; $a->strings["Response from remote channel was incomplete."] = "Respuesta del canal remoto incompleta."; @@ -415,31 +415,31 @@ $a->strings["Cannot connect to yourself."] = "No puede conectarse consigo mismo. $a->strings["Private Message"] = "Mensaje Privado"; $a->strings["Select"] = "Seleccionar"; $a->strings["Save to Folder"] = "Guardar en carpeta"; -$a->strings["I will attend"] = "Asistiré"; -$a->strings["I will not attend"] = "No asistiré"; +$a->strings["I will attend"] = "Participaré"; +$a->strings["I will not attend"] = "No participaré"; $a->strings["I might attend"] = "Quizá asista"; $a->strings["I agree"] = "Estoy de acuerdo"; $a->strings["I disagree"] = "No estoy de acuerdo"; $a->strings["I abstain"] = "Me abstengo"; $a->strings["View all"] = "Ver todo"; $a->strings["__ctx:noun__ Like"] = array( - 0 => "Le gusta", + 0 => "Me gusta", 1 => "Me gusta", ); $a->strings["__ctx:noun__ Dislike"] = array( - 0 => "No le gusta", + 0 => "No me gusta", 1 => "No me gusta", ); $a->strings["Add Star"] = "Añadir estrella"; $a->strings["Remove Star"] = "Eliminar estrella"; -$a->strings["Toggle Star Status"] = "Invertir estado de estrella"; +$a->strings["Toggle Star Status"] = "Activa o desactiva el estado de preferido"; $a->strings["starred"] = "preferidos"; $a->strings["Message signature validated"] = "Firma de mensaje validada"; $a->strings["Message signature incorrect"] = "Firma de mensaje incorrecta"; $a->strings["Add Tag"] = "Añadir etiqueta"; -$a->strings["I like this (toggle)"] = "me gusta (conmutar)"; +$a->strings["I like this (toggle)"] = "me gusta (cambiar)"; $a->strings["like"] = "Me gusta"; -$a->strings["I don't like this (toggle)"] = "No me gusta (conmutar)"; +$a->strings["I don't like this (toggle)"] = "No me gusta (cambiar)"; $a->strings["dislike"] = "No me gusta"; $a->strings["Share This"] = "Compartir esto"; $a->strings["share"] = "Compartir"; @@ -452,7 +452,7 @@ $a->strings["to"] = "a"; $a->strings["via"] = "mediante"; $a->strings["Wall-to-Wall"] = "Muro-a-Muro"; $a->strings["via Wall-To-Wall:"] = "mediante Muro-a-Muro"; -$a->strings["from %s"] = "de %s"; +$a->strings["from %s"] = "desde %s"; $a->strings["last edited: %s"] = "último cambio: %s"; $a->strings["Expires: %s"] = "Caduca: %s"; $a->strings["Save Bookmarks"] = "Guardar marcadores"; @@ -499,7 +499,7 @@ $a->strings["Your webpages"] = "Sus páginas web"; $a->strings["Login"] = "Iniciar sesión"; $a->strings["Sign in"] = "Acceder"; $a->strings["%s - click to logout"] = "%s - pulsar para cerrar sesión"; -$a->strings["Remote authentication"] = "Autenticación remota"; +$a->strings["Remote authentication"] = "Acceder desde su servidor"; $a->strings["Click to authenticate to your home hub"] = "Pulsar para identificarse en su servidor"; $a->strings["Home Page"] = "Página de inicio"; $a->strings["Register"] = "Registrarse"; @@ -587,8 +587,8 @@ $a->strings["Group Repository"] = "Repositorio de grupo"; $a->strings["Other"] = "Otro"; $a->strings["Custom/Expert Mode"] = "Modo personalizado/experto"; $a->strings["channel"] = "canal"; -$a->strings["%1\$s doesn't like %2\$s's %3\$s"] = "a %1\$s no le gusta el/la %3\$s de %2\$s"; -$a->strings["%1\$s is now connected with %2\$s"] = "%1\$s ahora es conectada con %2\$s"; +$a->strings["%1\$s doesn't like %2\$s's %3\$s"] = "a %1\$s no le gusta el %3\$s de %2\$s"; +$a->strings["%1\$s is now connected with %2\$s"] = "%1\$s ahora está conectado con %2\$s"; $a->strings["%1\$s poked %2\$s"] = "%1\$s dio un toque a %2\$s"; $a->strings["__ctx:mood__ %1\$s is %2\$s"] = "%1\$s está %2\$s"; $a->strings["__ctx:title__ Likes"] = "Me gusta"; @@ -596,20 +596,20 @@ $a->strings["__ctx:title__ Dislikes"] = "No me gusta"; $a->strings["__ctx:title__ Agree"] = "De acuerdo"; $a->strings["__ctx:title__ Disagree"] = "En desacuerdo"; $a->strings["__ctx:title__ Abstain"] = "Abstenerse"; -$a->strings["__ctx:title__ Attending"] = "Asistir"; -$a->strings["__ctx:title__ Not attending"] = "No asistir"; -$a->strings["__ctx:title__ Might attend"] = "Quizá asista"; +$a->strings["__ctx:title__ Attending"] = "Participar"; +$a->strings["__ctx:title__ Not attending"] = "No participar"; +$a->strings["__ctx:title__ Might attend"] = "Quizá participe"; $a->strings["View %s's profile @ %s"] = "Ver perfil @ %s de %s"; $a->strings["Categories:"] = "Categorías:"; $a->strings["Filed under:"] = "Archivado bajo:"; -$a->strings["View in context"] = "Mostrar en contexto"; +$a->strings["View in context"] = "Mostrar en su contexto"; $a->strings["remove"] = "eliminar"; $a->strings["Delete Selected Items"] = "Eliminar elementos seleccionados"; $a->strings["View Source"] = "Ver fuente"; $a->strings["Follow Thread"] = "Seguir el hilo"; $a->strings["View Status"] = "Ver estado"; $a->strings["View Photos"] = "Ver fotos"; -$a->strings["Matrix Activity"] = "Actvidad de Matrix"; +$a->strings["Matrix Activity"] = "Actividad en la red"; $a->strings["Edit Contact"] = "Editar contacto"; $a->strings["Send PM"] = "Enviar Mensaje Privado"; $a->strings["Poke"] = "Dar un toque"; @@ -636,7 +636,7 @@ $a->strings["Please enter a video link/URL:"] = "Por favor, introduzca un enlace $a->strings["Please enter an audio link/URL:"] = "Por favor, introduzca un enlace/URL de audio:"; $a->strings["Tag term:"] = "Término de etiqueta:"; $a->strings["Save to Folder:"] = "Guardar en carpeta:"; -$a->strings["Where are you right now?"] = "¿Donde estás ahora?"; +$a->strings["Where are you right now?"] = "¿Donde está ahora?"; $a->strings["Expires YYYY-MM-DD HH:MM"] = "Caduca YYYY-MM-DD HH:MM"; $a->strings["Share"] = "Compartir"; $a->strings["Page link name"] = "Nombre de enlace de página"; @@ -689,11 +689,11 @@ $a->strings["Saved Bookmarks"] = "Marcadores guardados"; $a->strings["Manage Webpages"] = "Administrar páginas web"; $a->strings["__ctx:noun__ Attending"] = array( 0 => "Asistir", - 1 => "Asistir", + 1 => "Participar", ); $a->strings["__ctx:noun__ Not Attending"] = array( 0 => "No asistir", - 1 => "No asistir", + 1 => "No participar", ); $a->strings["__ctx:noun__ Undecided"] = array( 0 => "Indeciso/a", @@ -709,7 +709,7 @@ $a->strings["__ctx:noun__ Disagree"] = array( ); $a->strings["__ctx:noun__ Abstain"] = array( 0 => "se abstiene", - 1 => "se abstienen", + 1 => "Abstenerse", ); $a->strings["Permission denied"] = "Permiso denegado"; $a->strings["(Unknown)"] = "(Desconocido)"; @@ -802,7 +802,7 @@ $a->strings["Birthday Reminders"] = "Recordatorios de cumpleaños"; $a->strings["Birthdays this week:"] = "Cumpleaños esta semana:"; $a->strings["[No description]"] = "[Sin descripción]"; $a->strings["Event Reminders"] = "Recordatorios de eventos"; -$a->strings["Events this week:"] = "Eventos esta semana:"; +$a->strings["Events this week:"] = "Eventos de esta semana:"; $a->strings["Profile"] = "Perfil"; $a->strings["Full Name:"] = "Nombre completo:"; $a->strings["Like this channel"] = "Me gusta este canal"; @@ -816,7 +816,7 @@ $a->strings["Hometown:"] = "Ciudad de origen:"; $a->strings["Tags:"] = "Etiquetas:"; $a->strings["Political Views:"] = "Posición política:"; $a->strings["Religion:"] = "Religión:"; -$a->strings["About:"] = "Sobre usted:"; +$a->strings["About:"] = "Sobre mí:"; $a->strings["Hobbies/Interests:"] = "Aficciones/Intereses:"; $a->strings["Likes:"] = "Me gusta:"; $a->strings["Dislikes:"] = "No me gusta:"; @@ -828,7 +828,7 @@ $a->strings["Television:"] = "Televisión:"; $a->strings["Film/dance/culture/entertainment:"] = "Cine/baile/cultura/entretenimiento:"; $a->strings["Love/Romance:"] = "Amor/romance:"; $a->strings["Work/employment:"] = "Trabajo/empleo:"; -$a->strings["School/education:"] = "Escuela/educación:"; +$a->strings["School/education:"] = "Estudios:"; $a->strings["Like this thing"] = "Me gusta esto"; $a->strings["Male"] = "Hombre"; $a->strings["Female"] = "Mujer"; @@ -1024,12 +1024,12 @@ $a->strings["Invalid request."] = "Solicitud incorrecta."; $a->strings["thing"] = "elemento"; $a->strings["Channel unavailable."] = "Canal no disponible."; $a->strings["Previous action reversed."] = "Acción anterior revocada."; -$a->strings["%1\$s agrees with %2\$s's %3\$s"] = "%1\$s está de acuerdo con %2\$s de %3\$s"; -$a->strings["%1\$s doesn't agree with %2\$s's %3\$s"] = "%1\$s no están de acuerdo con %2\$s de %3\$s"; -$a->strings["%1\$s abstains from a decision on %2\$s's %3\$s"] = "%1\$s se abstiene de pronunciarse sobre %2\$s de %3\$s"; -$a->strings["%1\$s is attending %2\$s's %3\$s"] = "%1\$s asistirá a %2\$s de %3\$s"; -$a->strings["%1\$s is not attending %2\$s's %3\$s"] = "%1\$s no asistirá a %2\$s de %3\$s"; -$a->strings["%1\$s may attend %2\$s's %3\$s"] = "%1\$s podrá asistir a %2\$s de %3\$s"; +$a->strings["%1\$s agrees with %2\$s's %3\$s"] = "%1\$s está de acuerdo con %3\$s de %2\$s"; +$a->strings["%1\$s doesn't agree with %2\$s's %3\$s"] = "%1\$s no está de acuerdo con %3\$s de %2\$s"; +$a->strings["%1\$s abstains from a decision on %2\$s's %3\$s"] = "%1\$s se abstiene en %3\$s de %2\$s"; +$a->strings["%1\$s is attending %2\$s's %3\$s"] = "%1\$s participará en el %3\$s de %2\$s"; +$a->strings["%1\$s is not attending %2\$s's %3\$s"] = "%1\$s no participará en el %3\$s de %2\$s"; +$a->strings["%1\$s may attend %2\$s's %3\$s"] = "%1\$s tal vez participe en el %3\$s de %2\$s"; $a->strings["Action completed."] = "Acción completada."; $a->strings["Thank you."] = "Gracias."; $a->strings["Calendar entries imported."] = "Entradas de calendario importadas."; @@ -1090,8 +1090,8 @@ $a->strings["No installed plugins/addons/apps"] = "Extensiones/Aplicaciones no i $a->strings["\$Projectname"] = "\$Projectname"; $a->strings["This is a hub of \$Projectname - a global cooperative network of decentralized privacy enhanced websites."] = "Este es un sitio integrado en \$Projectname - una red cooperativa mundial de sitios web descentralizados de privacidad mejorada."; $a->strings["Tag: "] = "Etiqueta:"; -$a->strings["Last background fetch: "] = "Último fondo elegido:"; -$a->strings["Running at web location"] = "Corriendo en un sitio web"; +$a->strings["Last background fetch: "] = "Última actualización en segundo plano:"; +$a->strings["Running at web location"] = "Corriendo en el sitio web"; $a->strings["Please visit redmatrix.me to learn more about \$Projectname."] = "Por favor, visite redmatrix.me para aprender más sobre \$Projectname."; $a->strings["Bug reports and issues: please visit"] = "Informes de errores e incidencias: por, favor visite"; $a->strings["\$projectname issues"] = "Problemas en \$projectname"; @@ -1142,7 +1142,7 @@ $a->strings["Block Name"] = "Nombre del bloque"; $a->strings["Block Title"] = "Título del bloque"; $a->strings["Item not found"] = "Elemento no encontrado"; $a->strings["Item is not editable"] = "El elemento no es editable"; -$a->strings["Delete item?"] = "¿Borrar este elemento?"; +$a->strings["Delete item?"] = "¿Borrar el elemento?"; $a->strings["Insert YouTube video"] = "Insertar vídeo de YouTube"; $a->strings["Insert Vorbis [.ogg] video"] = "Insertar vídeo Vorbis [.ogg]"; $a->strings["Insert Vorbis [.ogg] audio"] = "Insertar audio Vorbis [.ogg]"; @@ -1443,7 +1443,7 @@ $a->strings["Television"] = "Televisión"; $a->strings["Film/dance/culture/entertainment"] = "Cine/danza/cultura/entretenimiento"; $a->strings["Love/romance"] = "Vida sentimental/amorosa"; $a->strings["Work/employment"] = "Trabajo"; -$a->strings["School/education"] = "Educación"; +$a->strings["School/education"] = "Estudios"; $a->strings["This is your default profile."] = "Este es su perfil principal."; $a->strings["Age: "] = "Edad:"; $a->strings["Edit/Manage Profiles"] = "Modificar/gestionar perfiles"; @@ -1540,7 +1540,7 @@ $a->strings["Errors encountered creating database tables."] = "Se han encontrado $a->strings["

What next

"] = "

Siguiente paso

"; $a->strings["IMPORTANT: You will need to [manually] setup a scheduled task for the poller."] = "IMPORTANTE: Debe crear [manualmente] una tarea programada para las actualizaciones."; $a->strings["OpenID protocol error. No ID returned."] = "Error del protocolo OpenID. Ningún ID recibido como respuesta."; -$a->strings["Welcome %s. Remote authentication successful."] = "Bienvenido %s. La identificación remota se ha llevado a cabo correctamente."; +$a->strings["Welcome %s. Remote authentication successful."] = "Bienvenido %s. La identificación desde su servidor se ha llevado a cabo correctamente."; $a->strings["%1\$s tagged %2\$s's %3\$s with %4\$s"] = "%1\$s ha etiquetado el %3\$s de %2\$s con %4\$s"; $a->strings["Export Channel"] = "Exportar el canal"; $a->strings["Export your basic channel information to a small file. This acts as a backup of your connections, permissions, profile and basic data, which can be used to import your data to a new hub, but\tdoes not contain your content."] = "Exportar la base de datos de su canal a un pequeño fichero. Este podrá servir como una copia de seguridad de sus conexiones, permisos, perfil y datos básicos, que podrá importar a un nuevo canal, pero sin sus contenidos."; @@ -1881,7 +1881,7 @@ $a->strings["Useful to reduce spamming"] = "Útil para reducir el envío de corr $a->strings["Notification Settings"] = "Configuración de notificaciones"; $a->strings["By default post a status message when:"] = "Por defecto, enviar un mensaje de estado cuando:"; $a->strings["accepting a friend request"] = "acepte una solicitud de amistad"; -$a->strings["joining a forum/community"] = "se una a un foro o comunidad"; +$a->strings["joining a forum/community"] = "unirse a un foro o comunidad"; $a->strings["making an interesting profile change"] = "realice un cambio interesante en su perfil"; $a->strings["Send a notification email when:"] = "Enviar una notificación por correo electrónico cuando:"; $a->strings["You receive a connection request"] = "Reciba una solicitud de conexión"; @@ -2000,7 +2000,7 @@ $a->strings["Last update:"] = "Última actualización:"; $a->strings["We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID."] = "Encontramos un problema durante el inicio de sesión con la OpenID que proporcionaste. por favor, comprueba la escritura correcta de la ID."; $a->strings["The error message was:"] = "El mensaje de error fue:"; $a->strings["Authentication failed."] = "Falló la autenticación."; -$a->strings["Remote Authentication"] = "Autenticación Remota"; +$a->strings["Remote Authentication"] = "Acceso desde su servidor"; $a->strings["Enter your channel address (e.g. channel@example.com)"] = "Introduzca la dirección del canal (p.e. channel@example.com)"; $a->strings["Authenticate"] = "Identifíquese"; $a->strings["Unable to lookup recipient."] = "No ha sido posible de "; @@ -2023,7 +2023,7 @@ $a->strings["Send Reply"] = "Envía Respuesta"; $a->strings["Invalid request identifier."] = "Petición inválida del identificador."; $a->strings["Discard"] = "Descarta"; $a->strings["Please login."] = "Por favor, inicia sesión."; -$a->strings["Remote authentication blocked. You are logged into this site locally. Please logout and retry."] = "La autenticación remota está bloqueada. Ha iniciado sesión localmente. Por favor, salga de la sesión y vuelva a intentarlo."; +$a->strings["Remote authentication blocked. You are logged into this site locally. Please logout and retry."] = "La autenticación desde su servidor está bloqueada. Ha iniciado sesión localmente. Por favor, salga de la sesión y vuelva a intentarlo."; $a->strings["Add a Channel"] = "Añade un Canal"; $a->strings["A channel is your own collection of related web pages. A channel can be used to hold social network profiles, blogs, conversation groups and forums, celebrity pages, and much more. You may create as many channels as your service provider allows."] = "Un canal es su propia colección de páginas web relacionadas. Un canal se puede utilizar para almacenar los perfiles sociales de la red, blogs, grupos de conversación y foros, páginas de famosos y mucho más. Puede crear tantos canales como su proveedor de servicio permita."; $a->strings["Examples: \"Bob Jameson\", \"Lisa and her Horses\", \"Soccer\", \"Aviation Group\" "] = "Ejemplos: \"Bob Jameson\", \"Lisa and her Horses\", \"Soccer\", \"Aviation Group\" "; @@ -2047,7 +2047,7 @@ $a->strings["Price of app"] = "Precio de la aplicación"; $a->strings["Location (URL) to purchase app"] = "Ubicación (URL) para conseguir la aplicación"; $a->strings["sent you a private message"] = "envia un mensaje privado"; $a->strings["added your channel"] = "se añadió su canal"; -$a->strings["posted an event"] = "Se publicó un evento"; +$a->strings["posted an event"] = "publicó un evento"; $a->strings["Comanche page description language help"] = "Página de ayuda de la descripción del lenguaje Comanche"; $a->strings["Layout Description"] = "Descripción del Formato Gráfico"; $a->strings["Download PDL file"] = "Descarga el fichero PDL"; @@ -2105,7 +2105,7 @@ $a->strings["Left offset of the aside"] = "Desplazamiento izquierdo del lateral" $a->strings["Right offset of the aside element"] = "Desplazamiento derecho del elemento lateral"; $a->strings["Light (Red Matrix default)"] = "Ligero (Red Matrix predeterminado)"; $a->strings["Select scheme"] = "Elija un esquema"; -$a->strings["Narrow navbar"] = "Limita la barra de navegación"; +$a->strings["Narrow navbar"] = "Estrechar la barra de navegación"; $a->strings["Navigation bar background color"] = "Color de fondo de la barra de navegación"; $a->strings["Navigation bar gradient top color"] = "Color superior del gradiente de la barra de navegación"; $a->strings["Navigation bar gradient bottom color"] = "Color inferior del gradiente de la barra de navegación"; -- cgit v1.2.3 From 6590ca02de462acd141e1f890aff36877adafa80 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 20 Aug 2015 16:49:13 -0700 Subject: some event related fixes and some base work for implementing native tasks (to-do lists); which should already be importable and exportable. --- mod/events.php | 16 ++++----- mod/tasks.php | 93 +++++++++++++++++++++++++++++++++++++++++++++++++ view/tpl/event_form.tpl | 9 +---- 3 files changed, 100 insertions(+), 18 deletions(-) create mode 100644 mod/tasks.php diff --git a/mod/events.php b/mod/events.php index 630b8191f..56c4ece54 100755 --- a/mod/events.php +++ b/mod/events.php @@ -89,14 +89,14 @@ function events_post(&$a) { $summary = escape_tags(trim($_POST['summary'])); $desc = escape_tags(trim($_POST['desc'])); $location = escape_tags(trim($_POST['location'])); - $type = 'event'; + $type = escape_tags(trim($_POST['type'])); require_once('include/text.php'); linkify_tags($a, $desc, local_channel()); linkify_tags($a, $location, local_channel()); $action = ($event_hash == '') ? 'new' : "event/" . $event_hash; - $onerror_url = $a->get_baseurl() . "/events/" . $action . "?summary=$summary&description=$desc&location=$location&start=$start_text&finish=$finish_text&adjust=$adjust&nofinish=$nofinish"; + $onerror_url = $a->get_baseurl() . "/events/" . $action . "?summary=$summary&description=$desc&location=$location&start=$start_text&finish=$finish_text&adjust=$adjust&nofinish=$nofinish&type=$type"; if(strcmp($finish,$start) < 0 && !$nofinish) { notice( t('Event can not end before it has started.') . EOL); if(intval($_REQUEST['preview'])) { @@ -400,7 +400,7 @@ function events_content(&$a) { $r = q("SELECT event.*, item.plink, item.item_flags, item.author_xchan, item.owner_xchan from event left join item on event_hash = resource_id - where resource_type = 'event' and event.uid = %d $ignored + where resource_type in ( 'event', 'birthday' ) and event.uid = %d $ignored AND (( `adjust` = 0 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' ) OR ( `adjust` = 1 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' )) ", intval(local_channel()), @@ -409,7 +409,6 @@ function events_content(&$a) { dbesc($adjust_start), dbesc($adjust_finish) ); - } $links = array(); @@ -572,9 +571,7 @@ function events_content(&$a) { if(x($_REQUEST,'location')) $orig_event['location'] = $_REQUEST['location']; if(x($_REQUEST,'start')) $orig_event['start'] = $_REQUEST['start']; if(x($_REQUEST,'finish')) $orig_event['finish'] = $_REQUEST['finish']; - } - - if($mode === 'edit' || $mode === 'new') { + if(x($_REQUEST,'type')) $orig_event['type'] = $_REQUEST['type']; $n_checked = ((x($orig_event) && $orig_event['nofinish']) ? ' checked="checked" ' : ''); $a_checked = ((x($orig_event) && $orig_event['adjust']) ? ' checked="checked" ' : ''); @@ -593,9 +590,6 @@ function events_content(&$a) { if($orig_event['event_xchan']) $sh_checked .= ' disabled="disabled" '; - - - $sdt = ((x($orig_event)) ? $orig_event['start'] : 'now'); $fdt = ((x($orig_event)) ? $orig_event['finish'] : 'now'); @@ -621,6 +615,7 @@ function events_content(&$a) { $fminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'i') : 0); $ftext = datetime_convert('UTC',$tz,$fdt); $ftext = substr($ftext,0,14) . "00:00"; + $type = ((x($orig_event)) ? $orig_event['type'] : 'event'); $f = get_config('system','event_input_format'); if(! $f) @@ -660,6 +655,7 @@ function events_content(&$a) { $o .= replace_macros($tpl,array( '$post' => $a->get_baseurl() . '/events', '$eid' => $eid, + '$type' => $type, '$xchan' => $event_xchan, '$mid' => $mid, '$event_hash' => $event_id, diff --git a/mod/tasks.php b/mod/tasks.php new file mode 100644 index 000000000..8220b9962 --- /dev/null +++ b/mod/tasks.php @@ -0,0 +1,93 @@ +get_channel(); + + if((argc() > 2) && (argv(1) === 'complete') && intval(argv(2))) { + $ret = array('success' => false); + $r = q("select * from event where `type` = 'task' and uid = %d and id = %d limit 1", + intval(local_channel()), + intval(argv(2)) + ); + if($r) { + $event = $r[0]; + if($event['event_status'] === 'COMPLETED') { + $event['event_status'] = 'IN-PROCESS'; + $event['event_status_date'] = NULL_DATE; + $event['event_percent'] = 0; + $event['event_sequence'] = $event['event_sequence'] + 1; + $event['edited'] = datetime_convert(); + } + else { + $event['event_status'] = 'COMPLETED'; + $event['event_status_date'] = datetime_convert(); + $event['event_percent'] = 100; + $event['event_sequence'] = $event['event_sequence'] + 1; + $event['edited'] = datetime_convert(); + } + $x = event_store_event($event); + if($x) + $ret['success'] = true; + } + json_return_and_die($ret); + } + + if(argc() == 2 && argv(1) === 'new') { + $text = escape_tags(trim($_REQUEST['summary'])); + if(! $text) + return array('success' => false); + $event = array(); + $event['aid'] = $channel['channel_account_id']; + $event['uid'] = $channel['channel_id']; + $event['event_xchan'] = $channel['channel_hash']; + $event['type'] = 'task'; + $event['nofinish'] = true; + $event['created'] = $event['edited'] = $event['start'] = datetime_convert(); + $event['adjust'] = 1; + $event['allow_cid'] = '<' . $channel['channel_hash'] . '>'; + $event['summary'] = escape_tags($_REQUEST['summary']); + $x = event_store_event($event); + if($x) + $x['success'] = true; + else + $x = array('success' => false); + json_return_and_die($x); + } + + +} + + + + + +function tasks_content(&$a) { + + if(! local_channel()) + return; + + $ret = array(); + $sql_extra = " and event_status != 'COMPLETED' "; + if(argc() > 1 && argv(1) === 'all') + $sql_extra = ''; + + + $r = q("select * from event where type = 'task' and uid = %d $sql_extra ", + intval(local_channel()) + ); + + $ret['success'] = (($r) ? true : false); + if($r) { + $ret['tasks'] = $r; + } + + json_return_and_die($r); + + + +} \ No newline at end of file diff --git a/view/tpl/event_form.tpl b/view/tpl/event_form.tpl index d2562f080..15505397b 100755 --- a/view/tpl/event_form.tpl +++ b/view/tpl/event_form.tpl @@ -12,6 +12,7 @@ +
{{$t_text}}
@@ -92,14 +93,6 @@ - -
-- cgit v1.2.3 From 05bec13bdc59713c89f0545d3a2955d886969dba Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 20 Aug 2015 16:55:03 -0700 Subject: We don't need photos to also include attachments. It's interesting, but not all that useful. --- mod/wall_attach.php | 1 + 1 file changed, 1 insertion(+) diff --git a/mod/wall_attach.php b/mod/wall_attach.php index f08f931c2..8677c2b83 100644 --- a/mod/wall_attach.php +++ b/mod/wall_attach.php @@ -52,6 +52,7 @@ function wall_attach_post(&$a) { echo "\n\n" . $r['body'] . "\n\n"; if($using_api) return; + killme(); } echo "\n\n" . '[attachment]' . $r['data']['hash'] . ',' . $r['data']['revision'] . '[/attachment]' . "\n"; killme(); -- cgit v1.2.3 From afbbc9cd72e48a9eb4fb035eb01cd6e742d0088e Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 20 Aug 2015 18:43:01 -0700 Subject: more work on tasks --- boot.php | 1 + include/event.php | 24 ++++++++++++++++++++++++ include/widgets.php | 21 +++++++++++++++++++++ mod/events.php | 22 +++++++++++++++++----- mod/tasks.php | 12 ++++++++---- 5 files changed, 71 insertions(+), 9 deletions(-) diff --git a/boot.php b/boot.php index d8b4fa686..29f62a346 100755 --- a/boot.php +++ b/boot.php @@ -2002,6 +2002,7 @@ function load_pdl(&$a) { $a->pdl = $s; } } + } diff --git a/include/event.php b/include/event.php index 95808452d..fad852dfc 100644 --- a/include/event.php +++ b/include/event.php @@ -918,3 +918,27 @@ function todo_stat() { 'CANCELLED' => t('Cancelled') ); } + + +function tasks_fetch($arr) { + + if(! local_channel()) + return; + + $ret = array(); + $sql_extra = " and event_status != 'COMPLETED' "; + if(argc() > 1 && argv(1) === 'all') + $sql_extra = ''; + + $r = q("select * from event where type = 'task' and uid = %d $sql_extra ", + intval(local_channel()) + ); + + $ret['success'] = (($r) ? true : false); + if($r) { + $ret['tasks'] = $r; + } + + return $ret; + +} \ No newline at end of file diff --git a/include/widgets.php b/include/widgets.php index e735f5b2f..7433a1ec8 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -1042,3 +1042,24 @@ function widget_forums($arr) { } + +function widget_tasklist($arr) { + + + require_once('include/event.php'); + $o .= ''; + $o .= ''; + $o .= '
' . '

' . t('Tasks') . '

'; + $x = tasks_fetch(array()); + + if($x['success']) { + foreach($x['tasks'] as $y) { + $o .= '
' . $y['summary'] . '
'; + } + } + $o .= '
'; + $o .= '
'; + return $o; + +} + diff --git a/mod/events.php b/mod/events.php index 56c4ece54..15fed9df2 100755 --- a/mod/events.php +++ b/mod/events.php @@ -391,8 +391,18 @@ function events_content(&$a) { intval(local_channel()), intval($_GET['id']) ); - } else { - + } elseif($export) { + $r = q("SELECT * from event where uid = %d + AND (( `adjust` = 0 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' ) + OR ( `adjust` = 1 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' )) ", + intval(local_channel()), + dbesc($start), + dbesc($finish), + dbesc($adjust_start), + dbesc($adjust_finish) + ); + } + else { // fixed an issue with "nofinish" events not showing up in the calendar. // There's still an issue if the finish date crosses the end of month. // Noting this for now - it will need to be fixed here and in Friendica. @@ -400,7 +410,7 @@ function events_content(&$a) { $r = q("SELECT event.*, item.plink, item.item_flags, item.author_xchan, item.owner_xchan from event left join item on event_hash = resource_id - where resource_type in ( 'event', 'birthday' ) and event.uid = %d $ignored + where resource_type = 'event' and event.uid = %d $ignored AND (( `adjust` = 0 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' ) OR ( `adjust` = 1 AND ( `finish` >= '%s' or nofinish = 1 ) AND `start` <= '%s' )) ", intval(local_channel()), @@ -411,14 +421,17 @@ function events_content(&$a) { ); } + $links = array(); - if($r) { + if($r && ! $export) { xchan_query($r); $r = fetch_post_tags($r,true); $r = sort_by_date($r); + } + if($r) { foreach($r as $rr) { $j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j')); if(! x($links,$j)) @@ -426,7 +439,6 @@ function events_content(&$a) { } } - $events=array(); $last_date = ''; diff --git a/mod/tasks.php b/mod/tasks.php index 8220b9962..869d9b3cd 100644 --- a/mod/tasks.php +++ b/mod/tasks.php @@ -75,18 +75,22 @@ function tasks_content(&$a) { $sql_extra = " and event_status != 'COMPLETED' "; if(argc() > 1 && argv(1) === 'all') $sql_extra = ''; - - +dbg(1); $r = q("select * from event where type = 'task' and uid = %d $sql_extra ", intval(local_channel()) ); +dbg(0); $ret['success'] = (($r) ? true : false); if($r) { $ret['tasks'] = $r; } - - json_return_and_die($r); + +// return $ret; + + return json_encode($ret); + +// json_return_and_die($ret); -- cgit v1.2.3 From 49c4aa1a546264fa39754ae8a7c08243a6896b04 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 20 Aug 2015 20:40:42 -0700 Subject: cleanup of task widget - make jquery workflow a bit smoother --- include/event.php | 4 ++-- include/widgets.php | 20 ++++++++++---------- mod/tasks.php | 54 +++++++++++++++++++++++++++++++---------------------- 3 files changed, 44 insertions(+), 34 deletions(-) diff --git a/include/event.php b/include/event.php index fad852dfc..95a165fdc 100644 --- a/include/event.php +++ b/include/event.php @@ -927,10 +927,10 @@ function tasks_fetch($arr) { $ret = array(); $sql_extra = " and event_status != 'COMPLETED' "; - if(argc() > 1 && argv(1) === 'all') + if($arr && $arr['all'] == 1) $sql_extra = ''; - $r = q("select * from event where type = 'task' and uid = %d $sql_extra ", + $r = q("select * from event where type = 'task' and uid = %d $sql_extra order by created desc", intval(local_channel()) ); diff --git a/include/widgets.php b/include/widgets.php index 7433a1ec8..5e70730a3 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -1047,17 +1047,17 @@ function widget_tasklist($arr) { require_once('include/event.php'); - $o .= ''; - $o .= ''; - $o .= '
' . '

' . t('Tasks') . '

'; - $x = tasks_fetch(array()); - - if($x['success']) { - foreach($x['tasks'] as $y) { - $o .= '
' . $y['summary'] . '
'; + $o .= ''; + $o .= ''; + + $o .= '
' . '

' . t('Tasks') . '

'; + $o .= '
'; $o .= '
'; return $o; diff --git a/mod/tasks.php b/mod/tasks.php index 869d9b3cd..ed267cc92 100644 --- a/mod/tasks.php +++ b/mod/tasks.php @@ -1,8 +1,39 @@ 1 && argv(1) === 'fetch') { + if(argc() > 2 && argv(2) === 'all') + $arr['all'] = 1; + + $x = tasks_fetch($arr); + if($x['tasks']) { + $x['html'] = ''; + foreach($x['tasks'] as $y) { + $x['html'] .= '
' . $y['summary'] . '
'; + } + } + json_return_and_die($x); + } + +} + + function tasks_post(&$a) { + +// logger('post: ' . print_r($_POST,true)); + + if(! local_channel()) return; @@ -71,27 +102,6 @@ function tasks_content(&$a) { if(! local_channel()) return; - $ret = array(); - $sql_extra = " and event_status != 'COMPLETED' "; - if(argc() > 1 && argv(1) === 'all') - $sql_extra = ''; -dbg(1); - $r = q("select * from event where type = 'task' and uid = %d $sql_extra ", - intval(local_channel()) - ); -dbg(0); - - $ret['success'] = (($r) ? true : false); - if($r) { - $ret['tasks'] = $r; - } - -// return $ret; - - return json_encode($ret); - -// json_return_and_die($ret); - - + return ''; } \ No newline at end of file -- cgit v1.2.3 From 3e7a76cc6418b8ef589ec9de725821743a156484 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 20 Aug 2015 21:02:42 -0700 Subject: put tasklist into events page comanche layout --- view/pdl/mod_events.pdl | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 view/pdl/mod_events.pdl diff --git a/view/pdl/mod_events.pdl b/view/pdl/mod_events.pdl new file mode 100644 index 000000000..5a9763297 --- /dev/null +++ b/view/pdl/mod_events.pdl @@ -0,0 +1,3 @@ +[region=aside] +[widget=tasklist][/widget] +[/region] -- cgit v1.2.3 From fef93af0a6908fdcb8d829229de8717acfc7ed81 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 20 Aug 2015 22:13:25 -0700 Subject: missed this one - it's required --- boot.php | 2 +- install/schema_mysql.sql | 4 +++- install/schema_postgres.sql | 2 ++ install/update.php | 10 +++++++++- version.inc | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/boot.php b/boot.php index 0ae12e4a7..53e1dc8a7 100755 --- a/boot.php +++ b/boot.php @@ -49,7 +49,7 @@ define ( 'PLATFORM_NAME', 'redmatrix' ); define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R'); define ( 'ZOT_REVISION', 1 ); -define ( 'DB_UPDATE_VERSION', 1147 ); +define ( 'DB_UPDATE_VERSION', 1148 ); /** * @brief Constant with a HTML line break. diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 3e0e88535..e3b9413f5 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -437,6 +437,7 @@ CREATE TABLE IF NOT EXISTS `event` ( `event_percent` smallint(6) NOT NULL DEFAULT '0', `event_repeat` text NOT NULL, `event_sequence` smallint(6) NOT NULL DEFAULT '0', + `event_priority` smallint(6) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `uid` (`uid`), KEY `type` (`type`), @@ -449,7 +450,8 @@ CREATE TABLE IF NOT EXISTS `event` ( KEY `event_hash` (`event_hash`), KEY `event_xchan` (`event_xchan`), KEY `event_status` (`event_status`), - KEY `event_sequence` (`event_sequence`) + KEY `event_sequence` (`event_sequence`), + KEY `event_priority` (`event_priority`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- -------------------------------------------------------- diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 9f92607e0..9bda284ac 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -337,6 +337,7 @@ CREATE TABLE "event" ( "event_percent" smallint(6) NOT NULL DEFAULT '0', "event_repeat" text NOT NULL, "event_sequence" smallint NOT NULL DEFAULT '0', + "event_priority" smallint NOT NULL DEFAULT '0', PRIMARY KEY ("id") ); create index "event_uid_idx" on event ("uid"); @@ -351,6 +352,7 @@ create index "event_hash_idx" on event ("event_hash"); create index "event_xchan_idx" on event ("event_xchan"); create index "event_status_idx" on event ("event_status"); create index "event_sequence_idx" on event ("event_sequence"); +create index "event_priority_idx" on event ("event_priority"); CREATE TABLE "fcontact" ( diff --git a/install/update.php b/install/update.php index fa15cac6b..e5542b9cf 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ Date: Thu, 20 Aug 2015 22:15:09 -0700 Subject: limit the height of tasklist --- view/css/widgets.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/view/css/widgets.css b/view/css/widgets.css index 5b6e8aeb9..abfeebf1e 100644 --- a/view/css/widgets.css +++ b/view/css/widgets.css @@ -110,3 +110,11 @@ li:hover .group-edit-icon { .directory-rating-submit { margin-top: 15px; } + + +/* tasklist */ + +.tasklist-tasks { + max-height: 300px; + overflow-y: auto; +} \ No newline at end of file -- cgit v1.2.3 From 7688bf3f219960ca3f9ff796fc1db3f0da8f2726 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 20 Aug 2015 22:24:33 -0700 Subject: support ical priority --- include/event.php | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/include/event.php b/include/event.php index 95a165fdc..c468420c0 100644 --- a/include/event.php +++ b/include/event.php @@ -100,9 +100,11 @@ function format_event_ical($ev) { $o .= "\r\nLOCATION:" . format_ical_text($ev['location']); if($ev['description']) $o .= "\r\nDESCRIPTION:" . format_ical_text($ev['description']); + if($ev['event_priority']) + $o .= "\r\nPRIORITY:" . intval($ev['event_priority']); $o .= "\r\nUID:" . $ev['event_hash'] ; $o .= "\r\nEND:VEVENT\r\n"; - + return $o; } @@ -135,6 +137,8 @@ function format_todo_ical($ev) { if($ev['description']) $o .= "\r\nDESCRIPTION:" . format_ical_text($ev['description']); $o .= "\r\nUID:" . $ev['event_hash'] ; + if($ev['event_priority']) + $o .= "\r\nPRIORITY:" . intval($ev['event_priority']); $o .= "\r\nEND:VTODO\r\n"; return $o; @@ -260,10 +264,11 @@ function ev_compare($a, $b) { function event_store_event($arr) { - $arr['created'] = (($arr['created']) ? $arr['created'] : datetime_convert()); - $arr['edited'] = (($arr['edited']) ? $arr['edited'] : datetime_convert()); - $arr['type'] = (($arr['type']) ? $arr['type'] : 'event' ); - $arr['event_xchan'] = (($arr['event_xchan']) ? $arr['event_xchan'] : ''); + $arr['created'] = (($arr['created']) ? $arr['created'] : datetime_convert()); + $arr['edited'] = (($arr['edited']) ? $arr['edited'] : datetime_convert()); + $arr['type'] = (($arr['type']) ? $arr['type'] : 'event' ); + $arr['event_xchan'] = (($arr['event_xchan']) ? $arr['event_xchan'] : ''); + $arr['event_priority'] = (($arr['event_priority']) ? $arr['event_priority'] : 0); if(array_key_exists('event_status_date',$arr)) @@ -317,6 +322,7 @@ function event_store_event($arr) { `event_percent` = %d, `event_repeat` = '%s', `event_sequence` = %d, + `event_priority` = %d, `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', @@ -337,6 +343,7 @@ function event_store_event($arr) { intval($arr['event_percent']), dbesc($arr['event_repeat']), intval($arr['event_sequence']), + intval($arr['event_priority']), dbesc($arr['allow_cid']), dbesc($arr['allow_gid']), dbesc($arr['deny_cid']), @@ -355,8 +362,8 @@ function event_store_event($arr) { $hash = random_string() . '@' . get_app()->get_hostname(); $r = q("INSERT INTO event ( uid,aid,event_xchan,event_hash,created,edited,start,finish,summary,description,location,type, - adjust,nofinish, event_status, event_status_date, event_percent, event_repeat, event_sequence, allow_cid,allow_gid,deny_cid,deny_gid) - VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', %d, '%s', %d, '%s', '%s', '%s', '%s' ) ", + adjust,nofinish, event_status, event_status_date, event_percent, event_repeat, event_sequence, event_priority, allow_cid,allow_gid,deny_cid,deny_gid) + VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', %d, '%s', %d, %d, '%s', '%s', '%s', '%s' ) ", intval($arr['uid']), intval($arr['account']), dbesc($arr['event_xchan']), @@ -376,6 +383,7 @@ function event_store_event($arr) { intval($arr['event_percent']), dbesc($arr['event_repeat']), intval($arr['event_sequence']), + intval($arr['event_priority']), dbesc($arr['allow_cid']), dbesc($arr['allow_gid']), dbesc($arr['deny_cid']), @@ -543,6 +551,8 @@ function event_import_ical($ical, $uid) { $ev['description'] = (string) $ical->DESCRIPTION; if(isset($ical->SUMMARY)) $ev['summary'] = (string) $ical->SUMMARY; + if(isset($ical->PRIORITY)) + $ev['event_priority'] = intval((string) $ical->PRIORITY); if(isset($ical->UID)) { $evuid = (string) $ical->UID; @@ -641,6 +651,8 @@ function event_import_ical_task($ical, $uid) { $ev['description'] = (string) $ical->DESCRIPTION; if(isset($ical->SUMMARY)) $ev['summary'] = (string) $ical->SUMMARY; + if(isset($ical->PRIORITY)) + $ev['event_priority'] = intval((string) $ical->PRIORITY); $stored_event = null; -- cgit v1.2.3 From 7c34911b1c9166cc781a316e9c4b933c05623637 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 21 Aug 2015 02:30:17 -0700 Subject: add task widget --- doc/Widgets.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/Widgets.md b/doc/Widgets.md index d9df66eee..5cc7eab2f 100644 --- a/doc/Widgets.md +++ b/doc/Widgets.md @@ -99,6 +99,11 @@ Some/many of these widgets have restrictions which may restrict the type of page * channel_id - if not your own
 
+* tasklist - provide a task or to-do list for the currently logged-in channel. + * args: + * all - display completed tasks if all is non-zero. +
 
+ Creating New Widgets ==================== -- cgit v1.2.3 From 39df2a475e66e2068fc2a4e3c069874f6ee6e7c1 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 22 Aug 2015 14:28:33 -0700 Subject: add load_pdl hook for plugins --- boot.php | 5 +++++ doc/features.bb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/boot.php b/boot.php index 3577addc6..458d676d4 100755 --- a/boot.php +++ b/boot.php @@ -1990,6 +1990,11 @@ function load_pdl(&$a) { require_once('include/comanche.php'); if (! count($a->layout)) { + + $arr = array('module' => $a->module, 'layout' => ''); + call_hooks('load_pdl',$arr); + $s = $arr['layout']; + $n = 'mod_' . $a->module . '.pdl' ; $u = comanche_get_channel_id(); if($u) diff --git a/doc/features.bb b/doc/features.bb index e8d1cd687..0a9bcee38 100644 --- a/doc/features.bb +++ b/doc/features.bb @@ -56,7 +56,7 @@ Store photos in albums. All your photos may be protected by Access Control Lists [b]Events Calendar[/b] -Create and manage events, which may also be protected with Access Control Lists. Events can be exported to other software using the industry standard vcalendar/iCal format and shared in posts with others. Birthday events are automatically added from your friends and converted to your correct timezone so that you will know precisely when the birthday occurs - no matter where you are located in the world in relation to the birthday person. Events are normally created with attendance counters so your friends and connections can RSVP instantly. +Create and manage events and tasks, which may also be protected with Access Control Lists. Events can be imported/exported to other software using the industry standard vcalendar/iCal format and shared in posts with others. Birthday events are automatically added from your friends and converted to your correct timezone so that you will know precisely when the birthday occurs - no matter where you are located in the world in relation to the birthday person. Events are normally created with attendance counters so your friends and connections can RSVP instantly. [b]Chatrooms[/b] -- cgit v1.2.3 From c9b8f404e073007093b465defa0d15c9bbd3f37f Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 22 Aug 2015 14:35:17 -0700 Subject: restrict event notification to events and birthdays (exclude tasks) --- mod/ping.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mod/ping.php b/mod/ping.php index 719183388..394dbf089 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -321,6 +321,7 @@ function ping_init(&$a) { $r = q("SELECT * FROM event left join xchan on event_xchan = xchan_hash WHERE `event`.`uid` = %d AND start < '%s' AND start > '%s' and `ignore` = 0 + and type in ( 'event', 'birthday' ) ORDER BY `start` DESC LIMIT 1000", intval(local_channel()), dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now + ' . intval($evdays) . ' days')), @@ -439,6 +440,7 @@ function ping_init(&$a) { if($vnotify & (VNOTIFY_EVENT|VNOTIFY_EVENTTODAY|VNOTIFY_BIRTHDAY)) { $events = q("SELECT type, start, adjust FROM `event` WHERE `event`.`uid` = %d AND start < '%s' AND start > '%s' and `ignore` = 0 + and type in ( 'event', 'birthday' ) ORDER BY `start` ASC ", intval(local_channel()), dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now + ' . intval($evdays) . ' days')), -- cgit v1.2.3 From feabaedd835ecf06ca8e49d5c284d505e47111ad Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 22 Aug 2015 15:46:40 -0700 Subject: increase width of tasklist input element --- view/css/widgets.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/view/css/widgets.css b/view/css/widgets.css index abfeebf1e..c1b80dabb 100644 --- a/view/css/widgets.css +++ b/view/css/widgets.css @@ -117,4 +117,8 @@ li:hover .group-edit-icon { .tasklist-tasks { max-height: 300px; overflow-y: auto; -} \ No newline at end of file +} + +#tasklist-new-summary { + width: 250px; +} -- cgit v1.2.3 From 2a59392ba8be974a5deec2e6f15959fde21186ea Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 22 Aug 2015 19:31:39 -0700 Subject: change name of module --- mod/oexchange.php | 2 +- mod/parse_url.php | 381 ----------------------------------------------- mod/rpost.php | 2 +- mod/urlinfo.php | 383 ++++++++++++++++++++++++++++++++++++++++++++++++ view/js/main.js | 2 +- view/tpl/jot-header.tpl | 4 +- view/tpl/msg-header.tpl | 4 +- 7 files changed, 390 insertions(+), 388 deletions(-) delete mode 100644 mod/parse_url.php create mode 100644 mod/urlinfo.php diff --git a/mod/oexchange.php b/mod/oexchange.php index a684bd5d8..867cea6f2 100644 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@ -47,7 +47,7 @@ function oexchange_content(&$a) { $tags = (((x($_REQUEST,'tags')) && strlen($_REQUEST['tags'])) ? '&tags=' . urlencode(notags(trim($_REQUEST['tags']))) : ''); - $ret = z_fetch_url($a->get_baseurl() . '/parse_url?f=&url=' . $url . $title . $description . $tags); + $ret = z_fetch_url($a->get_baseurl() . '/urlinfo?f=&url=' . $url . $title . $description . $tags); if($ret['success']) $s = $ret['body']; diff --git a/mod/parse_url.php b/mod/parse_url.php deleted file mode 100644 index 2a6f7663e..000000000 --- a/mod/parse_url.php +++ /dev/null @@ -1,381 +0,0 @@ - - - - - -

Shiny Trinket

- -

Shiny trinkets are shiny.

- -*/ - -if(!function_exists('deletenode')) { - function deletenode(&$doc, $node) - { - $xpath = new DomXPath($doc); - $list = $xpath->query("//".$node); - foreach ($list as $child) - $child->parentNode->removeChild($child); - } -} - -function completeurl($url, $scheme) { - $urlarr = parse_url($url); - - if (isset($urlarr["scheme"])) - return($url); - - $schemearr = parse_url($scheme); - - $complete = $schemearr["scheme"]."://".$schemearr["host"]; - - if ($schemearr["port"] != "") - $complete .= ":".$schemearr["port"]; - - if(strpos($urlarr['path'],'/') !== 0) - $complete .= '/'; - - $complete .= $urlarr["path"]; - - if ($urlarr["query"] != "") - $complete .= "?".$urlarr["query"]; - - if ($urlarr["fragment"] != "") - $complete .= "#".$urlarr["fragment"]; - - return($complete); -} - -function parseurl_getsiteinfo($url) { - $siteinfo = array(); - - - $result = z_fetch_url($url,false,0,array('novalidate' => true)); - if(! $result['success']) - return $siteinfo; - - $header = $result['header']; - $body = $result['body']; - - $body = mb_convert_encoding($body, 'UTF-8', 'UTF-8'); - $body = mb_convert_encoding($body, 'HTML-ENTITIES', "UTF-8"); - - $doc = new DOMDocument(); - @$doc->loadHTML($body); - - deletenode($doc, 'style'); - deletenode($doc, 'script'); - deletenode($doc, 'option'); - deletenode($doc, 'h1'); - deletenode($doc, 'h2'); - deletenode($doc, 'h3'); - deletenode($doc, 'h4'); - deletenode($doc, 'h5'); - deletenode($doc, 'h6'); - deletenode($doc, 'ol'); - deletenode($doc, 'ul'); - - $xpath = new DomXPath($doc); - - //$list = $xpath->query("head/title"); - $list = $xpath->query("//title"); - foreach ($list as $node) - $siteinfo["title"] = html_entity_decode($node->nodeValue, ENT_QUOTES, "UTF-8"); - - //$list = $xpath->query("head/meta[@name]"); - $list = $xpath->query("//meta[@name]"); - foreach ($list as $node) { - $attr = array(); - if ($node->attributes->length) - foreach ($node->attributes as $attribute) - $attr[$attribute->name] = $attribute->value; - - $attr["content"] = html_entity_decode($attr["content"], ENT_QUOTES, "UTF-8"); - - switch (strtolower($attr["name"])) { - case 'generator': - $siteinfo['generator'] = $attr['content']; - break; - case "fulltitle": - $siteinfo["title"] = $attr["content"]; - break; - case "description": - $siteinfo["text"] = $attr["content"]; - break; - case "dc.title": - $siteinfo["title"] = $attr["content"]; - break; - case "dc.description": - $siteinfo["text"] = $attr["content"]; - break; - } - } - - //$list = $xpath->query("head/meta[@property]"); - $list = $xpath->query("//meta[@property]"); - foreach ($list as $node) { - $attr = array(); - if ($node->attributes->length) - foreach ($node->attributes as $attribute) - $attr[$attribute->name] = $attribute->value; - - $attr["content"] = html_entity_decode($attr["content"], ENT_QUOTES, "UTF-8"); - - switch (strtolower($attr["property"])) { - case "og:image": - $siteinfo["image"] = $attr["content"]; - break; - case "og:title": - $siteinfo["title"] = $attr["content"]; - break; - case "og:description": - $siteinfo["text"] = $attr["content"]; - break; - } - } - - if ($siteinfo["image"] == "") { - $list = $xpath->query("//img[@src]"); - foreach ($list as $node) { - $attr = array(); - if ($node->attributes->length) - foreach ($node->attributes as $attribute) - $attr[$attribute->name] = $attribute->value; - - $src = completeurl($attr["src"], $url); - $photodata = @getimagesize($src); - - if (($photodata) && ($photodata[0] > 150) and ($photodata[1] > 150)) { - if ($photodata[0] > 300) { - $photodata[1] = round($photodata[1] * (300 / $photodata[0])); - $photodata[0] = 300; - } - if ($photodata[1] > 300) { - $photodata[0] = round($photodata[0] * (300 / $photodata[1])); - $photodata[1] = 300; - } - $siteinfo["images"][] = array("src"=>$src, - "width"=>$photodata[0], - "height"=>$photodata[1]); - } - - } - } else { - $src = completeurl($siteinfo["image"], $url); - - unset($siteinfo["image"]); - - $photodata = @getimagesize($src); - - if (($photodata) && ($photodata[0] > 10) and ($photodata[1] > 10)) - $siteinfo["images"][] = array("src"=>$src, - "width"=>$photodata[0], - "height"=>$photodata[1]); - } - - if ($siteinfo["text"] == "") { - $text = ""; - - $list = $xpath->query("//div[@class='article']"); - foreach ($list as $node) - if (strlen($node->nodeValue) > 40) - $text .= " ".trim($node->nodeValue); - - if ($text == "") { - $list = $xpath->query("//div[@class='content']"); - foreach ($list as $node) - if (strlen($node->nodeValue) > 40) - $text .= " ".trim($node->nodeValue); - } - - // If none text was found then take the paragraph content - if ($text == "") { - $list = $xpath->query("//p"); - foreach ($list as $node) - if (strlen($node->nodeValue) > 40) - $text .= " ".trim($node->nodeValue); - } - - if ($text != "") { - $text = trim(str_replace(array("\n", "\r"), array(" ", " "), $text)); - - while (strpos($text, " ")) - $text = trim(str_replace(" ", " ", $text)); - - $siteinfo["text"] = html_entity_decode(substr($text,0,350), ENT_QUOTES, "UTF-8").'...'; - } - } - - return($siteinfo); -} - -function arr_add_hashes(&$item,$k) { - $item = '#' . $item; -} - -function parse_url_content(&$a) { - - $text = null; - $str_tags = ''; - - - $br = "\n"; - - if(x($_GET,'binurl')) - $url = trim(hex2bin($_GET['binurl'])); - else - $url = trim($_GET['url']); - - if((substr($url,0,1) != '/') && (substr($url,0,4) != 'http')) - $url = 'http://' . $url; - - - if($_GET['title']) - $title = strip_tags(trim($_GET['title'])); - - if($_GET['description']) - $text = strip_tags(trim($_GET['description'])); - - if($_GET['tags']) { - $arr_tags = str_getcsv($_GET['tags']); - if(count($arr_tags)) { - array_walk($arr_tags,'arr_add_hashes'); - $str_tags = $br . implode(' ',$arr_tags) . $br; - } - } - - logger('parse_url: ' . $url); - - $result = z_fetch_url($url,false,0,array('novalidate' => true, 'nobody' => true)); - if($result['success']) { - $hdrs=array(); - $h = explode("\n",$result['header']); - foreach ($h as $l) { - list($k,$v) = array_map("trim", explode(":", trim($l), 2)); - $hdrs[$k] = $v; - } - if (array_key_exists('Content-Type', $hdrs)) - $type = $hdrs['Content-Type']; - if($type) { - $zrl = is_matrix_url($url); - if(stripos($type,'image/') !== false) { - if($zrl) - echo $br . '[zmg]' . $url . '[/zmg]' . $br; - else - echo $br . '[img]' . $url . '[/img]' . $br; - killme(); - } - if(stripos($type,'video/') !== false) { - if($zrl) - echo $br . '[zvideo]' . $url . '[/zvideo]' . $br; - else - echo $br . '[video]' . $url . '[/video]' . $br; - killme(); - } - if(stripos($type,'audio/') !== false) { - if($zrl) - echo $br . '[zaudio]' . $url . '[/zaudio]' . $br; - else - echo $br . '[audio]' . $url . '[/audio]' . $br; - killme(); - } - } - } - - $template = $br . '#^[url=%s]%s[/url]%s' . $br; - - $arr = array('url' => $url, 'text' => ''); - - call_hooks('parse_link', $arr); - - if(strlen($arr['text'])) { - echo $arr['text']; - killme(); - } - - $x = oembed_process($url); - if($x) { - echo $x; - killme(); - } - - if($url && $title && $text) { - - - $text = $br . '[quote]' . trim($text) . '[/quote]' . $br; - - $title = str_replace(array("\r","\n"),array('',''),$title); - - $result = sprintf($template,$url,($title) ? $title : $url,$text) . $str_tags; - - logger('parse_url (unparsed): returns: ' . $result); - - echo $result; - killme(); - } - - $siteinfo = parseurl_getsiteinfo($url); - - // If this is a Red site, use zrl rather than url so they get zids sent to them by default - - if( x($siteinfo,'generator') && (strpos($siteinfo['generator'],PLATFORM_NAME . ' ') === 0)) - $template = str_replace('url','zrl',$template); - - if($siteinfo["title"] == "") { - echo sprintf($template,$url,$url,'') . $str_tags; - killme(); - } else { - $text = $siteinfo["text"]; - $title = $siteinfo["title"]; - } - - $image = ""; - - if(sizeof($siteinfo["images"]) > 0){ - /* Execute below code only if image is present in siteinfo */ - - $total_images = 0; - $max_images = get_config('system','max_bookmark_images'); - if($max_images === false) - $max_images = 2; - else - $max_images = intval($max_images); - - foreach ($siteinfo["images"] as $imagedata) { - if ($url) { - $image .= sprintf('[url=%s]', $url); - } - $image .= '[img='.$imagedata["width"].'x'.$imagedata["height"].']'.$imagedata["src"].'[/img]'; - if ($url) { - $image .= '[/url]'; - } - $image .= "\n"; - $total_images ++; - if($max_images && $max_images >= $total_images) - break; - } - } - - if(strlen($text)) { - $text = $br.'[quote]'.trim($text).'[/quote]'.$br ; - } - - if($image) { - $text = $br.$br.$image.$text; - } - $title = str_replace(array("\r","\n"),array('',''),$title); - - $result = sprintf($template,$url,($title) ? $title : $url,$text) . $str_tags; - - logger('parse_url: returns: ' . $result, LOGGER_DEBUG); - - echo trim($result); - killme(); -} diff --git a/mod/rpost.php b/mod/rpost.php index 0c0916646..4a6b87cc6 100644 --- a/mod/rpost.php +++ b/mod/rpost.php @@ -102,7 +102,7 @@ function rpost_content(&$a) { ); if($_REQUEST['url']) { - $x = z_fetch_url(z_root() . '/parse_url?f=&url=' . urlencode($_REQUEST['url'])); + $x = z_fetch_url(z_root() . '/urlinfo?f=&url=' . urlencode($_REQUEST['url'])); if($x['success']) $_REQUEST['body'] = $_REQUEST['body'] . $x['body']; } diff --git a/mod/urlinfo.php b/mod/urlinfo.php new file mode 100644 index 000000000..6b9be3f6f --- /dev/null +++ b/mod/urlinfo.php @@ -0,0 +1,383 @@ + + + + + +

Shiny Trinket

+ +

Shiny trinkets are shiny.

+ +*/ + +if(!function_exists('deletenode')) { + function deletenode(&$doc, $node) + { + $xpath = new DomXPath($doc); + $list = $xpath->query("//".$node); + foreach ($list as $child) + $child->parentNode->removeChild($child); + } +} + +function completeurl($url, $scheme) { + $urlarr = parse_url($url); + + if (isset($urlarr["scheme"])) + return($url); + + $schemearr = parse_url($scheme); + + $complete = $schemearr["scheme"]."://".$schemearr["host"]; + + if ($schemearr["port"] != "") + $complete .= ":".$schemearr["port"]; + + if(strpos($urlarr['path'],'/') !== 0) + $complete .= '/'; + + $complete .= $urlarr["path"]; + + if ($urlarr["query"] != "") + $complete .= "?".$urlarr["query"]; + + if ($urlarr["fragment"] != "") + $complete .= "#".$urlarr["fragment"]; + + return($complete); +} + +function parseurl_getsiteinfo($url) { + $siteinfo = array(); + + + $result = z_fetch_url($url,false,0,array('novalidate' => true)); + if(! $result['success']) + return $siteinfo; + + $header = $result['header']; + $body = $result['body']; + + $body = mb_convert_encoding($body, 'UTF-8', 'UTF-8'); + $body = mb_convert_encoding($body, 'HTML-ENTITIES', "UTF-8"); + + $doc = new DOMDocument(); + @$doc->loadHTML($body); + + deletenode($doc, 'style'); + deletenode($doc, 'script'); + deletenode($doc, 'option'); + deletenode($doc, 'h1'); + deletenode($doc, 'h2'); + deletenode($doc, 'h3'); + deletenode($doc, 'h4'); + deletenode($doc, 'h5'); + deletenode($doc, 'h6'); + deletenode($doc, 'ol'); + deletenode($doc, 'ul'); + + $xpath = new DomXPath($doc); + + //$list = $xpath->query("head/title"); + $list = $xpath->query("//title"); + foreach ($list as $node) + $siteinfo["title"] = html_entity_decode($node->nodeValue, ENT_QUOTES, "UTF-8"); + + //$list = $xpath->query("head/meta[@name]"); + $list = $xpath->query("//meta[@name]"); + foreach ($list as $node) { + $attr = array(); + if ($node->attributes->length) + foreach ($node->attributes as $attribute) + $attr[$attribute->name] = $attribute->value; + + $attr["content"] = html_entity_decode($attr["content"], ENT_QUOTES, "UTF-8"); + + switch (strtolower($attr["name"])) { + case 'generator': + $siteinfo['generator'] = $attr['content']; + break; + case "fulltitle": + $siteinfo["title"] = $attr["content"]; + break; + case "description": + $siteinfo["text"] = $attr["content"]; + break; + case "dc.title": + $siteinfo["title"] = $attr["content"]; + break; + case "dc.description": + $siteinfo["text"] = $attr["content"]; + break; + } + } + + //$list = $xpath->query("head/meta[@property]"); + $list = $xpath->query("//meta[@property]"); + foreach ($list as $node) { + $attr = array(); + if ($node->attributes->length) + foreach ($node->attributes as $attribute) + $attr[$attribute->name] = $attribute->value; + + $attr["content"] = html_entity_decode($attr["content"], ENT_QUOTES, "UTF-8"); + + switch (strtolower($attr["property"])) { + case "og:image": + $siteinfo["image"] = $attr["content"]; + break; + case "og:title": + $siteinfo["title"] = $attr["content"]; + break; + case "og:description": + $siteinfo["text"] = $attr["content"]; + break; + } + } + + if ($siteinfo["image"] == "") { + $list = $xpath->query("//img[@src]"); + foreach ($list as $node) { + $attr = array(); + if ($node->attributes->length) + foreach ($node->attributes as $attribute) + $attr[$attribute->name] = $attribute->value; + + $src = completeurl($attr["src"], $url); + $photodata = @getimagesize($src); + + if (($photodata) && ($photodata[0] > 150) and ($photodata[1] > 150)) { + if ($photodata[0] > 300) { + $photodata[1] = round($photodata[1] * (300 / $photodata[0])); + $photodata[0] = 300; + } + if ($photodata[1] > 300) { + $photodata[0] = round($photodata[0] * (300 / $photodata[1])); + $photodata[1] = 300; + } + $siteinfo["images"][] = array("src"=>$src, + "width"=>$photodata[0], + "height"=>$photodata[1]); + } + + } + } else { + $src = completeurl($siteinfo["image"], $url); + + unset($siteinfo["image"]); + + $photodata = @getimagesize($src); + + if (($photodata) && ($photodata[0] > 10) and ($photodata[1] > 10)) + $siteinfo["images"][] = array("src"=>$src, + "width"=>$photodata[0], + "height"=>$photodata[1]); + } + + if ($siteinfo["text"] == "") { + $text = ""; + + $list = $xpath->query("//div[@class='article']"); + foreach ($list as $node) + if (strlen($node->nodeValue) > 40) + $text .= " ".trim($node->nodeValue); + + if ($text == "") { + $list = $xpath->query("//div[@class='content']"); + foreach ($list as $node) + if (strlen($node->nodeValue) > 40) + $text .= " ".trim($node->nodeValue); + } + + // If none text was found then take the paragraph content + if ($text == "") { + $list = $xpath->query("//p"); + foreach ($list as $node) + if (strlen($node->nodeValue) > 40) + $text .= " ".trim($node->nodeValue); + } + + if ($text != "") { + $text = trim(str_replace(array("\n", "\r"), array(" ", " "), $text)); + + while (strpos($text, " ")) + $text = trim(str_replace(" ", " ", $text)); + + $siteinfo["text"] = html_entity_decode(substr($text,0,350), ENT_QUOTES, "UTF-8").'...'; + } + } + + return($siteinfo); +} + +function arr_add_hashes(&$item,$k) { + $item = '#' . $item; +} + +function urlinfo_content(&$a) { + + logger('urlinfo: ' . print_r($_REQUEST,true)); + + $text = null; + $str_tags = ''; + + + $br = "\n"; + + if(x($_GET,'binurl')) + $url = trim(hex2bin($_GET['binurl'])); + else + $url = trim($_GET['url']); + + if((substr($url,0,1) != '/') && (substr($url,0,4) != 'http')) + $url = 'http://' . $url; + + + if($_GET['title']) + $title = strip_tags(trim($_GET['title'])); + + if($_GET['description']) + $text = strip_tags(trim($_GET['description'])); + + if($_GET['tags']) { + $arr_tags = str_getcsv($_GET['tags']); + if(count($arr_tags)) { + array_walk($arr_tags,'arr_add_hashes'); + $str_tags = $br . implode(' ',$arr_tags) . $br; + } + } + + logger('urlinfo: ' . $url); + + $result = z_fetch_url($url,false,0,array('novalidate' => true, 'nobody' => true)); + if($result['success']) { + $hdrs=array(); + $h = explode("\n",$result['header']); + foreach ($h as $l) { + list($k,$v) = array_map("trim", explode(":", trim($l), 2)); + $hdrs[$k] = $v; + } + if (array_key_exists('Content-Type', $hdrs)) + $type = $hdrs['Content-Type']; + if($type) { + $zrl = is_matrix_url($url); + if(stripos($type,'image/') !== false) { + if($zrl) + echo $br . '[zmg]' . $url . '[/zmg]' . $br; + else + echo $br . '[img]' . $url . '[/img]' . $br; + killme(); + } + if(stripos($type,'video/') !== false) { + if($zrl) + echo $br . '[zvideo]' . $url . '[/zvideo]' . $br; + else + echo $br . '[video]' . $url . '[/video]' . $br; + killme(); + } + if(stripos($type,'audio/') !== false) { + if($zrl) + echo $br . '[zaudio]' . $url . '[/zaudio]' . $br; + else + echo $br . '[audio]' . $url . '[/audio]' . $br; + killme(); + } + } + } + + $template = $br . '#^[url=%s]%s[/url]%s' . $br; + + $arr = array('url' => $url, 'text' => ''); + + call_hooks('parse_link', $arr); + + if(strlen($arr['text'])) { + echo $arr['text']; + killme(); + } + + $x = oembed_process($url); + if($x) { + echo $x; + killme(); + } + + if($url && $title && $text) { + + + $text = $br . '[quote]' . trim($text) . '[/quote]' . $br; + + $title = str_replace(array("\r","\n"),array('',''),$title); + + $result = sprintf($template,$url,($title) ? $title : $url,$text) . $str_tags; + + logger('urlinfo (unparsed): returns: ' . $result); + + echo $result; + killme(); + } + + $siteinfo = parseurl_getsiteinfo($url); + + // If this is a Red site, use zrl rather than url so they get zids sent to them by default + + if( x($siteinfo,'generator') && (strpos($siteinfo['generator'],PLATFORM_NAME . ' ') === 0)) + $template = str_replace('url','zrl',$template); + + if($siteinfo["title"] == "") { + echo sprintf($template,$url,$url,'') . $str_tags; + killme(); + } else { + $text = $siteinfo["text"]; + $title = $siteinfo["title"]; + } + + $image = ""; + + if(sizeof($siteinfo["images"]) > 0){ + /* Execute below code only if image is present in siteinfo */ + + $total_images = 0; + $max_images = get_config('system','max_bookmark_images'); + if($max_images === false) + $max_images = 2; + else + $max_images = intval($max_images); + + foreach ($siteinfo["images"] as $imagedata) { + if ($url) { + $image .= sprintf('[url=%s]', $url); + } + $image .= '[img='.$imagedata["width"].'x'.$imagedata["height"].']'.$imagedata["src"].'[/img]'; + if ($url) { + $image .= '[/url]'; + } + $image .= "\n"; + $total_images ++; + if($max_images && $max_images >= $total_images) + break; + } + } + + if(strlen($text)) { + $text = $br.'[quote]'.trim($text).'[/quote]'.$br ; + } + + if($image) { + $text = $br.$br.$image.$text; + } + $title = str_replace(array("\r","\n"),array('',''),$title); + + $result = sprintf($template,$url,($title) ? $title : $url,$text) . $str_tags; + + logger('urlinfo: returns: ' . $result, LOGGER_DEBUG); + + echo trim($result); + killme(); +} diff --git a/view/js/main.js b/view/js/main.js index 5fe778488..20b23b7ed 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -135,7 +135,7 @@ function insertCommentURL(comment, id) { if(reply && reply.length) { reply = bin2hex(reply); $('body').css('cursor', 'wait'); - $.get('parse_url?binurl=' + reply, function(data) { + $.get('urlinfo?f=&binurl=' + reply, function(data) { var tmpStr = $("#comment-edit-text-" + id).val(); if(tmpStr == comment) { tmpStr = ""; diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 4121882b7..424d856e3 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -191,7 +191,7 @@ function enableOnUser(){ if(reply && reply.length) { reply = bin2hex(reply); $('#profile-rotator').spin('tiny'); - $.get('{{$baseurl}}/parse_url?binurl=' + reply, function(data) { + $.get('{{$baseurl}}/urlinfo?f=&binurl=' + reply, function(data) { addeditortext(data); $('#profile-rotator').spin(false); }); @@ -258,7 +258,7 @@ function enableOnUser(){ if(reply && reply.length) { reply = bin2hex(reply); $('#profile-rotator').spin('tiny'); - $.get('{{$baseurl}}/parse_url?binurl=' + reply, function(data) { + $.get('{{$baseurl}}/urlinfo?f=&binurl=' + reply, function(data) { if (!editor) $("#profile-jot-text").val(""); initEditor(function(){ addeditortext(data); diff --git a/view/tpl/msg-header.tpl b/view/tpl/msg-header.tpl index e1d1c6d23..20d0dd914 100755 --- a/view/tpl/msg-header.tpl +++ b/view/tpl/msg-header.tpl @@ -78,7 +78,7 @@ else reply = prompt("{{$linkurl}}"); if(reply && reply.length) { $('#prvmail-rotator').spin('tiny'); - $.get('parse_url?url=' + reply, function(data) { + $.get('urlinfo?f=&url=' + reply, function(data) { addmailtext(data); $('#prvmail-rotator').spin(false); }); @@ -104,7 +104,7 @@ else event.preventDefault(); if(reply && reply.length) { $('#prvmail-rotator').spin('tiny'); - $.get('parse_url?url=' + reply, function(data) { + $.get('urlinfo?f=&url=' + reply, function(data) { addmailtext(data); $('#prvmail-rotator').spin(false); }); -- cgit v1.2.3