/** * Cleans all the generated fields of the data obkects */ public function clean() { $this->comment->clean(); if ($this->media !== null) { $this->media->clean(); } }
function __construct($post_id, $page = false, $info = NULL) { parent::__construct("posts_has_comments", "posts_id", intval($post_id), "posts"); $this->page = intval($page); $this->action_method = "post_post"; $this->router = lib()->using('router'); if ($info === NULL) { $this->post_info = $this->db->get("posts", ['users_id' => 'user_id', 'post_status', 'post_allow_comment'], ['id' => $post_id]); } else { $this->post_info = $info; } }
function __construct($g_id, $page = false, $info = NULL) { parent::__construct("gallery_has_comments", "gallery_id", intval($g_id), "gallery"); $this->page = intval($page); $this->action_method = "post_gallery"; $this->router = lib()->using('router'); if (!is_array($info)) { $this->gallery_info = $this->db->get("gallery", ["gallery_comment_status", 'users_id' => 'user_id', 'gallery_title', 'gallery_status'], ['id' => $g_id]); } else { $this->gallery_info = $info; } }
public static function recent_comments($val) { $ret = ""; $values = explode(",", $val); if (count($values) > 0) { $posts = CommentData::getApproveds($values[0]); if (count($posts) > 0) { $ret = "<ul type='none'>"; foreach ($posts as $p) { $px = $p->getPost(); $ret .= "<li><i class='fa fa-comment'></i> {$p->content} por <b>{$p->name}</b> en <a href='./?view=post&id=" . $p->id . "'>" . $px->title . "</a></li>"; } $ret .= "</ul>"; } } return $ret; }
/** * 构造函数 * @param int $pic_id 图片ID * @param int|bool $page 当前页面数 * @param array $info 图片的相关信息 * @throws \Exception */ function __construct($pic_id, $page = false, $info = NULL) { parent::__construct("pictures_has_comments", "pictures_id", intval($pic_id), "pictures"); $this->page = intval($page); $this->action_method = "post_picture"; $this->router = lib()->using('router'); if ($info === NULL) { lib()->load('Picture'); $pic = new Picture(); $this->picture_info = $pic->get_simple_pic($pic_id); } else { $this->picture_info = $info; } if (!isset($this->picture_info['pic_id'])) { throw new \Exception("Picture comment load error."); } }
<?php } ?> <p><?php echo $file->description; ?> </p> <br> <p class="text-muted"><i class="fa fa-clock-o"></i> <?php echo $file->created_at; ?> </p> <?php $comments = CommentData::getAllByFileId($file->id); ?> <h3>Comentarios (<?php echo count($comments); ?> )</h3> <form method="post" action="./?action=addfilecomment"> <div class="form-group"> <textarea name="comment" required class="form-control"></textarea> </div> <input type="hidden" value="<?php echo $file->id; ?> " name="id"> <input type="submit" class="btn btn-primary" value="Enviar comentario">
<h1>Comentarios</h1> <a class="btn btn-default" href='index.php?view=channelpanel'>Configuracion</a> <a class="btn btn-default" href='index.php?view=channelpanel&part=image2'>Imagen de Canal</a> <a class="btn btn-default" href='index.php?view=channelpanel&part=followers'>Seguidores</a> <a class="btn btn-default" href='index.php?view=channelpanel&part=comments'>Comentarios</a> <br> <?php $comments = CommentData::getAllByChannelId($channel->id); if (count($comments) > 0) { foreach ($comments as $com) { $user = $com->getUser(); ?> <tr> <div class="media"> <a class="pull-left" href="#"> <img class="media-object" data-src="holder.js/64x64"> </a> <div class="media-body"> <h4 class="media-heading"><?php echo $user->name . " " . $user->lastname; ?> en <a href=''><?php echo $com->getImage()->title; ?> </a></h4> <?php echo $com->content; ?> </div> </div> <?php
<?php $comments = CommentData::getAllByTR($_POST["t"], $_POST["r"]); if (count($comments) > 0) { ?> <hr> <div style="background:#f0f0f0;"> <ul class="media-list"> <?php foreach ($comments as $comment) { ?> <li class="media"> <div class="media-body" style="font-size:14px;"> <p class="media-heading"><b><?php echo $comment->getUser()->getFullname(); ?> </b></p> <p><?php echo $comment->content; ?> </p> <hr style="margin:0;border-top: 1px #e5e5e5 solid;"> </div> </li> <?php } ?> </ul> </div> <?php }
<?php /** * @author evilnapsis * @brief Agregar likes apartir del id y tipo de referencia con el usuario logeado. **/ if (Session::exists("user_id") && !empty($_POST)) { if ($_POST["content"] != "") { $h = new CommentData(); $h->ref_id = $_POST["r"]; $h->user_id = $_SESSION["user_id"]; $h->type_id = $_POST["t"]; $h->content = $_POST["content"]; $h->add(); $user_id = null; $author_id = null; if ($_POST["t"] == 1) { $post = PostData::getReceptorId($_POST["r"]); $user_id = $post->receptor_ref_id; $author_id = $post->author_ref_id; } else { if ($_POST["t"] == 2) { $post = ImageData::getUserId($_POST["r"]); $user_id = $post->user_id; $author_id = $post->user_id; } } if ($author_id != $_SESSION["user_id"] && $user_id != $_SESSION["user_id"]) { // si es el mismo autor del post, entonces no le notificamos $notification = new NotificationData(); $notification->not_type_id = 2;
public function searchForNewComments() { $curl=curl_init(); $vidId=$this->getVideoId(); $request="http://gdata.youtube.com/feeds/api/videos/{$vidId}/comments"; curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($curl, CURLOPT_URL,$request); $response = curl_exec ($curl); curl_close($curl); try{ $commentFeed=new SimpleXMLElement($response); foreach ($commentFeed as $commentEntry) { if (!CommentData::commentExists($commentEntry->id)) { echo 'YouTube Comment: ' . $commentEntry->title. "\n"; $c=CommentData::create(); $c->setMessageId($this->getId()); $c->setCommentId($commentEntry->id); $c->setComment($commentEntry->content); $c->setAuthorName($commentEntry->author[0]->name); $c->setServiceId('3'); $tZulu=$commentEntry->published; $toStrip=array("T", "Z"); $tZuluStripped=str_replace($toStrip, " ", $tZulu); $tZuluStrippedUnix=strtotime($tZuluStripped); $gooddate=date('Y-m-d H:i:s', $tZuluStrippedUnix); $c->setDate($gooddate); } $this->incrimentChecked(); } } Catch(Exception $e) { echo "Youtube had no response. Please try again later \n"; } }
<?php if (!empty($_POST)) { $file = FileData::getById($_POST["id"]); $p = new CommentData(); $p->user_id = $_SESSION["user_id"]; $p->file_id = $_POST["id"]; $p->comment = $_POST["comment"]; $p->add(); Core::alert("Agregado exitosamente!"); Core::redir("./?view=file&code=" . $file->code); }
<?php $comment = new CommentData(); $comment->content = $_POST['content']; $comment->image_id = $_POST['image_id']; $comment->user_id = Session::getUID(); $comment->add(); $not_type = NotificationTypeData::getByName("Nuevo Comentario"); $u = UserData::getById(Session::getUID()); $image = ImageData::getById($_POST['image_id']); $n = new NotificationData(); $n->brief = "<b>{$u->name} {$u->lastname}</b> Te ha agregado un nuevo comentario."; $n->content = ""; $n->channel_id = $image->channel_id; $n->image_id = $_POST['image_id']; $n->comment_id = "NULL"; $n->album_id = "NULL"; $n->notification_type_id = $not_type->id; $n->user_id = Session::getUID(); $n->add(); print "<script>window.location='index.php?view=image&id={$_POST['image_id']}';</script>";
} else { if ($xlike[0]->is_like == "1") { echo "<button class='btn btn-primary'><i class='fa fa-thumbs-up'></i> Me Gusta</button>"; } else { if ($xlike[0]->is_like == "0") { echo "<button class='btn btn-danger'><i class='fa fa-thumbs-down'></i> No Me Gusta</button>"; } } ?> <?php } ?> <br> <span class='label label-default'>visto <?php $cx = count(ImageViewData::getAllByImageId($_GET['id'])); $comments = CommentData::getAllByImageId($_GET['id']); echo $cx; if ($cx == 1) { echo " vez"; } else { echo " veces"; } ?> <i class='fa fa-eye-open'></i></span> <div class='clearfix'></div> <!-- Place this tag where you want the share button to render. --> <!-- <ul> <li style='display:inline;'><div class="g-plus" data-action="share" data-annotation="none"></div></li> <li style='display:inline;'> <div class="fb-share-button" data-href="http://yobup.com/index.php?view=image&id=<?php