Updated modules to allow for partial overrides without errors
Only define functions if they have not been defined before, e.g. in themes. This makes it possible to override parts of a module and still use the other functions.
This commit is contained in:
parent
a81d929cdf
commit
db949bb802
123 changed files with 768 additions and 471 deletions
|
@ -1,12 +1,14 @@
|
|||
<?php
|
||||
|
||||
if(! function_exists('share_init')) {
|
||||
function share_init(&$a) {
|
||||
|
||||
$post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
|
||||
if((! $post_id) || (! local_user()))
|
||||
killme();
|
||||
|
||||
$r = q("SELECT item.*, contact.network FROM `item`
|
||||
inner join contact on `item`.`contact-id` = `contact`.`id`
|
||||
$r = q("SELECT item.*, contact.network FROM `item`
|
||||
inner join contact on `item`.`contact-id` = `contact`.`id`
|
||||
WHERE `item`.`id` = %d AND `item`.`uid` = %d LIMIT 1",
|
||||
|
||||
intval($post_id),
|
||||
|
@ -40,7 +42,9 @@ function share_init(&$a) {
|
|||
echo $o;
|
||||
killme();
|
||||
}
|
||||
}
|
||||
|
||||
if(! function_exists('share_header')) {
|
||||
function share_header($author, $profile, $avatar, $guid, $posted, $link) {
|
||||
$header = "[share author='".str_replace(array("'", "[", "]"), array("'", "[", "]"),$author).
|
||||
"' profile='".str_replace(array("'", "[", "]"), array("'", "[", "]"),$profile).
|
||||
|
@ -56,3 +60,4 @@ function share_header($author, $profile, $avatar, $guid, $posted, $link) {
|
|||
|
||||
return $header;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue