コード例 #1
0
function calendar_build(){
	$t=$_GET["t"];
	$obj_cal = new classe_calendrier("calendar-$t");
	$obj_cal->USLink=true;
	$obj_cal->afficheMois();
	$obj_cal->afficheSemaines(false);
	$obj_cal->afficheJours(true);
	$obj_cal->afficheNavigMois(true);
	$obj_cal->activeJoursPasses();
	$obj_cal->activeJourPresent();
	
	
	$obj_cal->activeJoursEvenements();	
	
	$obj_cal->setFormatLienMois("javascript:Blurz();\" OnClick=\"javascript:NavCalendar$t('%s','%s');");
	$obj_cal->setFormatLienJours("javascript:Blurz();\" OnClick=\"javascript:NavCalendarJ$t('%s','%s','%s');");

	
	
	
	
	$q=new mysql_squid_builder();
	if(isset($_SESSION["LIST_TABLES_BLOCKED"])){$hash=$_SESSION["LIST_TABLES_BLOCKED"];}else{
	$hash=$q->LIST_TABLES_BLOCKED();
	$_SESSION["LIST_TABLES_BLOCKED"]=$q->LIST_TABLES_BLOCKED();
	}
	
	if(!isset($_SESSION["LIST_TABLES_BLOCKED_EV"])){
	while (list ($tablename,$none ) = each ($hash) ){
		$ct=$q->COUNT_ROWS($tablename);
		if($ct==0){continue;}
		if(!preg_match("#^([0-9]+)_blocked$#", $tablename,$re)){continue;}
		
		$intval=$re[1];
		$Cyear=substr($intval, 0,4);
		$CMonth=substr($intval,4,2);
		$CDay=substr($intval,6,2);
		$CDay=str_replace("_", "", $CDay);
		$time=strtotime("$Cyear-$CMonth-$CDay 00:00:00");		
		$year=date("Y",$time);
		$month=date("m",$time);
		$day=date("d",$time);
		$_SESSION["LIST_TABLES_BLOCKED_EV"]["$year-$month-$day"]="$ct Hits";
		
		$obj_cal->ajouteEvenement("$year-$month-$day","$ct Hits");
	}
	}else{
		$hash=$_SESSION["LIST_TABLES_BLOCKED_EV"];
		while (list ($d,$h ) = each ($hash) ){
			$obj_cal->ajouteEvenement($d,$h);
		}
	}
	
	$calendar=$obj_cal->makeCalendrier($_GET["year"],$_GET["month"]);
	echo $calendar;
	
}
コード例 #2
0
ファイル: calendrier.php プロジェクト: JigSawFr/iftheme
}
$obj_cal->setLangue(strtoupper($lang));
$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);