Modified:related photos issue fixed after shifting mysql engine from myIsam to InnoDB

This commit is contained in:
Awais-cb 2018-10-09 13:11:42 +05:00
parent cd68549304
commit 4544750deb
7 changed files with 35 additions and 11 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

@ -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

@ -1222,6 +1222,7 @@ ALTER TABLE `{tbl_prefix}video` ADD `file_type` INT( 10 ) NOT NULL DEFAULT '0' A
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

@ -1,2 +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,14 +3412,20 @@ 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) {