Foros del Web » Programando para Internet » PHP »

Quiero saltar el index

Estas en el tema de Quiero saltar el index en el foro de PHP en Foros del Web. Hola a todos, me he bajado gratis una programa que crea una galería de imagenes, no hace upload, sino que pongo a mano las imagenes ...
  #1 (permalink)  
Antiguo 09/10/2009, 23:28
Avatar de fedefrankk  
Fecha de Ingreso: agosto-2007
Mensajes: 871
Antigüedad: 16 años, 8 meses
Puntos: 7
Pregunta Quiero saltar el index

Hola a todos, me he bajado gratis una programa que crea una galería de imagenes, no hace upload, sino que pongo a mano las imagenes en una carpeta y me la mustra en una galeria muy linda, el tema es que primero me hace elejir dos ejemplo de galerías, 1 y 2 ... quiero saltar ese paso para que me muestre unicamente la galeria, cualquiera la 1 o la 2, pero no se como hacerlo, les dejo el programita y el codigo, si alguine me extiende una mano se lo voy a agradecer,
Muchas gracias de antemano,

Aca dejo el programita, son 297kb
http://www.quodigital.com.ar/01/02/P...c_2.1_Free.zip

aca dejo el principio del codigo por las dudas que sea hay el problema

Código PHP:
<html>
<head>
<title>powered by PHP Pic-o-matic 2.1 Free</title>
<base target=_self>
<style type="text/css">
   body     { table-align: center; font-family: Trebuchet MS, Verdana, Arial; font-size: 10px; }
   a         { text-decoration: none; color: #000000; }
   img         { border-color: #000000; }
   img.albumtn     { margin-left:13px; margin-top:10px; margin-right:10px; margin-bottom:10px; float:right; }
   .linktd td a    { display:block; width:100%; }
   td        { text-align:center; font-family: Trebuchet MS, Tahoma; font-size: 9pt; border: 1px solid #000000; }
   td.previmg    { width:92px; border:0px }
   td.prevbtn    { width:10px; border:0px }
   p        { margin-left:5px; margin-top:6px; margin-bottom:6px; text-align:justify; }
   p.navigation    { margin-top:0px; margin-right:5px; margin-bottom:0px; }
   p.albuminfo    { margin-left:8px; margin-top:8px; margin-right:10px; margin-bottom:8px; }
</style>
</head>

<body>

<?php
  
if (isset($_GET['album']))
     
$album $_GET['album'];
  else
     
$album "";

  
// Properties
  
$headline "PHP Pic-o-matic 2.1 Free";
  
$subheadline "Example picture gallery";
  
$showroomwidth 500;
  
$showdesc 1;

  
// Headline
  
print("<div align=center><font size=\"+2\"><b>$headline</b></a></font>
    <br><font size=2>$subheadline</font><br><br>"
);

  
// Index
  
if ($album == "" && $filehandle opendir("."))
  {
    print(
"<table><tr><td width=$showroomwidth><p class=navigation>&nbsp;Navigation:&nbsp;&nbsp;
          <a href=\"pic-o-matic.php\"><b>Index</b></a></p></td></tr></table><table>"
);
    while (
false !== ($albumcheck readdir($filehandle)))
    {
      if (
$albumcheck != "." && $albumcheck != ".." && is_dir($albumcheck) && substr($albumcheck,0,1) != "_")
      {
          
$albums[] = $albumcheck;
      }
    }

    
closedir($filehandle);
    
natcasesort($albums);

    foreach (
$albums as $album)
    {
        if (
file_exists("./$album/info.txt"))
           include(
"./$album/info.txt");
        else
        {
           
$albumname $album;
           
$albuminfo "";
        }

        print (
"<tr><td width=$showroomwidth>");
        if (
file_exists("./$album/thumbnail.jpg"))
           print (
"<a href=\"pic-o-matic.php?album=$album\"><img border=1 class=albumtn src=\"$album/thumbnail.jpg\"></a>");
        print (
"<p class=albuminfo><a href=\"pic-o-matic.php?album=$album\"><b>$albumname</b></a>");
        print (
"<br>$albuminfo");
        print (
"</p></td></tr>");
    }
    print(
"</table>");
  }

  
// Creating the albums
  
else
  {
    if(
is_dir($album))
    {
      if (
file_exists("./$album/info.txt"))
      {
          include(
"./$album/info.txt");
      }
      else
      {
          
$albumname $album;
         
$albuminfo "";
      }

      if (isset(
$_GET['show']))
         
$show $_GET['show'];
      else
          
$show 1;
      
$img_dir "./$album";
      
$dir opendir($img_dir);
      
$thumbstring "|";

   
// Reading and checking images in the folder of the album
      
while ($file readdir($dir))
      {
         if (
$file != "." && $file != ".." && $file != "thumbnail.jpg")
         {
           
$extension substr($file, -4);
      if((
$extension == ".JPG") || ($extension == ".jpg"))
             
$thumbstring .= "$file|";
         }
      }

      
$thumbstring trim($thumbstring"|");
      
$arry_txt explode("|" $thumbstring);
      (array)
$temparray null;
      
natcasesort($arry_txt);
      
$arry_txt array_merge((array)$temparray$arry_txt);

      if (
$show > (sizeof($arry_txt)) || $show == "")
         
$show 1;
      if (
$show 1)
        
$show sizeof($arry_txt);

      
$img "" $arry_txt[$show 1] . "";

   
// Setting the beginning and the end of the album
      
if ($show == 0)
         
$back "<td width=75><font size=0><a href=\"pic-o-matic.php?album=$album&amp;show=" . (sizeof($arry_txt) - 1) . "\">back</a></font>";
      else
         
$back "<td width=75><font size=0><a href=\"pic-o-matic.php?album=$album&amp;show=" . ($show 1) . "\">back</a></font>";
      if (
$show == sizeof($arry_txt) - 1)
          
$forward "<td width=75><font size=0><a title=forward href=\"pic-o-matic.php?album=$album&amp;show=1\">forward</a></font>";
      else
          
$forward "<td width=75><font size=0><a title=forward href=\"pic-o-matic.php?album=$album&amp;show=" . ($show 1) . "\">forward</a></font>";

   
// Reading the images' width and adjusting the size of a cell
      
$imgsize = (getimagesize(rtrim($album "/" $img)));
      
$midtdsize = ($imgsize[0] - 162);
      if (
$midtdsize 370)   $midtdsize 370;
      print(
"<table><tr><td colspan=3 width=" . ($midtdsize 162) . "><p class=navigation>&nbsp;Navigation:&nbsp;
             <a href=\"pic-o-matic.php\">Index</a> > <a href=\"pic-o-matic.php?album=$album\"><b>$albumname</b></a></p>
             </td></tr></table>"
);
      print(
"<table class=\"linktd\"><tr>");
      print(
$back);
      print(
"</td><td width=\"" $midtdsize "\"><font size=\"0\"><b>");
      print(
"Image " . ($show) . " of " . (sizeof($arry_txt)));
      print(
"</b></font></td>");
      print(
$forward);
      print(
"</td></tr></table><table><tr>");
      print(
"<td colspan=3><a title=\"forward\" href=\"pic-o-matic.php?album=$album&amp;show=" . ($show 1) . "\"><img border=0 src=\"" $img_dir "/" $img "\"></a></td>");
      print(
"</tr>");
      print(
"</table><table class=\"linktd\"><tr>");
      if(
$showdesc == 1)
           print(
"<td width=$imgsize[0] colspan=3><font size=1><b>Filename:</b> '" $img "'&nbsp;&nbsp;&nbsp;<b>Filesize:</b> " . (round((filesize($img_dir "/" $img)/1024), 1)) . " KB &nbsp;&nbsp;&nbsp;<b>Imagesize:</b> " $imgsize[0] . "x" $imgsize[1] . " px</font></td></tr>");

      
$imginfo substr($img0, -4) . '_info';

      if (isset($
$imginfo) && $$imginfo != "")
         print(
"<td width=$imgsize[0] colspan=3><font size=1><b>Image description:</b> " . $$imginfo "</font></td></tr>");

      print(
$back);
      print(
"</td><td width=" $midtdsize "><font size=0><b>");
      print(
"Image " . ($show) . " of " . (sizeof($arry_txt)));
      print(
"</b></font></td>");
      print(
$forward);
      print(
"</td></tr>");

   
// Preview
      
print("<tr><td colspan=3 valign=top height=116><div align=center><table><tr>");
      if ((
$show 3) > 0)
         print(
"<td class=prevbtn><a href=\"pic-o-matic.php?album=$album&amp;show=" . ($show 4) . "\"><br><<br><br><br><<br></a></td>");
      else  print(
"<td class=prevbtn>&nbsp;</td>");

      for (
$i = -2$i 3$i++)
      {
         if (!isset(
$arry_txt[$show $i 1]) || $arry_txt[$show $i 1] == null)
             
$link "&nbsp;";
         else
         {
            
$imgsize getimagesize(rtrim($album "/" . ($arry_txt[$show $i 1])));
            if ((
$imgsize[0]) > ($imgsize[1]))
               
$img  "<img border=1 width=85 src=\"" $img_dir "/" . ($arry_txt[$show $i 1]) . "\">";
            else
               
$img  "<img border=1 height=80 src=\"" $img_dir "/" . ($arry_txt[$show $i 1]) . "\">";
            if (
$i == 0)
               
$link "<a href=\"pic-o-matic.php?album=$album&amp;show=" . ($show) . "\">current<br>$img</a>";
            else
               
$link "<a href=\"pic-o-matic.php?album=$album&amp;show=" . ($show $i) . "\">" . ($show $i) . "/" . (sizeof($arry_txt)) . "<br>$img</a>";
         }
         print(
"<td class=previmg>");
         print(
$link);
         print(
"</td>");
      }

      if ((
$show 4) < sizeof($arry_txt))
         print(
"<td class=prevbtn><a href=\"pic-o-matic.php?album=$album&amp;show=" . ($show 4) . "\"><br>><br><br><br>><br></a></td>");
      else
          print(
"<td class=prevbtn>&nbsp;</td>");
      print(
"</tr></table></div></td></tr></table>");
    }
  }
?>

<font size=0><a href="http://www.popwars.de/Pic-o-matic/">powered by PHP Pic-o-matic &copy;</a></font>
</div>
</body>

</html>
Es largo, pero se que esta en el principio el tema
saludos y gracias
  #2 (permalink)  
Antiguo 10/10/2009, 15:15
Avatar de mortiprogramador
Colaborador
 
Fecha de Ingreso: septiembre-2009
Ubicación: mortuoria
Mensajes: 3.805
Antigüedad: 14 años, 7 meses
Puntos: 214
Respuesta: Quiero saltar el index

Hola
Pues si te entendi bien, quieres no escoger entre alguna de las dos sino que se muestre alguna por defecto, pues bien, si te fijas en el codigo de pic-o-matic.php luego del body tienes esto

Código PHP:
  if (isset($_GET['album']))
     
$album $_GET['album'];
  else
     
$album ""
Te sugiero cambiarlo por esto entonces
Código PHP:
  /*if (isset($_GET['album']))
     $album = $_GET['album'];
  else
     $album = "";*/

    
$album "1_example"// o 2_example si quieres la galeria 2 
Saludos
  #3 (permalink)  
Antiguo 11/10/2009, 16:40
Avatar de fedefrankk  
Fecha de Ingreso: agosto-2007
Mensajes: 871
Antigüedad: 16 años, 8 meses
Puntos: 7
De acuerdo Respuesta: Quiero saltar el index

Hola.. Muchisimas gracias..!!! si me sirvio y anduvo de 10... gracias..!!!!!!!!!!
Saludos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 21:40.