Skip to content
This repository was archived by the owner on Oct 16, 2019. It is now read-only.

Commit c6cb4cb

Browse files
author
Fabien Basmaison
committed
Add files from years ago.
0 parents  commit c6cb4cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1639
-0
lines changed

.gitignore

Whitespace-only changes.

FAQ.htm

Lines changed: 343 additions & 0 deletions
Large diffs are not rendered by default.

admin/.htaccess

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
PerlSetVar AuthFile frontier/.doNotCross
2+
AuthName "authentification necessaire"
3+
AuthType Basic
4+
require user Bam!

admin/console_admin.php

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
<?php print("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); ?>
2+
<?php
3+
4+
include("lib-general.php");
5+
include("../mysql.php");
6+
######################################################################
7+
# variables #
8+
######################################################################
9+
# différentes variables
10+
$pseudo = testPostVar("pseudo","aucun pseudo fourni");
11+
$adresse_ip = $_SERVER['REMOTE_ADDR'];
12+
$poids = 1;
13+
14+
######################################################################
15+
# base de données #
16+
######################################################################
17+
# connnexion à la base de données
18+
$connexion = mysql_connect($mon_hote, $mon_pseudo, $mon_mdp) or die("impossible de se connecter... <!-- ".mysql_error()." -->\n");
19+
20+
# création de la base si elle n'existe pas
21+
mysql_query("CREATE DATABASE IF NOT EXISTS myah");
22+
# selection de la base de donnees
23+
mysql_select_db($ma_base) or die("impossible d'ouvrir la base de donnees.");
24+
# création de la table si elle n'existe pas
25+
mysql_query("CREATE TABLE IF NOT EXISTS myah (
26+
id_user MEDIUMINT (9) NOT NULL AUTO_INCREMENT,
27+
adr_IP VARCHAR (15) NOT NULL,
28+
pseudo VARCHAR (20) NOT NULL,
29+
poids SMALLINT (9) NOT NULL default '1',
30+
date_crea DATETIME DEFAULT NULL,
31+
date_visit DATETIME DEFAULT NULL,
32+
INDEX(id_user))") or die("impossible de créer la table 'myah'\n <!-- ".mysql_error()." -->\n");
33+
34+
$select_IP = mysql_query("SELECT * FROM myah") or die("Impossible d'effectuer la requête\n <!-- ".mysql_error()." -->\n");
35+
36+
?>
37+
38+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
39+
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
40+
<head>
41+
<title>myah / administration</title>
42+
43+
<meta http-equiv="Content-language" content="fr" />
44+
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
45+
<meta name="robots" content="noindex,nofollow" />
46+
<link rel="stylesheet" type="text/css" href="../css/defaut/defaut.css" title="défaut" />
47+
</head>
48+
49+
<body>
50+
<div id="contenant">
51+
<h1>
52+
<a href="../">
53+
<strong>m</strong>ake <strong>y</strong>ourself <strong>a</strong> <strong>h</strong>ome
54+
</a>
55+
</h1>
56+
<div id="console">
57+
<table>
58+
<caption>
59+
les dix dernières visites&nbsp;:
60+
</caption>
61+
<tr>
62+
<th>date de dernière visite</th>
63+
<th>pseudo</th>
64+
<th>poids</th>
65+
<th>numéro d'inscription</th>
66+
<th>adresse IP</th>
67+
</tr>
68+
69+
<?php
70+
$select_IP = mysql_query("SELECT * FROM myah WHERE date_visit != '0000-00-00 00:00:00' ORDER BY date_visit DESC LIMIT 10") or die("Impossible d'effectuer la requête\n <!-- ".mysql_error()." -->\n");
71+
while($col = mysql_fetch_object($select_IP)) {
72+
print("
73+
<tr>
74+
<td>".date_validation($col->date_visit, "d.m.Y - H:i")."</td>
75+
<td>".$col->pseudo."</td>
76+
<td>".$col->poids."</td>
77+
<td>".$col->id_user."</td>
78+
<td>".$col->adr_IP."</td>
79+
</tr>");
80+
}
81+
?>
82+
</table>
83+
<table>
84+
<caption>
85+
les derniers referers&nbsp;:
86+
</caption>
87+
<tr>
88+
<th>date</th>
89+
<th><abbr title="Uniform resource locator">URL</abbr></th>
90+
<th>navigateur</th>
91+
</tr>
92+
93+
<?php
94+
$select_referer = mysql_query("SELECT * FROM myah_referers ORDER BY date DESC LIMIT 10") or die("Impossible d'effectuer la requête\n <!-- ".mysql_error()." -->\n");
95+
while($col = mysql_fetch_object($select_referer)) {
96+
print("
97+
<tr>
98+
<td>".date_validation($col->date, "d.m.Y - H:i")."</td>
99+
<td><a href=\"".$col->site_url."\">".$col->site_url."</a></td>
100+
<td>".$col->navig."</td>
101+
</tr>");
102+
}
103+
?>
104+
</table>
105+
<table>
106+
<caption>
107+
les dix derniers inscrits&nbsp;:
108+
</caption>
109+
<tr>
110+
<th>numéro d'inscription</th>
111+
<th>date de première visite</th>
112+
<th>date de dernière visite</th>
113+
<th>pseudo</th>
114+
<th>poids</th>
115+
<th>adresse IP</th>
116+
</tr>
117+
118+
<?php
119+
$select_IP = mysql_query("SELECT * FROM myah ORDER BY id_user DESC LIMIT 10") or die("Impossible d'effectuer la requête\n <!-- ".mysql_error()." -->\n");
120+
while($col = mysql_fetch_object($select_IP)) {
121+
print("
122+
<tr>
123+
<td>".$col->id_user."</td>
124+
<td>".date_validation($col->date_crea, "d.m.Y - H:i")."</td>
125+
<td>".date_validation($col->date_visit, "d.m.Y - H:i")."</td>
126+
<td>".$col->pseudo."</td>
127+
<td>".$col->poids."</td>
128+
<td>".$col->adr_IP."</td>
129+
</tr>");
130+
}
131+
?>
132+
</table>
133+
<table>
134+
<caption>
135+
les dix plus présents&nbsp;:
136+
</caption>
137+
<tr>
138+
<th>poids</th>
139+
<th>pseudo</th>
140+
<th>numéro d'inscription</th>
141+
</tr>
142+
<?php
143+
$select_IP = mysql_query("SELECT * FROM myah ORDER BY poids DESC, date_visit DESC LIMIT 10") or die("Impossible d'effectuer la requête\n <!-- ".mysql_error()." -->\n");
144+
while($col = mysql_fetch_object($select_IP)) {
145+
print("
146+
<tr>
147+
<td>".$col->poids."</td>
148+
<td>".$col->pseudo."</td>
149+
<td>".$col->id_user."</td>
150+
</tr>");
151+
}
152+
?>
153+
</table>
154+
</div>
155+
<div>
156+
<object type="model/vrml" data="../vrml_boxes.php" viewpoint_transition_mode="1" vrml_dashboard="false" standby="chargement en cours..." width="400" height="250">
157+
<param name="classid" value="CLSID:86A88967-7A20-11d2-8EDA-00600818EDB1" />
158+
<param name="codebase" value="http://www.parallelgraphics.com/bin/cortvrml.cab#Version=4,2,0,93" />
159+
</object>
160+
</div>
161+
</div>
162+
</body>
163+
</html>
164+
<?php
165+
# deconnexion
166+
mysql_close($connexion) or die("probleme durant la deconnexion.");
167+
?>

admin/lib-general.php

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<?php
2+
######################################################################
3+
# fonctions #
4+
######################################################################
5+
function testVar($var,$defaut)
6+
{
7+
if(isset($var))
8+
{
9+
$var=$var;
10+
}
11+
else
12+
{
13+
$var=$defaut;
14+
}
15+
return $var;
16+
}
17+
function testGetVar($var,$defaut)
18+
{
19+
if(isset($_GET[$var]))
20+
{
21+
$var=$_GET[$var];
22+
}
23+
else
24+
{
25+
$var=$defaut;
26+
}
27+
return $var;
28+
}
29+
function testPostVar($var,$defaut)
30+
{
31+
if(isset($_POST[$var]))
32+
{
33+
$var=$_POST[$var];
34+
}
35+
else
36+
{
37+
$var=$defaut;
38+
}
39+
return $var;
40+
}
41+
42+
function date_validation($date, $format) {
43+
if($date != "0000-00-00 00:00:00") {
44+
return date($format, strtotime($date));
45+
}
46+
else return "";
47+
}
48+
49+
function align_viewpoint($vx,$vy,$vz,$cx,$cy,$cz,$pseudo) {
50+
# différences de coordonnées
51+
$delta_x = $vx - $cx;
52+
$delta_y = $vy - $cy;
53+
$delta_z = $vz - $cz;
54+
55+
# projection de la ligne reliant le point de vue et la cible en plan
56+
$plane_line = sqrt(pow($delta_x,2) + pow($delta_z,2));
57+
# angle alignant la vue sur la cible en plan
58+
$ay = acos(abs($delta_z) / $plane_line);
59+
//$ay = $vx > $cx && $vz > $cz ? $ay : $ay;
60+
$ay = $vx > $cx && $vz < $cz ? -$ay+deg2rad(180) : $ay;
61+
$ay = $vx < $cx && $vz < $cz ? $ay+deg2rad(180) : $ay;
62+
$ay = $vx < $cx && $vz > $cz ? -$ay : $ay;
63+
64+
# distance la plus courte entre les deux points
65+
$short_dist = sqrt(pow($plane_line,2) + pow($delta_y,2));
66+
# angle alignant la vue sur la cible autour de x
67+
$ax = acos($plane_line / $short_dist);
68+
$ax = $vy > $cy && $vz < $cz ? -$ax+deg2rad(180) : $ax;
69+
$ax = $vy < $cy && $vz < $cz ? $ax+deg2rad(180) : $ax;
70+
//$ax = $vy < $cy && $vz > $cz ? $ax : $ax;
71+
$ax = $vy > $cy && $vz > $cz ? -$ax : $ax;
72+
73+
# On écrit tout ça
74+
$Viepoint = "
75+
Transform {
76+
rotation 0 1 0 ".$ay."
77+
translation ".$vx." ".$vy." ".$vz."
78+
children [
79+
Transform {
80+
rotation 1 0 0 ".$ax."
81+
children [
82+
Viewpoint
83+
{
84+
description \"".$pseudo."\"
85+
position 0 0 0
86+
orientation 0 0 1 0
87+
}
88+
]
89+
}
90+
]
91+
}";
92+
return $Viepoint;
93+
}
94+
?>

0 commit comments

Comments
 (0)