コード例 #1
0
 public function delete($id)
 {
     try {
         VideoModel::find($id)->delete();
         $alert['msg'] = 'Video has been deleted successfully';
         $alert['type'] = 'success';
     } catch (\Exception $ex) {
         $alert['msg'] = 'This Video has been already used';
         $alert['type'] = 'danger';
     }
     return Redirect::route('company.video')->with('alert', $alert);
 }
コード例 #2
0
 public function video($id, $param2, $param3 = 'nope')
 {
     $autoplay = $param3 != 'nope';
     if ($autoplay) {
         $request = $param3;
     } else {
         $request = $param2;
     }
     $video = Video::find($id);
     $url = preg_match("#^http#isU", $video->url) ? $video->url : 'http://dreamvids.fr/' . $video->url;
     $data = array();
     $data['video'] = $video;
     $data['url'] = $url;
     $data['autoplay'] = $autoplay;
     return new ViewResponse('embed/video', $data, false);
 }
コード例 #3
0
ファイル: Video.php プロジェクト: tatu-carreta/mariasanti_v2
 public static function borrar($input)
 {
     $respuesta = array();
     $reglas = array('id' => array('integer'));
     $validator = Validator::make($input, $reglas);
     if ($validator->fails()) {
         $respuesta['mensaje'] = $validator;
         $respuesta['error'] = true;
     } else {
         $video = Video::find($input['id']);
         $video->fecha_baja = date("Y-m-d H:i:s");
         $video->estado = 'B';
         $video->usuario_id_baja = Auth::user()->id;
         $video->save();
         $respuesta['mensaje'] = 'Video eliminado.';
         $respuesta['error'] = false;
         $respuesta['data'] = $video;
     }
     return $respuesta;
 }
コード例 #4
0
ファイル: playlist.php プロジェクト: boulama/DreamVids
 public function getVideos()
 {
     $videos = array();
     $videosIds = $this->videos_ids;
     if (strpos($videosIds, ';') !== false) {
         if (strpos($videosIds, ';') === 0) {
             $videosIds = substr($videosIds, 1);
         }
         if (substr($videosIds, -1) === ';') {
             $videosIds = substr($videosIds, 0, -1);
         }
         $videosIdsArray = explode(';', $videosIds);
         foreach ($videosIdsArray as $videoId) {
             $video = Video::find($videoId);
             if (is_object($video)) {
                 $videos[] = $video;
             }
         }
     }
     return $videos;
 }
コード例 #5
0
ファイル: controllerVideo.php プロジェクト: spikomino/site
 public function newVideo()
 {
     // Permet de trouver une nouvelle vidéo à l'utilisateur
     $videos = Video::all();
     foreach ($videos as $video) {
         try {
             $questionnaire = Video::find($video->id_video)->questionnaire()->where('id_user', '=', $_SESSION['id_user'])->firstorFail();
             // Si la vidéo à un questionnaire pour l'utilisateur, on passe à une autre vidéo
         } catch (\Exception $e) {
             // Si elle n'a pas de vidéo, alors ce sera la prochaine vidéo à annoter
             $_SESSION['id_video'] = $video->id_video;
             $this->app->controllerUser->video();
             $_SESSION['page'] = 4;
             // On dirige la personne vers la page de remerciement pour l'inviter à annoter une nouvelle vidéo
             $this->app->redirect($this->app->urlFor('remerciement'));
         }
     }
     $_SESSION['page'] = 5;
     // Si toutes les vidéo on été annoté, alors l'utilisateur est dirigé vers une page de fin d'expérience
     $this->app->redirect($this->app->urlFor('fin'));
 }
コード例 #6
0
 public function handleViewCount($id)
 {
     // check if this key already exists in the view_media session
     $blank_array = array();
     if (!array_key_exists($id, Session::get('viewed_video', $blank_array))) {
         try {
             // increment view
             $video = Video::find($id);
             $video->views = $video->views + 1;
             $video->save();
             // Add key to the view_media session
             Session::put('viewed_video.' . $id, time());
             return true;
         } catch (Exception $e) {
             return false;
         }
     } else {
         return false;
     }
 }
コード例 #7
0
ファイル: VideoRepository.php プロジェクト: phillipmadsen/app
 /**
  * @param $id
  * @return mixed|void
  */
 public function delete($id)
 {
     $video = $this->video->find($id);
     $video->delete();
 }
コード例 #8
0
ファイル: comment.php プロジェクト: boulama/DreamVids
 public static function postNew($authorId, $videoId, $commentContent, $parent)
 {
     $timestamp = Utils::tps();
     $poster_channel = UserChannel::find(Video::find($videoId)->poster_id);
     $admins_ids = $poster_channel->admins_ids;
     $admins_ids = ChannelAction::filterReceiver($admins_ids, "comment");
     $admin_ids_array = $poster_channel->getArrayAdminsIds($admins_ids);
     foreach ($admin_ids_array as $k => $value) {
         if ($value == Session::get()->id) {
             unset($admin_ids_array[$k]);
             break;
         }
     }
     $recipients_ids = ';' . trim(implode(';', $admin_ids_array), ';') . ';';
     $comment = Comment::create(array('id' => Comment::generateId(6), 'poster_id' => $authorId, 'video_id' => $videoId, 'comment' => $commentContent, 'likes' => 0, 'dislikes' => 0, 'timestamp' => $timestamp, 'parent' => $parent));
     ChannelAction::create(array('id' => ChannelAction::generateId(6), 'channel_id' => $authorId, 'recipients_ids' => $recipients_ids, 'type' => 'comment', 'target' => $videoId, 'complementary_id' => $comment->id, 'timestamp' => $timestamp));
     return $comment;
 }
コード例 #9
0
ファイル: Team_Index.php プロジェクト: xJakub/LCE
    private function showFriendlyMatches() {
        $csrf = $_SESSION['csrf'];
        $opponents = Model::indexBy($this->season->getTeams(), 'teamid');

        $postCsrf = HTMLResponse::fromPOST('friendlycsrf', '');

        if ($postCsrf == $csrf && $this->team->isManager()) {
            $url = HTMLResponse::fromPOST('friendlyurl');
            $opponentsId = HTMLResponse::fromPOST('friendlyopponentsid');
            $publishDate = HTMLResponse::fromPOST('friendlydate');
            $publishTime = HTMLResponse::fromPOST('friendlytime');

            if (!strlen($publishDate)) $publishDate = date('Y-m-d');
            if (!strlen($publishTime)) $publishTime = date('H').':00';

            $possibleOpponents = Model::pluck($this->season->getTeams(), 'teamid');

            $regex = '/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/';
            $timeRegex = "'^[0-9]{2}:[0-9]{2}$'";
            $dateRegex = "'^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$'";

            $removeId = HTMLResponse::fromPOST('removeid');
            if ($removeId) {
                /** @var Video $video */
                if ($video = Video::findOne('seasonid = ? and type = ? and videoid = ? and teamid = ?',
                    [$this->season->seasonid, 3, $removeId, $this->team->teamid])) {
                    $video->delete();
                    HTMLResponse::exitWithRoute(HTMLResponse::getRoute());
                }
            }

            if (!strlen($opponentsId) || !strlen($publishTime) || !strlen($publishDate) || !strlen($url)) {
                $this->design->addJavaScript("
                    $(function() { alert(\"No has rellenado todos los datos\"); })
                ", false);
            } else {
                if ($opponentsId != $this->team->teamid && in_array($opponentsId, $possibleOpponents)) {
                    if (!preg_match($regex, $url)) {
                        $this->design->addJavaScript("
                    $(function() { alert(\"El enlace que has puesto no es un enlace de YouTube válido\"); })
                ", false);
                    } else {
                        if (!preg_match($timeRegex, $publishTime)) {
                            $this->design->addJavaScript("
                    $(function() { alert(\"La hora que has puesto tiene un formato inválido (ha de ser 08:06)\"); })
                ", false);
                        } else {
                            if (!preg_match($dateRegex, $publishDate)) {
                                $this->design->addJavaScript("
                    $(function() { alert(\"La fecha que has puesto tiene un formato inválido (ha de ser 2099-12-31)\"); })
                ", false);
                            } else {
                                $video = Video::create();
                                $video->dateline = time();
                                $video->publishdate = $publishDate;
                                $video->publishtime = $publishTime;
                                $video->link = $url;
                                $video->opponentid = $opponentsId * 1;
                                $video->teamid = $this->team->teamid;
                                $video->type = 3;
                                $video->seasonid = $this->season->seasonid;
                                $video->save();
                                HTMLResponse::exitWithRoute(HTMLResponse::getRoute());
                            }
                        }
                    }
                }
            }
        }

        $videos = Video::find('seasonid = ? and teamid = ? and type = ? order by publishdate asc, publishtime asc',
            [$this->season->seasonid, $this->team->teamid, 3]);

        if ($videos || $this->team->isManager()) {
            ?>
            <h2>Combates amistosos</h2>
            <? if ($this->team->isManager()) { ?>
                <form action="<?=HTMLResponse::getRoute()?>" method="post">
            <? } ?>
            <table>
                <thead>
                <tr>
                    <td>Fecha</td>
                    <td>Hora</td>
                    <td>Oponentes</td>
                    <td>Vídeo</td>
                </tr>
                </thead>
                <? foreach($videos as $video) {
                    if (!$this->team->isManager() &&
                        ($video->publishdate > date('Y-m-d') ||
                            ($video->publishdate == date('Y-m-d') && $video->publishtime > date('H:i')))) {
                        continue;
                    }
                    ?>
                    <tr>
                        <td><?= $video->publishdate ?></td>
                        <td><?= $video->publishtime ?></td>
                        <td>
                            <a href="/<?=$this->season->getLink()?>/equipos/<?=$opponents[$video->opponentid]->getLink()?>/">
                                <?= htmlentities($opponents[$video->opponentid]->name) ?>
                            </a>
                        </td>
                        <td>
                            <a href="<?=htmlentities($video->link)?>" target="_blank">
                                Ver combate
                            </a>
                            <? if ($this->team->isManager()) { ?>
                                <a style="font-size: 10px" href="javascript:void(0)" onclick="removeFriendlyVideo(this, <?=$video->videoid?>)">
                                    (Quitar)
                                </a>
                            <? } ?>
                        </td>
                    </tr>
                <? } ?>
                <? if ($this->team->isManager()) { ?>
                    <tr>
                        <td>
                            <input type="date" name="friendlydate" placeholder="<?=date('Y-m-d')?>" style="width:80px">
                        </td>
                        <td>
                            <input name="friendlytime" placeholder="<?=date('H:i')?>" style="width: 64px">
                        </td>
                        <td>
                            <select name="friendlyopponentsid">
                                <option value="">-- Elige oponentes --</option>
                                <?
                                foreach($this->season->getTeams() as $team) {
                                    if ($team->teamid == $this->team->teamid) continue;
                                    ?>
                                    <option value="<?=$team->teamid?>">
                                        <?= htmlentities($team->name) ?>
                                    </option>
                                    <?
                                }
                                ?>
                            </select>
                        </td>
                        <td>
                            <input name="friendlyurl" placeholder="http://youtube.com/..." style="width:200px">
                        </td>
                    </tr>
                <? } ?>
            </table>
            <? if ($this->team->isManager()) { ?>
                <div style="height: 6px"></div>
                <button type="submit">Añadir amostoso</button>
                <input type="hidden" name="friendlycsrf" value="<?=$csrf?>">
                <input type="hidden" name="removeid" value="">
                </form>
            <? }
        }
    }
コード例 #10
0
ファイル: list.php プロジェクト: boulama/DreamVids
    if ($action->type == 'comment' && Utils::relative_time($action->timestamp)) {
        ?>
				<div>
					<p>
						<a href="<?php 
        echo WEBROOT . 'channel/' . $action->channel_id;
        ?>
"><?php 
        echo UserChannel::getNameById($action->channel_id);
        ?>
</a>
						a commenté votre vidéo <a href="<?php 
        echo WEBROOT . 'watch/' . $action->target;
        ?>
"><?php 
        echo Video::find($action->target)->title;
        ?>
:</a>
						<p>"<?php 
        echo Comment::getByChannelAction($action)->comment;
        ?>
"</p>

					</p>
					<p><?php 
        echo Utils::relative_time($action->timestamp);
        ?>
</p>
					<br><br>
				</div>
			<?php 
コード例 #11
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $video = Video::find($id);
     // Detach and delete any unused tags
     foreach ($video->tags as $tag) {
         $this->detachTagFromVideo($video, $tag->id);
         if (!$this->isTagContainedInAnyVideos($tag->name)) {
             $tag->delete();
         }
     }
     $this->deleteVideoImages($video);
     Video::destroy($id);
     return Redirect::to('admin/videos')->with(array('note' => 'Successfully Deleted Video', 'note_type' => 'success'));
 }
コード例 #12
0
//back to index.php
if (!$user->exists()) {
    Redirect::to('../index.php');
} else {
    if (!$user->isLoggedIn() || !$user->hasPermission('admin')) {
        Redirect::to('../index.php');
    } else {
        foreach ($_GET as $key => $value) {
            if ($value == "") {
                Redirect::to('../index.php');
            }
        }
        if (Input::exists('get')) {
            $video_entry = new Video();
            $video_entry_id = $video_entry->safe_string(Input::get('id'));
            $video_entry->find($video_entry_id);
            if (!$video_entry->exists()) {
                Redirect::to('../index.php');
            } else {
                $video_entry_title = $video_entry->data()->video_title;
                try {
                    $video_entry->delete(['id', '=', Input::get('id')]);
                    Session::flash('delete', 'Video for entry "' . $video_entry_title . '" has been deleted from the database.');
                    Redirect::to('../index.php');
                } catch (Exception $e) {
                    die($e->getMessage());
                }
            }
        } else {
            Redirect::to('../index.php');
        }
コード例 #13
0
 public function video($id, $request)
 {
     $video = Video::exists($id) ? Video::find($id) : false;
     if (!$request->acceptsJson()) {
         return new RedirectResponse(WEBROOT . 'watch/' . $id);
     }
     if (is_object($video)) {
         $comments = $video->getComments();
         $commentsData = array();
         foreach ($comments as $comment) {
             $commentsData[] = array('id' => $comment->id, 'author' => UserChannel::find($comment->poster_id)->name, 'video_id' => $comment->video_id, 'comment' => $comment->comment, 'relativeTime' => Utils::relative_time($comment->timestamp), 'timestamp' => $comment->timestamp, 'likes' => $comment->likes, 'dislikes' => $comment->dislikes);
         }
         return new JsonResponse($commentsData);
     }
     return new Response(500);
 }
コード例 #14
0
ファイル: feed.php プロジェクト: boulama/DreamVids
										<div class="thumbnail bg-loader" data-background-load-in-view data-background="http://lorempicsum.com/up/350/200/6"></div>
										<p><?php 
                        echo $phrase;
                        ?>
</p>
									</a>
									<i><?php 
                        echo Utils::relative_time($action->timestamp);
                        ?>
</i>
								</div>
							<?php 
                    } else {
                        if ($action->type == 'comment' && Video::exists($action->target)) {
                            $comment = Comment::getByChannelAction($action);
                            $video = Utils::secureActiveRecordModel(Video::find($action->target));
                            ?>
								<div class="card<?php 
                            echo $supp_class;
                            ?>
 comment">
									<a href="<?php 
                            echo WEBROOT . 'watch/' . $action->target;
                            ?>
">
										<p><b><?php 
                            echo Utils::secure($channel_action->name);
                            ?>
</b> a commenté votre vidéo "<b><?php 
                            echo $video->title;
                            ?>
コード例 #15
0
 public function supprimervideoAction()
 {
     if (isset($_GET['id'])) {
         $video = new Video();
         $selectlavideo = $video->selectOne($_GET['id']);
         $videoname = $selectlavideo['nomVideo'];
         exec('rm ' . APPLICATION_PATH . '/../public/videoNao/' . $videoname . '.mp4', $outputmp4, $returnmp4);
         exec('rm ' . APPLICATION_PATH . '/../public/videoNao/miniature/' . $videoname . '.jpeg', $outputjpeg, $returnjpeg);
         $lavideo = $video->find($_GET['id'])->current();
         $lavideo->delete();
         $this->_redirect('photovideo/video');
     }
 }
コード例 #16
0
 public function videoById($id)
 {
     $banners = $this->banners;
     $video = Video::find($id);
     return View::make('pages.videoById')->with(compact('banners', 'video'));
 }
コード例 #17
0
if (!$user->exists()) {
    Redirect::to('../index.php');
} else {
    if (!$user->isLoggedIn()) {
        Redirect::to('../index.php');
    } else {
        foreach ($_GET as $key => $value) {
            if ($value == "") {
                Redirect::to('../index.php');
            }
        }
        if (Input::exists('get')) {
            $video_entry = new Video();
            $video_entry_index = $video_entry->safe_string(Input::get('id'));
            //You can also use the video->exists method!!!
            if (!$video_entry->find($video_entry_index)) {
                echo "Data not found!";
            } else {
                $video_entry_data = $video_entry->data();
                $video_entry_date_published = $video_entry_data->date_published;
                $video_entry_date_exp = explode("-", $video_entry_date_published);
                $video_entry_date_m = $video_entry_date_exp[1];
                $video_entry_date_d = $video_entry_date_exp[2];
                $video_entry_date_y = $video_entry_date_exp[0];
            }
        } else {
            Redirect::to('../index.php');
        }
    }
}
?>
コード例 #18
0
ファイル: video.php プロジェクト: helloworldprojects/Autism
<?php

require __DIR__ . '/../../vendor/autoload.php';
require '../../config.php';
require_once '../../helpers/session.php';
require '../../helpers/boot.php';
require '../../helpers/functions.php';
require_once '../../helpers/User.php';
require_once '../../helpers/Article.php';
require_once '../../helpers/Video.php';
$video = Video::find($_GET['id']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />

  <title>Autism</title>
  <link href="../../static/css/awe.css" rel="stylesheet">
  <link href="../../static/css/player.css" rel="stylesheet">
  <script type="text/javascript" src="../../static/js/jquery-1.11.3.min.js"></script>
  <script type="text/javascript" src="../../static/js/bootstrap.min.js"></script>
  <script type="text/javascript" src="../../static/js/video.min.js"></script>

</head>

<body>

<div class="slc">
コード例 #19
0
 /**
  * 
  * Return a Json Response. The most important index for js are data.sd.status and data.hd.status : 
  * values can be : 
  * 'ok' => everything is okay, 
  * 'doing' => a file is being converted, 
  * 'no' => There is no file availlable in this resolution
  */
 public function status($id, $request)
 {
     if (Video::exists($id)) {
         $video = Video::find($id);
         $data = [];
         $sizes = ['sd' => '640x360p', 'hd' => '1280x720p'];
         //Arrays of sizes and formats
         $formats = ['mp4', 'webm'];
         foreach ($sizes as $k => $size) {
             //For each size
             foreach ($formats as $format) {
                 //And each format
                 $file_name = $video->url . '_' . $size . '.' . $format;
                 //File name = <url of the video>_<size>.<format>
                 if (Utils::stringStartsWith($file_name, 'http')) {
                     //If stocked on an external server : absoulute path.
                     $data[$k][$format] = Utils::getHTTPStatusCodeFromURL($file_name);
                 } else {
                     $data[$k][$format] = Utils::getHTTPStatusCodeFromURL('http://' . $_SERVER['HTTP_HOST'] . '/' . $file_name);
                     //Ressource is directly on the same server with relative path
                 }
             }
         }
         foreach ($data as $k => $v) {
             if ($v['mp4'] < 400 && $v['webm'] < 400) {
                 $data[$k]['status'] = 'ok';
             } elseif ($v['mp4'] < 400 xor $v['webm'] < 400) {
                 $data[$k]['status'] = 'doing';
             } else {
                 $data[$k]['status'] = 'no';
             }
         }
         return new JsonResponse($data);
         //Return as JSON
     } else {
         return new JsonResponse([null]);
     }
 }
コード例 #20
0
ファイル: video.php プロジェクト: boulama/DreamVids
		
		<div class="playlist__title">Playlist "<?php 
    echo $playlist->name;
    ?>
"</div>

		<img title="Gauche" id="playlist-button-scroll-left" class="playlist__button playlist__button--left" src="<?php 
    echo IMG . '/playlist-button-left.png';
    ?>
">

		<div id="playlist-videos" class="playlist__videos">
<?php 
    $videos_ids = json_decode($playlist->videos_ids);
    foreach ($videos_ids as $vid) {
        $vid = Video::find($vid);
        echo '<a href="' . WEBROOT . 'playlists/' . $playlist->id . '/watch/' . $vid->id . '"><div class="playlist__video bg-loader" data-background="' . $vid->getThumbnail() . '"></div></a>';
    }
    ?>
		</div>

		<img title="Droite" id="playlist-button-scroll-right" class="playlist__button playlist__button--right" src="<?php 
    echo IMG . '/playlist-button-right.png';
    ?>
">

	</section>
<?php 
}
?>
コード例 #21
0
ファイル: video.php プロジェクト: agiza/DreamVids
 public static function register($vidId, $channelId, $title, $desc, $tags, $thumb, $visibility)
 {
     $video = Video::find($vidId);
     Upload::find(array('conditions' => array('video_id = ?', $vidId)))->delete();
     $video->title = $title;
     $video->description = $desc;
     $video->tags = $tags;
     $video->visibility = in_array($visibility, array(0, 1, 2)) ? $visibility : 0;
     if ($visibility == Config::getValue_("vid_visibility_public")) {
         $video->published_once = 1;
     } else {
         $video->published_once = 0;
     }
     $video->tumbnail = Utils::upload($thumb, 'img', $vidId, $channelId, $video->getThumbnail());
     $video->save();
     if ($visibility == 2) {
         Video::sendUploadNotification($vidId, $channelId);
     }
 }
コード例 #22
0
 /**
  * Update view status of selfie video
  * POST /updateselfieviewstatus
  * Param video_id
  * @return Response
  */
 public function updateSelfieViewStatus()
 {
     $arr = array();
     $videoId = Input::get('video_id');
     if ($videoId == '') {
         $arr['Success'] = false;
         $arr['Status'] = 'Parameter missing: video_id';
         $arr['StatusCode'] = 400;
     } else {
         $selfie = Video::find($videoId);
         if ($selfie) {
             $selfie->isunpublishedview_video = 1;
             $selfie->save();
             $arr['Success'] = true;
             $arr['Status'] = 'OK';
             $arr['StatusCode'] = 200;
             $arr['Result']['id'] = $videoId;
             $arr['Result']['isunpublishedview_video'] = 1;
         } else {
             $arr['Success'] = false;
             $arr['Status'] = 'Video not found';
             $arr['StatusCode'] = 404;
         }
     }
     return Response::json($arr);
 }
コード例 #23
0
ファイル: routes.php プロジェクト: pcerbino/brea
    $cita = Cita::orderBy('created_at', 'desc')->first();
    $galerias = Galeria::with('imagenes')->where('estado', '=', 'Activa')->orderBy('order')->get();
    $video = Video::orderBy('id')->first();
    $audio = Audio::orderBy('id')->first();
    $menu = Galeria::where('menu', '=', 'Si')->orderBy('order')->get();
    return View::make('index', array('cita' => $cita, 'galerias' => $galerias, 'menu' => $menu, 'audio' => $audio, 'video' => $video));
});
Route::get('/imagen/{name}/{id}', function ($name, $id) {
    $cita = Cita::orderBy('created_at', 'desc')->first();
    $imagen = Imagen::find($id);
    $menu = Galeria::where('menu', '=', 'Si')->orderBy('order')->get();
    return View::make('imagen', array('cita' => $cita, 'imagen' => $imagen, 'menu' => $menu));
});
Route::get('/video/{name}/{id}', function ($name, $id) {
    $cita = Cita::orderBy('created_at', 'desc')->first();
    $video = Video::find($id);
    $menu = Galeria::where('menu', '=', 'Si')->orderBy('order')->get();
    return Redirect::to($video->video);
});
Route::get('/serie/{name}/{id}', function ($name, $id) {
    $cita = Cita::orderBy('created_at', 'desc')->first();
    $galeria = Galeria::find($id);
    if ($name == 'Videos') {
        $sql = "SELECT id, galeria_id, null as imagen, video, poster, null as audio, titulo, 'video' as tipo, descripcion, created_at FROM videos ORDER BY created_at desc";
    } else {
        $sql = "\n\n        SELECT id, galeria_id, imagen, null as video, null as poster, null as audio, titulo, 'imagen' as tipo, descripcion, created_at FROM imagenes WHERE galeria_id = {$id} \n                UNION \n        SELECT id, galeria_id, null as imagen, video, poster, null as audio, titulo, 'video' as tipo, descripcion, created_at FROM videos WHERE galeria_id = {$id} \n                UNION \n        SELECT id, galeria_id, null as imagen, null as video, null as poster, audio, titulo, 'audio' as tipo, descripcion, created_at FROM audios WHERE galeria_id = {$id} ORDER BY created_at desc";
    }
    $items = DB::select($sql);
    $subgalerias = "SELECT * FROM subcategorias WHERE galeria_id = " . $id;
    $subgalerias = DB::select($subgalerias);
    $menu = Galeria::where('menu', '=', 'Si')->orderBy('order')->get();
コード例 #24
0
 public function index($request)
 {
     $data = [];
     $data['videos'] = Video::find('all');
     return new ViewResponse('admin/videos/index', $data);
 }