Beispiel #1
0
         $data[$k]['description'] = $video["description_{$locale}"];
         $video['description'] = $video["description_{$locale}"];
     }
     if ($video["cs_title_{$locale}"] != '') {
         $data[$k]['cs_title'] = $video["cs_title_{$locale}"];
         $video['cs_title'] = $video["cs_title_{$locale}"];
     }
     if ($video["dvd_title_{$locale}"] != '') {
         $data[$k]['dvd_title'] = $video["dvd_title_{$locale}"];
         $video['dvd_title'] = $video["dvd_title_{$locale}"];
     }
 }
 if ($pattern != '') {
     $data[$k]['website_link'] = $config['project_url'] . '/' . str_replace("%ID%", $video_id, str_replace("%DIR%", $video['dir'], $pattern)) . $affiliate_str;
     if ($feed_options['enable_localization'] == 1 && $locale != '') {
         $satellites = mr2array(sql("select * from {$config['tables_prefix']}admin_satellites"));
         foreach ($satellites as $satellite) {
             $satellite_website_ui_data = @unserialize($satellite['website_ui_data']);
             if ($satellite_website_ui_data['locale'] == $locale) {
                 $data[$k]['website_link'] = $satellite['project_url'] . '/' . str_replace("%ID%", $video_id, str_replace("%DIR%", $video['dir'], $satellite_website_ui_data['WEBSITE_LINK_PATTERN'])) . $affiliate_str;
                 break;
             }
         }
     }
 }
 if ($feed_options['enable_categories'] == 1) {
     $data[$k]['categories'] = get_video_categories($video_id, $feed['cache'], $feed_options['enable_localization'] == 1 && $locale != '' ? $locale : "");
 }
 if ($feed_options['enable_tags'] == 1) {
     $data[$k]['tags'] = get_video_tags($video_id, $feed['cache'], $feed_options['enable_localization'] == 1 && $locale != '' ? $locale : "");
 }
Beispiel #2
0
        $data = mr2array(sql_pr($query, $now_date));
        if (!is_dir("{$cache_dir}")) {
            mkdir("{$cache_dir}", 0777);
            chmod("{$cache_dir}", 0777);
        }
        if (!is_dir("{$cache_dir}/{$hash['0']}{$hash['1']}")) {
            mkdir("{$cache_dir}/{$hash['0']}{$hash['1']}", 0777);
            chmod("{$cache_dir}/{$hash['0']}{$hash['1']}", 0777);
        }
        $fp = fopen("{$cache_dir}/{$hash['0']}{$hash['1']}/{$hash}.dat", "w");
        flock($fp, LOCK_EX);
        fwrite($fp, serialize($data));
        fclose($fp);
    }
} else {
    $data = mr2array(sql_pr($query, $now_date));
}
$website_ui_data = @unserialize(file_get_contents("{$config['project_path']}/admin/data/system/website_ui_params.dat"));
$pattern = $website_ui_data['WEBSITE_LINK_PATTERN'];
$affiliate_str = '';
$affiliate_str_embed = '';
if ($feed['affiliate_param_name'] != '' && $_REQUEST[$feed['affiliate_param_name']] != '') {
    $affiliate_str = "?{$feed['affiliate_param_name']}=" . $_REQUEST[$feed['affiliate_param_name']];
    $affiliate_str_embed = "&wm_id=" . $_REQUEST[$feed['affiliate_param_name']];
}
foreach ($data as $k => $video) {
    $video_id = $video['video_id'];
    $dir_path = get_dir_by_id($video_id);
    $video_formats = get_video_formats($video_id, $video['file_formats']);
    $data[$k]['screen_url'] = "{$dir_path}/{$video_id}/{$screenshot_format}";
    if ($pattern != '') {