]> 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 ae00185cca9da11fe03c6352499ea820be86ae16..6550428f95150b5157ada29b0d40fb6319372f5a 100644 (file)
@@ -33,18 +33,16 @@ function videos_init(&$a) {
 
                $profile = get_profiledata_by_nick($nick, $a->profile_uid);
 
-               if((x($profile['page-flags']) == 1)
-                               || (x($profile['page-flags']) == 2)
-                               || (x($profile['page-flags']) == 5))
-                       $account_type = page_type_translate($profile['page-flags']);
+               $account_type = account_type($profile);
 
                $tpl = get_markup_template("vcard-widget.tpl");
 
                $vcard_widget .= replace_macros($tpl, array(
-                       '$name' => $profile[name],
-                       '$photo' => $profile[photo],
-                       '$addr' => (($profile['addr'] != "") ? $profile['addr'] : ''),
+                       '$name' => $profile['name'],
+                       '$photo' => $profile['photo'],
+                       '$addr' => (($profile['addr'] != "") ? $profile['addr'] : ""),
                        '$account_type' => $account_type,
+                       '$pdesc' => (($profile['pdesc'] != "") ? $profile['pdesc'] : ""),
                ));
 
 
@@ -60,7 +58,7 @@ function videos_init(&$a) {
                        $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 .= '<div id="sidebar-photos-albums" class="widget">';
                                $o .= '<h3>' . '<a href="' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '">' . t('Photo Albums') . '</a></h3>';
 
                                $o .= '<ul>';
@@ -142,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)
@@ -166,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);
                        }
                }
 
@@ -261,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;
                                }
                        }
                }
@@ -289,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;
                        }
@@ -349,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);
        }
@@ -365,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']);