public function getChannel() { $channels = ChannelData::getAllByUID($this->id); if (count($channels) > 0) { return $channels[0]; } }
public function getChannel() { return ChannelData::getById($this->channel_id); }
<?php $channel = null; if (Session::getUID() != "") { $channels = ChannelData::getAllByUID(Session::getUID()); $channel = $channels[0]; } ?> <div class='row'> <?php if ($channel != null) { ?> <div class='span6'> <h3 class='roboto'>Crear Album</h3> <form enctype="multipart/form-data" method='post' action='add.php' class='form-horizontal' id='form_upload'> <div class="control-group" id='title'> <label class="control-label" for="inputEmail">Titulo</label> <div class="controls"> <input type="text" name='title' id="input_title" style='width:280px;' placeholder="Titulo de el Album"> <input type="hidden" name='reference' value='addalbum'> <input type="hidden" name='channel_id' value='<?php echo $channel->id; ?> '> <span class='help-inline' id='title_control'>Debes escribir un titulo a el Album.</span> </div> </div> <div class="control-group" id='description'>
<?php $channel = ChannelData::getById($_GET['id']); // aui empieza ... if ($channel != null) { $images = ImageData::getAllByChannel($channel->id); $followers = FollowerData::getByChannelId($_GET['id']); $url = ""; $background = ""; if ($channel->image != "") { $url = "storage/channel/{$channel->id}/profile/{$channel->image}"; } if ($url != "") { $background = "style='background: url({$url}) center;'"; } $f = null; if (Session::getUID() != "") { $f = FollowerData::existFollowerChannel(Session::getUID(), $channel->id); } ?> <br> <div class='row'> <div class="col-md-12"> <h1 class='roboto'><?php echo $channel->title; ?> </h1> <p class="lead"><?php echo $channel->description; ?> </p>
<div class='row'> <?php $channels = ChannelData::getAll(); $images = ImageData::getAll(); $resultados = ImageViewData::getSearch($_GET['q']); $im = null; $url = null; if (count($resultados) > 0) { $im = $resultados[0]->getImage(); $url = "storage/channel/{$im->channel_id}/" . $im->name; } ?> <div class="col-md-12"> <h1 class='roboto'>Buscar: <?php echo $_GET['q']; ?> </h1> <?php if ($url != null) { ?> <hr><?php foreach ($resultados as $resultado) { $image = $resultado->getImage(); $url = "storage/channel/{$image->channel_id}/" . $image->name; echo <<<AAA \t\t<ul class="row"> <li class="col-md-4"> <img data-src="holder.js/360x270" class='img-responsive' src='{$url}' alt=""> </li> <li class="col-md-8">
<?php $f = new FollowerData(); $f->channel_id = $_POST['channel_id']; $f->add(); $u = UserData::getById(Session::getUID()); $channel = ChannelData::getById($_POST['channel_id']); $author = $channel->getUser(); $not_type = NotificationTypeData::getByName("Nuevo Seguidor"); $n = new NotificationData(); $n->brief = "<b>{$u->name} {$u->lastname}</b> Te Sigue"; $n->content = ""; $n->channel_id = $_POST['channel_id']; $n->image_id = "NULL"; $n->comment_id = "NULL"; $n->album_id = "NULL"; $n->notification_type_id = $not_type->id; $n->user_id = Session::getUID(); $n->add(); //index.php?module=channelinfo&id=1 print "<script>window.location='index.php?view=channelinfo&id={$_POST['channel_id']}';</script>";
<?php $channel = new ChannelData(); $channel->title = $_POST['title']; $channel->description = $_POST['description']; $channel->user_id = Session::getUID(); $channel->add(); print "<script>window.location='index.php?view=mychannel';</script>";
<div class='row'> <?php $channel_populars = ChannelData::getAll(); $image_populars = ImageData::getAll(); $im = null; $url = null; if ($image_populars != null) { $im = $image_populars[0]; $url = "storage/channel/{$im->channel_id}/" . $im->name; } // RecentWidget::renderChannels($channel_populars); ?> <div class="col-md-12"> <h2 class='roboto'>Recientes <small>Las mas nuevas</small></h2> <?php if ($url != null) { ?> <?php RecentWidget::renderImages($image_populars); } else { ?> <div class='hero-unit'> <h2 class='roboto'>No hay imagenes</h2> <p class='roboto'>No se ha cargado imagenes al sistema</p> </div> <?php } ?> </div>
</h1><br> <img class="img-responsive" src='storage/channel/<?php echo $image->channel_id . "/" . $image->name; ?> '> <br><br> <?php $xlike = null; if (Session::getUID() != "") { $xlike = IslikeData::getAllLikeImageUser($_GET['id'], Session::getUID()); } ?> <?php $channel = ChannelData::getById($image->channel_id); echo "<a href='index.php?view=channel&id={$channel->id}' class='btn btn-default pull-right'><i class='fa fa-th-large'></i> {$channel->title}</a>"; if (count($xlike) == 0) { ?> <div class="btn-group"> <a href="index.php?action=addlike&id=<?php echo $image->id; ?> &l=1" class="btn btn-default" ><i class='fa fa-thumbs-up'></i> Me Gusta</a> <a href="index.php?action=addlike&id=<?php echo $image->id; ?> &l=0" class="btn btn-default "> No Me Gusta <i class='fa fa-thumbs-down'></i></a> </div> <?php } else {