aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/admin.php28
-rw-r--r--mod/community.php2
-rw-r--r--mod/connect.php128
-rw-r--r--mod/connections.php3
-rw-r--r--mod/follow.php3
-rw-r--r--mod/home.php6
-rw-r--r--mod/import.php33
-rwxr-xr-xmod/like.php1
-rw-r--r--mod/menu.php4
-rw-r--r--mod/message.php43
-rw-r--r--mod/network.php17
-rw-r--r--mod/search.php2
-rw-r--r--mod/settings.php48
-rw-r--r--mod/toggle_mobile.php4
-rw-r--r--mod/zfinger.php12
15 files changed, 265 insertions, 69 deletions
diff --git a/mod/admin.php b/mod/admin.php
index 7de133b38..7e8f7a301 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -210,9 +210,9 @@ function admin_page_site_post(&$a){
$banner = ((x($_POST,'banner')) ? trim($_POST['banner']) : false);
$language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : '');
$theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : '');
- $theme_mobile = ((x($_POST,'theme-mobile')) ? notags(trim($_POST['theme-mobile'])) : '');
- $theme_accessibility = ((x($_POST,'theme-accessibility')) ? notags(trim($_POST['theme-accessibility'])) : '');
- $site_channel = ((x($_POST,'site-channel')) ? notags(trim($_POST['site-channel'])) : '');
+ $theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : '');
+ $theme_accessibility = ((x($_POST,'theme_accessibility')) ? notags(trim($_POST['theme_accessibility'])) : '');
+ $site_channel = ((x($_POST,'site_channel')) ? notags(trim($_POST['site_channel'])) : '');
$maximagesize = ((x($_POST,'maximagesize')) ? intval(trim($_POST['maximagesize'])) : 0);
@@ -294,17 +294,17 @@ function admin_page_site_post(&$a){
set_config('system','language', $language);
set_config('system','theme', $theme);
if ( $theme_mobile === '---' ) {
- del_config('system','mobile-theme');
+ del_config('system','mobile_theme');
} else {
- set_config('system','mobile-theme', $theme_mobile);
+ set_config('system','mobile_theme', $theme_mobile);
}
if ( $theme_accessibility === '---' ) {
- del_config('system','accessibility-theme');
+ del_config('system','accessibility_theme');
} else {
- set_config('system','accessibility-theme', $theme_accessibility);
+ set_config('system','accessibility_theme', $theme_accessibility);
}
- set_config('system','site-channel', $site_channel);
+ set_config('system','site_channel', $site_channel);
set_config('system','maximagesize', $maximagesize);
set_config('system','register_policy', $register_policy);
@@ -365,11 +365,11 @@ function admin_page_site(&$a) {
if($files) {
foreach($files as $file) {
$f = basename($file);
- $theme_name = ((file_exists($file . '/.experimental')) ? sprintf("%s - Experimental", $f) : $f);
- if (file_exists($file . '/.mobile')) {
+ $theme_name = ((file_exists($file . '/experimental')) ? sprintf("%s - Experimental", $f) : $f);
+ if (file_exists($file . '/mobile')) {
$theme_choices_mobile[$f] = $theme_name;
}
- if (file_exists($file . '/.accessibility')) {
+ if (file_exists($file . '/accessibility')) {
$theme_choices_accessibility[$f] = $theme_name;
}
$theme_choices[$f] = $theme_name;
@@ -418,9 +418,9 @@ function admin_page_site(&$a) {
'$banner' => array('banner', t("Banner/Logo"), $banner, ""),
'$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices),
'$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices),
- '$theme_mobile' => array('theme-mobile', t("Mobile system theme"), get_config('system','mobile-theme'), t("Theme for mobile devices"), $theme_choices_mobile),
- '$theme_accessibility' => array('theme-accessibility', t("Accessibility system theme"), get_config('system','accessibility-theme'), t("Accessibility theme"), $theme_choices_accessibility),
- '$site_channel' => array('site-channel', t("Channel to use for this website's static pages"), get_config('system','site-channel'), t("Site Channel")),
+ '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile),
+ '$theme_accessibility' => array('theme_accessibility', t("Accessibility system theme"), get_config('system','accessibility_theme'), t("Accessibility theme"), $theme_choices_accessibility),
+ '$site_channel' => array('site_channel', t("Channel to use for this website's static pages"), get_config('system','site_channel'), t("Site Channel")),
'$ssl_policy' => array('ssl_policy', t("SSL link policy"), (string) intval(get_config('system','ssl_policy')), t("Determines whether generated links should be forced to use SSL"), $ssl_choices),
'$maximagesize' => array('maximagesize', t("Maximum image size"), get_config('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")),
'$register_policy' => array('register_policy', t("Register policy"), get_config('system','register_policy'), "", $register_choices),
diff --git a/mod/community.php b/mod/community.php
index 971ecca5c..e4c6e6b04 100644
--- a/mod/community.php
+++ b/mod/community.php
@@ -3,7 +3,7 @@
function community_init(&$a) {
if(! local_user()) {
unset($_SESSION['theme']);
- unset($_SESSION['mobile-theme']);
+ unset($_SESSION['mobile_theme']);
}
diff --git a/mod/connect.php b/mod/connect.php
new file mode 100644
index 000000000..93f994af5
--- /dev/null
+++ b/mod/connect.php
@@ -0,0 +1,128 @@
+<?php /** @file */
+
+
+require_once('include/Contact.php');
+require_once('include/contact_widgets.php');
+require_once('include/items.php');
+
+
+function connect_init(&$a) {
+ if(argc() > 1)
+ $which = argv(1);
+ else {
+ notice( t('Requested profile is not available.') . EOL );
+ $a->error = 404;
+ return;
+ }
+
+ $r = q("select * from channel where channel_address = '%s' limit 1",
+ dbesc($which)
+ );
+
+ if($r)
+ $a->data['channel'] = $r[0];
+
+ profile_load($a,$which,'');
+
+ profile_create_sidebar($a,false);
+
+
+}
+
+function connect_post(&$a) {
+
+ if(! array_key_exists('channel', $a->data))
+ return;
+
+ $edit = ((local_user() && (local_user() == $a->data['channel']['channel_id'])) ? true : false);
+
+ if($edit) {
+ $has_premium = (($a->data['channel']['channel_pageflags'] & PAGE_PREMIUM) ? 1 : 0);
+ $premium = (($_POST['premium']) ? intval($_POST['premium']) : 0);
+ $text = escape_tags($_POST['text']);
+
+ if($has_premium != $premium) {
+ $r = q("update channel set channel_pageflags = ( channel_pageflags ^ %d ) where channel_id = %d limit 1",
+ intval(PAGE_PREMIUM),
+ intval(local_user())
+ );
+ proc_run('php','include/notifier.php','refresh_all',$a->data['channel']['channel_id']);
+ }
+ set_pconfig($a->data['channel']['channel_id'],'system','selltext',$text);
+ // reload the page completely to get fresh data
+ goaway(z_root() . '/' . $a->query_string);
+
+ }
+
+ $url = '';
+ $observer = $a->get_observer();
+ if(($observer) && ($_POST['submit'] === t('Continue'))) {
+ if($observer['xchan_follow'])
+ $url = sprintf($observer['xchan_follow'],urlencode($a->data['channel']['channel_address'] . '@' . $a->get_hostname()));
+ if(! $url) {
+ $r = q("select * from hubloc where hubloc_hash = '%s' order by hubloc_id desc limit 1",
+ dbesc($observer['xchan_hash'])
+ );
+ if($r)
+ $url = $r[0]['hubloc_url'] . '/follow?f=&url=' . urlencode($a->data['channel']['channel_address'] . '@' . $a->get_hostname());
+ }
+ }
+ if($url)
+ goaway($url . '&confirm=1');
+ else
+ notice('Unable to connect to your home hub location.');
+
+}
+
+
+
+function connect_content(&$a) {
+
+ $edit = ((local_user() && (local_user() == $a->data['channel']['channel_id'])) ? true : false);
+
+ $text = get_pconfig($a->data['channel']['channel_id'],'system','selltext');
+
+ if($edit) {
+
+ $o = replace_macros(get_markup_template('sellpage_edit.tpl'),array(
+ '$header' => t('Premium Channel Setup'),
+ '$address' => $a->data['channel']['channel_address'],
+ '$premium' => array('premium', t('Enable premium channel connection restrictions'),(($a->data['channel']['channel_pageflags'] & PAGE_PREMIUM) ? '1' : ''),''),
+ '$lbl_about' => t('Please enter your restrictions or conditions, such as paypal receipt, usage guidelines, etc.'),
+ '$text' => $text,
+ '$desc' => t('This channel may require additional steps or acknowledgement of the following conditions prior to connecting:'),
+ '$lbl2' => t('Potential connections will then see the following text before proceeding:'),
+ '$desc2' => t('By continuing, I certify that I have complied with any instructions provided on this page.'),
+ '$submit' => t('Submit'),
+
+
+ ));
+ return $o;
+ }
+ else {
+ if(! $text)
+ $text = t('(No specific instructions have been provided by the channel owner.)');
+
+ $submit = replace_macros(get_markup_template('sellpage_submit.tpl'), array(
+ '$continue' => t('Continue'),
+ '$address' => $a->data['channel']['channel_address']
+ ));
+
+ $o = replace_macros(get_markup_template('sellpage_view.tpl'),array(
+ '$header' => t('Restricted or Premium Channel'),
+ '$desc' => t('This channel may require additional steps or acknowledgement of the following conditions prior to connecting:'),
+ '$text' => prepare_text($text),
+
+ '$desc2' => t('By continuing, I certify that I have complied with any instructions provided on this page.'),
+ '$submit' => $submit,
+
+ ));
+
+ $arr = array('channel' => $a->data['channel'],'observer' => $a->get_observer(), 'sellpage' => $o, 'submit' => $submit);
+ call_hooks('connect_premium', $arr);
+ $o = $arr['sellpage'];
+
+ }
+
+ return $o;
+} \ No newline at end of file
diff --git a/mod/connections.php b/mod/connections.php
index 8f779bca5..7c4d8acc1 100644
--- a/mod/connections.php
+++ b/mod/connections.php
@@ -179,7 +179,8 @@ function connections_content(&$a) {
intval($contact_id),
intval(local_user()),
intval(ABOOK_FLAG_SELF),
- intval(ABOOK_FLAG_PENDING)
+ // allow drop even if pending, just duplicate the self query
+ intval(($cmd === 'drop') ? ABOOK_FLAG_SELF : ABOOK_FLAG_PENDING)
);
if(! count($orig_record)) {
diff --git a/mod/follow.php b/mod/follow.php
index d21c50df6..9f5a8183b 100644
--- a/mod/follow.php
+++ b/mod/follow.php
@@ -12,8 +12,9 @@ function follow_init(&$a) {
$uid = local_user();
$url = notags(trim($_REQUEST['url']));
$return_url = $_SESSION['return_url'];
+ $confirm = intval($_REQUEST['confirm']);
- $result = new_contact($uid,$url,$a->get_channel(),true);
+ $result = new_contact($uid,$url,$a->get_channel(),true,$confirm);
if($result['success'] == false) {
if($result['message'])
diff --git a/mod/home.php b/mod/home.php
index 86d489853..d17d477c8 100644
--- a/mod/home.php
+++ b/mod/home.php
@@ -30,10 +30,10 @@ function home_content(&$a) {
if(x($_SESSION,'theme'))
unset($_SESSION['theme']);
- if(x($_SESSION,'mobile-theme'))
- unset($_SESSION['mobile-theme']);
+ if(x($_SESSION,'mobile_theme'))
+ unset($_SESSION['mobile_theme']);
-$channel_address = get_config("system", "site-channel" );
+$channel_address = get_config("system", "site_channel" );
if ($channel_address){
require_once('include/items.php');
diff --git a/mod/import.php b/mod/import.php
index 4c878f5c6..08311013a 100644
--- a/mod/import.php
+++ b/mod/import.php
@@ -16,10 +16,10 @@ function import_post(&$a) {
$data = null;
$seize = ((x($_REQUEST,'make_primary')) ? intval($_REQUEST['make_primary']) : 0);
- $src = $_FILES['userfile']['tmp_name'];
- $filename = basename($_FILES['userfile']['name']);
- $filesize = intval($_FILES['userfile']['size']);
- $filetype = $_FILES['userfile']['type'];
+ $src = $_FILES['filename']['tmp_name'];
+ $filename = basename($_FILES['filename']['name']);
+ $filesize = intval($_FILES['filename']['size']);
+ $filetype = $_FILES['filename']['type'];
if($src) {
@@ -206,10 +206,35 @@ function import_post(&$a) {
// import xchans and contact photos
+ if($seize) {
+
+ // replace our existing xchan if we're seizing control
+
+ $r = q("delete from xchan where xchan_hash = '%s' limit 1",
+ dbesc($channel['channel_hash'])
+ );
+
+ $r = q("insert into xchan ( xchan_hash, xchan_guid, xchan_guid_sig, xchan_pubkey, xchan_photo_l, xchan_photo_m, xchan_photo_s, xchan_addr, xchan_url, xchan_name, xchan_network, xchan_photo_date, xchan_name_date ) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')",
+ dbesc($channel['channel_hash']),
+ dbesc($channel['channel_guid']),
+ dbesc($channel['channel_guid_sig']),
+ dbesc($channel['channel_pubkey']),
+ dbesc($a->get_baseurl() . "/photo/profile/l/" . $channel['channel_id']),
+ dbesc($a->get_baseurl() . "/photo/profile/m/" . $channel['channel_id']),
+ dbesc($a->get_baseurl() . "/photo/profile/s/" . $channel['channel_id']),
+ dbesc($channel['channel_address'] . '@' . get_app()->get_hostname()),
+ dbesc(z_root() . '/channel/' . $channel['channel_address']),
+ dbesc($channel['channel_name']),
+ dbesc('zot'),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert())
+ );
+ }
$xchans = $data['xchan'];
if($xchans) {
foreach($xchans as $xchan) {
+
$r = q("select xchan_hash from xchan where xchan_hash = '%s' limit 1",
dbesc($xchan['xchan_hash'])
);
diff --git a/mod/like.php b/mod/like.php
index f617391a1..90005eca3 100755
--- a/mod/like.php
+++ b/mod/like.php
@@ -110,6 +110,7 @@ function like_content(&$a) {
$obj = json_encode(array(
'type' => $objtype,
'id' => $item['mid'],
+ 'parent' => (($item['thr_parent']) ? $item['thr_parent'] : $item['parent_mid']),
'link' => $links,
'title' => $item['title'],
'content' => $item['body'],
diff --git a/mod/menu.php b/mod/menu.php
index 910fc389b..c3302544e 100644
--- a/mod/menu.php
+++ b/mod/menu.php
@@ -45,7 +45,7 @@ function menu_content(&$a) {
if(argc() == 1) {
// list menus
$x = menu_list(local_user());
- if($x) {
+
$o = replace_macros(get_markup_template('menulist.tpl'),array(
'$title' => t('Manage Menus'),
'$menus' => $x,
@@ -57,7 +57,7 @@ function menu_content(&$a) {
'$hintcontent' => t('Edit menu contents'),
'$hintedit' => t('Edit this menu')
));
- }
+
return $o;
diff --git a/mod/message.php b/mod/message.php
index 9c6cf75a6..f5a60b73b 100644
--- a/mod/message.php
+++ b/mod/message.php
@@ -249,7 +249,7 @@ function message_content(&$a) {
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(true),
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
- '$nickname' => $channel['channel_addr'],
+ '$nickname' => $channel['channel_address'],
'$linkurl' => t('Please enter a link URL:')
));
@@ -293,6 +293,7 @@ function message_content(&$a) {
'$select' => $select,
'$parent' => '',
'$upload' => t('Upload photo'),
+ '$attach' => t('Attach file'),
'$insert' => t('Insert web link'),
'$wait' => t('Please wait'),
'$submit' => t('Submit')
@@ -371,10 +372,39 @@ function message_content(&$a) {
foreach($messages as $message) {
-// FIXME
-// $extracted = item_extract_images($message['body']);
-// if($extracted['images'])
-// $message['body'] = item_redir_and_replace_images($extracted['body'], $extracted['images'], $message['contact-id']);
+ $s = $arr = '';
+
+ if($message['attach'])
+ $arr = json_decode_plus($message['attach']);
+ if($arr) {
+ $s .= '<div class="body-attach">';
+ foreach($arr as $r) {
+ $matches = false;
+ $icon = '';
+ $icontype = substr($r['type'],0,strpos($r['type'],'/'));
+
+ switch($icontype) {
+ case 'video':
+ case 'audio':
+ case 'image':
+ case 'text':
+ $icon = '<div class="attachtype icon s22 type-' . $icontype . '"></div>';
+ break;
+ default:
+ $icon = '<div class="attachtype icon s22 type-unkn"></div>';
+ break;
+ }
+
+ $title = htmlentities($r['title'], ENT_COMPAT,'UTF-8');
+ if(! $title)
+ $title = t('unknown.???');
+ $title .= ' ' . $r['length'] . ' ' . t('bytes');
+
+ $url = $a->get_baseurl() . '/magic?f=&hash=' . $message['from_xchan'] . '&dest=' . $r['href'] . '/' . $r['revision'];
+ $s .= '<a href="' . $url . '" title="' . $title . '" class="attachlink" >' . $icon . '</a>';
+ }
+ $s .= '<div class="clear"></div></div>';
+ }
$mails[] = array(
'id' => $message['id'],
@@ -385,7 +415,7 @@ function message_content(&$a) {
'to_url' => chanlink_hash($message['to_xchan']),
'to_photo' => $message['to']['xchan_photo_m'],
'subject' => $message['title'],
- 'body' => smilies(bbcode($message['body'])),
+ 'body' => smilies(bbcode($message['body']) . $s),
'delete' => t('Delete message'),
'date' => datetime_convert('UTC',date_default_timezone_get(),$message['created'],'D, d M Y - g:i A'),
);
@@ -425,6 +455,7 @@ function message_content(&$a) {
'$select' => $select,
'$parent' => $parent,
'$upload' => t('Upload photo'),
+ '$attach' => t('Attach file'),
'$insert' => t('Insert web link'),
'$submit' => t('Submit'),
'$wait' => t('Please wait')
diff --git a/mod/network.php b/mod/network.php
index 413990ce2..e44a604de 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -104,23 +104,6 @@ function network_init(&$a) {
$a->page['aside'] .= saved_searches($search);
$a->page['aside'] .= fileas_widget($a->get_baseurl(true) . '/network',(x($_GET, 'file') ? $_GET['file'] : ''));
- $base = $a->get_baseurl();
-
- $a->page['htmlhead'] .= <<< EOT
-
-<script>$(document).ready(function() {
- var a;
- a = $("#search-text").autocomplete({
- serviceUrl: '$base/search_ac',
- minChars: 2,
- width: 350,
- });
-});
-</script>
-EOT;
-
-
-
}
function saved_searches($search) {
diff --git a/mod/search.php b/mod/search.php
index 1335ea508..38131f63f 100644
--- a/mod/search.php
+++ b/mod/search.php
@@ -59,7 +59,7 @@ function search_init(&$a) {
}
else {
unset($_SESSION['theme']);
- unset($_SESSION['mobile-theme']);
+ unset($_SESSION['mobile_theme']);
}
diff --git a/mod/settings.php b/mod/settings.php
index c39286ebc..2a3a64581 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -31,6 +31,8 @@ function settings_aside(&$a) {
$a->argv[] = 'channel';
}
+ $channel = $a->get_channel();
+
$abook_self_id = 0;
// Retrieve the 'self' address book entry for use in the auto-permissions link
@@ -101,6 +103,17 @@ function settings_aside(&$a) {
);
+
+ if(feature_enabled(local_user(),'premium_channel')) {
+ $tabs[] = array(
+ 'label' => t('Premium Channel Settings'),
+ 'url' => $a->get_baseurl(true) . '/connect/' . $channel['channel_address'],
+ 'selected' => ''
+ );
+
+ }
+
+
$tabtpl = get_markup_template("generic_links_widget.tpl");
$a->page['aside'] = replace_macros($tabtpl, array(
@@ -349,22 +362,23 @@ function settings_post(&$a) {
$post_joingroup = (($_POST['post_joingroup'] == 1) ? 1: 0);
$post_profilechange = (($_POST['post_profilechange'] == 1) ? 1: 0);
+
$arr = array();
- $arr['channel_r_stream'] = (($_POST['view_stream']) ? $_POST['view_stream'] : 0);
- $arr['channel_r_profile'] = (($_POST['view_profile']) ? $_POST['view_profile'] : 0);
- $arr['channel_r_photos'] = (($_POST['view_photos']) ? $_POST['view_photos'] : 0);
- $arr['channel_r_abook'] = (($_POST['view_contacts']) ? $_POST['view_contacts'] : 0);
- $arr['channel_w_stream'] = (($_POST['send_stream']) ? $_POST['send_stream'] : 0);
- $arr['channel_w_wall'] = (($_POST['post_wall']) ? $_POST['post_wall'] : 0);
- $arr['channel_w_tagwall'] = (($_POST['tag_deliver']) ? $_POST['tag_deliver'] : 0);
- $arr['channel_w_comment'] = (($_POST['post_comments']) ? $_POST['post_comments'] : 0);
- $arr['channel_w_mail'] = (($_POST['post_mail']) ? $_POST['post_mail'] : 0);
- $arr['channel_w_photos'] = (($_POST['post_photos']) ? $_POST['post_photos'] : 0);
- $arr['channel_w_chat'] = (($_POST['chat']) ? $_POST['chat'] : 0);
- $arr['channel_a_delegate'] = (($_POST['delegate']) ? $_POST['delegate'] : 0);
- $arr['channel_r_storage'] = (($_POST['view_storage']) ? $_POST['view_storage'] : 0);
- $arr['channel_w_storage'] = (($_POST['write_storage']) ? $_POST['write_storage'] : 0);
- $arr['channel_r_pages'] = (($_POST['view_pages']) ? $_POST['view_pages'] : 0);
+ $arr['channel_r_stream'] = (($_POST['view_stream']) ? $_POST['view_stream'] : 0);
+ $arr['channel_r_profile'] = (($_POST['view_profile']) ? $_POST['view_profile'] : 0);
+ $arr['channel_r_photos'] = (($_POST['view_photos']) ? $_POST['view_photos'] : 0);
+ $arr['channel_r_abook'] = (($_POST['view_contacts']) ? $_POST['view_contacts'] : 0);
+ $arr['channel_w_stream'] = (($_POST['send_stream']) ? $_POST['send_stream'] : 0);
+ $arr['channel_w_wall'] = (($_POST['post_wall']) ? $_POST['post_wall'] : 0);
+ $arr['channel_w_tagwall'] = (($_POST['tag_deliver']) ? $_POST['tag_deliver'] : 0);
+ $arr['channel_w_comment'] = (($_POST['post_comments']) ? $_POST['post_comments'] : 0);
+ $arr['channel_w_mail'] = (($_POST['post_mail']) ? $_POST['post_mail'] : 0);
+ $arr['channel_w_photos'] = (($_POST['post_photos']) ? $_POST['post_photos'] : 0);
+ $arr['channel_w_chat'] = (($_POST['chat']) ? $_POST['chat'] : 0);
+ $arr['channel_a_delegate'] = (($_POST['delegate']) ? $_POST['delegate'] : 0);
+ $arr['channel_r_storage'] = (($_POST['view_storage']) ? $_POST['view_storage'] : 0);
+ $arr['channel_w_storage'] = (($_POST['write_storage']) ? $_POST['write_storage'] : 0);
+ $arr['channel_r_pages'] = (($_POST['view_pages']) ? $_POST['view_pages'] : 0);
$arr['channel_w_pages'] = (($_POST['write_pages']) ? $_POST['write_pages'] : 0);
$defperms = 0;
@@ -783,7 +797,7 @@ function settings_content(&$a) {
$default_theme = get_config('system','theme');
if(! $default_theme)
$default_theme = 'default';
- $default_mobile_theme = get_config('system','mobile-theme');
+ $default_mobile_theme = get_config('system','mobile_theme');
if(! $mobile_default_theme)
$mobile_default_theme = 'none';
@@ -817,7 +831,7 @@ function settings_content(&$a) {
}
}
$theme_selected = (!x($_SESSION,'theme')? $default_theme : $_SESSION['theme']);
- $mobile_theme_selected = (!x($_SESSION,'mobile-theme')? $default_mobile_theme : $_SESSION['mobile-theme']);
+ $mobile_theme_selected = (!x($_SESSION,'mobile_theme')? $default_mobile_theme : $_SESSION['mobile_theme']);
$browser_update = intval(get_pconfig(local_user(), 'system','update_interval'));
$browser_update = (($browser_update == 0) ? 40 : $browser_update / 1000); // default if not set: 40 seconds
diff --git a/mod/toggle_mobile.php b/mod/toggle_mobile.php
index 00991e44c..06dadca04 100644
--- a/mod/toggle_mobile.php
+++ b/mod/toggle_mobile.php
@@ -3,9 +3,9 @@
function toggle_mobile_init(&$a) {
if(isset($_GET['off']))
- $_SESSION['show-mobile'] = false;
+ $_SESSION['show_mobile'] = false;
else
- $_SESSION['show-mobile'] = true;
+ $_SESSION['show_mobile'] = true;
if(isset($_GET['address']))
$address = $_GET['address'];
diff --git a/mod/zfinger.php b/mod/zfinger.php
index cf61233ad..320f0ca71 100644
--- a/mod/zfinger.php
+++ b/mod/zfinger.php
@@ -71,6 +71,8 @@ function zfinger_init(&$a) {
$id = $e['channel_id'];
+ $special_channel = (($e['channel_pageflags'] & PAGE_PREMIUM) ? true : false);
+
$searchable = (($e['channel_pageflags'] & PAGE_HIDDEN) ? false : true);
if($e['xchan_flags'] & XCHAN_FLAGS_HIDDEN)
$searchable = false;
@@ -134,6 +136,16 @@ function zfinger_init(&$a) {
$ret['searchable'] = $searchable;
+ // premium or other channel desiring some contact with potential followers before connecting.
+ // This is a template - %s will be replaced with the follow_url we discover for the return channel.
+
+ if($special_channel)
+ $ret['connect_url'] = z_root() . '/connect/' . $e['channel_address'];
+
+ // This is a template for our follow url, %s will be replaced with a webbie
+
+ $ret['follow_url'] = z_root() . '/follow?f=&url=%s';
+
$permissions = get_all_perms($e['channel_id'],(($ztarget && $zsig)
? base64url_encode(hash('whirlpool',$ztarget . $zsig,true))
: '' ),false);