All pastes #89622 Raw Edit

Oexal

public text v1 · immutable
#89622 ·published 2006-07-16 20:34 UTC
rendered paste body
#
if ($id = $_GET["view"])
#
{
#
                $path = substr($row["fichier"],0,strrpos($row["fichier"],"/"));
#
                if (!$resultat = mysql_query("SELECT * FROM contenu WHERE id = '$id' ORDER by dir DESC ;"))
#
                        echo mysql_error();     
#
                $row = mysql_fetch_array($resultat);
#
                if ($row["dir"]=="n")
#
                        $path = substr($row["fichier"],0,strrpos($row["fichier"],"/"));
#
                else
#
                        $path = $row["fichier"];
#
                if (!$resultat = mysql_query("SELECT count(DISTINCT fichier) FROM contenu WHERE fichier like \"$path%\" ORDER by dir DESC;"))
#
                        echo mysql_error();     
#
                $row = mysql_fetch_array($resultat);
#
 
#
 
#
                if ($row["count(DISTINCT fichier)"] < 55)
#
                        $query = "SELECT DISTINCT fichier,dir,titre,id FROM contenu WHERE fichier like \"$path/%\" AND dir ='n' ORDER by dir DESC;";
#
                else
#
                        $query = "SELECT DISTINCT fichier,dir,titre,id FROM contenu WHERE fichier like \"$path/%\" AND fichier
#
 NOT LIKE \"$path/%/%\" ORDER by dir DESC;";
#
 
#
                if (!$resultat = mysql_query($query))
#
                        echo mysql_error();     
#
$row = mysql_fetch_array($resultat);
#
echo "
#
                                <div class=\"titre\">". utf8_encode($row['titre']) ."</div>";
#
                do
#
                {              
#
                        if (strtolower(substr($row["fichier"],strrpos($row["fichier"],".")+1,strlen($row["fichier"]))) == "jpg")
#
                        {
#
                                $tbimg=substr($row["fichier"],0,strpos($row["fichier"],".")) . "-tb" . substr($row["fichier"],strlen($row["fichier"])-4,strlen($row["fichier"]));
#
                                if (!file_exists("/home/oexal/www/" .$tbimg))
#
                                {
#
                                        if (!$flagge)
#
                                        {
#
                                                echo "<script>document.getElementById('block').style.display='block';document.getElementById('wait').style.display='block';</script>";
#
                                                $flagge=1;
#
                                                ob_flush();
#
                                                flush();
#
                                               
#
                                        }
#
                                        shell_exec("convert -scale 130x130 '/home/oexal/www/" . $row["fichier"] . "' '/home/oexal/www/" . $tbimg ."'");
#
                                }
#
                        echo "
#
                        <a href=\"?viewimg=".$row["id"]."&page=$cat\"><img alt=\"".$row["fichier"]."\" src=\"http://oexal.net:5555/" . $tbimg ."\"  /></a>";
#
                        }
#
                        if ($row[dir]=="y")
#
                                echo "
#
                                        <a class=\"dir\" href=\"?view=".$row["id"]."&page=$cat\"><img class=\"dirimg\" alt=\"".$row["fichier"]."\" src=\"dir.png\" /> ".strtolower(substr($row["fichier"],strrpos($row["fichier"],"/")+1,strlen($row["fichier"])))."</a>";
#
                                                ob_flush();
#
                                                flush();
#
                }
#
        while ($row = mysql_fetch_array($resultat)) ;
#
}