return false;
logger("Addons: installing " . $plugin);
$t = @filemtime('addon/' . $plugin . '/' . $plugin . '.php');
@include_once('addon/' . $plugin . '/' . $plugin . '.php');
return false;
logger("Addons: installing " . $plugin);
$t = @filemtime('addon/' . $plugin . '/' . $plugin . '.php');
@include_once('addon/' . $plugin . '/' . $plugin . '.php');
// once most site tables have been updated.
// This way the system won't fall over dead during the update.
// once most site tables have been updated.
// This way the system won't fall over dead during the update.
function reload_plugins() {
$plugins = get_config('system','addon');
function reload_plugins() {
$plugins = get_config('system','addon');
*/
function plugin_enabled($plugin) {
$r = q("SELECT * FROM `addon` WHERE `installed` = 1 AND `name` = '%s'", $plugin);
*/
function plugin_enabled($plugin) {
$r = q("SELECT * FROM `addon` WHERE `installed` = 1 AND `name` = '%s'", $plugin);
function register_hook($hook,$file,$function,$priority=0) {
$r = q("SELECT * FROM `hook` WHERE `hook` = '%s' AND `file` = '%s' AND `function` = '%s' LIMIT 1",
function register_hook($hook,$file,$function,$priority=0) {
$r = q("SELECT * FROM `hook` WHERE `hook` = '%s' AND `file` = '%s' AND `function` = '%s' LIMIT 1",
* @param string $hook the name of the hook
* @param string $file the name of the file that hooks into
* @param string $function the name of the function that the hook called
* @return array
*/
* @param string $hook the name of the hook
* @param string $file the name of the file that hooks into
* @param string $function the name of the function that the hook called
* @return array
*/
function unregister_hook($hook,$file,$function) {
$r = q("DELETE FROM `hook` WHERE `hook` = '%s' AND `file` = '%s' AND `function` = '%s'",
function unregister_hook($hook,$file,$function) {
$r = q("DELETE FROM `hook` WHERE `hook` = '%s' AND `file` = '%s' AND `function` = '%s'",
$a->hooks[$rr['hook']] = array();
$a->hooks[$rr['hook']][] = array($rr['file'],$rr['function']);
}
$a->hooks[$rr['hook']] = array();
$a->hooks[$rr['hook']][] = array($rr['file'],$rr['function']);
}
- if(is_array($a->hooks) && (array_key_exists('app_menu',$a->hooks))) {
- foreach($a->hooks['app_menu'] as $hook) {
- if($hook[0] == 'addon/'.$name.'/'.$name.'.php')
+ if (is_array($a->hooks) && (array_key_exists('app_menu',$a->hooks))) {
+ foreach ($a->hooks['app_menu'] as $hook) {
+ if ($hook[0] == 'addon/'.$name.'/'.$name.'.php')
$l = trim($l,"\t\n\r */");
if ($l!=""){
list($k,$v) = array_map("trim", explode(":",$l,2));
$l = trim($l,"\t\n\r */");
if ($l!=""){
list($k,$v) = array_map("trim", explode(":",$l,2));
$l = trim($l,"\t\n\r */");
if ($l!=""){
list($k,$v) = array_map("trim", explode(":",$l,2));
$l = trim($l,"\t\n\r */");
if ($l!=""){
list($k,$v) = array_map("trim", explode(":",$l,2));
*/
function get_theme_screenshot($theme) {
$exts = array('.png','.jpg');
*/
function get_theme_screenshot($theme) {
$exts = array('.png','.jpg');
return false; // everything is allowed
$arr = get_config('service_class',$service_class);
return false; // everything is allowed
$arr = get_config('service_class',$service_class);
function upgrade_link($bbcode = false) {
$l = get_config('service_class','upgrade_link');
function upgrade_link($bbcode = false) {
$l = get_config('service_class','upgrade_link');
* This function search in the theme directory (and if not present in global theme directory)
* if there is a directory with the file extension and for a file with the given
* This function search in the theme directory (and if not present in global theme directory)
* if there is a directory with the file extension and for a file with the given
* @param string $file Filename
* @param string $root Full root path
* @return string Path to the file or empty string if the file isn't found
*/
function theme_include($file, $root = '') {
// Make sure $root ends with a slash / if it's not blank
* @param string $file Filename
* @param string $root Full root path
* @return string Path to the file or empty string if the file isn't found
*/
function theme_include($file, $root = '') {
// Make sure $root ends with a slash / if it's not blank
$theme = current_theme();
$thname = $theme;
$ext = substr($file,strrpos($file,'.')+1);
$theme = current_theme();
$thname = $theme;
$ext = substr($file,strrpos($file,'.')+1);
"{$root}view/theme/$parent/$ext/$file",
"{$root}view/$ext/$file",
);
"{$root}view/theme/$parent/$ext/$file",
"{$root}view/$ext/$file",
);