]> git.mxchange.org Git - friendica.git/blobdiff - mod/wall_upload.php
Markdown formatting and minor changes
[friendica.git] / mod / wall_upload.php
index 164ca470c3c9cc042e4e0709b0086c3b734c79d2..d6cb0c2e1a9db6ce7033887f28a0a8a6611908e8 100644 (file)
@@ -12,6 +12,7 @@
 use Friendica\App;
 use Friendica\Core\System;
 use Friendica\Core\Config;
+use Friendica\Database\DBM;
 
 require_once 'include/Photo.php';
 
@@ -32,7 +33,7 @@ function wall_upload_post(App $a, $desktopmode = true) {
                                dbesc($nick)
                        );
 
-                       if (! dbm::is_result($r)) {
+                       if (! DBM::is_result($r)) {
                                if ($r_json) {
                                        echo json_encode(array('error'=>t('Invalid request.')));
                                        killme();
@@ -88,7 +89,7 @@ function wall_upload_post(App $a, $desktopmode = true) {
                                        intval($contact_id),
                                        intval($page_owner_uid)
                                );
-                               if (dbm::is_result($r)) {
+                               if (DBM::is_result($r)) {
                                        $can_post = true;
                                        $visitor = $contact_id;
                                }
@@ -189,29 +190,6 @@ function wall_upload_post(App $a, $desktopmode = true) {
                killme();
        }
 
-
-       $limit = service_class_fetch($page_owner_uid, 'photo_upload_limit');
-
-       if ($limit) {
-               $r = q("SELECT SUM(OCTET_LENGTH(`data`)) AS `total` FROM `photo`
-                       WHERE `uid` = %d AND `scale` = 0
-                       AND `album` != 'Contact Photos' ",
-                       intval($page_owner_uid)
-               );
-               $size = $r[0]['total'];
-
-               if (($size + strlen($imagedata)) > $limit) {
-                       $msg = upgrade_message(true);
-                       if ($r_json) {
-                               echo json_encode(array('error'=>$msg));
-                       } else {
-                               echo  $msg. EOL;
-                       }
-                       @unlink($src);
-                       killme();
-               }
-       }
-
        $imagedata = @file_get_contents($src);
        $ph = new Photo($imagedata, $filetype);