From d8969bb84b7a710bf77f23de0d392a192dfc8f53 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 22 Dec 2010 20:23:41 -0800 Subject: [PATCH] add more plugin hooks, etc. --- boot.php | 21 +++++++++++++++++++++ mod/profile.php | 3 +++ mod/settings.php | 8 +++++++- view/en/profile_advanced.php | 1 + 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/boot.php b/boot.php index 7e630eba89..3a6886fd11 100644 --- a/boot.php +++ b/boot.php @@ -1118,6 +1118,23 @@ function set_config($family,$key,$value) { }} +if(! function_exists('load_pconfig')) { +function load_pconfig($uid,$family) { + global $a; + $r = q("SELECT * FROM `pconfig` WHERE `cat` = '%s' AND `uid` = %d", + dbesc($family), + intval($uid) + ); + if(count($r)) { + foreach($r as $rr) { + $k = $rr['k']; + $a->config[$uid][$family][$k] = $rr['v']; + } + } +}} + + + if(! function_exists('get_pconfig')) { function get_pconfig($uid,$family, $key, $instore = false) { @@ -1759,6 +1776,8 @@ function contact_block() { $o .= '
' . t('View Contacts') . '
'; } + + call_hooks('contact_block_end', $o); return $o; }} @@ -2018,6 +2037,8 @@ function profile_sidebar($profile) { '$homepage' => $homepage )); + call_hooks('profile_sidebar', $o); + return $o; }} diff --git a/mod/profile.php b/mod/profile.php index b40617d03b..b1f0209307 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -97,6 +97,9 @@ function profile_content(&$a, $update = 0) { require_once("view/$profile_lang/profile_advanced.php"); else require_once('view/profile_advanced.php'); + + call_hooks('profile_advanced',$o); + return $o; } diff --git a/mod/settings.php b/mod/settings.php index b86ff4c1c8..4743ecd661 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -14,6 +14,9 @@ function settings_post(&$a) { notice( t('Permission denied.') . EOL); return; } + + call_hooks('settings_post', $_POST); + if(count($a->user) && x($a->user,'uid') && $a->user['uid'] != local_user()) { notice( t('Permission denied.') . EOL); return; @@ -298,6 +301,9 @@ function settings_content(&$a) { '$pagetype' => $pagetype )); + call_hooks('settings_page',$o); + return $o; -}} \ No newline at end of file +}} + diff --git a/view/en/profile_advanced.php b/view/en/profile_advanced.php index 7e2036890b..82c66adece 100644 --- a/view/en/profile_advanced.php +++ b/view/en/profile_advanced.php @@ -223,3 +223,4 @@ $o .= <<< EOT EOT; } +