aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-10-16 13:06:47 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-10-16 13:06:47 -0700
commit4f0490f26f7a0125c3dbcd64d2a1fccc2261fd25 (patch)
treea52aadef4dc67f9e98370cea083733310ca738bc
parent7fe6bc52d089570994074c4fbb19428d7cc58e6d (diff)
parentb7408fa39eca66f75cf6d29b6bdf3c4b602d201b (diff)
downloadvolse-hubzilla-4f0490f26f7a0125c3dbcd64d2a1fccc2261fd25.tar.gz
volse-hubzilla-4f0490f26f7a0125c3dbcd64d2a1fccc2261fd25.tar.bz2
volse-hubzilla-4f0490f26f7a0125c3dbcd64d2a1fccc2261fd25.zip
Merge https://github.com/redmatrix/hubzilla into pending_merge
-rw-r--r--doc/admins.bb1
-rw-r--r--doc/theme_management.bb10
-rw-r--r--include/photos.php61
-rw-r--r--view/css/conversation.css3
4 files changed, 38 insertions, 37 deletions
diff --git a/doc/admins.bb b/doc/admins.bb
index 817b79d0f..c77b004a4 100644
--- a/doc/admins.bb
+++ b/doc/admins.bb
@@ -9,5 +9,6 @@
[zrl=[baseurl]/help/hidden_configs]Tweaking $Projectname's Hidden Configurations[/zrl]
[zrl=[baseurl]/help/faq_admins]FAQ For Admins[/zrl]
[zrl=[baseurl]/help/service_classes]Service Classes[/zrl]
+[zrl=[baseurl]/help/theme_management]Theme Management[/zrl]
diff --git a/doc/theme_management.bb b/doc/theme_management.bb
new file mode 100644
index 000000000..5691f7c48
--- /dev/null
+++ b/doc/theme_management.bb
@@ -0,0 +1,10 @@
+[h1]Theme Management[/h1]
+$Projectname allows hub admins to easily add and update themes hosted in common git repositories.
+[h2]Add new theme repo to your hub[/h2]
+1. Navigate to your hub web root
+[code]root@hub:~# cd /var/www[/code]
+2. Add the theme repo and give it a name
+[code][nobb]root@hub:/var/www# util/add_theme_repo https://github.com/username/theme-repo.git UniqueThemeRepoName[/nobb][/code]
+[h2]Update existing theme repo[/h2]
+Update the repo by using
+[code]root@hub:/var/www# util/update_theme_repo UniqueThemeRepoName[/code]
diff --git a/include/photos.php b/include/photos.php
index 618f36fb1..e78b899e0 100644
--- a/include/photos.php
+++ b/include/photos.php
@@ -185,11 +185,11 @@ function photo_upload($channel, $observer, $args) {
if($args['description'])
$p['description'] = $args['description'];
- $r1 = $ph->save($p);
- if(! $r1)
+ $r0 = $ph->save($p);
+ $r0wxh = $ph->getWidth() . 'x' . $ph->getHeight();
+ if(! $r0)
$errors = true;
-
unset($p['os_storage']);
unset($p['os_path']);
@@ -197,18 +197,18 @@ function photo_upload($channel, $observer, $args) {
$ph->scaleImage(1024);
$p['scale'] = 1;
- $r2 = $ph->save($p);
- $smallest = 1;
- if(! $r2)
+ $r1 = $ph->save($p);
+ $r1wxh = $ph->getWidth() . 'x' . $ph->getHeight();
+ if(! $r1)
$errors = true;
if(($width > 640 || $height > 640) && (! $errors))
$ph->scaleImage(640);
$p['scale'] = 2;
- $r3 = $ph->save($p);
- $smallest = 2;
- if(! $r3)
+ $r2 = $ph->save($p);
+ $r2wxh = $ph->getWidth() . 'x' . $ph->getHeight();
+ if(! $r2)
$errors = true;
if(($width > 320 || $height > 320) && (! $errors))
@@ -216,7 +216,7 @@ function photo_upload($channel, $observer, $args) {
$p['scale'] = 3;
$r3 = $ph->save($p);
- $smallest = 3;
+ $r3wxh = $ph->getWidth() . 'x' . $ph->getHeight();
if(! $r3)
$errors = true;
@@ -231,12 +231,6 @@ function photo_upload($channel, $observer, $args) {
return $ret;
}
- // This will be the width and height of the smallest representation
-
- $width_x_height = $ph->getWidth() . 'x' . $ph->getHeight();
-
- // Create item container
-
$item_hidden = (($visible) ? 0 : 1 );
$lat = $lon = null;
@@ -248,6 +242,19 @@ function photo_upload($channel, $observer, $args) {
}
}
+ $larger = feature_enabled($channel['channel_id'], 'large_photos');
+
+ if($larger) {
+ $tag = (($r1wxh) ? '[zmg=' . $r1wxh . ']' : '[zmg]');
+ $scale = 1;
+ }
+ else {
+ $tag = (($r2wxh) ? '[zmg=' . $r2wxh . ']' : '[zmg]');
+ $scale = 2;
+ }
+
+ // Create item container
+
if($args['item']) {
foreach($args['item'] as $i) {
@@ -257,7 +264,7 @@ function photo_upload($channel, $observer, $args) {
if($item['mid'] === $item['parent_mid']) {
$item['body'] = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']'
- . $tag . z_root() . "/photo/{$photo_hash}-{$smallest}.".$ph->getExt() . '[/zmg]'
+ . $tag . z_root() . "/photo/{$photo_hash}-{$scale}.".$ph->getExt() . '[/zmg]'
. '[/zrl]';
if($item['author_xchan'] === $channel['channel_hash']) {
@@ -319,26 +326,8 @@ function photo_upload($channel, $observer, $args) {
$arr['item_private'] = intval($acl->is_private());
$arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $arr['mid'];
- // We should also put a width_x_height on large photos. Left as an exercise for
- // devs looking for simple stuff to fix.
-
- $larger = feature_enabled($channel['channel_id'], 'large_photos');
- if($larger) {
- $tag = '[zmg]';
- if($r2)
- $smallest = 1;
- else
- $smallest = 0;
- }
- else {
- if ($width_x_height)
- $tag = '[zmg=' . $width_x_height. ']';
- else
- $tag = '[zmg]';
- }
-
$arr['body'] = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']'
- . $tag . z_root() . "/photo/{$photo_hash}-{$smallest}.".$ph->getExt() . '[/zmg]'
+ . $tag . z_root() . "/photo/{$photo_hash}-{$scale}.".$ph->getExt() . '[/zmg]'
. '[/zrl]';
$result = item_store($arr);
diff --git a/view/css/conversation.css b/view/css/conversation.css
index d72315fc2..df89eb7d1 100644
--- a/view/css/conversation.css
+++ b/view/css/conversation.css
@@ -78,7 +78,8 @@ code {
/* conv_item */
.wall-photo-item img {
- width: 100%;
+ width: 100% !important;
+ max-width: 100% !important;
}
.wall-item-info {