From 3e5b9e97e74528b721ecd61b19c32e6d45e0f426 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 4 Dec 2013 23:46:51 +0100 Subject: [PATCH 1/2] New "minimal" mode for displaying the network content. Preparation for e.g. a multicolumn layout. --- index.php | 25 ++++++++++++++++++------- view/minimal.php | 2 +- view/theme/vier/style.css | 6 ++++++ 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/index.php b/index.php index 87795ade7..a1e3282c3 100644 --- a/index.php +++ b/index.php @@ -428,7 +428,7 @@ else $a->page['htmlhead'] = str_replace('{{$stylesheet}}',$stylesheet,$a->page['htmlhead']); //$a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array('$stylesheet' => $stylesheet)); -if ($_GET["mode"] == "raw") { +if (($_GET["mode"] == "raw") OR ($_GET["mode"] == "minimal")) { $doc = new DOMDocument(); $target = new DOMDocument(); @@ -449,6 +449,9 @@ if ($_GET["mode"] == "raw") { // And then append it to the target $target->documentElement->appendChild($item); } +} + +if ($_GET["mode"] == "raw") { header("Content-type: text/html; charset=utf-8"); @@ -515,13 +518,21 @@ $profile = $a->profile; header("Content-type: text/html; charset=utf-8"); -$template = 'view/theme/' . current_theme() . '/' - . ((x($a->page,'template')) ? $a->page['template'] : 'default' ) . '.php'; -if(file_exists($template)) - require_once($template); -else - require_once(str_replace('theme/' . current_theme() . '/', '', $template)); +if ($_GET["mode"] == "minimal") { + //$page['content'] = substr($target->saveHTML(), 6, -8)."\n\n". + // '
'."\n\n"; + + require "view/minimal.php"; +} else { + $template = 'view/theme/' . current_theme() . '/' + . ((x($a->page,'template')) ? $a->page['template'] : 'default' ) . '.php'; + + if(file_exists($template)) + require_once($template); + else + require_once(str_replace('theme/' . current_theme() . '/', '', $template)); +} session_write_close(); exit; diff --git a/view/minimal.php b/view/minimal.php index a8c693985..a131e3ec5 100644 --- a/view/minimal.php +++ b/view/minimal.php @@ -6,7 +6,7 @@ -
+
diff --git a/view/theme/vier/style.css b/view/theme/vier/style.css index f3379fe61..d340f12d6 100644 --- a/view/theme/vier/style.css +++ b/view/theme/vier/style.css @@ -1088,6 +1088,12 @@ section { position: absolute; left: 215px; } + +section.minimal { + top: 0px; + left: 0px; +} + /* wall item */ .tread-wrapper { /* border-bottom: 1px solid #BDCDD4; */ From 285584e8d67feb8d1b75253ecd9b8358eb7fd9ac Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 5 Dec 2013 20:41:30 +0100 Subject: [PATCH 2/2] Minimal: Disable loading of content at the end of the page, since it makes problems at the moment. --- index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index a1e3282c3..98c7bce11 100644 --- a/index.php +++ b/index.php @@ -460,7 +460,8 @@ if ($_GET["mode"] == "raw") { session_write_close(); exit; -} elseif (get_pconfig(local_user(),'system','infinite_scroll') AND ($_GET["q"] == "network")) { +} elseif (get_pconfig(local_user(),'system','infinite_scroll') + AND ($_GET["q"] == "network") AND ($_GET["mode"] != "minimal")) { if (is_string($_GET["page"])) $pageno = $_GET["page"]; else