aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorroot <root@diekershoff.homeunix.net>2010-12-21 07:14:58 +0100
committerroot <root@diekershoff.homeunix.net>2010-12-21 07:14:58 +0100
commit8cfa93b730f87edf98c52e9a38cfa015ce1f5d47 (patch)
treeda79ea09482cf8984c7d9e02076dd2e4f0e8e65e /boot.php
parentad32d85cfaa775efbd89b273bd51c82f4e45baab (diff)
parentddec422de6707809aceb541e1191073b43aec18a (diff)
downloadvolse-hubzilla-8cfa93b730f87edf98c52e9a38cfa015ce1f5d47.tar.gz
volse-hubzilla-8cfa93b730f87edf98c52e9a38cfa015ce1f5d47.tar.bz2
volse-hubzilla-8cfa93b730f87edf98c52e9a38cfa015ce1f5d47.zip
Merge branch 'master' of git://github.com/friendika/friendika
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php62
1 files changed, 59 insertions, 3 deletions
diff --git a/boot.php b/boot.php
index 1870e059e..9cc4d0f34 100644
--- a/boot.php
+++ b/boot.php
@@ -2,7 +2,7 @@
set_time_limit(0);
-define ( 'BUILD_ID', 1024 );
+define ( 'BUILD_ID', 1027 );
define ( 'DFRN_PROTOCOL_VERSION', '2.0' );
define ( 'EOL', "<br />\r\n" );
@@ -174,8 +174,10 @@ class App {
public $pager;
public $strings;
public $path;
+ public $hooks;
public $interactive = true;
+
private $scheme;
private $hostname;
private $baseurl;
@@ -1924,7 +1926,7 @@ function profile_sidebar($profile) {
$gender = ((x($profile,'gender') == 1) ? '<div class="mf"><span class="gender-label">' . t('Gender:') . '</span> <span class="x-gender">' . $profile['gender'] . '</span></div><div class="profile-clear"></div>' : '');
- $pubkey = ((x($profile,'key') == 1) ? '<div class="key" style="display:none;">' . $profile['pubkey'] . '</div>' : '');
+ $pubkey = ((x($profile,'pubkey') == 1) ? '<div class="key" style="display:none;">' . $profile['pubkey'] . '</div>' : '');
$marital = ((x($profile,'marital') == 1) ? '<div class="marital"><span class="marital-label"><span class="heart">&hearts;</span> ' . t('Status:') . ' </span><span class="marital-text">' . $profile['marital'] . '</span></div></div><div class="profile-clear"></div>' : '');
@@ -1945,4 +1947,58 @@ function profile_sidebar($profile) {
));
return $o;
-}} \ No newline at end of file
+}}
+
+
+if(! function_exists('register_hook')) {
+function register_hook($hook,$file,$function) {
+
+ $r = q("INSERT INTO `hook` (`hook`, `file`, `function`) VALUES ( '%s', '%s', '%s' ) ",
+ dbesc($hook),
+ dbesc($file),
+ dbesc($function)
+ );
+ return $r;
+}}
+
+if(! function_exists('unregister_hook')) {
+function unregister_hook($hook,$file,$function) {
+
+ $r = q("DELETE FROM `hook` WHERE `hook` = '%s' AND `file` = '%s' AND `function` = '%s' LIMIT 1",
+ dbesc($hook),
+ dbesc($file),
+ dbesc($function)
+ );
+ return $r;
+}}
+
+
+if(! function_exists('load_hooks')) {
+function load_hooks() {
+ $a = get_app();
+ $r = q("SELECT * FROM `hook` WHERE 1");
+ if(count($r)) {
+ foreach($r as $rr) {
+ $a->hooks[] = array($rr['hook'], $rr['file'], $rr['function']);
+ }
+ }
+}}
+
+
+if(! function_exists('call_hooks')) {
+function call_hooks($name, $data = null) {
+ $a = get_app();
+
+ if(count($a->hooks)) {
+ foreach($a->hooks as $hook) {
+ if($hook[0] === $name) {
+ @require_once($hook[1]);
+ if(function_exists($hook[2])) {
+ $func = $hook[2];
+ $func($a,$data);
+ }
+ }
+ }
+ }
+}}
+