Merge https://github.com/redmatrix/hubzilla into pending_merge
This commit is contained in:
commit
4f0490f26f
@ -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]
|
||||
|
||||
|
||||
|
10
doc/theme_management.bb
Normal file
10
doc/theme_management.bb
Normal file
@ -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]
|
@ -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);
|
||||
|
@ -78,7 +78,8 @@ code {
|
||||
/* conv_item */
|
||||
|
||||
.wall-photo-item img {
|
||||
width: 100%;
|
||||
width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
}
|
||||
|
||||
.wall-item-info {
|
||||
|
Reference in New Issue
Block a user