Devil Can't Burn
Hey ! My name is Julien Chaniolleau.
I’m graphic designer, web developper and Mac lover.
And it’s my personal web site to know some more about me... then...Hellcome !
Hey ! My name is Julien Chaniolleau.
I’m graphic designer, web developper and Mac lover.
And it’s my personal web site to know some more about me... then...Hellcome !
Here some parts of codes and easy ways which will be perhaps useful for you. You'll find some codes for PHP, Javascript, CSS and Hacks...
How to announce an external link?Here you can display a css class if the url is not same than the current domain name.
a[href^="http://"]{
color:#555;
background-color:#ecf3fd;
padding:3px;
border:1px solid #b7d5ff; border-width:1px 0 1px 0;
}
a[href^="http://"]:hover{
color:#0099de;
background-color:#fff6ea;
padding:3px;
border:1px solid #fedeb5; border-width:1px 0 1px 0;
}
a[href*="devilcantburn.com"] {
padding: 0;
background: none;
}
Same domain : www.devilcantburn.com - Other domain : www.google.com
How to make beautiful separators of block?To improve your page-setting, anything of such as a separator of block text.
Here how to carry out one of them, very simply.
<p class="sepalight"></p> or <div class="sepalight"></div>
.sepalight{
width:630px; height:30px; /* image sizes */
/* image center in the bloc */
background:url(../images/sepalight.png) no-repeat 50% 50%;
display:block;
}
How to make a message box on rollover?All is in the title...
<div class="bloc_css_3> <a href="#"><strong>See the box</strong>
<span> cool CSS rollover !</span></a> </div>
.bloc_css_3{ margin:12px; }
.bloc_css_3{font-size:2em;}
.bloc_css_3:hover{ cursor:help; }
.bloc_css_3 a{ display:block;
width:auto;
z-index:10;
}
.bloc_css_3 a:hover{
position:relative;
z-index:100; cursor:help;
}
.bloc_css_3 a span{
font-size:0.7em;
display:none;
}
.bloc_css_3 a:hover span{
display:block;
position:absolute;
float:left;
top:-50%;
left:300px;
background:#b7ceec;
border:3px solid #516784;
color:#263344;
padding:10px 20px;
z-index:10;
}
When the time become conditional...Here, we go to see how to make a conditional date like : There is 8 mn 45 s
function ilya($data_ref){
$current_date = date('Y-m-d H:i:s');
// Extraction de $current_date
$current_year = substr($current_date,0,4);
$current_month = substr($current_date,5,2);
$current_day = substr($current_date,8,2);
// Extraction de $data_ref
$ref_year = substr($data_ref,0,4);
$ref_month = substr($data_ref,5,2);
$ref_day = substr($data_ref,8,2);
// Creation de la chaine type : 20071021
$tempMaxDate = $current_year . $current_month . $current_day;
$tempDataRef = $ref_year . $ref_month . $ref_day;
$tempDifference = $tempMaxDate-$tempDataRef;
if($tempDifference >= 3){
$date = substr($data_ref,0,20);
$jours = substr($date,8,2);
$mois = substr($date,5,2);
$an = substr($date,2,2);
$m = substr($date,14,2);
$h = substr($date,11,2);
$prefix = "";
$suffix = "";
$tab_month = array(1=>"Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre");
$tab_day = array("Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi");
$tab_date = explode(' ', $date);
$date_hour = explode(':', $tab_date[1]);
$tab_dmy = explode('-', $tab_date[0]);
$day = date("w", mktime(0, 0, 0, $tab_dmy[1], $tab_dmy[2], $tab_dmy[0]));
$date = $prefix . "$tab_day[$day] " . "$tab_dmy[2] ";
settype($tab_dmy[1], integer);
$date .= $tab_month[$tab_dmy[1]] . " $tab_dmy[0]";
echo $date;
} else {
// Extraction de $current_date H:m:ss
$current_hour = substr($current_date,11,2);
$current_min = substr($current_date,14,2);
$current_seconds = substr($current_date,17,2);
// Extraction de $data_ref Date H:m:ss
$ref_hour = substr($data_ref,11,2);
$ref_min = substr($data_ref,14,2);
$ref_seconds = substr($data_ref,17,2);
$dDf = $current_day-$ref_day;
$hDf = $current_hour-$ref_hour;
$mDf = $current_min-$ref_min;
$sDf = $current_seconds-$ref_seconds;
if($dDf>1){
echo 'il y a ' .$dDf . ' jours';
}
elseif($dDf<1){
// Heures
if($hDf>0){
if($mDf<0){
$mDf = 60 + $mDf;
$hDf = $hDf -1;
echo 'Il y a ' . $hDf . ' h ' . $mDf . ' min';
} else {
echo 'Il y a ' . $mDf . ' min';
}
} else {
if($mDf>0){
echo 'Il y a ' . $mDf . ' min ';
} else {
echo 'Il y a ' . $sDf . ' sec';
}
}
} else {
echo 'Il y a ' . $dDf . ' jour';
}
}
}