aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/dfrn_confirm.php2
-rw-r--r--mod/photos.php39
-rw-r--r--mod/profiles.php21
3 files changed, 57 insertions, 5 deletions
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php
index 76b99cbca..8e39f5fd0 100644
--- a/mod/dfrn_confirm.php
+++ b/mod/dfrn_confirm.php
@@ -146,7 +146,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
*/
require_once('include/crypto.php');
- $res = new_keypair(1024);
+ $res = new_keypair(4096);
$private_key = $res['prvkey'];
$public_key = $res['pubkey'];
diff --git a/mod/photos.php b/mod/photos.php
index d96bc135e..ea4d7f81f 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -38,8 +38,10 @@ function photos_init(&$a) {
$o .= '<div class="fn">' . $a->data['user']['username'] . '</div>';
$o .= '<div id="profile-photo-wrapper"><img class="photo" style="width: 175px; height: 175px;" src="' . $a->get_cached_avatar_image($a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg') . '" alt="' . $a->data['user']['username'] . '" /></div>';
$o .= '</div>';
-
- if(! intval($a->data['user']['hidewall'])) {
+
+ $albums_visible = ((intval($a->data['user']['hidewall']) && (! local_user()) && (! remote_user())) ? false : true);
+
+ if($albums_visible) {
$o .= '<div id="side-bar-photos-albums" class="widget">';
$o .= '<h3>' . '<a href="' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '">' . t('Photo Albums') . '</a></h3>';
@@ -709,6 +711,24 @@ function photos_post(&$a) {
logger('mod/photos.php: photos_post(): loading the contents of ' . $src , LOGGER_DEBUG);
$imagedata = @file_get_contents($src);
+
+
+
+ $r = q("select sum(octet_length(data)) as total from photo where uid = %d and scale = 0 and album != 'Contact Photos' ",
+ intval($a->data['user']['uid'])
+ );
+
+ $limit = service_class_fetch($a->data['user']['uid'],'photo_upload_limit');
+
+ if(($limit !== false) && (($r[0]['total'] + strlen($imagedata)) > $limit)) {
+ notice( upgrade_message() . EOL );
+ @unlink($src);
+ $foo = 0;
+ call_hooks('photo_post_end',$foo);
+ killme();
+ }
+
+
$ph = new Photo($imagedata, $type);
if(! $ph->is_valid()) {
@@ -966,12 +986,25 @@ function photos_content(&$a) {
<input type="submit" name="submit" value="' . t('Submit') . '" id="photos-upload-submit" /> </div>';
-
+ $r = q("select sum(octet_length(data)) as total from photo where uid = %d and scale = 0 and album != 'Contact Photos' ",
+ intval($a->data['user']['uid'])
+ );
+
+
+ $limit = service_class_fetch($a->data['user']['uid'],'photo_upload_limit');
+ if($limit !== false) {
+ $usage_message = sprintf( t("You have used %1$.2f Mbytes of %2$.2f Mbytes photo storage."), $r[0]['total'] / 1024000, $limit / 1024000 );
+ }
+ else {
+ $usage_message = sprintf( t('You have used %1$.2f Mbytes of photo storage.'), $r[0]['total'] / 1024000 );
+ }
+
$tpl = get_markup_template('photos_upload.tpl');
$o .= replace_macros($tpl,array(
'$pagename' => t('Upload Photos'),
'$sessid' => session_id(),
+ '$usage' => $usage_message,
'$nickname' => $a->data['user']['nickname'],
'$newalbum' => t('New album name: '),
'$existalbumtext' => t('or existing album name: '),
diff --git a/mod/profiles.php b/mod/profiles.php
index a9da5454c..4df8a5af7 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -130,6 +130,9 @@ function profiles_post(&$a) {
$politic = notags(trim($_POST['politic']));
$religion = notags(trim($_POST['religion']));
+ $likes = fix_mce_lf(escape_tags(trim($_POST['likes'])));
+ $dislikes = fix_mce_lf(escape_tags(trim($_POST['dislikes'])));
+
$about = fix_mce_lf(escape_tags(trim($_POST['about'])));
$interest = fix_mce_lf(escape_tags(trim($_POST['interest'])));
$contact = fix_mce_lf(escape_tags(trim($_POST['contact'])));
@@ -155,7 +158,15 @@ function profiles_post(&$a) {
if($withchanged) {
$changes[] = '[color=#ff0000]&hearts;[/color] ' . t('Romantic Partner');
$value = strip_tags($with);
- }
+ }
+ if($likes != $orig[0]['likes']) {
+ $changes[] = t('Likes');
+ $value = $likes;
+ }
+ if($dislikes != $orig[0]['dislikes']) {
+ $changes[] = t('Dislikes');
+ $value = $dislikes;
+ }
if($work != $orig[0]['work']) {
$changes[] = t('Work/Employment');
}
@@ -222,6 +233,8 @@ function profiles_post(&$a) {
`religion` = '%s',
`pub_keywords` = '%s',
`prv_keywords` = '%s',
+ `likes` = '%s',
+ `dislikes` = '%s',
`about` = '%s',
`interest` = '%s',
`contact` = '%s',
@@ -254,6 +267,8 @@ function profiles_post(&$a) {
dbesc($religion),
dbesc($pub_keywords),
dbesc($prv_keywords),
+ dbesc($likes),
+ dbesc($dislikes),
dbesc($about),
dbesc($interest),
dbesc($contact),
@@ -577,6 +592,8 @@ function profiles_content(&$a) {
'$lbl_religion' => t('Religious Views:'),
'$lbl_pubkey' => t('Public Keywords:'),
'$lbl_prvkey' => t('Private Keywords:'),
+ '$lbl_likes' => t('Likes:'),
+ '$lbl_dislikes' => t('Dislikes:'),
'$lbl_ex2' => t('Example: fishing photography software'),
'$lbl_pubdsc' => t("\x28Used for suggesting potential friends, can be seen by others\x29"),
'$lbl_prvdsc' => t("\x28Used for searching profiles, never shown to others\x29"),
@@ -617,6 +634,8 @@ function profiles_content(&$a) {
'$religion' => $r[0]['religion'],
'$pub_keywords' => $r[0]['pub_keywords'],
'$prv_keywords' => $r[0]['prv_keywords'],
+ '$likes' => $r[0]['likes'],
+ '$dislikes' => $r[0]['dislikes'],
'$music' => $r[0]['music'],
'$book' => $r[0]['book'],
'$tv' => $r[0]['tv'],