diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/admin.php | 7 | ||||
-rw-r--r-- | mod/channel.php | 4 | ||||
-rw-r--r-- | mod/dirsearch.php | 10 | ||||
-rw-r--r-- | mod/dreport.php | 52 | ||||
-rw-r--r-- | mod/import.php | 2 | ||||
-rw-r--r-- | mod/mail.php | 235 | ||||
-rw-r--r-- | mod/message.php | 37 | ||||
-rw-r--r-- | mod/rate.php | 5 | ||||
-rw-r--r-- | mod/ratingsearch.php | 5 | ||||
-rw-r--r-- | mod/regdir.php | 5 | ||||
-rw-r--r-- | mod/sitelist.php | 8 | ||||
-rw-r--r-- | mod/tasks.php | 2 | ||||
-rw-r--r-- | mod/uexport.php | 15 |
13 files changed, 251 insertions, 136 deletions
diff --git a/mod/admin.php b/mod/admin.php index 2b7bb007d..aaf00b14f 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -254,6 +254,7 @@ function admin_page_site_post(&$a){ $proxy = ((x($_POST,'proxy')) ? notags(trim($_POST['proxy'])) : ''); $timeout = ((x($_POST,'timeout')) ? intval(trim($_POST['timeout'])) : 60); $delivery_interval = ((x($_POST,'delivery_interval'))? intval(trim($_POST['delivery_interval'])) : 0); + $delivery_batch_count = ((x($_POST,'delivery_batch_count') && $_POST['delivery_batch_count'] > 0)? intval(trim($_POST['delivery_batch_count'])) : 1); $poll_interval = ((x($_POST,'poll_interval')) ? intval(trim($_POST['poll_interval'])) : 0); $maxloadavg = ((x($_POST,'maxloadavg')) ? intval(trim($_POST['maxloadavg'])) : 50); $feed_contacts = ((x($_POST,'feed_contacts')) ? intval($_POST['feed_contacts']) : 0); @@ -261,6 +262,7 @@ function admin_page_site_post(&$a){ set_config('system', 'feed_contacts', $feed_contacts); set_config('system', 'delivery_interval', $delivery_interval); + set_config('system', 'delivery_batch_count', $delivery_batch_count); set_config('system', 'poll_interval', $poll_interval); set_config('system', 'maxloadavg', $maxloadavg); set_config('system', 'frontpage', $frontpage); @@ -330,10 +332,10 @@ function admin_page_site(&$a) { /* Installed langs */ $lang_choices = array(); - $langs = glob('view/*/strings.php'); + $langs = glob('view/*/hstrings.php'); if(is_array($langs) && count($langs)) { - if(! in_array('view/en/strings.php',$langs)) + if(! in_array('view/en/hstrings.php',$langs)) $langs[] = 'view/en/'; asort($langs); foreach($langs as $l) { @@ -442,6 +444,7 @@ function admin_page_site(&$a) { '$proxy' => array('proxy', t("Proxy URL"), get_config('system','proxy'), ""), '$timeout' => array('timeout', t("Network timeout"), (x(get_config('system','curl_timeout'))?get_config('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")), '$delivery_interval' => array('delivery_interval', t("Delivery interval"), (x(get_config('system','delivery_interval'))?get_config('system','delivery_interval'):2), t("Delay background delivery processes by this many seconds to reduce system load. Recommend: 4-5 for shared hosts, 2-3 for virtual private servers. 0-1 for large dedicated servers.")), + '$delivery_batch_count' => array('delivery_batch_count', t('Deliveries per process'),(x(get_config('system','delivery_batch_count'))?get_config('system','delivery_batch_count'):1), t("Number of deliveries to attempt in a single operating system process. Adjust if necessary to tune system performance. Recommend: 1-5.")), '$poll_interval' => array('poll_interval', t("Poll interval"), (x(get_config('system','poll_interval'))?get_config('system','poll_interval'):2), t("Delay background polling processes by this many seconds to reduce system load. If 0, use delivery interval.")), '$maxloadavg' => array('maxloadavg', t("Maximum Load Average"), ((intval(get_config('system','maxloadavg')) > 0)?get_config('system','maxloadavg'):50), t("Maximum system load before delivery and poll processes are deferred - default 50.")), '$default_expire_days' => array('default_expire_days', t('Expiration period in days for imported (matrix/network) content'), intval(get_config('system','default_expire_days')), t('0 for no expiration of imported content')), diff --git a/mod/channel.php b/mod/channel.php index d1064e939..f1b74136e 100644 --- a/mod/channel.php +++ b/mod/channel.php @@ -153,7 +153,6 @@ function channel_content(&$a, $update = 0, $load = false) { else $page_mode = 'client'; - $abook_uids = " and abook.abook_channel = " . intval($a->profile['profile_uid']) . " "; $simple_update = (($update) ? " AND item_unseen = 1 " : ''); @@ -260,9 +259,6 @@ function channel_content(&$a, $update = 0, $load = false) { } - - - if((! $update) && (! $load)) { // This is ugly, but we can't pass the profile_uid through the session to the ajax updater, diff --git a/mod/dirsearch.php b/mod/dirsearch.php index 132ed252b..ec730b28d 100644 --- a/mod/dirsearch.php +++ b/mod/dirsearch.php @@ -398,13 +398,15 @@ function list_public_sites() { $rand = db_getfunc('rand'); $realm = get_directory_realm(); if($realm == DIRECTORY_REALM) { - $r = q("select * from site where site_access != 0 and site_register !=0 and ( site_realm = '%s' or site_realm = '') order by $rand", - dbesc($realm) + $r = q("select * from site where site_access != 0 and site_register !=0 and ( site_realm = '%s' or site_realm = '') and site_type = %d order by $rand", + dbesc($realm), + intval(SITE_TYPE_ZOT) ); } else { - $r = q("select * from site where site_access != 0 and site_register !=0 and site_realm = '%s' order by $rand", - dbesc($realm) + $r = q("select * from site where site_access != 0 and site_register !=0 and site_realm = '%s' and site_type = %d order by $rand", + dbesc($realm), + intval(SITE_TYPE_ZOT) ); } diff --git a/mod/dreport.php b/mod/dreport.php index a20e17372..31a6274c8 100644 --- a/mod/dreport.php +++ b/mod/dreport.php @@ -30,9 +30,48 @@ function dreport_content(&$a) { $o .= '<h2>' . sprintf( t('Delivery report for %1$s'),substr($mid,0,32)) . '...' . '</h2>'; $o .= '<table>'; + for($x = 0; $x < count($r); $x++ ) { + $r[$x]['name'] = escape_tags(substr($r[$x]['dreport_recip'],strpos($r[$x]['dreport_recip'],' '))); + + switch($r[$x]['dreport_result']) { + case 'channel sync processed': + $r[$x]['gravity'] = 0; + $r[$x]['dreport_result'] = t('channel sync processed'); + break; + case 'queued': + $r[$x]['gravity'] = 2; + $r[$x]['dreport_result'] = t('queued'); + break; + case 'posted': + $r[$x]['gravity'] = 3; + $r[$x]['dreport_result'] = t('posted'); + break; + case 'accepted for delivery': + $r[$x]['gravity'] = 4; + $r[$x]['dreport_result'] = t('accepted for delivery'); + break; + case 'updated': + $r[$x]['gravity'] = 5; + $r[$x]['dreport_result'] = t('updated'); + case 'update ignored': + $r[$x]['gravity'] = 6; + $r[$x]['dreport_result'] = t('update ignored'); + break; + case 'permission denied': + $r[$x]['dreport_result'] = t('permission denied'); + $r[$x]['gravity'] = 6; + break; + default: + $r[$x]['gravity'] = 1; + break; + } + } + + usort($r,'dreport_gravity_sort'); + + foreach($r as $rr) { - $name = escape_tags(substr($rr['dreport_recip'],strpos($rr['dreport_recip'],' '))); - $o .= '<tr><td>' . $name . '</td><td>' . escape_tags($rr['dreport_result']) . '</td><td>' . escape_tags($rr['dreport_time']) . '</td></tr>'; + $o .= '<tr><td width="40%">' . $rr['name'] . '</td><td width="20%">' . escape_tags($rr['dreport_result']) . '</td><td width="20%">' . escape_tags($rr['dreport_time']) . '</td></tr>'; } $o .= '</table>'; @@ -40,4 +79,13 @@ function dreport_content(&$a) { +} + +function dreport_gravity_sort($a,$b) { + if($a['gravity'] == $b['gravity']) { + if($a['name'] === $b['name']) + return strcmp($a['dreport_time'],$b['dreport_time']); + return strcmp($a['name'],$b['name']); + } + return (($a['gravity'] > $b['gravity']) ? 1 : (-1)); }
\ No newline at end of file diff --git a/mod/import.php b/mod/import.php index 563967aa2..b6e36d734 100644 --- a/mod/import.php +++ b/mod/import.php @@ -450,6 +450,8 @@ function import_post(&$a) { if(is_array($data['menu'])) import_menus($channel,$data['menu']); + $addon = array('channel' => $channel,'data' => $data); + call_hooks('import_channel',$addon); $saved_notification_flags = notifications_off($channel['channel_id']); diff --git a/mod/mail.php b/mod/mail.php index 80d7f477d..e4a5ebafd 100644 --- a/mod/mail.php +++ b/mod/mail.php @@ -101,7 +101,7 @@ function mail_post(&$a) { notice($ret['message']); } - goaway(z_root() . '/message'); + goaway(z_root() . '/mail/combined'); } @@ -128,33 +128,45 @@ function mail_content(&$a) { '$header' => t('Messages'), )); - if((argc() == 3) && (argv(1) === 'drop')) { - if(! intval(argv(2))) + if((argc() == 4) && (argv(2) === 'drop')) { + if(! intval(argv(3))) return; - $cmd = argv(1); - - $r = private_messages_drop(local_channel(), argv(2)); + $cmd = argv(2); + $mailbox = argv(1); + $r = private_messages_drop(local_channel(), argv(3)); if($r) { - info( t('Message deleted.') . EOL ); + //info( t('Message deleted.') . EOL ); } - goaway($a->get_baseurl(true) . '/message' ); + goaway($a->get_baseurl(true) . '/mail/' . $mailbox); } - if((argc() == 3) && (argv(1) === 'recall')) { - if(! intval(argv(2))) + if((argc() == 4) && (argv(2) === 'recall')) { + if(! intval(argv(3))) return; - $cmd = argv(1); + $cmd = argv(2); + $mailbox = argv(1); $r = q("update mail set mail_recalled = 1 where id = %d and channel_id = %d", - intval(argv(2)), + intval(argv(3)), intval(local_channel()) ); - proc_run('php','include/notifier.php','mail',intval(argv(2))); + proc_run('php','include/notifier.php','mail',intval(argv(3))); if($r) { info( t('Message recalled.') . EOL ); } - goaway($a->get_baseurl(true) . '/message' ); + goaway($a->get_baseurl(true) . '/mail/' . $mailbox . '/' . argv(3)); + + } + if((argc() == 4) && (argv(2) === 'dropconv')) { + if(! intval(argv(3))) + return; + $cmd = argv(2); + $mailbox = argv(1); + $r = private_messages_drop(local_channel(), argv(3), true); + if($r) + info( t('Conversation removed.') . EOL ); + goaway($a->get_baseurl(true) . '/mail/' . $mailbox); } if((argc() > 1) && (argv(1) === 'new')) { @@ -249,117 +261,130 @@ function mail_content(&$a) { return $o; } + switch(argv(1)) { + case 'combined': + $mailbox = 'combined'; + break; + case 'inbox': + $mailbox = 'inbox'; + break; + case 'outbox': + $mailbox = 'outbox'; + break; + default: + $mailbox = 'combined'; + break; + } - if((argc() > 1) && (intval(argv(1)))) { + $last_message = private_messages_list(local_channel(), $mailbox, 0, 1); - $o .= $header; + $mid = ((argc() > 2) && (intval(argv(2)))) ? argv(2) : $last_message[0]['id']; - $plaintext = true; + $plaintext = true; -// if( local_channel() && feature_enabled(local_channel(),'richtext') ) -// $plaintext = false; +// if( local_channel() && feature_enabled(local_channel(),'richtext') ) +// $plaintext = false; - $messages = private_messages_fetch_conversation(local_channel(), argv(1), true); + $messages = private_messages_fetch_conversation(local_channel(), $mid, true); - if(! $messages) { - info( t('Message not found.') . EOL); - return $o; - } + if(! $messages) { + //info( t('Message not found.') . EOL); + return; + } - if($messages[0]['to_xchan'] === $channel['channel_hash']) - $a->poi = $messages[0]['from']; - else - $a->poi = $messages[0]['to']; + if($messages[0]['to_xchan'] === $channel['channel_hash']) + $a->poi = $messages[0]['from']; + else + $a->poi = $messages[0]['to']; -// require_once('include/Contact.php'); +// require_once('include/Contact.php'); -// $a->set_widget('mail_conversant',vcard_from_xchan($a->poi,$get_observer_hash,'mail')); +// $a->set_widget('mail_conversant',vcard_from_xchan($a->poi,$get_observer_hash,'mail')); - $tpl = get_markup_template('msg-header.tpl'); + $tpl = get_markup_template('msg-header.tpl'); - $a->page['htmlhead'] .= replace_macros($tpl, array( - '$nickname' => $channel['channel_address'], - '$baseurl' => $a->get_baseurl(true), - '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), - '$linkurl' => t('Please enter a link URL:'), - '$expireswhen' => t('Expires YYYY-MM-DD HH:MM') - )); - + $a->page['htmlhead'] .= replace_macros($tpl, array( + '$nickname' => $channel['channel_address'], + '$baseurl' => $a->get_baseurl(true), + '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), + '$linkurl' => t('Please enter a link URL:'), + '$expireswhen' => t('Expires YYYY-MM-DD HH:MM') + )); - $mails = array(); - $seen = 0; - $unknown = false; - - foreach($messages as $message) { - - $s = theme_attachments($message); - - $mails[] = array( - 'id' => $message['id'], - 'from_name' => $message['from']['xchan_name'], - 'from_url' => chanlink_hash($message['from_xchan']), - 'from_photo' => $message['from']['xchan_photo_m'], - 'to_name' => $message['to']['xchan_name'], - 'to_url' => chanlink_hash($message['to_xchan']), - 'to_photo' => $message['to']['xchan_photo_m'], - 'subject' => $message['title'], - 'body' => smilies(bbcode($message['body']) . $s), - 'delete' => t('Delete message'), - 'recall' => t('Recall message'), - 'can_recall' => (($channel['channel_hash'] == $message['from_xchan']) ? true : false), - 'is_recalled' => (intval($message['mail_recalled']) ? t('Message has been recalled.') : ''), - 'date' => datetime_convert('UTC',date_default_timezone_get(),$message['created'],'D, d M Y - g:i A'), - ); + $mails = array(); + + $seen = 0; + $unknown = false; + + foreach($messages as $message) { + + $s = theme_attachments($message); + + $mails[] = array( + 'mailbox' => $mailbox, + 'id' => $message['id'], + 'from_name' => $message['from']['xchan_name'], + 'from_url' => chanlink_hash($message['from_xchan']), + 'from_photo' => $message['from']['xchan_photo_s'], + 'to_name' => $message['to']['xchan_name'], + 'to_url' => chanlink_hash($message['to_xchan']), + 'to_photo' => $message['to']['xchan_photo_s'], + 'subject' => $message['title'], + 'body' => smilies(bbcode($message['body']) . $s), + 'delete' => t('Delete message'), + 'recall' => t('Recall message'), + 'can_recall' => (($channel['channel_hash'] == $message['from_xchan']) ? true : false), + 'is_recalled' => (intval($message['mail_recalled']) ? t('Message has been recalled.') : ''), + 'date' => datetime_convert('UTC',date_default_timezone_get(),$message['created'],'D, d M Y - g:i A'), + ); - $seen = $message['seen']; + $seen = $message['seen']; - } + } - $recp = (($message['from_xchan'] === $channel['channel_hash']) ? 'to' : 'from'); + $recp = (($message['from_xchan'] === $channel['channel_hash']) ? 'to' : 'from'); // FIXME - move this HTML to template - $select = $message[$recp]['xchan_name'] . '<input type="hidden" name="messageto" value="' . $message[$recp]['xchan_hash'] . '" />'; - $parent = '<input type="hidden" name="replyto" value="' . $message['parent_mid'] . '" />'; - - $tpl = get_markup_template('mail_display.tpl'); - $o = replace_macros($tpl, array( - '$prvmsg_header' => t('Private Conversation'), - '$thread_id' => $a->argv[1], - '$thread_subject' => $message['title'], - '$thread_seen' => $seen, - '$delete' => t('Delete conversation'), - '$canreply' => (($unknown) ? false : '1'), - '$unknown_text' => t("No secure communications available. You <strong>may</strong> be able to respond from the sender's profile page."), - '$mails' => $mails, + $select = $message[$recp]['xchan_name'] . '<input type="hidden" name="messageto" value="' . $message[$recp]['xchan_hash'] . '" />'; + $parent = '<input type="hidden" name="replyto" value="' . $message['parent_mid'] . '" />'; + $tpl = get_markup_template('mail_display.tpl'); + $o = replace_macros($tpl, array( + '$mailbox' => $mailbox, + '$prvmsg_header' => $message['title'], + '$thread_id' => $mid, + '$thread_subject' => $message['title'], + '$thread_seen' => $seen, + '$delete' => t('Delete Conversation'), + '$canreply' => (($unknown) ? false : '1'), + '$unknown_text' => t("No secure communications available. You <strong>may</strong> be able to respond from the sender's profile page."), + '$mails' => $mails, - // reply - '$header' => t('Send Reply'), - '$to' => t('To:'), - '$showinputs' => '', - '$subject' => t('Subject:'), - '$subjtxt' => $message['title'], - '$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ', - '$yourmessage' => t('Your message:'), - '$text' => '', - '$select' => $select, - '$parent' => $parent, - '$upload' => t('Upload photo'), - '$attach' => t('Attach file'), - '$insert' => t('Insert web link'), - '$submit' => t('Submit'), - '$wait' => t('Please wait'), - '$defexpire' => '', - '$feature_expire' => ((feature_enabled(local_channel(),'content_expire')) ? true : false), - '$expires' => t('Set expiration date'), - '$feature_encrypt' => ((feature_enabled(local_channel(),'content_encrypt')) ? true : false), - '$encrypt' => t('Encrypt text'), - '$cipher' => $cipher, - - )); + // reply + '$header' => t('Send Reply'), + '$to' => t('To:'), + '$showinputs' => '', + '$subject' => t('Subject:'), + '$subjtxt' => $message['title'], + '$readonly' => 'readonly="readonly"', + '$yourmessage' => t('Your message:'), + '$text' => '', + '$select' => $select, + '$parent' => $parent, + '$upload' => t('Upload photo'), + '$attach' => t('Attach file'), + '$insert' => t('Insert web link'), + '$submit' => t('Submit'), + '$wait' => t('Please wait'), + '$defexpire' => '', + '$feature_expire' => ((feature_enabled(local_channel(),'content_expire')) ? true : false), + '$expires' => t('Set expiration date'), + '$feature_encrypt' => ((feature_enabled(local_channel(),'content_encrypt')) ? true : false), + '$encrypt' => t('Encrypt text'), + '$cipher' => $cipher, + )); - return $o; - } + return $o; } diff --git a/mod/message.php b/mod/message.php index 9f62f6b61..73239d2cb 100644 --- a/mod/message.php +++ b/mod/message.php @@ -24,9 +24,7 @@ function message_content(&$a) { if(! $cipher) $cipher = 'aes256'; - - - +/* if((argc() == 3) && (argv(1) === 'dropconv')) { if(! intval(argv(2))) return; @@ -34,14 +32,31 @@ function message_content(&$a) { $r = private_messages_drop(local_channel(), argv(2), true); if($r) info( t('Conversation removed.') . EOL ); - goaway($a->get_baseurl(true) . '/message' ); + goaway($a->get_baseurl(true) . '/mail/combined' ); } - if(argc() == 1) { + if(argc() == 2) { + + switch(argv(1)) { + case 'combined': + $mailbox = 'combined'; + $header = t('Conversations'); + break; + case 'inbox': + $mailbox = 'inbox'; + $header = t('Received Messages'); + break; + case 'outbox': + $mailbox = 'outbox'; + $header = t('Sent Messages'); + break; + default: + break; + } // private_messages_list() can do other more complicated stuff, for now keep it simple - $r = private_messages_list(local_channel(), '', $a->pager['start'], $a->pager['itemspage']); + $r = private_messages_list(local_channel(), $mailbox, $a->pager['start'], $a->pager['itemspage']); if(! $r) { info( t('No messages.') . EOL); @@ -51,6 +66,7 @@ function message_content(&$a) { $messages = array(); foreach($r as $rr) { + $messages[] = array( 'id' => $rr['id'], 'from_name' => $rr['from']['xchan_name'], @@ -70,14 +86,19 @@ function message_content(&$a) { $tpl = get_markup_template('mail_head.tpl'); $o = replace_macros($tpl, array( - '$header' => t('Messages'), + '$header' => $header, '$messages' => $messages )); $o .= alt_pager($a,count($r)); + return $o; - } + return; + + } +*/ + return; } diff --git a/mod/rate.php b/mod/rate.php index a3a36b4a9..f30afed64 100644 --- a/mod/rate.php +++ b/mod/rate.php @@ -22,8 +22,9 @@ function rate_init(&$a) { $a->poi = $r[0]; } else { - $r = q("select * from site where site_url like '%s' ", - dbesc('%' . $target) + $r = q("select * from site where site_url like '%s' and site_type = %d", + dbesc('%' . $target), + intval(SITE_TYPE_ZOT) ); if($r) { $a->data['site'] = $r[0]; diff --git a/mod/ratingsearch.php b/mod/ratingsearch.php index 9c4f2f827..173dd39ff 100644 --- a/mod/ratingsearch.php +++ b/mod/ratingsearch.php @@ -35,8 +35,9 @@ function ratingsearch_init(&$a) { if($p) $target = $p[0]['xchan_hash']; else { - $p = q("select * from site where site_url like '%s' ", - dbesc('%' . $hash) + $p = q("select * from site where site_url like '%s' and site_type = %d ", + dbesc('%' . $hash), + intval(SITE_TYPE_ZOT) ); if($p) { $target = strtolower($hash); diff --git a/mod/regdir.php b/mod/regdir.php index dce50e76a..7168c3373 100644 --- a/mod/regdir.php +++ b/mod/regdir.php @@ -86,8 +86,9 @@ function regdir_init(&$a) { if ($dirmode == DIRECTORY_MODE_STANDALONE) { $r = array(array('site_url' => z_root())); } else { - $r = q("select site_url from site where site_flags in ( 1, 2 ) and site_realm = '%s' $sql_extra ", - dbesc(get_directory_realm()) + $r = q("select site_url from site where site_flags in ( 1, 2 ) and site_realm = '%s' and site_type = %d $sql_extra ", + dbesc(get_directory_realm()), + intval(SITE_TYPE_ZOT) ); } if ($r) { diff --git a/mod/sitelist.php b/mod/sitelist.php index 12911cbd4..30b2359ac 100644 --- a/mod/sitelist.php +++ b/mod/sitelist.php @@ -28,7 +28,9 @@ function sitelist_init(&$a) { $result = array('success' => false); - $r = q("select count(site_url) as total from site where true $sql_extra "); + $r = q("select count(site_url) as total from site where site_type = %d $sql_extra ", + intval(SITE_TYPE_ZOT) + ); if($r) $result['total'] = intval($r[0]['total']); @@ -36,7 +38,9 @@ function sitelist_init(&$a) { $result['start'] = $start; $result['limit'] = $limit; - $r = q("select * from site where true $sql_extra $sql_order $sql_limit"); + $r = q("select * from site where site_type = %d $sql_extra $sql_order $sql_limit", + intval(SITE_TYPE_ZOT) + ); $result['results'] = 0; $result['entries'] = array(); diff --git a/mod/tasks.php b/mod/tasks.php index ed267cc92..b1b81473b 100644 --- a/mod/tasks.php +++ b/mod/tasks.php @@ -73,7 +73,7 @@ function tasks_post(&$a) { if(! $text) return array('success' => false); $event = array(); - $event['aid'] = $channel['channel_account_id']; + $event['account'] = $channel['channel_account_id']; $event['uid'] = $channel['channel_id']; $event['event_xchan'] = $channel['channel_hash']; $event['type'] = 'task'; diff --git a/mod/uexport.php b/mod/uexport.php index df66474f1..ee22383a3 100644 --- a/mod/uexport.php +++ b/mod/uexport.php @@ -41,13 +41,24 @@ function uexport_init(&$a) { } function uexport_content(&$a) { + + $y = datetime_convert('UTC',date_default_timezone_get(),'now','Y'); + + $yearurl = z_root() . '/uexport/' . $y; + $janurl = z_root() . '/uexport/' . $y . '/1'; + $impurl = '/import_items'; $o = replace_macros(get_markup_template('uexport.tpl'), array( '$title' => t('Export Channel'), '$basictitle' => t('Export Channel'), - '$basic' => t('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 does not contain your content.'), + '$basic' => t('Export your basic channel information to a 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 server hub, but does not contain your content.'), '$fulltitle' => t('Export Content'), - '$full' => t('Export your channel information and all the content to a JSON backup. This backs up all of your connections, permissions, profile data and the last year of posts. This file may be VERY large. Please be patient - it may take several minutes for this download to begin.'), + '$full' => t('Export your channel information and recent content to a JSON backup that can be restored or imported to another server hub. This backs up all of your connections, permissions, profile data and several months of posts. This file may be VERY large. Please be patient - it may take several minutes for this download to begin.'), '$by_year' => t('Export your posts from a given year.'), + + '$extra' => t('You may also export your posts and conversations for a particular year or month. Adjust the date in your browser location bar to select other dates. If the export fails (possibly due to memory exhaustion on your server hub), please try again selecting a more limited date range.'), + '$extra2' => sprintf( t('To select all posts for a given year, such as this year, visit <a href="%1$s">%2$s</a>'),$yearurl,$yearurl), + '$extra3' => sprintf( t('To select all posts for a given month, such as January of this year, visit <a href="%1$s">%2$s</a>'),$janurl,$janurl), + '$extra4' => sprintf( t('These content files may be imported or restored by visiting <a href="%1$s">%2$s</a> on any site containing your channel. For best results please import or restore these in date order (oldest first).'),$impurl,$impurl) )); return $o; |