From 9de5b6b9053023d72901c3492e602dcae69c7cc6 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Mon, 29 Sep 2014 15:13:39 +0100 Subject: [PATCH 1/6] Pluggable page templates --- include/conversation.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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')), From 018f1b813cffaef849652a7d287169f01defef68 Mon Sep 17 00:00:00 2001 From: Paolo Tacconi Date: Tue, 30 Sep 2014 12:24:49 +0200 Subject: [PATCH 2/6] Added mod returning a list of known hubs, for a lightweight hub crawler --- mod/knownhubs.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 mod/knownhubs.php diff --git a/mod/knownhubs.php b/mod/knownhubs.php new file mode 100644 index 000000000..9993d8e50 --- /dev/null +++ b/mod/knownhubs.php @@ -0,0 +1,22 @@ +argv[1]=="json"){ + $known_hubs = array(); + $r = q("SELECT s.site_url FROM site as s group by s.site_url"); + + if(count($r)) { + foreach($r as $rr) { + $known_hubs[] = $rr['site_url']; + } + } + sort($known_hubs); + + $data = Array( + 'knownhubs' => $known_hubs, + ); + json_return_and_die($data); + } + +} From 1cc5babd39259409558a3be1bf206bc38bc9ca56 Mon Sep 17 00:00:00 2001 From: Paolo Tacconi Date: Tue, 30 Sep 2014 13:30:04 +0200 Subject: [PATCH 3/6] added directory status to siteinfo --- mod/siteinfo.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/siteinfo.php b/mod/siteinfo.php index 4568906f3..eab52e41e 100644 --- a/mod/siteinfo.php +++ b/mod/siteinfo.php @@ -4,7 +4,8 @@ function siteinfo_init(&$a) { if ($a->argv[1]=="json"){ $register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN'); - + $directory_mode = Array('DIRECTORY_MODE_NORMAL', 'DIRECTORY_MODE_SECONDARY','DIRECTORY_MODE_PRIMARY', 'DIRECTORY_MODE_STANDALONE'); + $sql_extra = ''; $r = q("select * from channel left join account on account_id = channel_account_id where ( account_roles & 4096 ) and account_default_channel = channel_id"); @@ -100,6 +101,7 @@ function siteinfo_init(&$a) { 'url' => z_root(), 'plugins' => $visible_plugins, 'register_policy' => $register_policy[$a->config['system']['register_policy']], + 'directory_mode' => $directory_mode[$a->config['system']['directory_mode']], 'diaspora_emulation' => get_config('system','diaspora_enabled'), 'rss_connections' => get_config('system','feed_contacts'), 'default_service_restrictions' => $service_class, From bfeac3670295781fac471d45a4efe8ee25f61083 Mon Sep 17 00:00:00 2001 From: Paolo Tacconi Date: Tue, 30 Sep 2014 13:32:08 +0200 Subject: [PATCH 4/6] useless file: knownhubs --- mod/knownhubs.php | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 mod/knownhubs.php diff --git a/mod/knownhubs.php b/mod/knownhubs.php deleted file mode 100644 index 9993d8e50..000000000 --- a/mod/knownhubs.php +++ /dev/null @@ -1,22 +0,0 @@ -argv[1]=="json"){ - $known_hubs = array(); - $r = q("SELECT s.site_url FROM site as s group by s.site_url"); - - if(count($r)) { - foreach($r as $rr) { - $known_hubs[] = $rr['site_url']; - } - } - sort($known_hubs); - - $data = Array( - 'knownhubs' => $known_hubs, - ); - json_return_and_die($data); - } - -} From 49b351d86ac96f956710061296857ce70d75bbec Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Tue, 30 Sep 2014 21:08:09 +0100 Subject: [PATCH 5/6] Couple of site specific files missing from gitignore --- .gitignore | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index 80fe3ec72..ca5cacd24 100755 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ composer.* #ignore documentation, it should be newly built doc/api +doc/sitetis #ignore reports, should be generted with every build report/ @@ -41,3 +42,9 @@ nbproject #Kdevelop project files *.kdev4 + +# Ignore site TOS +doc/SiteTOS.md + +#Ingore site theme schemas +view/theme/redbasic/schema/default.php From 1a4a248a26940dc108592c7b5f279a961d31f055 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Tue, 30 Sep 2014 21:09:11 +0100 Subject: [PATCH 6/6] A...typo? Relic of some kind. --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index ca5cacd24..df7ca3549 100755 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,6 @@ composer.* #ignore documentation, it should be newly built doc/api -doc/sitetis #ignore reports, should be generted with every build report/