Author Topic: Al hacer clic en el thumbnail salga un aviso para que se registre ¿Se puede ?  (Read 6622 times)

0 Members and 1 Guest are viewing this topic.

Offline Cimmerio

  • Full Member
  • ***
  • Posts: 143
    • View Profile
    • Cartagena en Fotos
Pues eso, creo recordar que existía un mod que haciía esto mismo pero no lo encuentro.

Offline benzo

  • Moderator
  • Hero Member
  • *****
  • Posts: 748
  • El que nada duda, nada sabe. :-)
    • View Profile
Si existe un MOD.

Edita el archivo:  /includes/function.php

Busca este código:
Code: [Select]
function get_thumbnail_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 0) {
 global $site_sess, $config;

 if (!check_media_type($media_file_name)) {
   $thumb = "<img src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
 }
 else {
   if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) {
     $file_src = ICON_PATH."/".get_file_extension($media_file_name).".gif";
     $image_info = @getimagesize($dummy);
     $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
     $thumb = "<img src=\"".$file_src."\" border=\"0\"".$width_height." alt=\"".$image_name."\" />";
   }
   else {
     $file_src = get_file_path($thumb_file_name, "thumb", $cat_id, 0, 1);
     $image_info = @getimagesize($file_src);
     $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
     $thumb = "<img src=\"".$file_src."\" border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" />";
   }
 }

 if ($show_link) {
   if ($open_window) {
     $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
   }
   else {
     $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>";
   }
 }
 return $thumb;
}

y cambialo todo por este otro:

Code: [Select]
function get_thumbnail_code($media_file_name, $thumb_file_name = "", $image_id, $cat_id, $image_name = "", $mode = "", $show_link = 1, $open_window = 0) {
 global $site_sess, $config, $lang;;

 if (!check_media_type($media_file_name)) {
   $thumb = "<img ".(($show_link) ? "" : "onClick=\"alert('".$lang['members_only']."');\"")."src=\"".ICON_PATH."/404.gif\" border=\"0\" alt=\"\" />";
 }
 else {
   if (!get_file_path($thumb_file_name, "thumb", $cat_id, 0, 0)) {
     $file_src = ICON_PATH."/".get_file_extension($media_file_name).".gif";
     $image_info = @getimagesize($dummy);
     $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
     $thumb = "<img src=\"".$file_src."\" ".(($show_link) ? "" : "onClick=\"alert('".$lang['members_only']."'); \"")."border=\"0\"".$width_height." alt=\"".$image_name."\" />";
   }
   else {
     $file_src = get_file_path($thumb_file_name, "thumb", $cat_id, 0, 1);
     $image_info = @getimagesize($file_src);
     $width_height = (!empty($image_info[3])) ? " ".$image_info[3] : "";
     $thumb = "<img src=\"".$file_src."\" ".(($show_link) ? "" : "onClick=\"alert('Acceso solo a miembros registrados'); \"")."border=\"".$config['image_border']."\"".$width_height." alt=\"".$image_name."\" />";
   }
 }

 if ($show_link) {
   if ($open_window) {
     $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\" onclick=\"opendetailwindow()\" target=\"detailwindow\">".$thumb."</a>";
   }
   else {
     $thumb = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$thumb."</a>";
   }
 }
 return $thumb;
}

Saludos.
¡ Antes de actualizar o modificar el script, realiza una copia de seguridad de todos los archivos y datos !

Tenemos una pequeña faq en español, también la faq oficial ( en inglés  ) y un buscador muy hermoso

Offline jotabonfim

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
podría cambiar esta tendencia a no mostrar la alerta?

Quiero que cuando el usuario hace clic en el pulgar se le redirige a una página register.php.

¿Es posible?

Gracias