1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
|
<?php
// PHP-MYSQL
$con = @mysql_pconnect("SERVER", "LOGIN", "PWD");
if(!$con)
{
header("Location: index.html");
exit;
}
@mysql_select_db("photography", $con);
// CHARGEMENT DE LA BASE UTILE
//****************************
// --------------------------------------------------------------------------
// Codification tableau:
// $Series[0][0] stocke le nombre total de séries enregistrées ($nbSeries).
// $Series[i][0] stocke le TITRE de chaque série i.
// Par conséquent, la 1ère image de la 1ère série est $Series[1][1] ...
// $Series[i][j] stocke le nom de fichier de la j-ième image (position) de la série i.
// $Textes[1] contient la description de la 1ère Série ...
// --------------------------------------------------------------------------
// Nombre de séries enregistrées
$req = @mysql_query("SELECT * FROM Serie;");
$nbSeries = @mysql_num_rows($req);
// -----------------
// INIT TABLEAU
// -----------------
$Series = array($nbSeries+1);
$Textes = array($nbSeries+1);
for($i=1; $i<=$nbSeries; $i++)
{
// association du serieID dans le bon ordre d'affichage
$req = @mysql_query("SELECT serieID FROM Serie WHERE serie_pos=".$i.";");
$sID = @mysql_fetch_array($req);
$sID = $sID['serieID'];
// Cmb photos dans chaque série
$req = @mysql_query("SELECT fichier FROM Photo WHERE serieID=".$sID." ORDER BY photo_pos ASC;");
$content = @mysql_fetch_array($req);
$nbPics = @mysql_num_rows($req);
$Series[$i] = array($nbPics+1);
// Enregistrement chemin d'accès fichiers images
$j = 1;
while($content)
{
$Series[$i][$j] = $content['fichier'];
$j++;
$content = @mysql_fetch_array($req);
}
// Enregistrement du TITRE de série
// Enregistrement du TEXTE de série
$req = @mysql_query("SELECT titre, description FROM Serie WHERE serieID=".$i.";");
$content = @mysql_fetch_array($req);
while($content)
{
$Series[$i][0] = $content['titre'];
$Textes[$i] = $content['description'];
$content = @mysql_fetch_array($req);
}
}
// Enregistrement
$Series[0][0] = $nbSeries;
// -----------------
// FIN INIT TABLEAU
// -----------------
// FIN CHARGEMENT BASE UTILE
//****************************
@mysql_close($con);
// PAGE HTML
//-------------------------------------------------------------------------------------------------------
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
echo "<html>";
echo "<head>";
echo "<script type=\"text/javascript\" src=\"zoom/jquery.js\"></script>";
echo "<script type=\"text/javascript\" src=\"zoom/thickbox.js\"></script>";
echo "<link rel=\"stylesheet\" href=\"zoom/thickbox.css\" type=\"text/css\" media=\"screen\" />";
echo "<link rel=\"icon\" type=\"image/png\" href=\"opbfavicon.png\" />";
echo "<title>OPB Photography - Daily life contemporary work</title>";
echo "<meta name=\"keywords\" content=\"OPB.Photography, OPB, photography, photographie, modern photographie, contemporan, photographie contemporaine, street art, argentique, photographie argentique\"/>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"default.css\">";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">";
echo "<script type=\"text/javascript\">";
echo "var _gaq = _gaq || [];";
echo "_gaq.push(['_setAccount', 'UE-1232JHD194-1']);";
echo "_gaq.push(['_trackPageview']);";
echo "(function() {";
echo "var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;";
echo "ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';";
echo "var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);";
echo " })();";
echo "</script>";
echo "</head>";
// BODY
echo "<body bgcolor=\"#FFFFFF\">";
echo "<div id=\"contentWrapper\">";
echo "<div id=\"leftSidebar\" class=\"medium\">";
echo "<a name=\"page-up\"></a>";
echo "<font class=\"bodyTitle\">OPB Photography</font>";
echo "<p>";
echo "<br>PORTFOLIO";
echo "<br><font size=\"-2\">//////////////////////////////////</font>";
// COLONNE GAUCHE (TITRES SERIES)
for($i=1; $i<=$nbSeries; $i++)
echo "<br><A HREF=\"Home.php?page=".$i."\">".$Series[i][0]."</A>";
// COLONE GAUCHE (SUITE MENU)
echo "<p>";
echo "<br>THIS IS ME";
echo "<br><A HREF=\"Home.php?page=about\">About</A>";
echo "<br><A HREF=\"Home.php?page=contact\">Contact</A>";
echo "</div>";
// CONTENU
echo "<div id=\"mainContent\">";
echo "<div id=\"rightSidebar\" align=\"justify\">";
$browsedID = $_GET['page'];
$pageURL = ereg('[[:digit:]]', $browsedID); |
Partager