ci2 #3

Merged
n merged 3 commits from ci2 into main 2024-09-14 21:24:36 +02:00
6 changed files with 23 additions and 18 deletions
Showing only changes of commit 41732eeda9 - Show all commits

5
.php-cs-fixer.php Normal file
View file

@ -0,0 +1,5 @@
<?php
return (new PhpCsFixer\Config())
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
;

View file

@ -113,7 +113,7 @@ function formcaller()
function splitchar($Number) function splitchar($Number)
{ {
$byte = strval(dechex($Number)); $byte = strval(dechex($Number));
switch(strlen($byte)) { switch (strlen($byte)) {
case 1: case 1:
$byte0 = $byte; $byte0 = $byte;
$byte1 = $byte2 = $byte3 = 0; $byte1 = $byte2 = $byte3 = 0;
@ -260,7 +260,7 @@ function password($folder)
$fd = fopen("$folder/password.txt", "r"); $fd = fopen("$folder/password.txt", "r");
$titre = fgetcsv($fd, 10000, ","); $titre = fgetcsv($fd, 10000, ",");
while($fd) { while ($fd) {
$data = fgetcsv($fd, 10000, ","); $data = fgetcsv($fd, 10000, ",");
$login[$i] = $data[0]; $login[$i] = $data[0];
$mdp[$i] = $data[1]; $mdp[$i] = $data[1];
@ -361,13 +361,13 @@ function nb_visiteurs_connecte($time, $filename = "/tmp/nbweb.dat")
$ii = 0; $ii = 0;
$bool = 0; $bool = 0;
if(file_exists($filename)) { if (file_exists($filename)) {
if($fichier = fopen($filename, "r")) { if ($fichier = fopen($filename, "r")) {
while(!feof($fichier)) { while (!feof($fichier)) {
$ligne = fgets($fichier, 4096); $ligne = fgets($fichier, 4096);
$tab = explode("|", $ligne); $tab = explode("|", $ligne);
if($tab[1] > 0) { if ($tab[1] > 0) {
$tab_de_tab[$i][0] = $tab[0]; $tab_de_tab[$i][0] = $tab[0];
$tab_de_tab[$i][1] = $tab[1]; $tab_de_tab[$i][1] = $tab[1];
@ -378,8 +378,8 @@ function nb_visiteurs_connecte($time, $filename = "/tmp/nbweb.dat")
} }
} }
for($j = 0;$j < $i;$j++) { for ($j = 0;$j < $i;$j++) {
if(($date - chop($tab_de_tab[$j][1])) > $time) { if (($date - chop($tab_de_tab[$j][1])) > $time) {
//on ne fait rien //on ne fait rien
} else { } else {
$tab_de_tab_actualise[$ii][0] = $tab_de_tab[$j][0]; $tab_de_tab_actualise[$ii][0] = $tab_de_tab[$j][0];
@ -388,20 +388,20 @@ function nb_visiteurs_connecte($time, $filename = "/tmp/nbweb.dat")
} }
} }
for($j = 0;$j < $ii;$j++) { for ($j = 0;$j < $ii;$j++) {
if($tab_de_tab_actualise[$j][0] == $ip) { if ($tab_de_tab_actualise[$j][0] == $ip) {
$bool = 1; $bool = 1;
} }
} }
if($bool == 0) { if ($bool == 0) {
$tab_de_tab_actualise[$ii][0] = $ip; $tab_de_tab_actualise[$ii][0] = $ip;
$tab_de_tab_actualise[$ii][1] = $date; $tab_de_tab_actualise[$ii][1] = $date;
$ii++; $ii++;
} }
if($fichier = fopen($filename, "w")) { if ($fichier = fopen($filename, "w")) {
for($j = 0;$j < $ii;$j++) { for ($j = 0;$j < $ii;$j++) {
fputs($fichier, chop($tab_de_tab_actualise[$j][0])); fputs($fichier, chop($tab_de_tab_actualise[$j][0]));
fputs($fichier, "|"); fputs($fichier, "|");
fputs($fichier, chop($tab_de_tab_actualise[$j][1])); fputs($fichier, chop($tab_de_tab_actualise[$j][1]));

View file

@ -81,7 +81,7 @@ echo "<td class='pageseparator'><img src='/modules/share/trans.gif' alt='' title
// --- gestion des modules --- // --- gestion des modules ---
if (isset($modulepage)) { if (isset($modulepage)) {
//include "include/logo.inc.php"; //include "include/logo.inc.php";
switch($modulepage) { switch ($modulepage) {
case "sondage": case "sondage":
extract($themeset, EXTR_OVERWRITE); extract($themeset, EXTR_OVERWRITE);

View file

@ -89,7 +89,7 @@ if ((!isset($NbMaxPost)) || ($NbMaxPost > $Cpt)) {
echo "<hr /><div class='left'>"; echo "<hr /><div class='left'>";
if ($NbMaxPost) { if ($NbMaxPost) {
for($i = 0;$i <= $NbMaxPost - 1;$i++) { for ($i = 0;$i <= $NbMaxPost - 1;$i++) {
if ($VisitorName[$i] == "") { if ($VisitorName[$i] == "") {
$VisitorName[$i] = "Anonyme"; $VisitorName[$i] = "Anonyme";
} }

View file

@ -45,7 +45,7 @@ if ($Cpt <= 0) {
<?php <?php
echo "<select name='ListeLiens'>"; echo "<select name='ListeLiens'>";
for($i = 0;$i <= $NbMaxPost - 1;$i++) { for ($i = 0;$i <= $NbMaxPost - 1;$i++) {
echo "<option value='$url[$i]'>$linkname[$i]</option>\n"; echo "<option value='$url[$i]'>$linkname[$i]</option>\n";
} }
@ -53,7 +53,7 @@ if ($Cpt <= 0) {
} else { } else {
// affichage des liens // affichage des liens
echo "<div class='left'>"; echo "<div class='left'>";
for($i = 0;$i <= $NbMaxPost - 1;$i++) { for ($i = 0;$i <= $NbMaxPost - 1;$i++) {
if ($level[$i] == 1) { if ($level[$i] == 1) {
echo "<b>"; echo "<b>";
if ($url[$i] != "") { if ($url[$i] != "") {

View file

@ -1,6 +1,6 @@
<?php <?php
$randimg = rand(1, 3); $randimg = rand(1, 3);
switch($randimg) { switch ($randimg) {
case '1': $logo = "yoyo.png"; case '1': $logo = "yoyo.png";
$logodesc = "Y8000"; $logodesc = "Y8000";
break; break;