From 7df6ab9a87bb564b9484b1fb0ab9f4a11bf97889 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 1 Apr 2012 22:22:26 -0700 Subject: add page_content_top hook --- index.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'index.php') diff --git a/index.php b/index.php index 2faac1f28..a51e33e26 100755 --- a/index.php +++ b/index.php @@ -243,6 +243,8 @@ if (file_exists($theme_info_file)){ if(! x($a->page,'content')) $a->page['content'] = ''; +if(! $install) + call_hooks('page_content_top',$a->page['content']); /** * Call module functions -- cgit v1.2.3 From 62e528ba43bedbd33eb81447775bd743f0c1acf8 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 2 Apr 2012 00:45:45 -0700 Subject: remove zrl from query string --- index.php | 1 + 1 file changed, 1 insertion(+) (limited to 'index.php') diff --git a/index.php b/index.php index a51e33e26..e7227962f 100755 --- a/index.php +++ b/index.php @@ -95,6 +95,7 @@ if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) { if(x($_GET,'zrl')) { $_SESSION['my_url'] = $_GET['zrl']; + $a->query_string = preg_replace('/[\?&]zrl=(.*?)([\?&]|$)/is','',$a->query_string); } /** -- cgit v1.2.3 From 741a5dba578444e5fea547a87c48824a69c39840 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 8 Apr 2012 05:52:00 -0700 Subject: provide theme_init() functions --- index.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'index.php') diff --git a/index.php b/index.php index e7227962f..69c224c1a 100644 --- a/index.php +++ b/index.php @@ -258,6 +258,11 @@ if($a->module_loaded) { $func($a); } + if(function_exists(str_replace('-','_',current_theme()) . '_init')) { + $func = str_replace('-','_',current_theme()) . '_init'; + $func($a); + } + if(($_SERVER['REQUEST_METHOD'] === 'POST') && (! $a->error) && (function_exists($a->module . '_post')) && (! x($_POST,'auth-params'))) { -- cgit v1.2.3 From 5c0446975516f2b52b6cf51618e0b75af56de71b Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 8 Apr 2012 06:20:57 -0700 Subject: prepare for using a master theme_init() --- index.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'index.php') diff --git a/index.php b/index.php index 69c224c1a..1cb16778a 100644 --- a/index.php +++ b/index.php @@ -262,6 +262,13 @@ if($a->module_loaded) { $func = str_replace('-','_',current_theme()) . '_init'; $func($a); } +// elseif (x($a->theme_info,"extends") && file_exists("view/theme/".$a->theme_info["extends"]."/theme.php")) { +// require_once("view/theme/".$a->theme_info["extends"]."/theme.php"); +// if(function_exists(str_replace('-','_',$a->theme_info["extends"]) . '_init')) { +// $func = str_replace('-','_',$a->theme_info["extends"]) . '_init'; +// $func($a); +// } +// } if(($_SERVER['REQUEST_METHOD'] === 'POST') && (! $a->error) && (function_exists($a->module . '_post')) -- cgit v1.2.3 From 0d60dbef31ea645b8495d8e28fca6c248d20048b Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Mon, 9 Apr 2012 00:45:10 +0200 Subject: added exceptions to dba class added exception handling to index.php, please mind that there is no recovery at the moment added transactions to db update. Please mind that they might not be supported by db table engines. added admin email on failed updates added german translation for admin email --- index.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'index.php') diff --git a/index.php b/index.php index 1cb16778a..0cf74365c 100644 --- a/index.php +++ b/index.php @@ -11,6 +11,7 @@ * bootstrap the application * */ +try { require_once('boot.php'); @@ -370,3 +371,9 @@ else session_write_close(); exit; +} catch(Exception $ex) { +// it may fail because logger uses the db, +// but give it a try: +logger('exception caught at index.php: '.$ex->getMessage()); +system_unavailable(); +} \ No newline at end of file -- cgit v1.2.3 From 7ac4b83c39d841c80c39ca034971aaaa4bdf0e59 Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Mon, 9 Apr 2012 14:04:49 +0200 Subject: made exceptions from the db optional set address for updae mails correctly --- index.php | 7 ------- 1 file changed, 7 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 0cf74365c..1cb16778a 100644 --- a/index.php +++ b/index.php @@ -11,7 +11,6 @@ * bootstrap the application * */ -try { require_once('boot.php'); @@ -371,9 +370,3 @@ else session_write_close(); exit; -} catch(Exception $ex) { -// it may fail because logger uses the db, -// but give it a try: -logger('exception caught at index.php: '.$ex->getMessage()); -system_unavailable(); -} \ No newline at end of file -- cgit v1.2.3 From 4c3b835307c072cbdf3b68857c34fc22a58872c6 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 10 Apr 2012 01:51:53 -0700 Subject: path to default.php in theme dir was incorrect --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 1cb16778a..f0ed00232 100644 --- a/index.php +++ b/index.php @@ -360,13 +360,13 @@ $profile = $a->profile; header("Content-type: text/html; charset=utf-8"); -$template = 'view/' . current_theme() . '/' +$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(current_theme() . '/', '', $template)); + require_once(str_replace('theme/' . current_theme() . '/', '', $template)); session_write_close(); exit; -- cgit v1.2.3 From 64cf2d089a598e9b8c8d1964303f92676c12e9b9 Mon Sep 17 00:00:00 2001 From: Alexander Kampmann Date: Tue, 10 Apr 2012 17:10:24 +0200 Subject: fixed install bug --- index.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 1cb16778a..933952341 100644 --- a/index.php +++ b/index.php @@ -38,11 +38,10 @@ load_translation_table($lang); */ require_once("dba.php"); -$db = new dba($db_host, $db_user, $db_pass, $db_data, $install); - unset($db_host, $db_user, $db_pass, $db_data); - if(! $install) { +$db = new dba($db_host, $db_user, $db_pass, $db_data, $install); + unset($db_host, $db_user, $db_pass, $db_data); /** * Load configs from db. Overwrite configs from .htconfig.php -- cgit v1.2.3 From f4ea764aaf125adc1bd94c921d1afd5e308f61bf Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 14 Apr 2012 04:54:26 -0700 Subject: zrl hook --- index.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 5dd93523e..442173eeb 100644 --- a/index.php +++ b/index.php @@ -40,8 +40,8 @@ load_translation_table($lang); require_once("dba.php"); if(! $install) { -$db = new dba($db_host, $db_user, $db_pass, $db_data, $install); - unset($db_host, $db_user, $db_pass, $db_data); + $db = new dba($db_host, $db_user, $db_pass, $db_data, $install); + unset($db_host, $db_user, $db_pass, $db_data); /** * Load configs from db. Overwrite configs from .htconfig.php @@ -95,6 +95,10 @@ if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) { if(x($_GET,'zrl')) { $_SESSION['my_url'] = $_GET['zrl']; $a->query_string = preg_replace('/[\?&]zrl=(.*?)([\?&]|$)/is','',$a->query_string); + if(! $install) { + $arr = array('zrl' => $_SESSION['my_url'], 'url' => $a->cmd); + call_hooks('zrl_init',$arr); + } } /** -- cgit v1.2.3