]> git.mxchange.org Git - friendica.git/blobdiff - mod/videos.php
Merge branch 'develop' into rewrites/dbm_is_result
[friendica.git] / mod / videos.php
index eb5a2cee4e191815b43e1622085f69ffeffe4f7f..58c4b6c6508bb4f5adaba776da6551aa487b3c92 100644 (file)
@@ -106,13 +106,17 @@ function videos_post(App &$a) {
 
        $owner_uid = $a->data['user']['uid'];
 
-       if (local_user() != $owner_uid) goaway(App::get_baseurl() . '/videos/' . $a->data['user']['nickname']);
+       if (local_user() != $owner_uid) {
+               goaway(App::get_baseurl() . '/videos/' . $a->data['user']['nickname']);
+       }
 
-       if(($a->argc == 2) && x($_POST,'delete') && x($_POST, 'id')) {
+       if (($a->argc == 2) && x($_POST,'delete') && x($_POST, 'id')) {
 
                // Check if we should do HTML-based delete confirmation
                if(!x($_REQUEST,'confirm')) {
-                       if(x($_REQUEST,'canceled')) goaway(App::get_baseurl() . '/videos/' . $a->data['user']['nickname']);
+                       if (x($_REQUEST,'canceled')) {
+                               goaway(App::get_baseurl() . '/videos/' . $a->data['user']['nickname']);
+                       }
 
                        $drop_url = $a->query_string;
                        $a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), array(
@@ -149,8 +153,8 @@ function videos_post(App &$a) {
                                dbesc($video_id),
                                intval(local_user())
                        );
-                       #echo "<pre>"; var_dump($i); killme();
-                       if(count($i)) {
+                       //echo "<pre>"; var_dump($i); killme();
+                       if (dbm::is_result($i)) {
                                q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
                                        dbesc(datetime_convert()),
                                        dbesc(datetime_convert()),
@@ -172,7 +176,7 @@ function videos_post(App &$a) {
                return; // NOTREACHED
        }
 
-    goaway(App::get_baseurl() . '/videos/' . $a->data['user']['nickname']);
+       goaway(App::get_baseurl() . '/videos/' . $a->data['user']['nickname']);
 
 }
 
@@ -376,12 +380,12 @@ function videos_content(App &$a) {
 
                        $videos[] = array(
                                'id'       => $rr['id'],
-                               'link'          => App::get_baseurl() . '/videos/' . $a->data['user']['nickname'] . '/video/' . $rr['resource-id'],
-                               'title'         => t('View Video'),
-                               'src'           => App::get_baseurl() . '/attach/' . $rr['id'] . '?attachment=0',
-                               'alt'           => $alt_e,
-                               'mime'          => $rr['filetype'],
-                               'album' => array(
+                               'link'     => App::get_baseurl() . '/videos/' . $a->data['user']['nickname'] . '/video/' . $rr['resource-id'],
+                               'title'    => t('View Video'),
+                               'src'      => App::get_baseurl() . '/attach/' . $rr['id'] . '?attachment=0',
+                               'alt'      => $alt_e,
+                               'mime'     => $rr['filetype'],
+                               'album' => array(
                                        'link'  => App::get_baseurl() . '/videos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']),
                                        'name'  => $name_e,
                                        'alt'   => t('View Album'),
@@ -393,11 +397,11 @@ function videos_content(App &$a) {
 
        $tpl = get_markup_template('videos_recent.tpl');
        $o .= replace_macros($tpl, array(
-               '$title' => t('Recent Videos'),
-               '$can_post' => $can_post,
-               '$upload' => array(t('Upload New Videos'), App::get_baseurl().'/videos/'.$a->data['user']['nickname'].'/upload'),
-               '$videos' => $videos,
-        '$delete_url' => (($can_post)?App::get_baseurl().'/videos/'.$a->data['user']['nickname']:False)
+               '$title'      => t('Recent Videos'),
+               '$can_post'   => $can_post,
+               '$upload'     => array(t('Upload New Videos'), App::get_baseurl().'/videos/'.$a->data['user']['nickname'].'/upload'),
+               '$videos'     => $videos,
+               '$delete_url' => (($can_post)?App::get_baseurl().'/videos/'.$a->data['user']['nickname']:False)
        ));