Skip to content

Commit

Permalink
Merge pull request #29 from DanielnetoDotCom/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
Vinzenz Hersche authored Mar 28, 2018
2 parents d943f62 + 7ee6897 commit bd6f6f1
Show file tree
Hide file tree
Showing 249 changed files with 2,244 additions and 1,871 deletions.
40 changes: 40 additions & 0 deletions objects/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,45 @@ static function userCanAdminComment($comments_id){
}
return false;
}

static function getTotalCommentsThumbsUpFromUser($users_id, $startDate, $endDate) {
global $global;
$sql = "SELECT id from comments WHERE users_id = {$users_id} ";

$res = $global['mysqli']->query($sql);

$r = array('thumbsUp'=>0, 'thumbsDown'=>0 );

if ($res) {
while ($row = $res->fetch_assoc()) {
$sql = "SELECT id from comments_likes WHERE comments_id = {$row['id']} AND `like` = 1 ";
if (!empty($startDate)) {
$sql .= " AND `created` >= '{$startDate}' ";
}

if (!empty($endDate)) {
$sql .= " AND `created` <= '{$endDate}' ";
}
$res2 = $global['mysqli']->query($sql);

$r['thumbsUp']+=$res2->num_rows;

$sql = "SELECT id from comments_likes WHERE comments_id = {$row['id']} AND `like` = -1 ";
if (!empty($startDate)) {
$sql .= " AND `created` >= '{$startDate}' ";
}

if (!empty($endDate)) {
$sql .= " AND `created` <= '{$endDate}' ";
}
$res2 = $global['mysqli']->query($sql);
$r['thumbsDown']+=$res2->num_rows;
}
}

return $r;
}



}
42 changes: 41 additions & 1 deletion objects/video.php
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ static function isOwner($videos_id, $users_id = 0) {
$sql = "SELECT * FROM videos WHERE id = {$videos_id} AND users_id = $users_id ";
$sql .= " LIMIT 1";
$res = $global['mysqli']->query($sql);
return !empty($res);
return !empty($res->num_rows);
}

/**
Expand Down Expand Up @@ -1407,6 +1407,46 @@ static function getLink($videos_id, $clean_title, $embed = false) {

return self::getLinkToVideo($videos_id, $clean_title, $embed, $type);
}

static function getTotalVideosThumbsUpFromUser($users_id, $startDate, $endDate) {
global $global;

$sql = "SELECT id from videos WHERE users_id = {$users_id} ";

$res = $global['mysqli']->query($sql);

$r = array('thumbsUp'=>0, 'thumbsDown'=>0 );

if ($res) {
while ($row = $res->fetch_assoc()) {
$sql = "SELECT id from likes WHERE videos_id = {$row['id']} AND `like` = 1 ";
if (!empty($startDate)) {
$sql .= " AND `created` >= '{$startDate}' ";
}

if (!empty($endDate)) {
$sql .= " AND `created` <= '{$endDate}' ";
}

$res2 = $global['mysqli']->query($sql);

$r['thumbsUp']+=$res2->num_rows;

$sql = "SELECT id from likes WHERE videos_id = {$row['id']} AND `like` = -1 ";
if (!empty($startDate)) {
$sql .= " AND `created` >= '{$startDate}' ";
}

if (!empty($endDate)) {
$sql .= " AND `created` <= '{$endDate}' ";
}
$res2 = $global['mysqli']->query($sql);
$r['thumbsDown']+=$res2->num_rows;
}
}

return $r;
}

}

Expand Down
2 changes: 1 addition & 1 deletion plugin/CustomizeAdvanced/CustomizeAdvanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function getUUID() {

public function getEmptyDataObject() {
$obj = new stdClass();
$obj->doNotShowUploadMP4Button = false;
$obj->doNotShowUploadMP4Button = true;
$obj->doNotShowEncoderButton = false;
$obj->doNotShowEmbedButton = false;
$obj->doNotShowEncoderResolutionLow = false;
Expand Down
12 changes: 6 additions & 6 deletions plugin/Gallery/view/modeGallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ function createOrderInfo($getName,$mostWord,$lessWord,$orderString){
echo $config->getAdsense();
?>
</div>
<div class="col-xs-12 col-sm-1 col-md-1 col-lg-1"></div>
<div class="col-xs-12 col-sm-10 col-md-10 col-lg-10 list-group-item">

<div class="col-sm-10 col-sm-offset-1 list-group-item">
<?php
if (!empty($videos)) {
$name = User::getNameIdentificationById($video['users_id']);
Expand Down Expand Up @@ -391,7 +391,7 @@ function afterExtraVideos($liveLi){
}
$countCols++;
?>
<div class="col-lg-2 col-md-4 col-sm-4 col-xs-6 galleryVideo thumbsImage fixPadding">
<div class="col-lg-2 col-sm-4 col-xs-6 galleryVideo thumbsImage fixPadding">
<a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>" >
<?php
$images = Video::getImageFromFilename($value['filename'], $value['type']);
Expand Down Expand Up @@ -506,7 +506,7 @@ function afterExtraVideos($liveLi){
}
$countCols++;
?>
<div class="col-lg-2 col-md-4 col-sm-4 col-xs-6 galleryVideo thumbsImage fixPadding">
<div class="col-lg-2 col-sm-4 col-xs-6 galleryVideo thumbsImage fixPadding">
<a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>" >
<?php
$images = Video::getImageFromFilename($value['filename'], $value['type']);
Expand Down Expand Up @@ -619,7 +619,7 @@ function afterExtraVideos($liveLi){
}
$countCols++;
?>
<div class="col-lg-2 col-md-4 col-sm-4 col-xs-6 galleryVideo thumbsImage fixPadding">
<div class="col-lg-2 col-sm-4 col-xs-6 galleryVideo thumbsImage fixPadding">
<a href="<?php echo $global['webSiteRootURL']; ?>cat/<?php echo $value['clean_category']; ?>/video/<?php echo $value['clean_title']; ?>" title="<?php echo $value['title']; ?>" >
<?php
$images = Video::getImageFromFilename($value['filename'], $value['type']);
Expand Down Expand Up @@ -712,7 +712,7 @@ function afterExtraVideos($liveLi){
<?php } ?>
</div>

<div class="col-xs-12 col-sm-1 col-md-1 col-lg-1"></div>



</div>
Expand Down
2 changes: 2 additions & 0 deletions plugin/Live/Live.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ function get_data($url) {
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$data = curl_exec($ch);
if($data===false){
error_log(curl_error($ch));
Expand Down
Loading

0 comments on commit bd6f6f1

Please sign in to comment.