diff options
author | friendica <info@friendica.com> | 2011-12-11 20:32:43 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2011-12-11 20:32:43 -0800 |
commit | 4f254ffb5b4a74482c6d70dc1858f20c13ee8c01 (patch) | |
tree | c043caef2b9510b2eaeecb093b3adc6f3826c395 | |
parent | 834639ebab3daded63c3ed076273e69b798ced90 (diff) | |
download | volse-hubzilla-4f254ffb5b4a74482c6d70dc1858f20c13ee8c01.tar.gz volse-hubzilla-4f254ffb5b4a74482c6d70dc1858f20c13ee8c01.tar.bz2 volse-hubzilla-4f254ffb5b4a74482c6d70dc1858f20c13ee8c01.zip |
system support for personal configurable ajax update interval
-rw-r--r-- | boot.php | 7 | ||||
-rw-r--r-- | index.php | 16 | ||||
-rw-r--r-- | js/main.js | 2 | ||||
-rw-r--r-- | view/head.tpl | 2 |
4 files changed, 19 insertions, 8 deletions
@@ -422,6 +422,10 @@ class App { } function init_pagehead() { + $interval = ((local_user()) ? get_pconfig(local_user(),'system','update_interval') : 30000); + if($interval < 10000) + $interval = 30000; + $this->page['title'] = $this->config['sitename']; $tpl = file_get_contents('view/head.tpl'); $this->page['htmlhead'] = replace_macros($tpl,array( @@ -430,7 +434,8 @@ class App { '$delitem' => t('Delete this item?'), '$comment' => t('Comment'), '$showmore' => t('show more'), - '$showfewer' => t('show fewer') + '$showfewer' => t('show fewer'), + '$update_interval' => $interval )); } @@ -93,12 +93,6 @@ if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) { load_translation_table($lang); } -/* - * Create the page head after setting the language - * - */ - -$a->init_pagehead(); /** * @@ -119,6 +113,16 @@ if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module == if(! x($_SESSION,'authenticated')) header('X-Account-Management-Status: none'); + +/* + * Create the page head after setting the language + * and getting any auth credentials + */ + +$a->init_pagehead(); + + + if(! x($_SESSION,'sysmsg')) $_SESSION['sysmsg'] = array(); diff --git a/js/main.js b/js/main.js index 829af2258..3428886e7 100644 --- a/js/main.js +++ b/js/main.js @@ -204,7 +204,7 @@ }); }) ; } - timer = setTimeout(NavUpdate,30000); + timer = setTimeout(NavUpdate,updateInterval); } function liveUpdate() { diff --git a/view/head.tpl b/view/head.tpl index 055c3cef5..9fe5a63b3 100644 --- a/view/head.tpl +++ b/view/head.tpl @@ -28,6 +28,8 @@ <script type="text/javascript" src="$baseurl/js/main.js" ></script> <script> + var updateInterval = $update_interval; + function confirmDelete() { return confirm("$delitem"); } function commentOpen(obj,id) { if(obj.value == '$comment') { |