Merge branch 'development' into demo

This commit is contained in:
Awais-cb 2018-10-11 11:46:24 +05:00
commit b8b668489c
12 changed files with 52 additions and 17 deletions

View file

@ -86,6 +86,7 @@ if(isset($_POST['update'])){
'debug_level',
'default_country_iso2',
'default_time_zone',
'pick_geo_country',
'disallowed_usernames',
'use_subs',

View file

@ -231,6 +231,13 @@
{/foreach}
</select>
</div>
<div class="col-md-4">
<label for="pick_geo_country">Pick signup country geologically(if yes default country won't work)</label>
<select name="pick_geo_country" id="pick_geo_country" class="form-control">
<option value="yes" {if $row.pick_geo_country!='no'} selected="selected"{/if}>Yes</option>
<option value="no" {if $row.pick_geo_country=='no'} selected="selected"{/if}>No</option>
</select>
</div>
</div>
<hr>

View file

@ -43,7 +43,7 @@
<div class="" style="display:none">
{foreach from=$requiredFields item=field}
{$field.class='form-control'}
{if $field.title=='Title'}
{if $field.id=='title'}
<div class="row">
<div class="col-md-6">
<label for="{$field.id}"><b style="color: #000000">{$field.name}</b></label>
@ -53,7 +53,7 @@
{/foreach}
{foreach from=$requiredFields item=field}
{$field.class='form-control'}
{if $field.title=='Description'}
{if $field.id=='desc'}
<div class="col-md-6">
<label for="{$field.id}"><b style="color: #000000">{$field.name}</b></label>
{$formObj->createField($field, true)}
@ -64,7 +64,7 @@
<div class="row">
{foreach from=$requiredFields item=field}
{$field.class='form-control'}
{if $field.title=='Video Category'}
{if $field.id=='category'}
<div class="col-md-6">
<label for="{$field.id}"><b style="color: #000000">{$field.name}</b></label>
<div class="scroll categories">
@ -75,7 +75,7 @@
{/foreach}
{foreach from=$requiredFields item=field}
{$field.class='form-control'}
{if $field.title=='Tags'}
{if $field.id=='tags'}
<div class="col-md-6">
<label for="{$field.id}"><b style="color: #000000">{$field.name}</b></label>
{$formObj->createField($field, true)}

View file

@ -310,3 +310,6 @@ INSERT INTO `{tbl_prefix}config` (`configid`, `name`, `value`) VALUES ('', 'cb_l
-- Addition for Cooporate cb allowing collection and playlist page
INSERT INTO `{tbl_prefix}config` (`configid`, `name`, `value`) VALUES ('', 'playlistsSection', 'yes');
-- Addition for Cooporate pick default sign up country geologically
INSERT INTO `{tbl_prefix}config` (`configid`, `name`, `value`) VALUES ('', 'pick_geo_country', 'yes');

View file

@ -1221,6 +1221,8 @@ ALTER TABLE `{tbl_prefix}video` ADD `conv_progress` TEXT NOT NULL;
ALTER TABLE `{tbl_prefix}video` ADD `file_type` INT( 10 ) NOT NULL DEFAULT '0' AFTER `file_name`;
ALTER TABLE `{tbl_prefix}video` ADD `blocked_countries` TEXT( 255 ) NOT NULL AFTER `country`;
ALTER TABLE `{tbl_prefix}video` ADD `sprite_count` INT(11) NOT NULL DEFAULT '0' AFTER `blocked_countries`;
ALTER TABLE `{tbl_prefix}video` ADD FULLTEXT INDEX (`title`,`tags`);
ALTER TABLE `{tbl_prefix}photos` ADD FULLTEXT INDEX (`photo_title`,`photo_tags`);
/*Cb_user_profile_info*/
ALTER TABLE `{tbl_prefix}user_profile` ADD `fb_url` VARCHAR(200) NOT NULL AFTER `web_url`, ADD `twitter_url` VARCHAR(200) NOT NULL AFTER `fb_url`, ADD `insta_url` VARCHAR(200) NOT NULL AFTER `twitter_url`;

View file

@ -0,0 +1 @@
-- No db changes made

View file

@ -0,0 +1,8 @@
-- enabling Fulltext search with InnoDB as mysql engine
ALTER TABLE `{tbl_prefix}video` ADD FULLTEXT INDEX (`title`,`tags`);
-- Addition for Cooporate pick default sign up country geologically
INSERT INTO `{tbl_prefix}config` (`configid`, `name`, `value`) VALUES ('', 'pick_geo_country', 'yes');
-- enabling Fulltext search with InnoDB as mysql engine
ALTER TABLE `{tbl_prefix}photos` ADD FULLTEXT INDEX (`photo_title`,`photo_tags`);

View file

@ -585,7 +585,7 @@ class CBPhotos
$query = $main_query;
$cond = "MATCH(".('photos.photo_title,photos.photo_tags').")";
$cond .= " AGAINST ('".$cbsearch->set_the_key($p['title'])."' IN BOOLEAN MODE)";
$cond .= " AGAINST ('".$cbsearch->set_the_key($p['title'])."' IN NATURAL LANGUAGE MODE)";
if($p['exclude'])
{
if($cond != "")
@ -624,7 +624,7 @@ class CBPhotos
$tags = str_replace('+','',$tags);
$cond = "MATCH(".('photos.photo_title,photos.photo_tags').")";
$cond .= " AGAINST ('".$tags."' IN BOOLEAN MODE)";
$cond .= " AGAINST ('".$tags."' IN NATURAL LANGUAGE MODE)";
if($p['exclude'])
{

View file

@ -3412,16 +3412,22 @@ class userquery extends CBCategory{
$dob = $dob ? date(config("date_format"),strtotime($dob)) : date(config("date_format"),strtotime('14-10-1989'));
$countries = $Cbucket->get_countries(iso2);
$user_ip = $_SERVER['REMOTE_ADDR']; // getting user's ip
$user_country = ip_info($user_ip, 'country'); // get country using IP
foreach ($countries as $code => $name) {
$name = strtolower($name);
$user_country = strtolower($user_country);
if ($name == $user_country) {
$selected_cont = $code;
$pick_geo_country = config('pick_geo_country');
if($pick_geo_country=='yes'){
$user_ip = $_SERVER['REMOTE_ADDR']; // getting user's ip
$user_country = ip_info($user_ip, 'country'); // get country using IP
foreach ($countries as $code => $name) {
$name = strtolower($name);
$user_country = strtolower($user_country);
if ($name == $user_country) {
$selected_cont = $code;
}
}
}else{
$selected_cont = config('default_country_iso2');
}
if (strlen($selected_cont) != 2) {
$selected_cont = "PK";
}

View file

@ -1119,7 +1119,7 @@ class CBvideo extends CBCategory
$cond = $superCond." AND ";
$cond .= "MATCH(".("video.title,video.tags").")
AGAINST ('".$params['title']."' IN BOOLEAN MODE) ";
AGAINST ('".$params['title']."' IN NATURAL LANGUAGE MODE) ";
if($params['exclude'])
{
@ -1151,7 +1151,7 @@ class CBvideo extends CBCategory
$cond = $superCond." AND ";
//Try Finding videos via tags
$cond .= "MATCH(".("video.title,video.tags").")
AGAINST ('".($params['tags'])."' IN BOOLEAN MODE) ";
AGAINST ('".($params['tags'])."' IN NATURAL LANGUAGE MODE) ";
if($params['exclude'])
{
if($cond!='')

7
upload/package.json Normal file
View file

@ -0,0 +1,7 @@
{
"name": "ClipBucket",
"description": "Open Source Video Sjaring Script",
"version": "4.1",
"license": "Attribution Assurance License",
"license_abbrevation": "AAL"
}

View file

@ -51,7 +51,7 @@
$tags = $vdo['tags'];
$videoid = $vdo['videoid'];
$related_videos = get_videos(array('title'=>$title,'tags'=>$tags,
'exclude'=>$videoid,'show_related'=>'yes','limit'=>12,'order'=>'date_added DESC'));
'exclude'=>$videoid,'show_related'=>'yes','limit'=>12,'order'=>'RAND()'));
if(!$related_videos){
$relMode = "ono";
$related_videos = get_videos(array('exclude'=>$videoid,'limit'=>12,'order'=>'date_added DESC'));