Merge branch 'dev' into sabre32

This commit is contained in:
Mario Vavti 2016-06-23 10:14:13 +02:00
commit 39b14b6b81
8 changed files with 36 additions and 24 deletions

View File

@ -62,7 +62,7 @@ class Photo extends \Zotlabs\Web\Controller {
intval($uid), intval($uid),
intval(PHOTO_PROFILE) intval(PHOTO_PROFILE)
); );
if(count($r)) { if($r) {
$data = dbunescbin($r[0]['content']); $data = dbunescbin($r[0]['content']);
$mimetype = $r[0]['mimetype']; $mimetype = $r[0]['mimetype'];
} }

View File

@ -23,7 +23,6 @@ class Profile_photo extends \Zotlabs\Web\Controller {
/* @brief Initalize the profile-photo edit view /* @brief Initalize the profile-photo edit view
* *
* @param $a Current application
* @return void * @return void
* *
*/ */
@ -72,6 +71,8 @@ class Profile_photo extends \Zotlabs\Web\Controller {
} }
logger('profile: ' . $_REQUEST['profile']);
// phase 2 - we have finished cropping // phase 2 - we have finished cropping
@ -270,10 +271,18 @@ class Profile_photo extends \Zotlabs\Web\Controller {
return; return;
}; };
// check_form_security_token_redirectOnErr('/profile_photo', 'profile_photo');
$resource_id = argv(2); $resource_id = argv(2);
// When using an existing photo, we don't have a dialogue to offer a choice of profiles,
// so it gets attached to the default
$p = q("select id from profile where is_default = 1 and uid = %d",
intval(local_channel())
);
if($p) {
$_REQUEST['profile'] = $p[0]['id'];
}
$r = q("SELECT id, album, imgscale FROM photo WHERE uid = %d AND resource_id = '%s' ORDER BY imgscale ASC", $r = q("SELECT id, album, imgscale FROM photo WHERE uid = %d AND resource_id = '%s' ORDER BY imgscale ASC",
intval(local_channel()), intval(local_channel()),
@ -349,7 +358,7 @@ class Profile_photo extends \Zotlabs\Web\Controller {
} }
} }
profile_photo_crop_ui_head($a, $ph, $hash, $smallest); $this->profile_photo_crop_ui_head($a, $ph, $hash, $smallest);
} }
$profiles = q("select id, profile_name as name, is_default from profile where uid = %d", $profiles = q("select id, profile_name as name, is_default from profile where uid = %d",

View File

@ -862,7 +862,7 @@ function profile_load(&$a, $nickname, $profile = '') {
); );
if($z) { if($z) {
$p[0]['picdate'] = $z[0]['xchan_photo_date']; $p[0]['picdate'] = $z[0]['xchan_photo_date'];
$p[0]['reddress'] = str_replace('@','@',$z[0]['xchan_addr']); $p[0]['reddress'] = str_replace('@','@',$z[0]['xchan_addr']);
} }
// fetch user tags if this isn't the default profile // fetch user tags if this isn't the default profile

View File

@ -332,6 +332,9 @@ function q($sql) {
else else
db_logger('dba: vsprintf error: ' . print_r(debug_backtrace(), true),LOGGER_NORMAL,LOG_CRIT); db_logger('dba: vsprintf error: ' . print_r(debug_backtrace(), true),LOGGER_NORMAL,LOG_CRIT);
} }
if(\DBA::$dba->debug)
db_logger('Sql: ' . $stmt, LOGGER_DEBUG, LOG_INFO);
return \DBA::$dba->q($stmt); return \DBA::$dba->q($stmt);
} }

View File

@ -2089,9 +2089,9 @@ function xchan_query(&$items,$abook = true,$effective_uid = 0) {
} }
foreach($items as $item) { foreach($items as $item) {
if($item['owner_xchan'] && (! in_array($item['owner_xchan'],$arr))) if($item['owner_xchan'] && (! in_array("'" . dbesc($item['owner_xchan']) . "'",$arr)))
$arr[] = "'" . dbesc($item['owner_xchan']) . "'"; $arr[] = "'" . dbesc($item['owner_xchan']) . "'";
if($item['author_xchan'] && (! in_array($item['author_xchan'],$arr))) if($item['author_xchan'] && (! in_array("'" . dbesc($item['author_xchan']) . "'",$arr)))
$arr[] = "'" . dbesc($item['author_xchan']) . "'"; $arr[] = "'" . dbesc($item['author_xchan']) . "'";
} }
} }
@ -2124,9 +2124,9 @@ function xchan_mail_query(&$item) {
$arr = array(); $arr = array();
$chans = null; $chans = null;
if($item) { if($item) {
if($item['from_xchan'] && (! in_array($item['from_xchan'],$arr))) if($item['from_xchan'] && (! in_array("'" . dbesc($item['from_xchan']) . "'",$arr)))
$arr[] = "'" . dbesc($item['from_xchan']) . "'"; $arr[] = "'" . dbesc($item['from_xchan']) . "'";
if($item['to_xchan'] && (! in_array($item['to_xchan'],$arr))) if($item['to_xchan'] && (! in_array("'" . dbesc($item['to_xchan']) . "'",$arr)))
$arr[] = "'" . dbesc($item['to_xchan']) . "'"; $arr[] = "'" . dbesc($item['to_xchan']) . "'";
} }

View File

@ -1158,7 +1158,7 @@ function widget_cover_photo($arr) {
if(array_key_exists('subtitle', $arr) && isset($arr['subtitle'])) if(array_key_exists('subtitle', $arr) && isset($arr['subtitle']))
$subtitle = $arr['subtitle']; $subtitle = $arr['subtitle'];
else else
$subtitle = $channel['xchan_addr']; $subtitle = str_replace('@','@',$channel['xchan_addr']);
$c = get_cover_photo($channel_id,'html'); $c = get_cover_photo($channel_id,'html');

View File

@ -4,7 +4,7 @@
</div> </div>
<div id="collapsed-comments-{{$item.id}}" class="collapsed-comments" style="display: none;"> <div id="collapsed-comments-{{$item.id}}" class="collapsed-comments" style="display: none;">
{{/if}} {{/if}}
<div id="thread-wrapper-{{$item.id}}" class="thread-wrapper{{if $item.toplevel}} {{$item.toplevel}} generic-content-wrapper{{/if}}"> <div id="thread-wrapper-{{$item.id}}" class="thread-wrapper{{if $item.toplevel}} {{$item.toplevel}} generic-content-wrapper h-entry {{else}} u-comment h-cite {{/if}}">
<a name="{{$item.id}}" ></a> <a name="{{$item.id}}" ></a>
<div class="wall-item-outside-wrapper {{$item.indent}}{{$item.previewing}}" id="wall-item-outside-wrapper-{{$item.id}}" > <div class="wall-item-outside-wrapper {{$item.indent}}{{$item.previewing}}" id="wall-item-outside-wrapper-{{$item.id}}" >
<div class="wall-item-content-wrapper {{$item.indent}}" id="wall-item-content-wrapper-{{$item.id}}" style="clear:both;"> <div class="wall-item-content-wrapper {{$item.indent}}" id="wall-item-content-wrapper-{{$item.id}}" style="clear:both;">
@ -20,8 +20,8 @@
{{/if}} {{/if}}
<div class="wall-item-head"> <div class="wall-item-head">
<div class="wall-item-info" id="wall-item-info-{{$item.id}}" > <div class="wall-item-info" id="wall-item-info-{{$item.id}}" >
<div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}}" id="wall-item-photo-wrapper-{{$item.id}}"> <div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}} h-card" id="wall-item-photo-wrapper-{{$item.id}}">
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-photo-link" id="wall-item-photo-link-{{$item.id}}"><img src="{{$item.thumb}}" class="wall-item-photo{{$item.sparkle}}" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" /></a> <a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-photo-link u-url" id="wall-item-photo-link-{{$item.id}}"><img src="{{$item.thumb}}" class="wall-item-photo{{$item.sparkle}} u-photo p-name" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" /></a>
</div> </div>
<div class="wall-item-photo-end" style="clear:both"></div> <div class="wall-item-photo-end" style="clear:both"></div>
</div> </div>
@ -39,14 +39,14 @@
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}}" id="wall-item-name-{{$item.id}}" >{{$item.name}}</span></a>{{if $item.owner_url}}&nbsp;{{$item.via}}&nbsp;<a href="{{$item.owner_url}}" title="{{$item.olinktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span></a>{{/if}} <a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}}" id="wall-item-name-{{$item.id}}" >{{$item.name}}</span></a>{{if $item.owner_url}}&nbsp;{{$item.via}}&nbsp;<a href="{{$item.owner_url}}" title="{{$item.olinktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span></a>{{/if}}
</div> </div>
<div class="wall-item-ago" id="wall-item-ago-{{$item.id}}"> <div class="wall-item-ago" id="wall-item-ago-{{$item.id}}">
{{if $item.verified}}<i class="fa fa-check item-verified" title="{{$item.verified}}"></i>&nbsp;{{elseif $item.forged}}<i class="fa fa-exclamation item-forged" title="{{$item.forged}}"></i>&nbsp;{{/if}}{{if $item.location}}<span class="wall-item-location" id="wall-item-location-{{$item.id}}">{{$item.location}},&nbsp;</span>{{/if}}<span class="autotime" title="{{$item.isotime}}">{{$item.localtime}}{{if $item.editedtime}}&nbsp;{{$item.editedtime}}{{/if}}{{if $item.expiretime}}&nbsp;{{$item.expiretime}}{{/if}}</span>{{if $item.editedtime}}&nbsp;<i class="fa fa-pencil"></i>{{/if}}&nbsp;{{if $item.app}}<span class="item.app">{{$item.str_app}}</span>{{/if}} {{if $item.verified}}<i class="fa fa-check item-verified" title="{{$item.verified}}"></i>&nbsp;{{elseif $item.forged}}<i class="fa fa-exclamation item-forged" title="{{$item.forged}}"></i>&nbsp;{{/if}}{{if $item.location}}<span class="wall-item-location p-location" id="wall-item-location-{{$item.id}}">{{$item.location}},&nbsp;</span>{{/if}}<span class="autotime" title="{{$item.isotime}}"><time class="dt-published" datetime="{{$item.isotime}}">{{$item.localtime}}</time>{{if $item.editedtime}}&nbsp;{{$item.editedtime}}{{/if}}{{if $item.expiretime}}&nbsp;{{$item.expiretime}}{{/if}}</span>{{if $item.editedtime}}&nbsp;<i class="fa fa-pencil"></i>{{/if}}&nbsp;{{if $item.app}}<span class="item.app">{{$item.str_app}}</span>{{/if}}
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
{{if $item.body}} {{if $item.body}}
<div class="wall-item-content" id="wall-item-content-{{$item.id}}"> <div class="wall-item-content" id="wall-item-content-{{$item.id}}">
<div class="wall-item-body" id="wall-item-body-{{$item.id}}" > <div class="wall-item-body e-content" id="wall-item-body-{{$item.id}}" >
{{$item.body}} {{$item.body}}
</div> </div>
<div class="clear"></div> <div class="clear"></div>
@ -66,7 +66,7 @@
{{/if}} {{/if}}
{{if $item.categories}} {{if $item.categories}}
<div class="body-tags" id="item-categories"> <div class="body-tags" id="item-categories">
<span class="tag">{{$item.categories}}</span> <span class="tag p-category">{{$item.categories}}</span>
</div> </div>
{{/if}} {{/if}}
{{if $item.folders}} {{if $item.folders}}

View File

@ -26,7 +26,7 @@
{{if ! $zcard}} {{if ! $zcard}}
<div class="fn p-name">{{$profile.fullname}}{{if $profile.online}} <i class="fa fa-asterisk online-now" title="{{$profile.online}}"></i>{{/if}}</div> <div class="fn p-name">{{$profile.fullname}}{{if $profile.online}} <i class="fa fa-asterisk online-now" title="{{$profile.online}}"></i>{{/if}}</div>
{{if $reddress}}<div class="reddress" oncopy="return false;">{{$profile.reddress}}</div>{{/if}} {{if $reddress}}<div class="reddress">{{$profile.reddress}}</div>{{/if}}
{{/if}} {{/if}}
{{if $pdesc}}<div class="title">{{$profile.pdesc}}</div>{{/if}} {{if $pdesc}}<div class="title">{{$profile.pdesc}}</div>{{/if}}
{{if $location}} {{if $location}}