Author Topic: Nuevos Botones on/off dependiendo de la caegoria  (Read 26481 times)

0 Members and 1 Guest are viewing this topic.

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Nuevos Botones on/off dependiendo de la caegoria
« 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

Offline excitex2

  • Addicted member
  • ******
  • Posts: 1.590
  • He desactivado la galería y el buscador
    • View Profile
Re: Nuevos Botones on/off dependiendo de la caegoria
« Reply #1 on: May 05, 2005, 11:36:52 PM »
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
Lo importante no es saber,,, lo importante es tener el E-Mail de quien sabe

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: Nuevos Botones on/off dependiendo de la caegoria
« Reply #2 on: May 06, 2005, 12:05:59 AM »
si, eso es loque quiero :)

Offline excitex2

  • Addicted member
  • ******
  • Posts: 1.590
  • He desactivado la galería y el buscador
    • View Profile
Re: Nuevos Botones on/off dependiendo de la caegoria
« Reply #3 on: May 13, 2005, 02:31:02 AM »
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 :

Code: [Select]
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 :

Quote
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 :
Code: [Select]
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 :

Quote
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

Code: [Select]
"auth_postcomment" => AUTH_USER
modifica a :

Quote
"auth_postcomment" => AUTH_USER,
"auth_nuevo_boton" => AUTH_ALL

localiza :

Code: [Select]
$auth_postcomment = $HTTP_POST_VARS['auth_postcomment'];
modificar a:

Quote
$auth_postcomment = $HTTP_POST_VARS['auth_postcomment'];
  $auth_nuevo_boton = $HTTP_POST_VARS['auth_nuevo_boton'];

localiza :

Code: [Select]
$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 :

Quote
$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 :

Code: [Select]
$sql = "SELECT cat_name, auth_viewcat, auth_viewimage, auth_download, auth_upload, auth_directupload, auth_vote, auth_sendpostcard, auth_readcomment, auth_postcomment
           

modifica a :

Quote
$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 :

Code: [Select]
$auth_postcomment = $HTTP_POST_VARS['auth_postcomment'];
modifica a :

Quote
$auth_postcomment = $HTTP_POST_VARS['auth_postcomment'];
  $auth_nuevo_boton = $HTTP_POST_VARS['auth_nuevo_boton'];

localiza :

Code: [Select]
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 :

Quote
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 :

Code: [Select]
$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:

Quote
$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

Code: [Select]
"lang_file_size" => $lang['file_size']
modifica a :

Quote
"lang_file_size" => $lang['file_size'],
  "lang_nuevo_boton" => $lang['nuevo_boton']

guardar cambios

localiza en includes/functions.php

Code: [Select]
$user_name = $lang['userlevel_guest'];
    $user_name_link = $user_name;
}

añadir debajo :

Quote
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 :

Code: [Select]
"thumbnail_file_name" => $image_row['image_thumb_file']
modificar a :

Quote
"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 :

Quote
{nuevo_boton}

guardar cambios

localizar en lang/tu_idioma/admin.php

Code: [Select]
$lang['auth_sendpostcard'] = "Enviar Postal";
modifica a :

Quote
$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

Quote
<?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
Lo importante no es saber,,, lo importante es tener el E-Mail de quien sabe

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: Nuevos Botones on/off dependiendo de la caegoria
« Reply #4 on: May 13, 2005, 05:48:39 AM »
Muchisimas gracias :)

Offline excitex2

  • Addicted member
  • ******
  • Posts: 1.590
  • He desactivado la galería y el buscador
    • View Profile
Re: Nuevos Botones on/off dependiendo de la caegoria
« Reply #5 on: May 13, 2005, 08:02:16 PM »
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
Lo importante no es saber,,, lo importante es tener el E-Mail de quien sabe

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: Nuevos Botones on/off dependiendo de la caegoria
« Reply #6 on: May 13, 2005, 08:31:16 PM »
oye una cosa cuando pones Modifica a: quieres decir remplazar? o insertar despues?

Offline excitex2

  • Addicted member
  • ******
  • Posts: 1.590
  • He desactivado la galería y el buscador
    • View Profile
Re: Nuevos Botones on/off dependiendo de la caegoria
« Reply #7 on: May 13, 2005, 11:37:02 PM »
Saludos,,,,

"Modificar a :" = " Reemplazar por"

exctex2
Lo importante no es saber,,, lo importante es tener el E-Mail de quien sabe

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: Nuevos Botones on/off dependiendo de la caegoria
« Reply #8 on: May 14, 2005, 07:47:57 PM »
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>';

Offline excitex2

  • Addicted member
  • ******
  • Posts: 1.590
  • He desactivado la galería y el buscador
    • View Profile
Re: Nuevos Botones on/off dependiendo de la caegoria
« Reply #9 on: May 14, 2005, 07:55:37 PM »
Saludos,,,

Que error te da ????????

excitex2
Lo importante no es saber,,, lo importante es tener el E-Mail de quien sabe

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: Nuevos Botones on/off dependiendo de la caegoria
« Reply #10 on: May 14, 2005, 08:06:57 PM »
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


Offline excitex2

  • Addicted member
  • ******
  • Posts: 1.590
  • He desactivado la galería y el buscador
    • View Profile
Re: Nuevos Botones on/off dependiendo de la caegoria
« Reply #11 on: May 14, 2005, 08:15:04 PM »
Saludos,,,

Prueba a ponerlo asi :

Quote
$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
Lo importante no es saber,,, lo importante es tener el E-Mail de quien sabe

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: Nuevos Botones on/off dependiendo de la caegoria
« Reply #12 on: May 14, 2005, 08:30:20 PM »
ahora si :) de maravilla, hay alguna manera de que tb funcione en thumbnail_bit.html como el boton de lightbox?

Offline excitex2

  • Addicted member
  • ******
  • Posts: 1.590
  • He desactivado la galería y el buscador
    • View Profile
Re: Nuevos Botones on/off dependiendo de la caegoria
« Reply #13 on: May 14, 2005, 10:35:23 PM »
Saludos,,,

 8O 8O No entiendo lo que quieres,,, explica exactamente lo que quieres que haga el MOD  8O 8O

excitex2
Lo importante no es saber,,, lo importante es tener el E-Mail de quien sabe

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: Nuevos Botones on/off dependiendo de la caegoria
« Reply #14 on: May 14, 2005, 11:30:24 PM »
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.