lundi 23 décembre 2013 à 20:15
ok je note mike007
Réponse ci-dessus posté le vendredi 09 novembre 2012 : 12:17
salut, j'ai mis ça pour le bloc.php
Code PHP :
Pour copier le contenu exact du code,
Veuillez citer le message
<?php
-
$bloc = "
-
<!-- Debut du Bloc -->
<CENTER>
<SCRIPT LANGUAGE=\"JavaScript\">
document.write(\"<b>Addresse IP</b><br> $_SERVER[REMOTE_ADDR]\");
document.write(\"<hr><b>Résolution</b><br>\" +screen.width+ \"x\" +screen.height+ \"x\" +window.screen.colorDepth);
-
document.write(\"<hr><b>Navigateur</b><br>\" +navigator.appName);
-
var ua = navigator.userAgent
if (ua.indexOf(\"Linux\") > -1) name = \"Linux: The Best OS\";
else if (ua.indexOf(\"PPC Mac OS X\") > -1) name = \"Mac OS >= X\";
else if (ua.indexOf(\"Macintosh\")> -1) name =\"Mac OS <= 9\";
else if (ua.indexOf(\"95\") > -1 && ua.indexOf(\"Win\") >-1) name=\"Windows 95\";
else if (ua.indexOf(\"98\") > -1 && ua.indexOf(\"Win\") > -1) name=\"Windows 98\";
else if (ua.indexOf(\"Windows NT 5.0\") > -1) name=\"Windows 2000\";
else if (ua.indexOf(\"Windows NT 5.1\") > -1) name =\"Windows XP\";
else if (ua.indexOf(\"Windows NT 6.0\") > -1) name =\"Windows Vista\";
else if (ua.indexOf(\"Windows NT 6.1\") > -1) name =\"Windows Seven\";
else if (ua.indexOf(\"Windows NT 6.2\") > -1) name =\"Windows 8\";
else name = \"Undeterminded OS\";
document.write(\"<hr><b>Plateforme</b><br>\" +name);
</script>
</CENTER>
<!-- Fin du Bloc -->";
Bloc ($result_blocs->parametre1,$bloc) ;
?>
et ça dans admin.php
Code PHP :
Pour copier le contenu exact du code,
Veuillez citer le message
<?php
if (!eregi("index.php", $_SERVER['PHP_SELF'])) {
die ("Vous n'avez pas l'autorisation d'accéder à ce fichier.");
}
$requete=mysql_query("SELECT * FROM `users` WHERE `users`.`pseudo`=\"$pseudo\"");
$ligne = mysql_fetch_object($requete);
if ($ligne->grade=4) {
-
$infos = "Nom : <a href=index.php?mod=admin&ac=param&id=$result_blocs->id onmouseover=aide(\"C'est le titre de la fenêtre.\"); onmouseout=aide(\"Cliquez sur un parametre pour le modifier\");>$result_blocs->parametre1 [Editer]</A><BR><BR>";
-
$informations = "<B>Nom</B> : MeZinfo<BR>
<B>Type</B> : Bloc<BR>
<B>Auteur</B> : b0b0</a><BR>
<B>Version</B> : 1.0<BR>
<BR>
<B>Description</B> : Bloc d'informations Systeme" ;
-
$new = "<form action=modules/admin/new3.php>
Ajouter le bloc MeZinfo :
<BR><BR>Ce bloc affiches quelques infos sur votre pc (Résolution, Addresse IP, ...) .
<BR><BR>Nom de la fenetre : <input type=text value=MeZinfo name=parametre1 size=20 maxlength=30>
<BR><BR><input type=submit value='Ajouter le bloc'>
<input type=hidden name=emplacement value=$emplacement>
<input type=hidden name=module value=$module>
</form>" ;
-
$edit = "<form action=modules/admin/edit.php>
Bloc 'MeZinfo':
<BR><BR>Nom de la fenetre : <input type=text value=\"$parametre1\" name=parametre1 size=20 maxlength=30>
<BR><BR><input type=submit value='Valider'>
<input type=hidden name=id value=$id>
</form>" ;
}
?>
pouvais vous me dire si c'est bon je ne suis pas persuadé du bon code
merci par avance de votre aide
Réponse ci-dessus posté le jeudi 13 décembre 2012 : 13:12
Code PHP :
Pour copier le contenu exact du code,
Veuillez citer le message
<?php
function OS() {
$ua = $_SERVER['HTTP_USER_AGENT'];
$os = "Autre/Bot";
$os_arr = array(
// -- Windows Phone
'Windows Phone' => 'Windows Phone',
// -- Android
'Android' => 'Android',
// -- Windows
'Windows NT 6.2' => 'Windows 8',
'Windows NT 6.1' => 'Windows Seven',
'Windows NT 6.0' => 'Windows Vista',
'Windows NT 5.2' => 'Windows Server 2003',
'Windows NT 5.1' => 'Windows XP',
'Windows NT 5.0' => 'Windows 2000',
'Windows 2000' => 'Windows 2000',
'Windows CE' => 'Windows Mobile',
'Win 9x 4.90' => 'Windows Me.',
'Windows 98' => 'Windows 98',
'Windows 95' => 'Windows 95',
'Win95' => 'Windows 95',
'Windows NT' => 'Windows NT',
// -- Linux
'Ubuntu' => 'Linux Ubuntu',
'Fedora' => 'Linux Fedora',
'Linux' => 'Linux',
// -- Mac
'Macintosh' => 'Mac',
'Mac OS X' => 'Mac OS X',
'Mac_PowerPC' => 'Mac PowerPC',
'Mac' => 'Mac',
// -- Autres ...
'FreeBSD' => 'FreeBSD',
'Unix' => 'Unix',
'Playstation portable' => 'Playstation portable',
'Playstation 1' => 'Playstation 1',
'Playstation 2' => 'Playstation 2',
'Playstation 3' => 'Playstation 3',
'OpenSolaris' => 'SunOS',
'SunOS' => 'SunOS',
'Nintendo Wii' => 'Nintendo Wii',
'Googlebot' => 'Google Bot',
'Haiku' => 'Haiku',
);
$ua = strtolower($ua);
foreach($os_arr as $k => $v) {
if(preg_match("#".$k."#i", $ua)) {
$os = $v;
break;
}
}
return $os;
}
-
function Navigateur() {
$u_agent = $_SERVER['HTTP_USER_AGENT'];
$bname = 'Autre/Bot';
$version = "";
if(preg_match('/MSIE/i', $u_agent) && !preg_match('/Opera/i', $u_agent)) {
$bname = 'Internet Explorer';
$ub = "MSIE";
} else if(preg_match('/Android/i', $u_agent)) {
$bname = 'Android';
$ub = "Android";
} else if(preg_match('/Firefox/i', $u_agent)) {
$bname = 'Mozilla Firefox';
$ub = "Firefox";
} else if(preg_match('/Chrome/i', $u_agent)) {
$bname = 'Google Chrome';
$ub = "Chrome";
} else if(preg_match('/Safari/i', $u_agent)) {
$bname = 'Apple Safari';
$ub = "Safari";
} else if(preg_match('/Opera/i', $u_agent)) {
$bname = 'Opera';
$ub = "Opera";
} else if(preg_match('/Netscape/i', $u_agent)) {
$bname = 'Netscape';
$ub = "Netscape";
} else if(preg_match('/Googlebot/i', $u_agent)) {
$bname = 'Googlebot';
$ub = "Googlebot";
}
$known = array('Version', $ub, 'other');
$pattern = '#(?<browser>'.join('|', $known).')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
if(!preg_match_all($pattern, $u_agent, $matches)) { }
$i = count($matches['browser']);
if($i !== 1) {
if(strripos($u_agent, "Version") < strripos($u_agent, $ub)) {
$version = $matches['version'][0];
} else {
$version = $matches['version'][1];
}
} else {
$version = $matches['version'][0];
}
if($version == null) {
$version = "";
}
return $bname." ".$version;
}
-
$bloc = "
<!-- Debut du Bloc -->
<center>
<script language='javascript'>
document.write('<b>Addresse IP</b><br>".$_SERVER['REMOTE_ADDR']."');
document.write('<hr><b>Résolution</b><br>' + screen.width + 'x' + screen.height + 'x' + window.screen.colorDepth);
document.write('<hr><b>Navigateur</b><br>".Navigateur()."');
document.write('<hr><b>Plateforme</b><br>".OS()."');
</script>
</center>
<!-- Fin du Bloc -->";
Bloc ($result_blocs->parametre1,$bloc) ;
?>
-
-
j'ai remplacé par ca cela me semble mieux, non ?
Réponse ci-dessus posté le lundi 24 décembre 2012 : 16:59
bonjour, j'ai un soucis sur le bloc.php du module mezinfos car j'ai une erreur sur la page d'accueil voici mon site
http://www.blog.musicgroove.free.fr/voici le code du bloc.php du module :
Code PHP :
Pour copier le contenu exact du code,
Veuillez citer le message
<?php
function OS() {
$ua = $_SERVER['HTTP_USER_AGENT'];
$os = "Autre/Bot";
$os_arr = array(
// -- Windows Phone
'Windows Phone' => 'Windows Phone',
// -- Android
'Android' => 'Android',
// -- Windows
'Windows NT 6.2' => 'Windows 8',
'Windows NT 6.1' => 'Windows Seven',
'Windows NT 6.0' => 'Windows Vista',
'Windows NT 5.2' => 'Windows Server 2003',
'Windows NT 5.1' => 'Windows XP',
'Windows NT 5.0' => 'Windows 2000',
'Windows 2000' => 'Windows 2000',
'Windows CE' => 'Windows Mobile',
'Win 9x 4.90' => 'Windows Me.',
'Windows 98' => 'Windows 98',
'Windows 95' => 'Windows 95',
'Win95' => 'Windows 95',
'Windows NT' => 'Windows NT',
// -- Linux
'Ubuntu' => 'Linux Ubuntu',
'Fedora' => 'Linux Fedora',
'Linux' => 'Linux',
// -- Mac
'Macintosh' => 'Mac',
'Mac OS X' => 'Mac OS X',
'Mac_PowerPC' => 'Mac PowerPC',
'Mac' => 'Mac',
// -- Autres ...
'FreeBSD' => 'FreeBSD',
'Unix' => 'Unix',
'Playstation portable' => 'Playstation portable',
'Playstation 1' => 'Playstation 1',
'Playstation 2' => 'Playstation 2',
'Playstation 3' => 'Playstation 3',
'OpenSolaris' => 'SunOS',
'SunOS' => 'SunOS',
'Nintendo Wii' => 'Nintendo Wii',
'Googlebot' => 'Google Bot',
'Haiku' => 'Haiku',
);
$ua = strtolower($ua);
foreach($os_arr as $k => $v) {
if(preg_match("#".$k."#i", $ua)) {
$os = $v;
break;
}
}
return $os;
}
-
function Navigateur() {
$u_agent = $_SERVER['HTTP_USER_AGENT'];
$bname = 'Autre/Bot';
$version = "";
if(preg_match('/MSIE/i', $u_agent) && !preg_match('/Opera/i', $u_agent)) {
$bname = 'Internet Explorer';
$ub = "MSIE";
} else if(preg_match('/Android/i', $u_agent)) {
$bname = 'Android';
$ub = "Android";
} else if(preg_match('/Firefox/i', $u_agent)) {
$bname = 'Mozilla Firefox';
$ub = "Firefox";
} else if(preg_match('/Chrome/i', $u_agent)) {
$bname = 'Google Chrome';
$ub = "Chrome";
} else if(preg_match('/Safari/i', $u_agent)) {
$bname = 'Apple Safari';
$ub = "Safari";
} else if(preg_match('/Opera/i', $u_agent)) {
$bname = 'Opera';
$ub = "Opera";
} else if(preg_match('/Netscape/i', $u_agent)) {
$bname = 'Netscape';
$ub = "Netscape";
} else if(preg_match('/Googlebot/i', $u_agent)) {
$bname = 'Googlebot';
$ub = "Googlebot";
}
$known = array('Version', $ub, 'other');
$pattern = '#(?<browser>'.join('|', $known).')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
//if(!preg_match_all($pattern, $u_agent, $matches)) { }
$i = count($matches['browser']);
if($i !== 1) {
//if(strripos($u_agent, "Version") < strripos($u_agent, $ub)) {
$version = $matches['version'][0];
} else {
$version = $matches['version'][1];
}
//} else {
//$version = $matches['version'][0];
//}
if($version == null) {
$version = "";
}
return $bname." ".$version;
}
-
$bloc = "
<!-- Debut du Bloc -->
<center>
<script language='javascript'>
document.write('<b>Addresse IP</b><br>".$_SERVER['REMOTE_ADDR']."');
document.write('<hr><b>Résolution</b><br>' + screen.width + 'x' + screen.height + 'x' + window.screen.colorDepth);
document.write('<hr><b>Navigateur</b><br>".Navigateur()."');
document.write('<hr><b>Plateforme</b><br>".OS()."');
</script>
</center>
<!-- Fin du Bloc -->";
Bloc ($result_blocs->parametre1,$bloc) ;
?>



