4images Forum & Community
International => Español / Castellano => Topic started by: ascanio on May 05, 2005, 11:10:53 PM
-
Hola me pregunto si hay alguna manera de agregar nuevos botones como los de download y postcards que puedan ponerse en on/off dependiendo de la categoria es decir activos o desactivados .
Gracias
-
Saludos,,,
Si que se puede,,, entra en mi galería ( no puedo poner la direción de mi galería,, esta censurada por los administradores del foro ) tú ya sabes la dirección,,, entra en cualquier categoría y mira el botón "Movil" veras que puedes mandar la imagen al movil,, pero luego entra el la categoría Metadoll o Flash veras que el botón de "Movil" está desactivado,,,
Si es eso lo que quieres,, dímelo y buscaré como lo hice :twisted: 8O 8O
excitex2
-
si, eso es loque quiero :)
-
Saludos,,,
Antes de realizar las modificaciones,,,, hacer copia de seguridad de todos los scripts que se van a modificar,,, asi como de la base de datos
localiza en global.php :
En la versión 1.7.1 :
if (defined("GET_CACHES")) {
$sql = "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
modificar a :
if (defined("GET_CACHES")) {
$sql = "SELECT cat_id, cat_name, cat_description, cat_parent_id, cat_hits, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment, auth_nuevo_boton
en la versión 1.7.0 :
if (defined("GET_CACHES")) {
$new_cutoff = time() - (60 * 60 * 24 * $config['new_cutoff']);
$sql = "SELECT c.cat_id, c.cat_name, c.cat_description, c.cat_parent_id, c.cat_hits, c.cat_order, c.auth_viewcat, c.auth_viewimage, c.auth_download, c.auth_upload, c.auth_directupload, c.auth_vote, c.auth_sendpostcard, c.auth_readcomment, c.auth_postcomment, COUNT(i.image_id) AS new_images
modificar a :
if (defined("GET_CACHES")) {
$new_cutoff = time() - (60 * 60 * 24 * $config['new_cutoff']);
$sql = "SELECT c.cat_id, c.cat_name, c.cat_description, c.cat_parent_id, c.cat_hits, c.cat_order, c.auth_viewcat, c.auth_viewimage, c.auth_download, c.auth_upload, c.auth_directupload, c.auth_vote, c.auth_sendpostcard, c.auth_nuevo_boton, c.auth_readcomment, c.auth_postcomment, COUNT(i.image_id) AS new_images
Guardar cambios
localiza en admin/categories.php
"auth_postcomment" => AUTH_USER
modifica a :
"auth_postcomment" => AUTH_USER,
"auth_nuevo_boton" => AUTH_ALL
localiza :
$auth_postcomment = $HTTP_POST_VARS['auth_postcomment'];
modificar a:
$auth_postcomment = $HTTP_POST_VARS['auth_postcomment'];
$auth_nuevo_boton = $HTTP_POST_VARS['auth_nuevo_boton'];
localiza :
$sql = "INSERT INTO ".CATEGORIES_TABLE."
(cat_name, cat_description, cat_parent_id, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment)
VALUES
('$cat_name', '$cat_description', $cat_parent_id, $cat_order, $auth_viewcat, $auth_viewimage, $auth_download, $auth_upload, $auth_directupload, $auth_vote, $auth_sendpostcard, $auth_readcomment, $auth_postcomment)";
modifica a :
$sql = "INSERT INTO ".CATEGORIES_TABLE."
(cat_name, cat_description, cat_parent_id, cat_order, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment, auth_nuevo_boton)
VALUES
('$cat_name', '$cat_description', $cat_parent_id, $cat_order, $auth_viewcat, $auth_viewimage, $auth_download, $auth_upload, $auth_directupload, $auth_vote, $auth_sendpostcard, $auth_readcomment, $auth_postcomment, $auth_nuevo_boton)";
localiza a :
$sql = "SELECT cat_name, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
modifica a :
$sql = "SELECT cat_name, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment, auth_nuevo_boton
localiza :
$auth_postcomment = $HTTP_POST_VARS['auth_postcomment'];
modifica a :
$auth_postcomment = $HTTP_POST_VARS['auth_postcomment'];
$auth_nuevo_boton = $HTTP_POST_VARS['auth_nuevo_boton'];
localiza :
if (empty($error)) {
$sql = "UPDATE ".CATEGORIES_TABLE."
SET cat_name = '$cat_name', cat_description = '$cat_description', cat_parent_id = $cat_parent_id, cat_hits = $cat_hits, auth_viewcat = $auth_viewcat, auth_viewimage = $auth_viewimage, auth_download = $auth_download, auth_upload = $auth_upload, auth_directupload = $auth_directupload, auth_vote = $auth_vote, auth_sendpostcard = $auth_sendpostcard, auth_readcomment = $auth_readcomment, auth_postcomment = $auth_postcomment
modifica a :
if (empty($error)) {
$sql = "UPDATE ".CATEGORIES_TABLE."
SET cat_name = '$cat_name', cat_description = '$cat_description', cat_parent_id = $cat_parent_id, cat_hits = $cat_hits, auth_viewcat = $auth_viewcat, auth_viewimage = $auth_viewimage, auth_download = $auth_download, auth_upload = $auth_upload, auth_directupload = $auth_directupload, auth_vote = $auth_vote, auth_sendpostcard = $auth_sendpostcard, auth_readcomment = $auth_readcomment, auth_postcomment = $auth_postcomment, auth_nuevo_boton = $auth_nuevo_boton
localiza :
$sql = "SELECT cat_name, cat_description, cat_parent_id, cat_hits, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
modifica a:
$sql = "SELECT cat_name, cat_description, cat_parent_id, cat_hits, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment, auth_nuevo_boton
guardar cambios
Localiza en details.php
"lang_file_size" => $lang['file_size']
modifica a :
"lang_file_size" => $lang['file_size'],
"lang_nuevo_boton" => $lang['nuevo_boton']
guardar cambios
localiza en includes/functions.php
$user_name = $lang['userlevel_guest'];
$user_name_link = $user_name;
}
añadir debajo :
if (!check_permission("auth_nuevo_boton", $image_row['cat_id'])) {
$nuevo_boton = "<img src=\"".get_gallery_image("nuevo_boton_off.gif")."\" border=\"0\" alt=\"\" />";
}
else {
$nuevo_boton = '<a href="AQUI PONER LO QUE TIENE QUE HACER EL BOTON SI TIENE PERMISO" ><img border="0" src="'.get_gallery_image("nuevo_boton.gif").'"></a>';
}
localizar :
"thumbnail_file_name" => $image_row['image_thumb_file']
modificar a :
"thumbnail_file_name" => $image_row['image_thumb_file'],
"image_nuevo_boton" => $image_row['image_nuevo_boton'],
"nuevo_boton" => $nuevo_boton
guardar cambios
Abrir templates/tus_plantillas/details.html
añadir donde quieras poner el boton :
{nuevo_boton}
guardar cambios
localizar en lang/tu_idioma/admin.php
$lang['auth_sendpostcard'] = "Enviar Postal";
modifica a :
$lang['auth_sendpostcard'] = "Enviar Postal";
$lang['auth_nuevo_boton'] = "El texto que quieres tener en el admin";
guardar cambios
Sube este script a tu servidor y nombralo como install_autorizacion_nuevo_boton.php y lo ejecutas
<?php
error_reporting(E_ALL);
define('ROOT_PATH', './');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/constants.php');
include(ROOT_PATH.'includes/db_mysql.php');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);
$sql = 'ALTER TABLE `'.CATEGORIES_TABLE.'` ADD `auth_nuevo_boton` TINYINT( 2 ) NOT NULL';
$site_db->query($sql);
echo "<br /><br /><center><b>SE AÑADIÓ <font color=\"#FF9900\">auth_nuevo_boton</font> A LA TABLA: <font color=\"#FF9900\">".CATEGORIES_TABLE." </font>BIEN </b><BR>PUEDES BORRAR <b>INSTALL_AUTORIZACION_nuevo_boton.PHP</b> AHORA</center>";
?>
luego crea dos botones uno lo nombras como nuevo_boton.gif y el otro como nuevo_boton_off.gif y lo subes a templates/tus_plantillas/images/
excitex2
-
Muchisimas gracias :)
-
Saludos,,,
Una cosa que se me olvidó 8O 8O 8O
Verificar que no tengais ninguna modificación en los script que vamos a modificar,,, si teneis alguna modificación anterior en los script que vamos a modificar,, aplicarla también a este MOD,,, si no,,, se perderá la modificaión anterior :twisted: :twisted: :( :(
excitex2
-
oye una cosa cuando pones Modifica a: quieres decir remplazar? o insertar despues?
-
Saludos,,,,
"Modificar a :" = " Reemplazar por"
exctex2
-
Hola acabo de instalar esta modificacion y fue todo perfecto menos una cosa, cuando modifique la funcion del boton es decir lo que tiene que hacer cuando es paretado creo que no soporta poner lo siguiente y no se como hacer para que funcione.
$nuevo_boton = '<a href="#" onClick="javascript: window.open('http://mpush.txtnation.com/req.php?account=ascanio&image=http://69.56.196.226/~ascanio/{media_src}&caption=Ahora+puedes+poner+las+fotos+de+las+Chicas+MSN+en+tu+movil+con+solo+mandar+un+SMS','_MPUSH','width=640,height=420,titlebar=1,resizable=1, scrollbars=0'); return(false);"><img border="0" src="'.get_gallery_image("nuevo_boton.gif").'"></a>';
-
Saludos,,,
Que error te da ????????
excitex2
-
este es el error : Parse error: parse error, unexpected T_STRING in /home/ascanio/domains/girlsandgirls.net/public_html/includes/functions.php on line 289
-
Saludos,,,
Prueba a ponerlo asi :
$nuevo_boton ="<a href=\"#\" onClick=\"javascript: window.open('http://mpush.txtnation.com/req.php?account=ascanio&image=http://69.56.196.226/~ascanio/{media_src}&caption=Ahora+puedes+poner+las+fotos+de+las+Chicas+MSN+en+tu+movil+con+solo+mandar+un+SMS','_MPUSH','width=640,height=420,titlebar=1,resizable=1, scrollbars=0'); return(false);\"> <img border=\"0\" src=\"'.get_gallery_image(\"nuevo_boton.gif\").'\"></a>";
excitex2
-
ahora si :) de maravilla, hay alguna manera de que tb funcione en thumbnail_bit.html como el boton de lightbox?
-
Saludos,,,
8O 8O No entiendo lo que quieres,,, explica exactamente lo que quieres que haga el MOD 8O 8O
excitex2
-
El MOD esta haciendo perfectamente lo que queria :) pero queria saber si el nuevo boton tb se podria poner en thumbnail_bit.html como el boton de lightbox.
-
Saludos,,,
Pues la verdad que no lo he provado,,,, y ya he borrado esta modificación para hacer otras cosas :twisted: :twisted:
Prueba tu entrar en thumbnail_bit.htm he inserta la etiqueta :
{nuevo_boton}
excitex2
-
Hola antes no me habia dado cuenta pero con lo que me enviastes antes ya no salia error pero no carga la imagen del boton y luego esta direccion que esta dentro del script http://69.56.196.226/~ascanio/{media_src} no es valida si quieres puedes entrar en la galeria para comprobarlo
Gracias
-
Saludos,,,
Prueba esto,,, a mi no me funciona,, pero creo que es porque el servidor de ellos comprueba la procedencia.
Todos los datos los da bien,, pero no muestra la imagen,, aunque la dirección la da correcta. :
if (!check_permission("auth_nuevo_boton", $image_row['cat_id'])) {
$nuevo_boton = "<img src=\"".TEMPLATE_PATH."/images/nuevo_boton_off.gif\" border=\"0\" alt=\"\" />";
}
else {
$nuevo_boton ="<a href=\"#\" onClick=\"javascript: window.open('http://mpush.txtnation.com/req.php?account=ascanio&image=".MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file']."&caption=Ahora+puedes+poner+las+fotos+de+las+Chicas+MSN+en+tu+movil+con+solo+mandar+un+SMS','_MPUSH','width=640,height=420,titlebar=1,resizable=1, scrollbars=0'); return(false);\">
<img border=\"0\" src=\"".TEMPLATE_PATH."/images/nuevo_boton.gif\"></a>";
}
-
Muchas gracias por el mod,me ha sido util :D