|
|
|
// Copyright 2003 Benjamin Py [www.ben3w.com]
// This file is part of 2BGAL
// 2BGAL is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 2BGAL is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with 2BGAL ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$lang_filename = "lang/".$lang."_default.inc.php";
require($lang_filename);
if (!empty($_GET))
{myExtract($_GET, $GLOBALS);}
else if (!empty($HTTP_GET_VARS))
{myExtract($HTTP_GET_VARS, $GLOBALS);}
if (!empty($_POST))
{myExtract($_POST, $GLOBALS);}
else if (!empty($HTTP_POST_VARS))
{myExtract($HTTP_POST_VARS, $GLOBALS);}
////////////////////////////////////////////////////////
////////////////////////// CHIFFRES CLé /////////////////
echo " \n";
echo "\n";
echo "\n";
echo " \n";
$request = MYSQL_QUERY("SELECT sum(hits) FROM $tbl_ilist");
$tot_hits = mysql_result($request,0,"sum(hits)");
$request = MYSQL_QUERY("SELECT count(id) FROM $tbl_alist");
$tot_albums = mysql_result($request,0,"count(id)");
$request = MYSQL_QUERY("SELECT count(id) FROM $tbl_ilist");
$tot_photos = mysql_result($request,0,"count(id)");
function DirSize($path)
{
$result = 0;
if(!is_dir($path) || !is_readable($path)) {return 0;}
$fd = dir($path);
while($file = $fd->read())
{
//echo "test pour $file ";
if(($file != ".") && ($file != ".."))
{
if(@is_dir("$path$file/"))
{
$result += DirSize("$path$file/");
//echo "lancement répertoire $path$file/ ";
}
else
{
$result += (filesize("$path$file")/(1024*1024)); //octets -> Mo
//echo "ajout ".filesize("$path$file")." ";
}
}
}
$fd->close();
return $result;
}
echo "\n";
echo "| ".$tot_albums." | ".$txt_ccalbums." | \n";
echo "| ".$tot_photos." | ".$txt_ccphotos." | \n";
echo "| ".number_format( DirSize("../img/"), 3, '.', ' ')." | ".$txt_ccmo." | \n";
echo "| ".$tot_hits." | ".$txt_cchits." | \n";
echo " \n";
echo " | \n";
echo " |
\n";
/////////////////////////////////////////////////////////////////
///////////////////////Bilan des visites/////////////////////////
echo " \n";
echo "\n";
echo "| $txt_balbum | $txt_bhits | $txt_bpics | $txt_bsumhits | | \n";
function affiche_contenu($browseid,$decal,$tbl_alist,$tbl_ilist,$lang,$titrerec)
{
$lang_filename = "lang/".$lang."_default.inc.php";
require($lang_filename);
//compter le nb d'albums par place contenus dans l'album courrant browseid
$list_album = MYSQL_QUERY("SELECT * FROM $tbl_alist WHERE idpere=$browseid ORDER BY place");
$nb_albums = MYSQL_NUMROWS($list_album);
//pour chaque sous album
$i=0;
WHILE($i<$nb_albums)
{
$id_album = mysql_result($list_album,$i,"id");
$nom_album = mysql_result($list_album,$i,"nom");
$hits_album = mysql_result($list_album,$i,"hits");
$place_album = mysql_result($list_album,$i,"place");
$gere_album = mysql_result($list_album,$i,"gere");
$idpere_album = mysql_result($list_album,$i,"idpere");
$widthdecal=10*$decal;
$commondecal=" ";
echo "| ";
echo $commondecal;
echo "° ".$nom_album." | \n";
if ($gere_album=="standalone")
{
$chaine = "SELECT count(id) FROM ".$tbl_ilist." WHERE album=".$id_album;
$request2 = MYSQL_QUERY($chaine);
$nb_img = mysql_result($request2,0,"count(id)");
$chaine = "SELECT sum(hits) FROM ".$tbl_ilist." WHERE album=".$id_album;
$request3 = MYSQL_QUERY($chaine);
$hitspics = mysql_result($request3,0,"sum(hits)");
echo "$hits_album | $nb_img | $hitspics |  | ";
}
else
{
echo "$hits_album | | |  | ";
}
echo " \n";
//si pere : lancer le reccursif avec (id album courrant,decal+1)
if ($gere_album=="pere")
{
$new_decal=$decal+1;
affiche_contenu($id_album,$new_decal,$tbl_alist,$tbl_ilist,$lang,$currenttitrerec);
}
$i++;
}
}
affiche_contenu(0,0,$tbl_alist,$tbl_ilist,$lang,"");
echo "
\n";
///////////////////////////////////////////////////
//////////////////////TOP 10////////////////////////
echo " \n";
echo "\n";
echo "\n";
echo " ".$txt_top10." | \n";
echo " \n";
echo "\n";
$chaine="SELECT id FROM ".$tbl_alist." WHERE passwd=''";
$request = MYSQL_QUERY($chaine);
$nb_albums = MYSQL_NUMROWS($request);
$j=0;
$chaine = "SELECT id,url,album,hits FROM ".$tbl_ilist." ORDER BY hits DESC LIMIT 0,10";
$request = MYSQL_QUERY($chaine);
$display_nb_favorite = MYSQL_NUMROWS($request);
$i=0;
while ($i<$display_nb_favorite)
{
$id_image = mysql_result($request,$i,"id");
$url_image = mysql_result($request,$i,"url");
$hits_image = mysql_result($request,$i,"hits");
$album_image = mysql_result($request,$i,"album");
$chaine2="SELECT folder FROM ".$tbl_alist." WHERE id=".$album_image;
$req2 = MYSQL_QUERY($chaine2);
$folder_image = MYSQL_RESULT($req2,0,"folder");
echo "  | \n";
$i++;
}
echo " \n";
echo " \n";
$i=0;
while ($i<$display_nb_favorite)
{
$hits_image = mysql_result($request,$i,"hits");
$album_image = mysql_result($request,$i,"album");
echo " ".$hits_image." hits [album ".$album_image."] | \n";
$i++;
}
echo " \n";
echo " \n";
echo " | \n";
echo " |
\n";
?>
|
|
page générée en 0.032 s
|