]> git.mxchange.org Git - friendica.git/blobdiff - index.php
rev update
[friendica.git] / index.php
index 87795ade700acd49faa38bfdadfcfc7609abb408..26bc800f7865dc3b77d29ab979998f65f1a14e4c 100644 (file)
--- 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");
 
@@ -457,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
@@ -467,7 +471,11 @@ if ($_GET["mode"] == "raw") {
 
        foreach ($_GET AS $param => $value)
                if (($param != "page") AND ($param != "q"))
-                       $reload_uri .= "&".$param."=".$value;
+                       $reload_uri .= "&".$param."=".urlencode($value);
+
+       if (($a->page_offset != "") AND !strstr($reload_uri, "&offset="))
+               $reload_uri .= "&offset=".urlencode($a->page_offset);
+
 
 $a->page['htmlhead'] .= <<< EOT
 <script type="text/javascript">
@@ -515,13 +523,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".
+       //                      '<div id="conversation-end"></div>'."\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;