Esempio n. 1
0
$lang_exist = $obj_cal->getLangue();
$obj_cal->setLangue($lang_exist);
$obj_cal->setJourCourt();
$obj_cal->afficheMois();
$obj_cal->afficheSemaines(false);
$obj_cal->afficheJours(true);
$obj_cal->afficheNavigMois(true);
$obj_cal->activeLienMois();
//$obj_cal->activeLiensSemaines();
$obj_cal->activeJoursPasses();
$obj_cal->activeJourPresent();
$obj_cal->activeJoursFuturs();
$obj_cal->activeJoursEvenements();
$obj_cal->setFormatLienJours($pathJ);
$obj_cal->setFormatLienMois($pathM);
$obj_cal->activeAjax("ajax_calendrier", get_bloginfo('wpurl') . "/wp-content/themes/iftheme/inc/calendar/calendrier.php");
global $wpdb;
$curLang = isset($_POST['lang']) ? $_POST['lang'] : str_ireplace('-', '_', get_bloginfo('language'));
//get language code if multilang
$tablemap = $wpdb->prefix . 'icl_locale_map';
$query_lang = "SELECT code FROM {$tablemap} WHERE locale = '{$curLang}'";
$code_lang = $wpdb->get_var("SHOW TABLES LIKE '{$tablemap}'") != $tablemap ? NULL : $wpdb->get_row($query_lang);
if ($code_lang) {
    $tabletrans = $wpdb->prefix . 'icl_translations';
    $query_trans = "SELECT * FROM {$tabletrans} WHERE language_code = '{$code_lang->code}' AND element_type = 'post_post'";
    $results_trans = $wpdb->get_results($query_trans);
}
$query_str = "\n    SELECT wposts.* \n    FROM {$wpdb->posts} wposts, {$wpdb->postmeta} wpostmeta\n    WHERE wposts.ID = wpostmeta.post_id \n    AND wposts.post_status = 'publish'\n    AND wpostmeta.meta_key = 'if_events_startdate' \n    AND wposts.post_type = 'post' \n    ORDER BY wpostmeta.meta_value DESC\n    ";
$entries = $wpdb->get_results($query_str, OBJECT);
$i = 0;
if (isset($results_trans)) {