From 7ef1ed2d7045a381c032d2142413b3a14af0d8e3 Mon Sep 17 00:00:00 2001
From: friendica
Date: Sun, 25 Mar 2012 17:55:43 -0700
Subject: [PATCH] theme screenshots
---
boot.php | 2 +-
images/blank.png | Bin 0 -> 1366 bytes
include/plugin.php | 10 ++++++++++
mod/admin.php | 8 +++++++-
view/admin_plugins_details.tpl | 4 ++++
view/theme/comix-plain/screenshot.jpg | Bin 0 -> 323812 bytes
6 files changed, 22 insertions(+), 2 deletions(-)
create mode 100644 images/blank.png
create mode 100644 view/theme/comix-plain/screenshot.jpg
diff --git a/boot.php b/boot.php
index 19661805c2..b2f91f3f7b 100755
--- a/boot.php
+++ b/boot.php
@@ -9,7 +9,7 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
-define ( 'FRIENDICA_VERSION', '2.3.1291' );
+define ( 'FRIENDICA_VERSION', '2.3.1292' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1133 );
diff --git a/images/blank.png b/images/blank.png
new file mode 100644
index 0000000000000000000000000000000000000000..67d391966763854a8c119c50d2f828e13ac36aaf
GIT binary patch
literal 1366
zcmeAS@N?(olHy`uVBq!ia0y~yU}|7sV4T3g1Qgjg(X9wbF%}28J29*~C-V}>;Vkfo
zEM{Qf76xHPhFNnY7#LW7d%8G=RNQ)d)liUuf#Zn5f&I^qvocTjcyY-uh~dE6i3|)p
z5+G!d073^E7=eg^nGJ*>5+hj-5-8ZiWn{=f5(IjhfcSl+$f+`*WC&!>LnYvuWdzC%
e)>7g}HlwEun{3LdHNSynBZH@_pUXO@geCxH1n0s4
literal 0
HcmV?d00001
diff --git a/include/plugin.php b/include/plugin.php
index 8280b1022e..df33fd3f20 100755
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -276,3 +276,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');
+}
diff --git a/mod/admin.php b/mod/admin.php
index a64b269035..53b5ee3544 100755
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -583,6 +583,7 @@ function admin_page_plugins(&$a){
'$admin_form' => $admin_form,
'$function' => 'plugins',
+ '$screenshot' => '',
'$readme' => $readme
));
}
@@ -738,7 +739,11 @@ function admin_page_themes(&$a){
}
$admin_form="";
-
+
+ $screenshot = array( get_theme_screenshot($theme), t('Screenshot'));
+ if(! stristr($screenshot[0],$theme))
+ $screenshot = null;
+
$t = get_markup_template("admin_plugins_details.tpl");
return replace_macros($t, array(
'$title' => t('Administration'),
@@ -755,6 +760,7 @@ function admin_page_themes(&$a){
'$admin_form' => $admin_form,
'$str_author' => t('Author: '),
'$str_maintainer' => t('Maintainer: '),
+ '$screenshot' => $screenshot,
'$readme' => $readme
));
}
diff --git a/view/admin_plugins_details.tpl b/view/admin_plugins_details.tpl
index ead356f5b9..cbaef2d66c 100755
--- a/view/admin_plugins_details.tpl
+++ b/view/admin_plugins_details.tpl
@@ -16,6 +16,10 @@
{{ endfor }}
+ {{ if $screenshot }}
+
+ {{ endif }}
+
{{ if $admin_form }}
$settings