= $start_advt_change) && ($cur_time < $stop_advt_change)) {*/ if(isset($vdo_id_req) && $vdo_id_req != "") { /*-------- extra code ---------*/ $current_dir = __DIR__; $base_dir = dirname(dirname($current_dir))."/"; define('BASE_DIR', $base_dir); define('CONF_DIR', 'includes/config/'); define('PHP_DIR', 'includes/php/'); define('MEM_DIR', 'includes/memcached/'); $secretPass = 'kljhflk73#OO#*U$O(*YO'; //$active_status = 'y'; //$inactive_status = 'n'; /**-------------------------------------------- Encode And Decode Function Start --------------------------------------------**/ function Encode($data,$pwd) { /* //to avoid notices */ $x = 0; //earlier php 7 it was defined blank $a = 0; $j = 0; $Zcrypt = ""; /* //to avoid notices */ $pwd_length = strlen($pwd); for ($i = 0; $i <= 255; $i++) { /* //to avoid notices replace $i < 255 to $i <= 255 */ $key[$i] = ord(substr($pwd, ($i % $pwd_length)+1, 1)); $counter[$i] = $i; } for ($i = 0; $i <= 255; $i++) { /* //to avoid notices replace $i < 255 to $i <= 255 */ $x = ($x + $counter[$i] + $key[$i]) % 256; $temp_swap = $counter[$i]; $counter[$i] = $counter[$x]; $counter[$x] = $temp_swap; } for ($i = 0; $i < strlen($data); $i++) { $a = ($a + 1) % 256; $j = ($j + $counter[$a]) % 256; $temp = $counter[$a]; $counter[$a] = $counter[$j]; $counter[$j] = $temp; $k = $counter[(($counter[$a] + $counter[$j]) % 256)]; $Zcipher = ord(substr($data, $i, 1)) ^ $k; $Zcrypt .= chr($Zcipher); } return $Zcrypt; } function hex2bin_for_decode($hexdata) { $bindata = ""; /* //to avoid notices */ for ($i=0;$iget($mem_cache_key_encrypt); //check for caching array $mem_cache_arr = json_decode($mem_cache_arr, true); if((is_array($mem_cache_arr) && (!empty($mem_cache_arr)) && (count($mem_cache_arr) >= 1))) { //if caching array exist return $mem_cache_arr; } } /**----------------------------------------- Fetch Cache Data End -----------------------------------------**/ /**----------------------------------------- Set Cache Data Start -----------------------------------------**/ function set_mem_cache_arr($mem_cache_key, $data_arr, $mem_cache_expire_time=60) { global $mem_obj; $mem_cache_key_encrypt = get_encrypt_mem_cache_key($mem_cache_key); //encrypted mem cache key to save data $data_arr = json_encode($data_arr); if($mem_cache_expire_time < 1) { $mem_cache_arr = $mem_obj->set($mem_cache_key_encrypt, $data_arr); //add caching for infinite time } else { $mem_cache_arr = $mem_obj->setEx($mem_cache_key_encrypt, $mem_cache_expire_time, $data_arr); //add caching for definite time } return $mem_cache_arr; } /**----------------------------------------- Set Cache Data End -----------------------------------------**/ require_once(BASE_DIR.CONF_DIR."func_video_views_update.php"); require_once(BASE_DIR.MEM_DIR."memcached_common.php"); /*-------- extra code ---------*/ /*-------------------video page views update redis recording start---------------------------*/ $vdo_play_id_encrypt = $vdo_id_req; //'371d90997a38cf'; $key_hourly = date('YmdG'); $mem_ukey_vdo_page_views = "vdo-page-views-update-$key_hourly"; vdo_page_views_update_memcache($vdo_play_id_encrypt, $mem_ukey_vdo_page_views); /*-------------------video page views update redis recording end---------------------------*/ include(BASE_DIR.PHP_DIR."db_close.php"); } else { //include(BASE_DIR.PHP_DIR."db_close.php"); return; } ?>