aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/group.php2
-rw-r--r--include/plugin.php9
2 files changed, 6 insertions, 5 deletions
diff --git a/include/group.php b/include/group.php
index 1071f5c78..8aaeb513f 100644
--- a/include/group.php
+++ b/include/group.php
@@ -226,7 +226,7 @@ function group_side($every="contacts",$each="group",$edit = false, $group_id = 0
'cid' => $cid,
'text' => $rr['name'],
'selected' => $selected,
- 'href' => $each."/".$rr['id'],
+ 'href' => (($each === 'network') ? $each.'?f=&gid='.$rr['id'] : $each."/".$rr['id']),
'edit' => $groupedit,
'ismember' => in_array($rr['id'],$member_of),
);
diff --git a/include/plugin.php b/include/plugin.php
index ffa562273..f60a7d296 100644
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -111,7 +111,7 @@ function reload_plugins() {
if(! function_exists('register_hook')) {
-function register_hook($hook,$file,$function) {
+function register_hook($hook,$file,$function,$priority=0) {
$r = q("SELECT * FROM `hook` WHERE `hook` = '%s' AND `file` = '%s' AND `function` = '%s' LIMIT 1",
dbesc($hook),
@@ -121,10 +121,11 @@ function register_hook($hook,$file,$function) {
if(count($r))
return true;
- $r = q("INSERT INTO `hook` (`hook`, `file`, `function`) VALUES ( '%s', '%s', '%s' ) ",
+ $r = q("INSERT INTO `hook` (`hook`, `file`, `function`, `priority`) VALUES ( '%s', '%s', '%s', '%s' ) ",
dbesc($hook),
dbesc($file),
- dbesc($function)
+ dbesc($function),
+ dbesc($priority)
);
return $r;
}}
@@ -145,7 +146,7 @@ if(! function_exists('load_hooks')) {
function load_hooks() {
$a = get_app();
$a->hooks = array();
- $r = q("SELECT * FROM `hook` WHERE 1");
+ $r = q("SELECT * FROM `hook` WHERE 1 ORDER BY `priority` DESC");
if(count($r)) {
foreach($r as $rr) {
if(! array_key_exists($rr['hook'],$a->hooks))