]> git.mxchange.org Git - friendica.git/blobdiff - mod/videos.php
More usage of dbm::is_result($r) instead of count($r):
[friendica.git] / mod / videos.php
index f9db7b05b19fe5e5c526f36e2d7e9e2d9bbfacb7..6550428f95150b5157ada29b0d40fb6319372f5a 100644 (file)
@@ -5,7 +5,7 @@ require_once('include/bbcode.php');
 require_once('include/security.php');
 require_once('include/redir.php');
 
-if(! function_exists('videos_init')) {
+
 function videos_init(&$a) {
 
        if($a->argc > 1)
@@ -33,10 +33,7 @@ function videos_init(&$a) {
 
                $profile = get_profiledata_by_nick($nick, $a->profile_uid);
 
-               if((intval($profile['page-flags']) == PAGE_COMMUNITY) || (intval($profile['page-flags']) == PAGE_PRVGROUP))
-                       $account_type = t('Forum');
-               else
-                       $account_type = "";
+               $account_type = account_type($profile);
 
                $tpl = get_markup_template("vcard-widget.tpl");
 
@@ -102,9 +99,9 @@ function videos_init(&$a) {
 
        return;
 }
-}
 
-if(! function_exists('videos_post')) {
+
+
 function videos_post(&$a) {
 
        $owner_uid = $a->data['user']['uid'];
@@ -143,7 +140,7 @@ function videos_post(&$a) {
                        dbesc($video_id)
                );
 
-               if(count($r)) {
+               if(dbm::is_result($r)) {
                        q("DELETE FROM `attach` WHERE `uid` = %d AND `id` = '%s'",
                                intval(local_user()),
                                dbesc($video_id)
@@ -167,7 +164,7 @@ function videos_post(&$a) {
                                $drop_id = intval($i[0]['id']);
 
                                if($i[0]['visible'])
-                                       proc_run('php',"include/notifier.php","drop","$drop_id");
+                                       proc_run(PRIORITY_HIGH, "include/notifier.php", "drop", $drop_id);
                        }
                }
 
@@ -176,11 +173,11 @@ function videos_post(&$a) {
        }
 
     goaway($a->get_baseurl() . '/videos/' . $a->data['user']['nickname']);
+
 }
-}
 
 
-if(! function_exists('videos_content')) {
+
 function videos_content(&$a) {
 
        // URLs (most aren't currently implemented):
@@ -262,11 +259,11 @@ function videos_content(&$a) {
                                        intval($contact_id),
                                        intval($owner_uid)
                                );
-                               if(count($r)) {
+                               if(dbm::is_result($r)) {
                                        $can_post = true;
                                        $contact = $r[0];
                                        $remote_contact = true;
-                                       $visitor = $cid;
+                                       $visitor = $contact_id;
                                }
                        }
                }
@@ -290,7 +287,7 @@ function videos_content(&$a) {
                                intval($contact_id),
                                intval($owner_uid)
                        );
-                       if(count($r)) {
+                       if(dbm::is_result($r)) {
                                $contact = $r[0];
                                $remote_contact = true;
                        }
@@ -350,7 +347,7 @@ function videos_content(&$a) {
                $sql_extra GROUP BY hash",
                intval($a->data['user']['uid'])
        );
-       if(count($r)) {
+       if(dbm::is_result($r)) {
                $a->set_pager_total(count($r));
                $a->set_pager_itemspage(20);
        }
@@ -366,7 +363,7 @@ function videos_content(&$a) {
 
 
        $videos = array();
-       if(count($r)) {
+       if(dbm::is_result($r)) {
                foreach($r as $rr) {
                        if($a->theme['template_engine'] === 'internal') {
                                $alt_e = template_escape($rr['filename']);
@@ -407,4 +404,4 @@ function videos_content(&$a) {
        $o .= paginate($a);
        return $o;
 }
-}
+