aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-12-09 13:30:54 -0800
committerfriendica <info@friendica.com>2013-12-09 13:30:54 -0800
commit3c19d9aed213b28f1c07809c193f98759b09cbf7 (patch)
tree1f145aea163d6f80f6874fd5fb13b9a14945fe6d
parent7459d2c9e33290b27982e2be66d9a2b7a607715a (diff)
parentc20f207cde7c4bfcfc856542cffe7db273694c6e (diff)
downloadvolse-hubzilla-3c19d9aed213b28f1c07809c193f98759b09cbf7.tar.gz
volse-hubzilla-3c19d9aed213b28f1c07809c193f98759b09cbf7.tar.bz2
volse-hubzilla-3c19d9aed213b28f1c07809c193f98759b09cbf7.zip
Merge pull request #233 from zzottel/master
First JS-less steps
-rwxr-xr-xindex.php6
-rw-r--r--mod/channel.php10
2 files changed, 13 insertions, 3 deletions
diff --git a/index.php b/index.php
index 1953dd5cd..adfa6534f 100755
--- a/index.php
+++ b/index.php
@@ -245,6 +245,12 @@ if (file_exists($theme_info_file)){
if(! x($a->page,'content'))
$a->page['content'] = '';
+/* set JS cookie */
+if($_COOKIE['jsAvailable'] != 1) {
+ $a->page['content'] .= '<script>document.cookie="jsAvailable=1; path=/"; location.reload();</script>';
+}
+
+
if(! $install)
call_hooks('page_content_top',$a->page['content']);
diff --git a/mod/channel.php b/mod/channel.php
index 2014cd08b..7879f72ee 100644
--- a/mod/channel.php
+++ b/mod/channel.php
@@ -189,7 +189,7 @@ function channel_content(&$a, $update = 0, $load = false) {
$a->set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20));
$pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage']));
- if($load) {
+ if($load || ($_COOKIE['jsAvailable'] != 1)) {
$r = q("SELECT distinct id AS item_id FROM item
left join abook on item.author_xchan = abook.abook_xchan
WHERE uid = %d AND item_restrict = 0
@@ -281,9 +281,13 @@ function channel_content(&$a, $update = 0, $load = false) {
}
- $o .= conversation($a,$items,'channel',$update,'client');
+ if($_COOKIE['jsAvailable'] == 1) {
+ $o .= conversation($a,$items,'channel',$update,'client');
+ } else {
+ $o .= conversation($a,$items,'channel',$update,'traditional');
+ }
- if(! $update)
+ if((! $update) || ($_COOKIE['jsAvailable'] != 1))
$o .= alt_pager($a,count($items));
return $o;