From c0b59ae36a5ef31b9071edb991f63d4800e21a9d Mon Sep 17 00:00:00 2001 From: habeascodice Date: Sun, 28 Sep 2014 19:30:47 -0700 Subject: Typo in regex causes runtime error --- include/identity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/identity.php b/include/identity.php index eaeb9f07f..b99bbe9c9 100644 --- a/include/identity.php +++ b/include/identity.php @@ -364,7 +364,7 @@ function create_identity($arr) { if($role_permissions) { set_pconfig($newuid,'system','permissions_role',$arr['permissions_role']); if(array_key_exists('online',$role_permissions)) - set_pconfig('system','hide_presence',1-intval($role_permissions['online'])); + set_pconfig($newuid,'system','hide_presence',1-intval($role_permissions['online'])); } // Create a group with yourself as a member. This allows somebody to use it -- cgit v1.2.3 From 9de5b6b9053023d72901c3492e602dcae69c7cc6 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Mon, 29 Sep 2014 15:13:39 +0100 Subject: Pluggable page templates --- include/conversation.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/conversation.php b/include/conversation.php index b0a388a68..92ba18d13 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1341,8 +1341,10 @@ function prepare_page($item) { // the template will get passed an unobscured title. $body = prepare_body($item,true); - - return replace_macros(get_markup_template('page_display.tpl'),array( + $tpl = get_pconfig($item['uid'],'system','pagetemplate'); + if (! $tpl) + $tpl = 'page_display.tpl'; + return replace_macros(get_markup_template($tpl),array( '$author' => (($naked) ? '' : $item['author']['xchan_name']), '$auth_url' => (($naked) ? '' : zid($item['author']['xchan_url'])), '$date' => (($naked) ? '' : datetime_convert('UTC',date_default_timezone_get(),$item['created'],'Y-m-d H:i')), -- cgit v1.2.3 From 90378e8ef8647807a348541a65a908da6656ce1b Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Mon, 29 Sep 2014 19:06:43 +0100 Subject: Silence insanely noisy log - should probably stick this in a dlogger if we need it - we're getting literally hundreds of thousands of these. --- include/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/config.php b/include/config.php index a77801717..3292059d1 100644 --- a/include/config.php +++ b/include/config.php @@ -248,7 +248,7 @@ function load_pconfig($uid) { * @return mixed Stored value or false if it does not exist */ function get_pconfig($uid, $family, $key, $instore = false) { - logger('include/config.php: get_pconfig() deprecated instore param used', LOGGER_DEBUG); +// logger('include/config.php: get_pconfig() deprecated instore param used', LOGGER_DEBUG); global $a; if($uid === false) -- cgit v1.2.3 From 5292e3a100dd8da20865167e59f859a528676df7 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 29 Sep 2014 21:58:35 -0700 Subject: implement a "powered-by" but leave it turned off until somebody with a good eye for layout can figure out where best to put it. --- include/Contact.php | 13 +++++++++++++ include/nav.php | 7 +++++++ 2 files changed, 20 insertions(+) (limited to 'include') diff --git a/include/Contact.php b/include/Contact.php index 8d50b1e5b..4440369dc 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -328,6 +328,19 @@ function mark_orphan_hubsxchans() { intval(HUBLOC_OFFLINE) ); +// $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) +// ); +// } +// 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 hubloc_id, hubloc_hash from hubloc where (hubloc_status & %d) and not (hubloc_flags & %d)", intval(HUBLOC_OFFLINE), intval(HUBLOC_FLAGS_ORPHANCHECK) diff --git a/include/nav.php b/include/nav.php index 98d1b644e..c35466412 100644 --- a/include/nav.php +++ b/include/nav.php @@ -239,6 +239,12 @@ EOT; $x = array('nav' => $nav, 'usermenu' => $userinfo ); call_hooks('nav', $x); +// Not sure the best place to put this on the page. So I'm implementing it but leaving it +// turned off until somebody discovers this and figures out a good location for it. +$powered_by = ''; + +// $powered_by = 'redr#matrix'; + $tpl = get_markup_template('nav.tpl'); $a->page['nav'] .= replace_macros($tpl, array( @@ -250,6 +256,7 @@ EOT; '$userinfo' => $x['usermenu'], '$localuser' => local_user(), '$sel' => $a->nav_sel, + '$powered_by' => $powered_by, '$pleasewait' => t('Please wait...') )); -- cgit v1.2.3 From f8468b4c3aeeb51f485c6bb7107f5b64a9643c85 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 29 Sep 2014 23:36:41 -0700 Subject: allow custom role permissions and fix site timezone. --- include/cli_startup.php | 6 +++++- include/permissions.php | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/cli_startup.php b/include/cli_startup.php index 6bd4e7520..f90a75cd1 100644 --- a/include/cli_startup.php +++ b/include/cli_startup.php @@ -6,7 +6,7 @@ require_once('boot.php'); function cli_startup() { - global $a, $db; + global $a, $db, $default_timezone; if(is_null($a)) { $a = new App; @@ -14,6 +14,10 @@ function cli_startup() { if(is_null($db)) { @include(".htconfig.php"); + + $a->timezone = ((x($default_timezone)) ? $default_timezone : 'UTC'); + date_default_timezone_set($a->timezone); + require_once('include/dba/dba_driver.php'); $db = dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data); unset($db_host, $db_port, $db_user, $db_pass, $db_data); diff --git a/include/permissions.php b/include/permissions.php index 438b807d0..61ac8aea3 100644 --- a/include/permissions.php +++ b/include/permissions.php @@ -722,6 +722,11 @@ function get_role_perms($role) { } + $x = get_config('system','role_perms'); + // let system settings over-ride any or all + if($x && is_array($x) && array_key_exists($role,$x)) + $ret = array_merge($ret,$x[$role]); + call_hooks('get_role_perms',$ret); return $ret; -- cgit v1.2.3 From cb44d015f3c3b0f0a8835d4391d5cea0041d1eed Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 30 Sep 2014 21:30:27 -0700 Subject: allow site specific templates, css, js, whatever --- include/plugin.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/plugin.php b/include/plugin.php index c2e08a989..4f9ab71da 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -552,6 +552,7 @@ function theme_include($file, $root = '') { $paths = array( "{$root}view/theme/$theme/$ext/$file", "{$root}view/theme/$parent/$ext/$file", + "{$root}view/site/$ext/$file", "{$root}view/$ext/$file", ); -- cgit v1.2.3 From f19d718631675d38efca1741f46bf0916af72a65 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 30 Sep 2014 23:41:50 -0700 Subject: that's why remove_obsolete_hublocs() isn't telling anybody when it does its thing, I forgot to uncomment the bit that tells everybody after I tested it. I needed extensive testing to make sure we didn't accidentally wipe out all hublocs everywhere. Testing went fine so I just assumed it was all working as planned; but went back today to find out why I wasn't told of a recent change. --- include/hubloc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/hubloc.php b/include/hubloc.php index cdc9de4af..fded434d2 100644 --- a/include/hubloc.php +++ b/include/hubloc.php @@ -105,9 +105,9 @@ function remove_obsolete_hublocs() { dbesc($rr['hubloc_hash']) ); if($x) { -// proc_run('php','include/notifier.php','location',$x[0]['channel_id']); -// if($interval) -// @time_sleep_until(microtime(true) + (float) $interval); + proc_run('php','include/notifier.php','location',$x[0]['channel_id']); + if($interval) + @time_sleep_until(microtime(true) + (float) $interval); } } } -- cgit v1.2.3