aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-06-23 10:14:13 +0200
committerMario Vavti <mario@mariovavti.com>2016-06-23 10:14:13 +0200
commit39b14b6b811ec65f8c8a812397f9ee04877cd53d (patch)
tree1f122a63a4f44aed278a54fab803706d77946997
parent5536df51f58a65f5a42051b0466b1c13c9a9718a (diff)
parentac81a3a5effe51b82310bbd831dec06e7914e649 (diff)
downloadvolse-hubzilla-39b14b6b811ec65f8c8a812397f9ee04877cd53d.tar.gz
volse-hubzilla-39b14b6b811ec65f8c8a812397f9ee04877cd53d.tar.bz2
volse-hubzilla-39b14b6b811ec65f8c8a812397f9ee04877cd53d.zip
Merge branch 'dev' into sabre32
-rw-r--r--Zotlabs/Module/Photo.php4
-rw-r--r--Zotlabs/Module/Profile_photo.php25
-rw-r--r--include/channel.php2
-rwxr-xr-xinclude/dba/dba_driver.php5
-rw-r--r--include/text.php8
-rw-r--r--include/widgets.php2
-rwxr-xr-xview/tpl/conv_item.tpl12
-rwxr-xr-xview/tpl/profile_vcard.tpl2
8 files changed, 36 insertions, 24 deletions
diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php
index 92c9ac3c0..5148c4a94 100644
--- a/Zotlabs/Module/Photo.php
+++ b/Zotlabs/Module/Photo.php
@@ -62,7 +62,7 @@ class Photo extends \Zotlabs\Web\Controller {
intval($uid),
intval(PHOTO_PROFILE)
);
- if(count($r)) {
+ if($r) {
$data = dbunescbin($r[0]['content']);
$mimetype = $r[0]['mimetype'];
}
@@ -79,7 +79,7 @@ class Photo extends \Zotlabs\Web\Controller {
* Other photos
*/
- /* Check for a cookie to indicate display pixel density, in order to detect high-resolution
+ /* Check for a cookie to indicate display pixel density, in order to detect high-resolution
displays. This procedure was derived from the "Retina Images" by Jeremey Worboys,
used in accordance with the Creative Commons Attribution 3.0 Unported License.
Project link: https://github.com/Retina-Images/Retina-Images
diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php
index 6129a7492..c02821a3c 100644
--- a/Zotlabs/Module/Profile_photo.php
+++ b/Zotlabs/Module/Profile_photo.php
@@ -23,12 +23,11 @@ class Profile_photo extends \Zotlabs\Web\Controller {
/* @brief Initalize the profile-photo edit view
*
- * @param $a Current application
* @return void
*
*/
- function init() {
+ function init() {
if(! local_channel()) {
return;
@@ -46,7 +45,7 @@ class Profile_photo extends \Zotlabs\Web\Controller {
*
*/
- function post() {
+ function post() {
if(! local_channel()) {
return;
@@ -71,6 +70,8 @@ class Profile_photo extends \Zotlabs\Web\Controller {
}
}
+
+logger('profile: ' . $_REQUEST['profile']);
// phase 2 - we have finished cropping
@@ -269,11 +270,19 @@ class Profile_photo extends \Zotlabs\Web\Controller {
notice( t('Permission denied.') . EOL );
return;
};
-
- // check_form_security_token_redirectOnErr('/profile_photo', 'profile_photo');
-
+
$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",
intval(local_channel()),
@@ -310,7 +319,7 @@ class Profile_photo extends \Zotlabs\Web\Controller {
dbesc($channel['xchan_hash'])
);
- profile_photo_set_profile_perms(); //Reset default photo permissions to public
+ profile_photo_set_profile_perms(); // Reset default photo permissions to public
\Zotlabs\Daemon\Master::Summon(array('Directory',local_channel()));
goaway(z_root() . '/profiles');
}
@@ -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",
diff --git a/include/channel.php b/include/channel.php
index 562aedddc..a0424ee39 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -862,7 +862,7 @@ function profile_load(&$a, $nickname, $profile = '') {
);
if($z) {
$p[0]['picdate'] = $z[0]['xchan_photo_date'];
- $p[0]['reddress'] = str_replace('@','&#xff20;',$z[0]['xchan_addr']);
+ $p[0]['reddress'] = str_replace('@','&#x40;',$z[0]['xchan_addr']);
}
// fetch user tags if this isn't the default profile
diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php
index df072ed76..f6091f6e1 100755
--- a/include/dba/dba_driver.php
+++ b/include/dba/dba_driver.php
@@ -90,7 +90,7 @@ abstract class dba_driver {
protected $db;
protected $pdo = array();
- public $debug = 0;
+ public $debug = 0;
public $connected = false;
public $error = false;
@@ -332,6 +332,9 @@ function q($sql) {
else
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);
}
diff --git a/include/text.php b/include/text.php
index 4f28c6dbc..12b6b1137 100644
--- a/include/text.php
+++ b/include/text.php
@@ -2089,9 +2089,9 @@ function xchan_query(&$items,$abook = true,$effective_uid = 0) {
}
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']) . "'";
- 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']) . "'";
}
}
@@ -2124,9 +2124,9 @@ function xchan_mail_query(&$item) {
$arr = array();
$chans = null;
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']) . "'";
- 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']) . "'";
}
diff --git a/include/widgets.php b/include/widgets.php
index cdd5d72ab..8a7f4b69f 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -1158,7 +1158,7 @@ function widget_cover_photo($arr) {
if(array_key_exists('subtitle', $arr) && isset($arr['subtitle']))
$subtitle = $arr['subtitle'];
else
- $subtitle = $channel['xchan_addr'];
+ $subtitle = str_replace('@','&#x40;',$channel['xchan_addr']);
$c = get_cover_photo($channel_id,'html');
diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl
index 817a03028..9c879e109 100755
--- a/view/tpl/conv_item.tpl
+++ b/view/tpl/conv_item.tpl
@@ -4,7 +4,7 @@
</div>
<div id="collapsed-comments-{{$item.id}}" class="collapsed-comments" style="display: none;">
{{/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>
<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;">
@@ -20,8 +20,8 @@
{{/if}}
<div class="wall-item-head">
<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}}">
- <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>
+ <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 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 class="wall-item-photo-end" style="clear:both"></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}}
</div>
<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 class="clear"></div>
</div>
{{if $item.body}}
<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}}
</div>
<div class="clear"></div>
@@ -66,7 +66,7 @@
{{/if}}
{{if $item.categories}}
<div class="body-tags" id="item-categories">
- <span class="tag">{{$item.categories}}</span>
+ <span class="tag p-category">{{$item.categories}}</span>
</div>
{{/if}}
{{if $item.folders}}
diff --git a/view/tpl/profile_vcard.tpl b/view/tpl/profile_vcard.tpl
index 626649784..5e9d192a1 100755
--- a/view/tpl/profile_vcard.tpl
+++ b/view/tpl/profile_vcard.tpl
@@ -26,7 +26,7 @@
{{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>
- {{if $reddress}}<div class="reddress" oncopy="return false;">{{$profile.reddress}}</div>{{/if}}
+ {{if $reddress}}<div class="reddress">{{$profile.reddress}}</div>{{/if}}
{{/if}}
{{if $pdesc}}<div class="title">{{$profile.pdesc}}</div>{{/if}}
{{if $location}}