diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/cloud.php | 55 | ||||
-rw-r--r-- | mod/editblock.php | 4 | ||||
-rw-r--r-- | mod/editlayout.php | 4 | ||||
-rw-r--r-- | mod/editwebpage.php | 4 | ||||
-rwxr-xr-x | mod/events.php | 4 | ||||
-rw-r--r-- | mod/filestorage.php | 55 | ||||
-rw-r--r-- | mod/group.php | 2 | ||||
-rw-r--r-- | mod/home.php | 2 | ||||
-rw-r--r-- | mod/item.php | 18 | ||||
-rwxr-xr-x | mod/like.php | 11 | ||||
-rw-r--r-- | mod/mail.php | 17 | ||||
-rw-r--r-- | mod/ping.php | 80 | ||||
-rw-r--r-- | mod/profiles.php | 4 | ||||
-rw-r--r-- | mod/rpost.php | 4 | ||||
-rw-r--r-- | mod/settings.php | 4 | ||||
-rw-r--r-- | mod/thing.php | 9 |
16 files changed, 122 insertions, 155 deletions
diff --git a/mod/cloud.php b/mod/cloud.php index 3606325bd..25773066a 100644 --- a/mod/cloud.php +++ b/mod/cloud.php @@ -1,13 +1,16 @@ <?php +/** + * @file mod/cloud.php + * @brief Initialize Red Matrix's cloud (SabreDAV) + * + */ use Sabre\DAV; - - require_once('vendor/autoload.php'); - + require_once('vendor/autoload.php'); // workaround for HTTP-auth in CGI mode if(x($_SERVER,'REDIRECT_REMOTE_USER')) { - $userpass = base64_decode(substr($_SERVER["REDIRECT_REMOTE_USER"],6)) ; + $userpass = base64_decode(substr($_SERVER["REDIRECT_REMOTE_USER"], 6)) ; if(strlen($userpass)) { list($name, $password) = explode(':', $userpass); $_SERVER['PHP_AUTH_USER'] = $name; @@ -16,18 +19,19 @@ } if(x($_SERVER,'HTTP_AUTHORIZATION')) { - $userpass = base64_decode(substr($_SERVER["HTTP_AUTHORIZATION"],6)) ; + $userpass = base64_decode(substr($_SERVER["HTTP_AUTHORIZATION"], 6)) ; if(strlen($userpass)) { - list($name, $password) = explode(':', $userpass); + list($name, $password) = explode(':', $userpass); $_SERVER['PHP_AUTH_USER'] = $name; $_SERVER['PHP_AUTH_PW'] = $password; } } - - - - +/** + * @brief Fires up the SabreDAV server. + * + * @param App &$a + */ function cloud_init(&$a) { require_once('include/reddav.php'); @@ -42,13 +46,10 @@ function cloud_init(&$a) { $profile = 0; $channel = $a->get_channel(); - $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/feed/' . $which .'" />' . "\r\n" ; + $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/feed/' . $which . '" />' . "\r\n" ; if($which) - profile_load($a,$which,$profile); - - - + profile_load($a, $which, $profile); $auth = new RedBasicAuth(); @@ -61,17 +62,16 @@ function cloud_init(&$a) { $auth->channel_name = $channel['channel_address']; $auth->channel_id = $channel['channel_id']; $auth->channel_hash = $channel['channel_hash']; + $auth->channel_account_id = $channel['channel_account_id']; if($channel['channel_timezone']) $auth->timezone = $channel['channel_timezone']; - } + } $auth->observer = $ob_hash; - } + } if($_GET['davguest']) $_SESSION['davguest'] = true; - - $_SERVER['QUERY_STRING'] = str_replace(array('?f=','&f='),array('',''),$_SERVER['QUERY_STRING']); $_SERVER['QUERY_STRING'] = strip_zids($_SERVER['QUERY_STRING']); $_SERVER['QUERY_STRING'] = preg_replace('/[\?&]davguest=(.*?)([\?&]|$)/ism','',$_SERVER['QUERY_STRING']); @@ -80,8 +80,11 @@ function cloud_init(&$a) { $_SERVER['REQUEST_URI'] = strip_zids($_SERVER['REQUEST_URI']); $_SERVER['REQUEST_URI'] = preg_replace('/[\?&]davguest=(.*?)([\?&]|$)/ism','',$_SERVER['REQUEST_URI']); - $rootDirectory = new RedDirectory('/',$auth); + $rootDirectory = new RedDirectory('/', $auth); + + // A SabreDAV server-object $server = new DAV\Server($rootDirectory); + // prevent overwriting changes each other with a lock backend $lockBackend = new DAV\Locks\Backend\File('store/[data]/locks'); $lockPlugin = new DAV\Locks\Plugin($lockBackend); @@ -94,11 +97,11 @@ function cloud_init(&$a) { // In order to avoid prompting for passwords for viewing a DIRECTORY, add the URL query parameter 'davguest=1' $isapublic_file = false; - $davguest = ((x($_SESSION,'davguest')) ? true : false); + $davguest = ((x($_SESSION, 'davguest')) ? true : false); if((! $auth->observer) && ($_SERVER['REQUEST_METHOD'] === 'GET')) { try { - $x = RedFileData('/' . $a->cmd,$auth); + $x = RedFileData('/' . $a->cmd, $auth); if($x instanceof RedFile) $isapublic_file = true; } @@ -112,21 +115,19 @@ function cloud_init(&$a) { $auth->Authenticate($server, t('Red Matrix - Guests: Username: {your email address}, Password: +++')); } catch ( Exception $e) { - logger('mod_cloud: auth exception' . $e->getMessage()); - http_status_exit($e->getHTTPCode(),$e->getMessage()); + logger('mod_cloud: auth exception' . $e->getMessage()); + http_status_exit($e->getHTTPCode(), $e->getMessage()); } } -// $browser = new DAV\Browser\Plugin(); + // provide a directory view for the cloud in Red Matrix $browser = new RedBrowser($auth); $auth->setBrowserPlugin($browser); - $server->addPlugin($browser); - // All we need to do now, is to fire up the server $server->exec(); diff --git a/mod/editblock.php b/mod/editblock.php index 507050eb0..536ddd7d2 100644 --- a/mod/editblock.php +++ b/mod/editblock.php @@ -58,8 +58,8 @@ function editblock_content(&$a) { $plaintext = true; // You may or may not be a local user. - if(local_user() && feature_enabled(local_user(),'richtext')) - $plaintext = false; +// if(local_user() && feature_enabled(local_user(),'richtext')) +// $plaintext = false; $mimeselect = ''; $mimetype = $itm[0]['mimetype']; diff --git a/mod/editlayout.php b/mod/editlayout.php index da681cf34..1e8a6e990 100644 --- a/mod/editlayout.php +++ b/mod/editlayout.php @@ -65,8 +65,8 @@ function editlayout_content(&$a) { $plaintext = true; // You may or may not be a local user. This won't work, - if(feature_enabled(local_user(),'richtext')) - $plaintext = false; +// if(feature_enabled(local_user(),'richtext')) +// $plaintext = false; $o .= replace_macros(get_markup_template('edpost_head.tpl'), array( '$title' => t('Edit Layout') diff --git a/mod/editwebpage.php b/mod/editwebpage.php index b8b7a465c..9fe76ba98 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -73,8 +73,8 @@ function editwebpage_content(&$a) { $plaintext = true; - if(feature_enabled($itm[0]['uid'],'richtext')) - $plaintext = false; +// if(feature_enabled($itm[0]['uid'],'richtext')) +// $plaintext = false; $mimetype = $itm[0]['mimetype']; diff --git a/mod/events.php b/mod/events.php index 911b6c891..7c4d6c191 100755 --- a/mod/events.php +++ b/mod/events.php @@ -161,8 +161,8 @@ function events_content(&$a) { $plaintext = true; - if(feature_enabled(local_user(),'richtext')) - $plaintext = false; +// if(feature_enabled(local_user(),'richtext')) +// $plaintext = false; diff --git a/mod/filestorage.php b/mod/filestorage.php index bcf798e7b..383af84fc 100644 --- a/mod/filestorage.php +++ b/mod/filestorage.php @@ -26,12 +26,12 @@ function filestorage_post(&$a) { attach_change_permissions($channel_id,$resource,$str_contact_allow,$str_group_allow,$str_contact_deny,$str_group_deny,$recurse = false); + //Build directory tree and redirect + $channel = $a->get_channel(); + $cloudPath = get_parent_cloudpath($channel_id, $channel['channel_address'], $resource) ; + goaway($cloudPath); } - - - - function filestorage_content(&$a) { if(argc() > 1) @@ -83,12 +83,12 @@ function filestorage_content(&$a) { ); if(! $r) { notice( t('File not found.') . EOL); - goaway(z_root() . '/filestorage/' . $which); + goaway(z_root() . '/cloud/' . $which); } attach_delete($owner,$r[0]['hash']); - goaway(z_root() . '/filestorage/' . $which); + goaway(z_root() . '/cloud/' . $which); } @@ -110,6 +110,7 @@ function filestorage_content(&$a) { $channel = $a->get_channel(); $cloudpath = get_cloudpath($f) . (($f['flags'] & ATTACH_FLAG_DIR) ? '?f=&davguest=1' : ''); + $parentpath = get_parent_cloudpath($channel['channel_id'], $channel['channel_address'], $f['hash']); $aclselect_e = populate_acl($f,false); $is_a_dir = (($f['flags'] & ATTACH_FLAG_DIR) ? true : false); @@ -121,6 +122,7 @@ function filestorage_content(&$a) { '$header' => t('Edit file permissions'), '$file' => $f, '$cloudpath' => z_root() . '/' . $cloudpath, + '$parentpath' => $parentpath, '$uid' => $channel['channel_id'], '$channelnick' => $channel['channel_address'], '$permissions' => t('Permissions'), @@ -139,45 +141,6 @@ function filestorage_content(&$a) { return $o; } - $r = q("select * from attach where uid = %d order by edited desc", - intval($owner) - ); - - $files = null; - - if($r) { - $files = array(); - foreach($r as $rr) { - $files[$rr['id']][] = array( - 'id' => $rr['id'], - 'download' => $rr['hash'], - 'title' => $rr['filename'], - 'size' => $rr['filesize'], - 'rev' => $rr['revision'], - 'dir' => (($rr['flags'] & ATTACH_FLAG_DIR) ? true : false) - ); - } - } - - $limit = service_class_fetch ($owner,'attach_upload_limit'); - $r = q("select sum(filesize) as total from attach where aid = %d ", - intval($channel['channel_account_id']) - ); - $used = $r[0]['total']; - - $url = z_root() . "/filestorage/" . $which; - return $o . replace_macros(get_markup_template("filestorage.tpl"), array( - '$baseurl' => $url, - '$download' => t('Download'), - '$files' => $files, - '$channel' => $which, - '$edit' => t('Edit'), - '$delete' => t('Delete'), - '$used' => $used, - '$usedlabel' => t('Used: '), - '$directory' => t('[directory]'), - '$limit' => $limit, - '$limitlabel' => t('Limit: '), - )); + goaway(z_root() . '/cloud/' . $which); } diff --git a/mod/group.php b/mod/group.php index 15e4ff2a3..d9bbec78b 100644 --- a/mod/group.php +++ b/mod/group.php @@ -117,7 +117,7 @@ function group_content(&$a) { check_form_security_token_ForbiddenOnErr('group_member_change', 't'); - $r = q("SELECT abook_xchan from abook where abook_xchan = '%s' and abook_channel = %d and not (xchan_flags & %d) and not (abook_flags & %d) and not (abook_flags & %d) limit 1", + $r = q("SELECT abook_xchan from abook left join xchan on abook_xchan = xchan_hash where abook_xchan = '%s' and abook_channel = %d and not (xchan_flags & %d) and not (abook_flags & %d) and not (abook_flags & %d) limit 1", dbesc(argv(2)), intval(local_user()), intval(XCHAN_FLAGS_DELETED), diff --git a/mod/home.php b/mod/home.php index 6f7a0b5d7..bc352976d 100644 --- a/mod/home.php +++ b/mod/home.php @@ -16,6 +16,8 @@ function home_init(&$a) { if(! $dest) $dest = get_pconfig(local_user(),'system','startpage'); if(! $dest) + $dest = get_config('system','startpage'); + if(! $dest) $dest = z_root() . '/apps'; goaway($dest); diff --git a/mod/item.php b/mod/item.php index 5ddafb709..c9ec56eeb 100644 --- a/mod/item.php +++ b/mod/item.php @@ -430,10 +430,14 @@ function item_post(&$a) { // First figure out if it's a status post that would've been // created using tinymce. Otherwise leave it alone. - $plaintext = ((feature_enabled($profile_uid,'richtext')) ? false : true); - if((! $parent) && (! $api_source) && (! $plaintext)) { - $body = fix_mce_lf($body); - } + $plaintext = true; + +// $plaintext = ((feature_enabled($profile_uid,'richtext')) ? false : true); +// if((! $parent) && (! $api_source) && (! $plaintext)) { +// $body = fix_mce_lf($body); +// } + + // If we're sending a private top-level message with a single @-taggable channel as a recipient, @-tag it, if our pconfig is set. @@ -781,7 +785,11 @@ function item_post(&$a) { logger('mod_item: saved item ' . $post_id); if($parent) { - if($datarray['owner_xchan'] != $datarray['author_xchan']) { + + // only send comment notification if this is a wall-to-wall comment, + // otherwise it will happen during delivery + + if(($datarray['owner_xchan'] != $datarray['author_xchan']) && ($parent_item['item_flags'] & ITEM_WALL)) { notification(array( 'type' => NOTIFY_COMMENT, 'from_xchan' => $datarray['author_xchan'], diff --git a/mod/like.php b/mod/like.php index aae96e753..ececb31c7 100755 --- a/mod/like.php +++ b/mod/like.php @@ -151,12 +151,12 @@ function like_content(&$a) { // second like of the same thing is "undo" for the first like - $z = q("select * from likes where channel_id = %d and liker = '%s' and verb = '%s' and target_type = '%s' and target = '%s' limit 1", + $z = q("select * from likes where channel_id = %d and liker = '%s' and verb = '%s' and target_type = '%s' and target_id = '%s' limit 1", intval($ch[0]['channel_id']), dbesc($observer['xchan_hash']), dbesc($activity), dbesc(($tgttype)?$tgttype:$objtype), - dbesc(json_encode(($target)?$target:$object)) + dbesc($obj_id) ); if($z) { @@ -328,6 +328,10 @@ function like_content(&$a) { $arr['body'] = sprintf( $bodyverb, $alink, $ulink, $plink ); + if($obj_type === 'thing' && $r[0]['imgurl']) { + $arr['body'] .= "\n\n[zmg=80x80]" . $r[0]['imgurl'] . '[/zmg]'; + } + $arr['verb'] = $activity; $arr['obj_type'] = $objtype; @@ -354,13 +358,14 @@ function like_content(&$a) { if($extended_like) { - $r = q("insert into likes (channel_id,liker,likee,iid,verb,target_type,target) values (%d,'%s','%s',%d,'%s','%s','%s')", + $r = q("insert into likes (channel_id,liker,likee,iid,verb,target_type,target_id,target) values (%d,'%s','%s',%d,'%s','%s','%s','%s')", intval($ch[0]['channel_id']), dbesc($observer['xchan_hash']), dbesc($ch[0]['channel_hash']), intval($post_id), dbesc($activity), dbesc(($tgttype)?$tgttype:$objtype), + dbesc($obj_id), dbesc(json_encode(($target)?$target:$object)) ); }; diff --git a/mod/mail.php b/mod/mail.php index 9c84872ef..c3ce47b5a 100644 --- a/mod/mail.php +++ b/mod/mail.php @@ -76,9 +76,9 @@ function mail_post(&$a) { } } - if(feature_enabled(local_user(),'richtext')) { - $body = fix_mce_lf($body); - } +// if(feature_enabled(local_user(),'richtext')) { +// $body = fix_mce_lf($body); +// } if(! $recipient) { notice('No recipient found.'); @@ -156,11 +156,7 @@ function mail_content(&$a) { $o .= $header; - $plaintext = false; - if(intval(get_pconfig(local_user(),'system','plaintext'))) - $plaintext = true; - if(! feature_enabled(local_user(),'richtext')) - $plaintext = true; + $plaintext = true; $tpl = get_markup_template('msg-header.tpl'); @@ -240,8 +236,9 @@ function mail_content(&$a) { $o .= $header; $plaintext = true; - if( local_user() && feature_enabled(local_user(),'richtext') ) - $plaintext = false; + +// if( local_user() && feature_enabled(local_user(),'richtext') ) +// $plaintext = false; $messages = private_messages_fetch_conversation(local_user(), argv(1), true); diff --git a/mod/ping.php b/mod/ping.php index ac12e2fc0..7e7ccaa15 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -1,9 +1,21 @@ <?php - +/** + * @file mod/ping.php + * + */ require_once('include/bbcode.php'); require_once('include/notify.php'); +/** + * @brief do several updates when pinged. + * + * This function does several tasks. Whenever called it checks for new messages, + * introductions, notifications, etc. and returns a json with the results. + * + * @param App &$a + * @result JSON + */ function ping_init(&$a) { $result = array(); @@ -30,13 +42,13 @@ function ping_init(&$a) { $result['invalid'] = ((intval($_GET['uid'])) && (intval($_GET['uid']) != local_user()) ? 1 : 0); - if(x($_SESSION,'sysmsg')){ + if(x($_SESSION, 'sysmsg')){ foreach ($_SESSION['sysmsg'] as $m){ $result['notice'][] = array('message' => $m); } unset($_SESSION['sysmsg']); } - if(x($_SESSION,'sysmsg_info')){ + if(x($_SESSION, 'sysmsg_info')){ foreach ($_SESSION['sysmsg_info'] as $m){ $result['info'][] = array('message' => $m); } @@ -48,7 +60,6 @@ function ping_init(&$a) { killme(); } - if(get_observer_hash() && (! $result['invalid'])) { $r = q("select cp_id, cp_room from chatpresence where cp_xchan = '%s' and cp_client = '%s' and cp_room = 0 limit 1", dbesc(get_observer_hash()), @@ -80,8 +91,8 @@ function ping_init(&$a) { killme(); } - if(x($_REQUEST,'markRead') && local_user()) { - + // mark all items read + if(x($_REQUEST, 'markRead') && local_user()) { switch($_REQUEST['markRead']) { case 'network': $r = q("update item set item_flags = ( item_flags ^ %d ) where (item_flags & %d) and uid = %d", @@ -90,7 +101,6 @@ function ping_init(&$a) { intval(local_user()) ); break; - case 'home': $r = q("update item set item_flags = ( item_flags ^ %d ) where (item_flags & %d) and (item_flags & %d) and uid = %d", intval(ITEM_UNSEEN), @@ -111,19 +121,16 @@ function ping_init(&$a) { intval(local_user()) ); break; - case 'notify': $r = q("update notify set seen = 1 where uid = %d", intval(local_user()) ); break; - default: break; } } - if(argc() > 1 && argv(1) === 'notify') { $t = q("select count(*) as total from notify where uid = %d and seen = 0", intval(local_user()) @@ -163,12 +170,9 @@ function ping_init(&$a) { echo json_encode(array('notify' => $notifs)); killme(); - } - if(argc() > 1 && argv(1) === 'messages') { - $channel = $a->get_channel(); $t = q("select mail.*, xchan.* from mail left join xchan on xchan_hash = from_xchan where channel_id = %d and not ( mail_flags & %d ) and not (mail_flags & %d ) @@ -196,14 +200,9 @@ function ping_init(&$a) { echo json_encode(array('notify' => $notifs)); killme(); - } - - - if(argc() > 1 && (argv(1) === 'network' || argv(1) === 'home')) { - $result = array(); $r = q("SELECT * FROM item @@ -220,15 +219,13 @@ function ping_init(&$a) { continue; $result[] = format_notification($item); } - } - logger('ping: ' . print_r($result,true)); + } + logger('ping (network||home): ' . print_r($result, true), LOGGER_DATA); echo json_encode(array('notify' => $result)); killme(); - } if(argc() > 1 && (argv(1) === 'intros')) { - $result = array(); $r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook_xchan = xchan_hash @@ -250,15 +247,13 @@ function ping_init(&$a) { 'message' => t('added your channel') ); } - } - logger('ping: ' . print_r($result,true)); + } + logger('ping (intros): ' . print_r($result, true), LOGGER_DATA); echo json_encode(array('notify' => $result)); killme(); - } if(argc() > 1 && (argv(1) === 'all_events')) { - $bd_format = t('g A l F d') ; // 8 AM Friday January 18 $result = array(); @@ -267,23 +262,22 @@ function ping_init(&$a) { WHERE `event`.`uid` = %d AND start < '%s' AND start > '%s' and `ignore` = 0 ORDER BY `start` DESC ", intval(local_user()), - dbesc(datetime_convert('UTC',date_default_timezone_get(),'now + 7 days')), - dbesc(datetime_convert('UTC',date_default_timezone_get(),'now - 1 days')) + dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now + 7 days')), + dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now - 1 days')) ); if($r) { foreach($r as $rr) { if($rr['adjust']) - $md = datetime_convert('UTC',date_default_timezone_get(),$rr['start'],'Y/m'); + $md = datetime_convert('UTC', date_default_timezone_get(), $rr['start'], 'Y/m'); else - $md = datetime_convert('UTC','UTC',$rr['start'],'Y/m'); + $md = datetime_convert('UTC', 'UTC', $rr['start'], 'Y/m'); - $strt = datetime_convert('UTC',$rr['convert'] ? date_default_timezone_get() : 'UTC',$rr['start']); - $today = ((substr($strt,0,10) === datetime_convert('UTC',date_default_timezone_get(),'now','Y-m-d')) ? true : false); + $strt = datetime_convert('UTC', $rr['convert'] ? date_default_timezone_get() : 'UTC', $rr['start']); + $today = ((substr($strt, 0, 10) === datetime_convert('UTC', date_default_timezone_get(), 'now', 'Y-m-d')) ? true : false); $when = day_translate(datetime_convert('UTC', $rr['adjust'] ? date_default_timezone_get() : 'UTC', $rr['start'], $bd_format)) . (($today) ? ' ' . t('[today]') : ''); - $result[] = array( 'notify_link' => $a->get_baseurl() . '/events', // FIXME this takes you to an edit page and it may not be yours, we really want to just view the single event --> '/events/event/' . $rr['event_hash'], 'name' => $rr['xchan_name'], @@ -294,23 +288,19 @@ function ping_init(&$a) { 'message' => t('posted an event') ); } - } - logger('ping: ' . print_r($result,true)); + } + logger('ping (all_events): ' . print_r($result, true), LOGGER_DATA); echo json_encode(array('notify' => $result)); killme(); - } - // Normal ping - just the counts - $t = q("select count(*) as total from notify where uid = %d and seen = 0", intval(local_user()) ); if($t) $result['notify'] = intval($t[0]['total']); - $t1 = dba_timer(); $r = q("SELECT id, item_restrict, item_flags FROM item @@ -321,7 +311,6 @@ function ping_init(&$a) { ); if(count($r)) { - $arr = array('items' => $r); call_hooks('network_ping', $arr); @@ -333,7 +322,6 @@ function ping_init(&$a) { } } - $t2 = dba_timer(); $intr = q("select count(abook_id) as total from abook where (abook_flags & %d) and abook_channel = %d", @@ -372,15 +360,15 @@ function ping_init(&$a) { WHERE `event`.`uid` = %d AND start < '%s' AND start > '%s' and `ignore` = 0 ORDER BY `start` ASC ", intval(local_user()), - dbesc(datetime_convert('UTC',date_default_timezone_get(),'now + 7 days')), - dbesc(datetime_convert('UTC',date_default_timezone_get(),'now - 1 days')) + dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now + 7 days')), + dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now - 1 days')) ); if($events) { $result['all_events'] = count($events); if($result['all_events']) { - $str_now = datetime_convert('UTC',$a->timezone,'now','Y-m-d'); + $str_now = datetime_convert('UTC', $a->timezone, 'now', 'Y-m-d'); foreach($events as $x) { $bd = false; if($x['type'] === 'birthday') { @@ -390,7 +378,7 @@ function ping_init(&$a) { else { $result['events'] ++; } - if(datetime_convert('UTC',((intval($x['adjust'])) ? $a->timezone : 'UTC'), $x['start'],'Y-m-d') === $str_now) { + if(datetime_convert('UTC', ((intval($x['adjust'])) ? $a->timezone : 'UTC'), $x['start'], 'Y-m-d') === $str_now) { $result['all_events_today'] ++; if($bd) $result['birthdays_today'] ++; @@ -409,6 +397,4 @@ function ping_init(&$a) { echo $x; killme(); - } - diff --git a/mod/profiles.php b/mod/profiles.php index 2e91db600..f6392d4ab 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -477,8 +477,8 @@ function profiles_content(&$a) { $editselect = 'none'; - if(feature_enabled(local_user(),'richtext')) - $editselect = 'textareas'; +// if(feature_enabled(local_user(),'richtext')) +// $editselect = 'textareas'; $a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array( '$baseurl' => $a->get_baseurl(true), diff --git a/mod/rpost.php b/mod/rpost.php index 309208870..80406ebef 100644 --- a/mod/rpost.php +++ b/mod/rpost.php @@ -83,8 +83,8 @@ function rpost_content(&$a) { } $plaintext = true; - if(feature_enabled(local_user(),'richtext')) - $plaintext = false; +// if(feature_enabled(local_user(),'richtext')) +// $plaintext = false; if(array_key_exists('type', $_REQUEST) && $_REQUEST['type'] === 'html') { require_once('include/html2bbcode.php'); diff --git a/mod/settings.php b/mod/settings.php index c72fdc8c4..7a63e5fc4 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -994,7 +994,9 @@ function settings_content(&$a) { '$hint' => t('Please enable expert mode (in <a href="settings/features">Settings > Additional features</a>) to adjust!'), '$lbl_misc' => t('Miscellaneous Settings'), '$menus' => $menu, - '$menu_desc' => t('Personal menu to display in your channel pages'), + '$menu_desc' => t('Personal menu to display in your channel pages'), + '$removeme' => t('Remove this channel'), + '$permanent' => t('Warning: This action is permanent and cannot be reversed.'), )); call_hooks('settings_form',$o); diff --git a/mod/thing.php b/mod/thing.php index cbf83fdf8..b6d59a3ee 100644 --- a/mod/thing.php +++ b/mod/thing.php @@ -243,12 +243,15 @@ function thing_content(&$a) { } } - if(! local_user()) { + $channel = $a->get_channel(); + + if(! (local_user() && $channel)) { notice( t('Permission denied.') . EOL); return; } $thing_hash = ''; + if(argc() == 3 && argv(1) === 'edit') { $thing_hash = argv(2); @@ -270,7 +273,7 @@ function thing_content(&$a) { '$multiprof' => feature_enabled(local_user(),'multi_profiles'), '$profile_lbl' => t('Select a profile'), '$profile_select' => contact_profile_assign($r[0]['obj_page']), - '$verb_lbl' => t('Select a category of stuff. e.g. I ______ something'), + '$verb_lbl' => $channel['channel_name'], '$verb_select' => obj_verb_selector($r[0]['obj_verb']), '$activity' => array('activity',t('Post an activity'),true,t('Only sends to viewers of the applicable profile')), '$thing_hash' => $thing_hash, @@ -317,7 +320,7 @@ function thing_content(&$a) { '$multiprof' => feature_enabled(local_user(),'multi_profiles'), '$profile_lbl' => t('Select a profile'), '$profile_select' => contact_profile_assign(''), - '$verb_lbl' => t('Select a category of stuff. e.g. I ______ something'), + '$verb_lbl' => $channel['channel_name'], '$activity' => array('activity',t('Post an activity'),true,t('Only sends to viewers of the applicable profile')), '$verb_select' => obj_verb_selector(), '$thing_lbl' => t('Name of thing e.g. something'), |