diff options
author | Michael <icarus@dabo.de> | 2012-04-11 18:47:21 +0200 |
---|---|---|
committer | Michael <icarus@dabo.de> | 2012-04-11 18:47:21 +0200 |
commit | c3139fa0fd49b0b4de4568d46a6946c75ccb2a62 (patch) | |
tree | a46d809d2e11fefba938717d38b1371572e4d815 /include/plugin.php | |
parent | 81a8d4f9dbd32de133e647c87a5394dd52f009fe (diff) | |
parent | fe257a20324fe68838e5829e19d18777045a41b4 (diff) | |
download | volse-hubzilla-c3139fa0fd49b0b4de4568d46a6946c75ccb2a62.tar.gz volse-hubzilla-c3139fa0fd49b0b4de4568d46a6946c75ccb2a62.tar.bz2 volse-hubzilla-c3139fa0fd49b0b4de4568d46a6946c75ccb2a62.zip |
Merge branch 'master' of github.com:annando/friendica
Diffstat (limited to 'include/plugin.php')
-rw-r--r--[-rwxr-xr-x] | include/plugin.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/include/plugin.php b/include/plugin.php index 8280b1022..8196e8756 100755..100644 --- a/include/plugin.php +++ b/include/plugin.php @@ -17,7 +17,12 @@ function uninstall_plugin($plugin){ }} if (! function_exists('install_plugin')){ -function install_plugin($plugin){ +function install_plugin($plugin) { + + // silently fail if plugin was removed + + if(! file_exists('addon/' . $plugin . '/' . $plugin . '.php')) + return false; logger("Addons: installing " . $plugin); $t = @filemtime('addon/' . $plugin . '/' . $plugin . '.php'); @include_once('addon/' . $plugin . '/' . $plugin . '.php'); @@ -32,9 +37,11 @@ function install_plugin($plugin){ intval($t), $plugin_admin ); + return true; } else { logger("Addons: FAILED installing " . $plugin); + return false; } }} @@ -249,6 +256,7 @@ function get_theme_info($theme){ list($k,$v) = array_map("trim", explode(":",$l,2)); $k= strtolower($k); if ($k=="author"){ + $r=preg_match("|([^<]+)<([^>]+)>|", $v, $m); if ($r) { $info['author'][] = array('name'=>$m[1], 'link'=>$m[2]); @@ -276,3 +284,13 @@ function get_theme_info($theme){ return $info; }} + +function get_theme_screenshot($theme) { + $a = get_app(); + $exts = array('.png','.jpg'); + foreach($exts as $ext) { + if(file_exists('view/theme/' . $theme . '/screenshot' . $ext)) + return($a->get_baseurl() . '/view/theme/' . $theme . '/screenshot' . $ext); + } + return($a->get_baseurl() . '/images/blank.png'); +} |