Foros del Web » Programando para Internet » PHP »

ayuda con webmodular

Estas en el tema de ayuda con webmodular en el foro de PHP en Foros del Web. hola a todos de este foro me encuentro en una tension de no poder utilizar mucho este sistema de php tengo este config tengo el ...
  #1 (permalink)  
Antiguo 06/06/2005, 14:25
 
Fecha de Ingreso: diciembre-2004
Mensajes: 108
Antigüedad: 19 años, 4 meses
Puntos: 1
ayuda con webmodular

hola a todos de este foro me encuentro en una tension de no poder utilizar mucho este sistema de php tengo este config

tengo el confi.php ahi meti esto:

<?php
define('MODULO_DEFECTO', 'home');
define('LAYOUT_DEFECTO', 'layout_simple.php');
define('MODULO_PATH', realpath('./modulos/'));
define('LAYOUT_PATH',realpath('./layouts/'));

$conf['home']=array('archivo'=>'home.php', 'layout'=>LAYOUT_DEFECTO);<-------aqui la pagina en blanco

$conf['galeria']=array('archivo'=>'galeria.php');

$conf['imp_art']=array('archivo'=>$conf['articulo']['archivo'],'layout'=>'imprimir.php');
?>

cuando yo cargo desde http://www.localhost/carpetaweb/
cargo bien el home.php pero yo le doy al link galeria de fotos y tambien me lo hace bien el problema es cuando yo quiero ver el link siguiente de la pagina de fotos me devuelve al home que realmente seria que no encuentra la siguiente pagina
esta es la direccion cuando le doy al link galeria http://localhost/web/hotel/?mod=galeria y cuando me posicione en otra imagen para mostrarla en grande esta es la direccion ?offset=&imageID=2 no se cual sera el problema yo realmente pense que era el offset y se lo cambien a como yo tengo los otras direcciones en ?mod=... pero no me sale todavia este es el script

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>Who Fwamed Woggew Wabbit?</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="../includes/estilohotel.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="ffffff" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" summary="">
<tr>
<td width="600" style="padding: 15px">
<div align="center">
<?php

//
// "WABBIT v0.3"
//
// Script by Arnold Cistai - www.arnoldcistai.net - mailto: [email protected]
//
// Questions or comments considering this scripts: [email protected]
//
// Array based, no need for any special configurations od databases
// Copy your images to "images/" and the thumbnails (with the same filenames!!!)
// to "thumbs/"
// That's it. Enjoy.
//
// Explore the script's comments for more specific informations
//
// Feel free to reuse it, skew it, smash it - it wasn't hard to put together, so
// do whatever you want, as far your conscience lets you :)
//
// Some bugs may appear, if you run into any, please report it to me...
//


// Change this variable and set your own title for the gallery

$TitleOfThePage = "WABBIT PHP GALLERY SCRIPT";


$mod = $_GET[mod];
$imageID = $_GET[imageID];

// Set the number of images per page (don't forget to reset the offset to zero
// in the url after you change this number)

$images_per_page = 3;

// Set the image directories

$thumbnail_dir = "thumbs/";
$image_dir = "images/";

// Reading the thumbnail directory an putting the filenames into an array

$readdir = opendir("$thumbnail_dir");
while (false !== ($file = readdir($readdir)))
{
if ($file != "." && $file != "..")
{
$gallery[] = $file;
}
}
closedir($readdir);

// Calculating the number of images in the array

$image_number = count($gallery);

// If offset variable not present for some reason or someone tried
// to play with it, set its value to 0

if (!$mod || ereg('[a-z]', $mod)==1 || ereg('[A-Z]', $mod)==1 || ereg('[[:punct:][:space:]]', $d_id)==1)
{
$mod = "0";
}

// Calculating navigation values

$thumbs_per_page = $offset+$images_per_page;
$previous_page = $offset-$images_per_page;
$next_page = $offset+$images_per_page;

echo '
<table border="0" cellpadding="0" cellspacing="0" summary="">
<tr>
<td width="600" bgcolor="#ffffff">
<div class="title" align="center">
<strong>'.$TitleOfThePage.'</strong>
</div>
<div class="main" align="center">
';

$from = $mod+1;

if ($mod >= $image_number-$images_per_page)
{
$to = $image_number;
}
else
{
$to = $mod + $images_per_page;
}
echo '
Showing images from '.$from.' to '.$to.'<br>(out from '.$image_number.')<br><br><br>
</div>
</td>
</tr>
</table>
';

// Hiding/enabling the >previous< button
// -------------------------------------
// If $offset is smaller than the value of entries per page, do the following actions:
// - if offset is smaller, consequently, don't link to the previous page
// - if offset is greater, make my day, and print the link

if ($mod < $images_per_page)
{
$previous ='&laquo;';
}else
{
$previous = '<a href="?mod='.$previous_page.'&imageID='.$imageID.' ">&laquo;</a>';
}

// Operations with the >next< button
// ---------------------------------
// If $offset is greater or equal than image numbers and entries per page ,
// do the following actions:
// - if offset is greater or equal, don't link to the next page
// - if offset is smaller, print the link

if ($mod >= $image_number-$images_per_page)
{
$forward ='&raquo;';
}else
{
$forward = '<a href="?mod='.$next_page.'&imageID='.$imageID.'">&r aquo;</a>';
}

// The total number of pages could be calculated by the substraction of
// image numbers and images per page

$pages_number = (int) ($image_number / $images_per_page);

// We will need some more informations for the pagination loop:
// - first of all, we have to check if the multiply of the number of pages
// and the value of images per page are equal to the number of images
// - if the values are not equal, we add 1 to the total page value,
// since we most likely wouldn't like to turn to an empty page, right?

$total_pages = $pages_number * $images_per_page;

if ($total_pages == $image_number)
{
$pages_loop = $pages_number;
}else
{
$pages_loop = $pages_number+1;
}


//
// Printing the gallery
//

echo '<table border="0" cellpadding="0" cellspacing="0">
<tr>';

// Printing the previous button, do it smooth.
echo ' <td valign="middle" class="navigation">';
echo $previous;
echo ' </td>';

for ($i = $mod; $i < $thumbs_per_page; $i++)
{
if ($gallery[$i])
{

$d=$i+1;
echo '<td valign="top" class="main"><div align="center"><a href="?mod='.$offset.'&imageID='.$i.'" target="_top"><img src="'.$thumbnail_dir.$gallery[$i].'" style="margin: 5px;"></a><br><span class="headingThumbnail">';

// Removing the extension from the filename

$name = substr_replace($gallery[$i],'',-4);

// Comment/uncomment *only one* of the following lines to
// control your filename's case

$name = ucwords($name); // Capitalize first letter of all words
// $name = ucfirst($name); // Capitalize first letter of the filename
// $name = strtoupper($name); // Whole filename in uppercase

echo $name;

}
}
// Printing the next button, do it smooth.
echo ' </span><td valign="middle" class="navigation">';
echo $forward;
echo ' </td>';

echo '
</tr>
</table>';


//
// End of printing the gallery
//


// End of script

?>
</div>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" summary="">
<tr>
<td width="600">
<div class="main" align="center">
<?php
// If $imageID variable not present for some reason or someone tried
// to play with it, set its value to 0

if (!$imageID || ereg('[a-z]', $imageID)==1 || ereg('[A-Z]', $imageID)==1 || ereg('[[:punct:][:space:]]', $imageID)==1)
{
$imageID = 0;
}

// Printing the image

echo '<img src="'.$image_dir.$gallery[$imageID].'">'
?>
</div>
</td>
</tr>
<tr>
<td width="600">
<div class="headingPicture" align="center" style="padding: 3px">
<?php

// Removing the extension from the filename

$name = substr_replace($gallery[$imageID],'',-4);

// Comment/uncomment *only one* of the following lines to
// control your filename's case

// $name = ucwords($name); // Capitalize first letter of all words
// $name = ucfirst($name); // Capitalize first letter of the filename
$name = strtoupper($name); // Whole filename in uppercase

echo $name;

?>
</div>
</td>
</tr>
</table>
</div>

</body>
</html>

si alguien me puede ayudar se lo agradeceria muchisimo tambien me gustaria implementar con otras carpetas si quisiera dar link a un archivo que se encuentra fuera de la carpeta modulos como seria el link y tambien en el config por favor ayudenme
  #2 (permalink)  
Antiguo 06/06/2005, 16:21
 
Fecha de Ingreso: diciembre-2004
Mensajes: 108
Antigüedad: 19 años, 4 meses
Puntos: 1
bueno explico un poco mejor el script es el wabbit yo quiero meter el wabbit dentro de la carpeta modulos y las carpetas de imagenes las dejor fuera donde esta el index pero cuando voy a cruzar de una foto a otra me lanza al home de nuevo no se por quise hacer todo afuera el wabbit y sus carpetas donde esta el index y lo mismo donde yo las ponga me hace los mismo no se por que el codigo esta perfecto funciona bien si lo llamo directo si me pueden decir cual es el problema
  #3 (permalink)  
Antiguo 07/06/2005, 13:11
 
Fecha de Ingreso: diciembre-2004
Mensajes: 108
Antigüedad: 19 años, 4 meses
Puntos: 1
bueno hay me disculpan la exigencia pero por si me preguntan si ya busque sobre el tema, si ya busque exactamente hay otra persona con el mismo problema con copermime la quiere meter a los modulos igual que yo pero mi script es una sola pagina y sencillo yo creo que es mas facil pero yo no puedo quise hacer lo que pude pero nada no pude por fa ayudenme ahi esta el script me imagino que deber ser alguna variable ya cambie algunas en mi local pero nada el script de arriba es el original si me pueden decir como le hago
  #4 (permalink)  
Antiguo 16/06/2005, 17:26
 
Fecha de Ingreso: diciembre-2004
Mensajes: 108
Antigüedad: 19 años, 4 meses
Puntos: 1
necesito ayuda con este script porfa ya no se que hacer he modificado variables por que pense que era eso y nada ayudenme porfa
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 14:28.