diff options
author | Paolo Tacconi <p.tacconi@giunti.it> | 2014-09-15 10:01:25 +0200 |
---|---|---|
committer | Paolo Tacconi <p.tacconi@giunti.it> | 2014-09-15 10:01:25 +0200 |
commit | 4f793069bf4aafcfe77d50e47690173104ef23c7 (patch) | |
tree | 7fe1bfcb18672300bf14967338690ea4fa51e640 /mod | |
parent | ed7f3001c1c1deec5076ae12114e5c42865b6251 (diff) | |
parent | 58aad83e5cb0edaf1ccc543147030e782c5e7ba9 (diff) | |
download | volse-hubzilla-4f793069bf4aafcfe77d50e47690173104ef23c7.tar.gz volse-hubzilla-4f793069bf4aafcfe77d50e47690173104ef23c7.tar.bz2 volse-hubzilla-4f793069bf4aafcfe77d50e47690173104ef23c7.zip |
Merge branch 'master' of https://github.com/friendica/red
Diffstat (limited to 'mod')
-rw-r--r-- | mod/admin.php | 6 | ||||
-rw-r--r-- | mod/home.php | 47 | ||||
-rw-r--r-- | mod/post.php | 4 | ||||
-rw-r--r-- | mod/settings.php | 15 | ||||
-rw-r--r-- | mod/siteinfo.php | 8 | ||||
-rw-r--r-- | mod/webpages.php | 2 | ||||
-rw-r--r-- | mod/xchan.php | 16 | ||||
-rw-r--r-- | mod/zfinger.php | 23 |
8 files changed, 67 insertions, 54 deletions
diff --git a/mod/admin.php b/mod/admin.php index 5bb97d158..836b12281 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -239,7 +239,7 @@ function admin_page_site_post(&$a){ $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'])) : ''); +// $site_channel = ((x($_POST,'site_channel')) ? notags(trim($_POST['site_channel'])) : ''); $maximagesize = ((x($_POST,'maximagesize')) ? intval(trim($_POST['maximagesize'])) : 0); @@ -304,7 +304,7 @@ function admin_page_site_post(&$a){ 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); @@ -426,7 +426,7 @@ function admin_page_site(&$a) { '$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")), +// '$site_channel' => array('site_channel', t("Channel to use for this website's static pages"), get_config('system','site_channel'), t("Site Channel")), '$diaspora_enabled' => array('diaspora_enabled',t('Enable Diaspora Protocol'), get_config('system','diaspora_enabled'), t('Communicate with Diaspora and Friendica - experimental')), '$feed_contacts' => array('feed_contacts', t('Allow Feeds as Connections'),get_config('system','feed_contacts'),t('(Heavy system resource usage)')), '$maximagesize' => array('maximagesize', t("Maximum image size"), intval(get_config('system','maximagesize')), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")), diff --git a/mod/home.php b/mod/home.php index bc352976d..576213e06 100644 --- a/mod/home.php +++ b/mod/home.php @@ -39,10 +39,29 @@ function home_content(&$a) { if(x($_SESSION,'mobile_theme')) unset($_SESSION['mobile_theme']); - $channel_address = get_config("system", "site_channel" ); - if ($channel_address){ - // We can do better, but until we figure out auto-linkification, let's keep things simple + if(get_config('system','projecthome')) { + $o .= file_get_contents('assets/home.html'); + $a->page['template'] = 'full'; + $a->page['title'] = t('Red Matrix - "The Network"'); + return $o; + } + + +// Deprecated + $channel_address = get_config("system", "site_channel" ); + +// See if the sys channel set a homepage + if (! $channel_address) { + $u = get_sys_channel(); + if ($u) { + $u = array($u); + // change to channel_id when below deprecated and skip the $u=... + $channel_address = $u[0]['channel_address']; + } + } + + if ($channel_address){ $page_id = 'home'; @@ -50,11 +69,6 @@ function home_content(&$a) { dbesc($channel_address) ); - if(! $u) { - notice( t('Channel not found.') . EOL); - return; - } - $r = q("select item.* from item left join item_id on item.id = item_id.iid where item.uid = %d and sid = '%s' and service = 'WEBPAGE' and item_restrict = %d limit 1", @@ -63,31 +77,24 @@ function home_content(&$a) { intval(ITEM_WEBPAGE) ); - if(! $r) { - notice( t('Item not found.') . EOL); - return; - } - + if($r) { xchan_query($r); $r = fetch_post_tags($r,true); $a->profile = array('profile_uid' => $u[0]['channel_id']); $o .= prepare_page($r[0]); return $o; - } + } - if(get_config('system','projecthome')) { - $o .= file_get_contents('assets/home.html'); - $a->page['template'] = 'full'; - $a->page['title'] = t('Red Matrix - "The Network"'); - return $o; } +// Nope, we didn't find an item. Let's see if there's any html + if(file_exists('home.html')) { $o .= file_get_contents('home.html'); } else { - // If there's no site channel or home contents configured, fallback to the old behaviour + // If there's nothing special happening, just spit out a login box $sitename = get_config('system','sitename'); if($sitename) diff --git a/mod/post.php b/mod/post.php index 3b4f66baf..d62233ca1 100644 --- a/mod/post.php +++ b/mod/post.php @@ -415,8 +415,8 @@ function post_init(&$a) { * } *} * - * Currently defined message types are 'activity', 'mail', 'profile' and 'channel_sync', which each have - * different content schemas. + * Currently defined message types are 'activity', 'mail', 'profile', 'location' and 'channel_sync', + * which each have different content schemas. * * Ping packet: * A ping packet does not require any parameters except the type. It may or may not be encrypted. diff --git a/mod/settings.php b/mod/settings.php index 5038a63c4..f9568feb3 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -136,7 +136,8 @@ function settings_post(&$a) { $theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : $a->channel['channel_theme']); $mobile_theme = ((x($_POST,'mobile_theme')) ? notags(trim($_POST['mobile_theme'])) : ''); $user_scalable = ((x($_POST,'user_scalable')) ? intval($_POST['user_scalable']) : 0); - $nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile']) : 0); + $nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile']) : 0); + $title_tosource = ((x($_POST,'title_tosource')) ? intval($_POST['title_tosource']) : 0); $browser_update = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0); $browser_update = $browser_update * 1000; if($browser_update < 10000) @@ -156,6 +157,7 @@ function settings_post(&$a) { set_pconfig(local_user(),'system','update_interval', $browser_update); set_pconfig(local_user(),'system','itemspage', $itemspage); set_pconfig(local_user(),'system','no_smilies',$nosmile); + set_pconfig(local_user(),'system','title_tosource',$title_tosource); // set_pconfig(local_user(),'system','chanview_full',$chanview_full); @@ -589,10 +591,9 @@ function settings_content(&$a) { if((argc() > 1) && (argv(1) === 'featured')) { $settings_addons = ""; - $r = q("SELECT * FROM `hook` WHERE `hook` = 'plugin_settings' "); - // FIXME: This is always 0, even if there are plugin settings on this page - // if(! count($r)) - // $settings_addons = t('No feature settings configured'); + $r = q("SELECT * FROM `hook` WHERE `hook` = 'feature_settings' "); + if(! count($r)) + $settings_addons = t('No feature settings configured'); call_hooks('feature_settings', $settings_addons); @@ -743,6 +744,9 @@ function settings_content(&$a) { $nosmile = get_pconfig(local_user(),'system','no_smilies'); $nosmile = (($nosmile===false)? '0': $nosmile); // default if not set: 0 + $title_tosource = get_pconfig(local_user(),'system','title_tosource'); + $title_tosource = (($title_tosource===false)? '0': $title_tosource); // default if not set: 0 + $theme_config = ""; if( ($themeconfigfile = get_theme_config_file($theme_selected)) != null){ require_once($themeconfigfile); @@ -763,6 +767,7 @@ function settings_content(&$a) { '$ajaxint' => array('browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds, no maximum')), '$itemspage' => array('itemspage', t("Maximum number of conversations to load at any time:"), $itemspage, t('Maximum of 100 items')), '$nosmile' => array('nosmile', t("Don't show emoticons"), $nosmile, ''), + '$title_tosource' => array('title_tosource', t("Link post titles to source"), $title_tosource, ''), '$layout_editor' => t('System Page Layout Editor - (advanced)'), '$theme_config' => $theme_config, '$expert' => feature_enabled(local_user(),'expert'), diff --git a/mod/siteinfo.php b/mod/siteinfo.php index 061989413..01355a51d 100644 --- a/mod/siteinfo.php +++ b/mod/siteinfo.php @@ -13,7 +13,13 @@ function siteinfo_init(&$a) { if($r) { $admin = array(); foreach($r as $rr) { - $admin[] = array( 'name' => $rr['channel_name'], 'address' => $rr['channel_address'] . '@' . get_app()->get_hostname(), 'channel' => z_root() . '/channel/' . $rr['channel_address']); + if($rr['channel_pageflags'] & PAGE_HUBADMIN) + $admin[] = array( 'name' => $rr['channel_name'], 'address' => $rr['channel_address'] . '@' . get_app()->get_hostname(), 'channel' => z_root() . '/channel/' . $rr['channel_address']); + } + if(! $admin) { + foreach($r as $rr) { + $admin[] = array( 'name' => $rr['channel_name'], 'address' => $rr['channel_address'] . '@' . get_app()->get_hostname(), 'channel' => z_root() . '/channel/' . $rr['channel_address']); + } } } else { diff --git a/mod/webpages.php b/mod/webpages.php index 1b906a97f..efaf3c4bf 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -46,7 +46,7 @@ function webpages_content(&$a) { // } - if(feature_enabled($owner,'expert_mode')) { + if(feature_enabled($owner,'expert')) { $mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_pconfig($owner,'system','page_mimetype')); if(! $mimetype) $mimetype = 'choose'; diff --git a/mod/xchan.php b/mod/xchan.php index 9d4cdcc22..e51cc53cc 100644 --- a/mod/xchan.php +++ b/mod/xchan.php @@ -15,16 +15,28 @@ function xchan_content(&$a) { if(x($_GET,'addr')) { $addr = trim($_GET['addr']); - $r = q("select xchan_name from xchan where xchan_hash like '%s%%'", + $r = q("select * from xchan where xchan_hash like '%s%%'", dbesc($addr) ); if($r) { foreach($r as $rr) - $o .= $rr['xchan_name'] . EOL; + $o .= str_replace("\n","<br />",print_r($rr,true)) . EOL; } else notice( t('Not found.') . EOL); + + $r = q("select * from hubloc where hubloc_hash like '%s%%'", + dbesc($addr) + ); + + if($r) { + foreach($r as $rr) + $o .= str_replace("\n","<br />",print_r($rr,true)) . EOL; + + } + + } return $o; } diff --git a/mod/zfinger.php b/mod/zfinger.php index 1226f74fe..666f141ec 100644 --- a/mod/zfinger.php +++ b/mod/zfinger.php @@ -208,28 +208,11 @@ function zfinger_init(&$a) { if($permissions['view_profile']) $ret['profile'] = $profile; - // array of (verified) hubs this channel uses - $ret['locations'] = array(); - - $x = zot_get_hublocs($e['channel_hash']); - if($x && count($x)) { - foreach($x as $hub) { - if(! ($hub['hubloc_flags'] & HUBLOC_FLAGS_UNVERIFIED)) { - $ret['locations'][] = array( - 'host' => $hub['hubloc_host'], - 'address' => $hub['hubloc_addr'], - 'primary' => (($hub['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) ? true : false), - 'url' => $hub['hubloc_url'], - 'url_sig' => $hub['hubloc_url_sig'], - 'callback' => $hub['hubloc_callback'], - 'sitekey' => $hub['hubloc_sitekey'], - 'deleted' => (($hub['hubloc_flags'] & HUBLOC_FLAGS_DELETED) ? true : false) - ); - } - } - } + $x = zot_encode_locations($e); + if($x) + $ret['locations'] = $x; $ret['site'] = array(); $ret['site']['url'] = z_root(); |