Foros del Web » Creando para Internet » Sistemas de gestión de contenidos »

[php-nuke] Ayuda mini modificacion bloque my egallery

Estas en el tema de [php-nuke] Ayuda mini modificacion bloque my egallery en el foro de Sistemas de gestión de contenidos en Foros del Web. Hola, hago una petición porque necesito hacer una modificación con el bloque random pic de my_egallery para php-nuke. Creo q no es algo muy dificil. ...
  #1 (permalink)  
Antiguo 05/07/2006, 03:55
 
Fecha de Ingreso: septiembre-2003
Ubicación: Barcelona
Mensajes: 7
Antigüedad: 20 años, 7 meses
Puntos: 0
[php-nuke] Ayuda mini modificacion bloque my egallery

Hola,
hago una petición porque necesito hacer una modificación con el bloque random pic de my_egallery para php-nuke. Creo q no es algo muy dificil.

Bueno, lo que necesito solo es poner un enlace debajo del bloque que lleve a la galería, es decir, sale el titulo del bloque, la foto y debajo de ésta el titulo de la foto, si le haces clic t lleva a la imagen grande, pues yo necesito que debajo del titulo aparezca un enlace tipo "Ver más" o "Ir a la galería" y q éste lleve al indice de la galería, o sea, con la url del modulo nada más.

Pongo aquí el código del modulo por si alguien no lo tiene:

Código:
<?php 



/************************************************************************/ 

/* PHP-NUKE: Web Portal System                                          */ 

/* ===========================                                          */ 

/*                                                                      */ 

/* Copyright (c) 2001 by Idefix                                         */  

/*                                                                      */ 

/* This program 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.       */ 

/************************************************************************/ 

/************************************************************************/ 

/* Filename: Block randompic                                            */ 

/* Original  Author:Idefix                                              */ 

/* Tested With PHP NUKE 5.2 and MEG 2.7.4                               */ 

/************************************************************************/ 





if (eregi("block-randompic.php",$PHP_SELF)) { 

    Header("Location: index.php"); 

    die(); 

} 



$blocks_modules[randompic] = array( 

    'title' => "randompic", 

    'func_display' => 'randompic', 

    'func_add' => '', 

    'func_update' => '', 

    'text_type' => 'randompic', 

    'text_type_long' => '', 

    'text_content' => "randompic", 

    'support_nukecode' => false, 

    'allow_create' => false, 

    'allow_delete' => false, 

    'form_url' => false, 

    'form_content' => false, 

    'form_refresh' => false 

); 



   global $user, $prefix; 

    

   include 'admin/modules/gallery/config.php'; 

   mt_srand((double)microtime()*1000000); 

   if (is_user($user)) 

      $total = mysql_fetch_array(mysql_query("SELECT COUNT(p.pid) AS total FROM $prefix"._gallery_pictures." AS p LEFT JOIN $prefix"._gallery_categories." AS c ON c.gallid=p.gid WHERE c.visible>=1")); 

   else 

      $total = mysql_fetch_array(mysql_query("SELECT COUNT(p.pid) AS total FROM $prefix"._gallery_pictures." AS p LEFT JOIN $prefix"._gallery_categories." AS c ON c.gallid=p.gid WHERE c.visible>=2")); 

    

   $p = mt_rand(0,($total[total] - 1)); 



   $pic = mysql_fetch_array(mysql_query("SELECT p.pid, p.img, p.name, p.description, c.galloc FROM $prefix"._gallery_pictures." AS p LEFT JOIN $prefix"._gallery_categories." AS c ON c.gallid=p.gid LIMIT $p,1")); 

    

   $pic[description] = htmlentities($pic[description]); 

    

   if (file_exists("$gallerypath/$pic[galloc]/thumb/$pic[img]")) 

      $content = "<center><a href=\"$baseurl&amp;do=showpic&amp;pid=$pic[pid]\"><img src=\"$gallerypath/$pic[galloc]/thumb/$pic[img]\" width=\"120\" border=\"0\" alt=\"$pic[description]\"><br><font size=\"1\">$pic[name]</font></a></center>"; 

   else 

      $content = "<center><a href=\"$baseurl&amp;do=showpic&amp;pid=$pic[pid]\"><img src=\"$gallerypath/$pic[galloc]/$pic[img]\" width=\"120\" border=\"0\" alt=\"$pic[description]\"><br><font size=\"1\">$pic[name]</font></a></center>"; 

  

?>
Yo no tg muchos conocimientos de php, probe de hacer el enlace con html pero evidentemente no me funciona y no se exactamente donde colocar el codigo para el enlace.

Aqui la url de la web, para ver el bloque, está izq abajo:

w w w . paideiasports . com/marxa/
  #2 (permalink)  
Antiguo 05/07/2006, 16:41
elmajaron
Invitado
 
Mensajes: n/a
Puntos:
prueba una de estas 2 formas: debajo de:

$content = "<center><a href=\"$baseurl&amp;do=showpic&amp;pid=$pic[pid]\"><img src=\"$gallerypath/$pic[galloc]/$pic[img]\" width=\"120\" border=\"0\" alt=\"$pic[description]\"><br><font size=\"1\">$pic[name]</font></a></center>"; pon esto:

$content = "<center><a href=\"modules.php?name=My_eGallery
\"><font size=\"1\">Ir a la galería</font></a></center>";


o esta otra:

$content = "<center><a href=\"http://www.paideiasports.com/marxa/modules.php?name=My_eGallery
\"><font size=\"1\">Ir a la galería</font></a></center>";
si no te va lo dices y lo miramos mas a fondo, un saludo
  #3 (permalink)  
Antiguo 06/07/2006, 10:08
 
Fecha de Ingreso: septiembre-2003
Ubicación: Barcelona
Mensajes: 7
Antigüedad: 20 años, 7 meses
Puntos: 0
Hola, gracias por contestar =)
he probado los dos codigos pero no me funcionan, cuando inserto cualquiera de los dos sí aparece el enlace pero entonces no sale la foto aleatoria =S es como si solo pueda salir o una cosa u la otra.

He echo una copia de la web en otro espacio para testearlo y no trabajar directamente en la web original. Puedes ver lo que te digo en esta url:

w w w . mjspain . com/phpnuke (no puedo poner urls ^^u)

Aquí está puesto el código que me has dado, aparece el enlace pero la foto no sale =(
  #4 (permalink)  
Antiguo 07/01/2008, 23:38
 
Fecha de Ingreso: marzo-2007
Mensajes: 3
Antigüedad: 17 años, 1 mes
Puntos: 0
Re: [php-nuke] Ayuda mini modificacion bloque my egallery

No se si aun necesites lo que preguntaste, creo que con esto lo consigues:

Código:
<?php 



/************************************************************************/ 

/* PHP-NUKE: Web Portal System                                          */ 

/* ===========================                                          */ 

/*                                                                      */ 

/* Copyright (c) 2001 by Idefix                                         */  

/*                                                                      */ 

/* This program 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.       */ 

/************************************************************************/ 

/************************************************************************/ 

/* Filename: Block randompic                                            */ 

/* Original  Author:Idefix                                              */ 

/* Tested With PHP NUKE 5.2 and MEG 2.7.4                               */ 

/************************************************************************/ 





if (eregi("block-randompic.php",$PHP_SELF)) { 

    Header("Location: index.php"); 

    die(); 

} 



$blocks_modules[randompic] = array( 

    'title' => "randompic", 

    'func_display' => 'randompic', 

    'func_add' => '', 

    'func_update' => '', 

    'text_type' => 'randompic', 

    'text_type_long' => '', 

    'text_content' => "randompic", 

    'support_nukecode' => false, 

    'allow_create' => false, 

    'allow_delete' => false, 

    'form_url' => false, 

    'form_content' => false, 

    'form_refresh' => false 

); 



   global $user, $prefix; 

    

   include 'admin/modules/gallery/config.php'; 

   mt_srand((double)microtime()*1000000); 

   if (is_user($user)) 

      $total = mysql_fetch_array(mysql_query("SELECT COUNT(p.pid) AS total FROM $prefix"._gallery_pictures." AS p LEFT JOIN $prefix"._gallery_categories." AS c ON c.gallid=p.gid WHERE c.visible>=1")); 

   else 

      $total = mysql_fetch_array(mysql_query("SELECT COUNT(p.pid) AS total FROM $prefix"._gallery_pictures." AS p LEFT JOIN $prefix"._gallery_categories." AS c ON c.gallid=p.gid WHERE c.visible>=2")); 

    

   $p = mt_rand(0,($total[total] - 1)); 



   $pic = mysql_fetch_array(mysql_query("SELECT p.pid, p.img, p.name, p.description, c.galloc FROM $prefix"._gallery_pictures." AS p LEFT JOIN $prefix"._gallery_categories." AS c ON c.gallid=p.gid LIMIT $p,1")); 

    

   $pic[description] = htmlentities($pic[description]); 

    

   if (file_exists("$gallerypath/$pic[galloc]/thumb/$pic[img]")) 

      $content = "<center><a href=\"$baseurl&amp;do=showpic&amp;pid=$pic[pid]\"><img src=\"$gallerypath/$pic[galloc]/thumb/$pic[img]\" width=\"120\" border=\"0\" alt=\"$pic[description]\"><br><font size=\"1\">$pic[name]</font></a><br><a href=\"$baseurl\">Ir a la galeria</a></center>"; 

   else 

      $content = "<center><a href=\"$baseurl&amp;do=showpic&amp;pid=$pic[pid]\"><img src=\"$gallerypath/$pic[galloc]/$pic[img]\" width=\"120\" border=\"0\" alt=\"$pic[description]\"><br><font size=\"1\">$pic[name]</font></a><br><a href=\"$baseurl\">Ir a la galeria</a></center>"; 

  

?>

Última edición por dj_truco; 07/01/2008 a las 23:50 Razón: Me falto poner el ir a la galeria dentro del $content del ultimo if
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 08:30.