<?php
function my_date_es($format_MyBB_By_Ed,$date_MyBB=0)
{
$dias_MyBB=array("Lunes","Martes","Miercoles","Jueves","Viernes","Sabado","Domingo",);
$dias_MyBB_short=array("Dom","Lun","Mar","Mie","Jue","Vie","Sab");
$meses_MyBB=array("","Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
$meses_MyBB_Short=array("","Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic");
if(ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})",$date_MyBB,$mods_By_Ed)) {
if (checkdate($mods_By_Ed[2],$mods_By_Ed[3],$mods_By_Ed[1])) {
$date_MyBB=strtotime($date_MyBB); } else { return(-1); } }
elseif ($date_MyBB==0) {
$date_MyBB=time(); }
$valMyBB=explode("|",date ("a|A|B|d|D|F|g|G|h|H|i|I|j|l|L|m|M|n|O|r|s|S|t|T|U|w|W|Y|y|z|Z",$date_MyBB));
$claves_by_Ed= array ("a","A","B","d","D","F","g","G","h","H","i","I","j","l","L","m","M","n","O","r","s","S","t","T","U","w","W","Y","y","z","Z");
for ($i=0;$i<count($claves_by_Ed);$i++) {
$modsMyBB[$claves_by_Ed[$i]]=$valMyBB[$i]; }
$modsMyBB["D"]=$dias_MyBB_short[$modsMyBB["w"]];
$modsMyBB["l"]=$dias_MyBB[$modsMyBB["w"]];
$modsMyBB["F"]=$meses_MyBB[$modsMyBB["n"]];
$modsMyBB["M"]=$meses_MyBB_Short[$modsMyBB["n"]];
$modsMyBB["r"]=$modsMyBB["D"].", ".$modsMyBB["d"]." ".$modsMyBB["M"]." ".$modsMyBB["Y"]." ".$modsMyBB["H"].":".$modsMyBB["i"].":".$modsMyBB["s"]." ".$modsMyBB["O"];
$modsMyBB["S"]="o";
$Edo_MyBB='\\\\\\';
$null=0;
$format=$format_MyBB_By_Ed;
$var_for="";
for ($MyBB=0;$MyBB<strlen($format_MyBB_By_Ed);$MyBB++) { if ($null==1) {
$var_for.=$format{$MyBB};
$null=0; } else {
if($format{$MyBB}==$Edo_MyBB) {
$null=1; } else {
if (isset($modsMyBB[$format[$MyBB]])){
$var_for.=$modsMyBB[$format[$MyBB]]; } else {
$var_for.=$format{$MyBB}; } } } }
return $var_for;
}
<?php
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
$plugins->add_hook("index_start", "prueba");
function prueba_info()
{
return array(
"name" => "Prueba",
"description" => "",
"website" => "mailto:nicedo_eeos@hotmail.com",
"author" => "Edson Ordaz Developer",
"authorsite" => "mailto:nicedo_eeos@hotmail.com",
"version" => "1.0",
"compatibility" => "16*",
);
}
function prueba_activate(){
}
function prueba_deactivate(){
}
function prueba()
{
global $header;
$header = my_date_es("D - l - F - M");
}
function my_date_es($format_MyBB_By_Ed,$date_MyBB=0)
{
$dias_MyBB=array("Lunes","Martes","Miercoles","Jueves","Viernes","Sabado","Domingo",);
$dias_MyBB_short=array("Dom","Lun","Mar","Mie","Jue","Vie","Sab");
$meses_MyBB=array("","Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
$meses_MyBB_Short=array("","Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic");
if(ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})",$date_MyBB,$mods_By_Ed)) {
if (checkdate($mods_By_Ed[2],$mods_By_Ed[3],$mods_By_Ed[1])) {
$date_MyBB=strtotime($date_MyBB); } else { return(-1); } }
elseif ($date_MyBB==0) {
$date_MyBB=time(); }
$valMyBB=explode("|",date ("a|A|B|d|D|F|g|G|h|H|i|I|j|l|L|m|M|n|O|r|s|S|t|T|U|w|W|Y|y|z|Z",$date_MyBB));
$claves_by_Ed= array ("a","A","B","d","D","F","g","G","h","H","i","I","j","l","L","m","M","n","O","r","s","S","t","T","U","w","W","Y","y","z","Z");
for ($i=0;$i<count($claves_by_Ed);$i++) {
$modsMyBB[$claves_by_Ed[$i]]=$valMyBB[$i]; }
$modsMyBB["D"]=$dias_MyBB_short[$modsMyBB["w"]];
$modsMyBB["l"]=$dias_MyBB[$modsMyBB["w"]];
$modsMyBB["F"]=$meses_MyBB[$modsMyBB["n"]];
$modsMyBB["M"]=$meses_MyBB_Short[$modsMyBB["n"]];
$modsMyBB["r"]=$modsMyBB["D"].", ".$modsMyBB["d"]." ".$modsMyBB["M"]." ".$modsMyBB["Y"]." ".$modsMyBB["H"].":".$modsMyBB["i"].":".$modsMyBB["s"]." ".$modsMyBB["O"];
$modsMyBB["S"]="o";
$Edo_MyBB='\\\\\\';
$null=0;
$format=$format_MyBB_By_Ed;
$var_for="";
for ($MyBB=0;$MyBB<strlen($format_MyBB_By_Ed);$MyBB++) { if ($null==1) {
$var_for.=$format{$MyBB};
$null=0; } else {
if($format{$MyBB}==$Edo_MyBB) {
$null=1; } else {
if (isset($modsMyBB[$format[$MyBB]])){
$var_for.=$modsMyBB[$format[$MyBB]]; } else {
$var_for.=$format{$MyBB}; } } } }
return $var_for;
}
?>