Author Topic: [MOD] Encuestas / Poll  (Read 154486 times)

0 Members and 1 Guest are viewing this topic.

Offline excitex2

  • Addicted member
  • ******
  • Posts: 1.590
  • He desactivado la galería y el buscador
    • View Profile
Re: MOD Encuestas / Poll
« Reply #15 on: April 02, 2005, 11:20:07 PM »
Saludos / hi,,

Localizar en : / Locate in : encuestas.php

Code: [Select]
$opinar = $lang['opinar'];

Añadir debajo : / Insert below :

Code: [Select]
setcookie("actualizar");
Localizar en : / Locate in : encuestas_resultados.php

Code: [Select]
$maximas_opciones = $lang['maximas_opciones'];

Añadir debajo : / Insert below :

Code: [Select]
$actualizar = $HTTP_COOKIE_VARS["actualizar"];

Localizar : / Locate :

Code: [Select]
FOR ($grabar=1;$grabar<=$maximas_opciones;$grabar++){

if ($eleccion == $grabar ){
$valor_es[$grabar] = $valor[$grabar][$ultimo_registro];
$votacion[$grabar] = $votos[$grabar][$ultimo_registro] + 1;
}

else {
$valor_es[$grabar] = $valor[$grabar][$ultimo_registro];
$votacion[$grabar] = $votos[$grabar][$ultimo_registro];
}
}

Cambiar a : / Change to :

Code: [Select]
FOR ($grabar=1;$grabar<=$maximas_opciones;$grabar++){

if ($eleccion == $grabar ){
$valor_es[$grabar] = $valor[$grabar][$ultimo_registro];

if ($actualizar == ""){
$votacion[$grabar] = $votos[$grabar][$ultimo_registro] + 1;}
else
{
$votacion[$grabar] = $votos[$grabar][$ultimo_registro];}
}
else
{
$valor_es[$grabar] = $valor[$grabar][$ultimo_registro];
$votacion[$grabar] = $votos[$grabar][$ultimo_registro];
}
}

Localizar : / Locate :

Code: [Select]
$register_array = array();
 $sql = "UPDATE ".ENCUESTAS_TABLE."
          SET  orden = '$orden[$ultimo_registro]', nombre = '$nombre[$ultimo_registro]', visitante = '$visitante[$ultimo_registro]',
 plazo_votacion = '$plazo_votacion[$ultimo_registro]', fecha_inicio = '$fecha_inicio[$ultimo_registro]', fecha_cierre = '$fecha[$ultimo_registro]',
 opcion_1 = '$valor_es[1]', votos_1 = '$votacion[1]',
 opcion_2 = '$valor_es[2]', votos_2 = '$votacion[2]',
 opcion_3 = '$valor_es[3]', votos_3 = '$votacion[3]',
 opcion_4 = '$valor_es[4]', votos_4 = '$votacion[4]',
 opcion_5 = '$valor_es[5]', votos_5 = '$votacion[5]',
 opcion_6 = '$valor_es[6]', votos_6 = '$votacion[6]',
 opcion_7 = '$valor_es[7]', votos_7 = '$votacion[7]',
 opcion_8 = '$valor_es[8]', votos_8 = '$votacion[8]',
 opcion_9 = '$valor_es[9]', votos_9 = '$votacion[9]',
 opcion_10 = '$valor_es[10]', votos_10 = '$votacion[10]' 
  WHERE orden = '$orden[$ultimo_registro]'";
$site_db->query($sql);

}

Cambiar a : / Change to :

Code: [Select]
if ($actualizar == ""){
$register_array = array();
 $sql = "UPDATE ".ENCUESTAS_TABLE."
          SET  orden = '$orden[$ultimo_registro]', nombre = '$nombre[$ultimo_registro]', visitante = '$visitante[$ultimo_registro]',
 plazo_votacion = '$plazo_votacion[$ultimo_registro]', fecha_inicio = '$fecha_inicio[$ultimo_registro]', fecha_cierre = '$fecha[$ultimo_registro]',
 opcion_1 = '$valor_es[1]', votos_1 = '$votacion[1]',
 opcion_2 = '$valor_es[2]', votos_2 = '$votacion[2]',
 opcion_3 = '$valor_es[3]', votos_3 = '$votacion[3]',
 opcion_4 = '$valor_es[4]', votos_4 = '$votacion[4]',
 opcion_5 = '$valor_es[5]', votos_5 = '$votacion[5]',
 opcion_6 = '$valor_es[6]', votos_6 = '$votacion[6]',
 opcion_7 = '$valor_es[7]', votos_7 = '$votacion[7]',
 opcion_8 = '$valor_es[8]', votos_8 = '$votacion[8]',
 opcion_9 = '$valor_es[9]', votos_9 = '$votacion[9]',
 opcion_10 = '$valor_es[10]', votos_10 = '$votacion[10]' 
  WHERE orden = '$orden[$ultimo_registro]'";
$site_db->query($sql);

}
}

Localizar : / Locate :

Code: [Select]
FOR ($calculo=1;$calculo<=$maximas_opciones;$calculo++){

$valor_es[$calculo] = $valor[$calculo][$ultimo_registro];
$votacion[$calculo] = $votos[$calculo][$ultimo_registro];
$total_votos = $total_votos + $votacion[$calculo];
}

Cambiar a : /Change to :

Code: [Select]
FOR ($calculo=1;$calculo<=$maximas_opciones;$calculo++){
$total_votos = $total_votos + $votacion[$calculo];
}

Localizar : / Locate :

Code: [Select]
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');

Cambiar a : / Change to

Code: [Select]
setcookie("actualizar","1");

$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');

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

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: MOD Encuestas / Poll
« Reply #16 on: April 02, 2005, 11:44:52 PM »
Hi,

thanks for this but when a User make a Vote they see the Vote. That is OK. But when the Page reloaded a New Vote is safe.

To see it please Test it.

Make a Vote on

http://www.terraristik-galerie.de (scroll down - left site)

an when you see the Result please reload the Page and see what i mean ;)

And another i see. When i click on "ANZEIGEN" (now to see the results, no vote) i see nothing.....
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline excitex2

  • Addicted member
  • ******
  • Posts: 1.590
  • He desactivado la galería y el buscador
    • View Profile
Re: MOD Encuestas / Poll
« Reply #17 on: April 03, 2005, 02:30:32 AM »
Saludos,,,

Tengo el servidor caído,, por lo tanto no puedo verificar si las modificaciones son totalmente correctas

Regards,,,

I have the fallen servant and cannot verify if the modifications are totally correct

Localizar en : / Locate in : encuestas_resultados.php (en la modificación anterior / In the previous modification )

Code: [Select]
FOR ($calculo=1;$calculo<=$maximas_opciones;$calculo++){
$total_votos = $total_votos + $votacion[$calculo];
}

Cambiar a : / Change to :

Code: [Select]
if ($control != votar){
FOR ($calculo=1;$calculo<=$maximas_opciones;$calculo++){
$valor_es[$calculo] = $valor[$calculo][$ultimo_registro];
$votacion[$calculo] = $votos[$calculo][$ultimo_registro];
$total_votos = $total_votos + $votacion[$calculo];
}
}
else
{
FOR ($calculo=1;$calculo<=$maximas_opciones;$calculo++){
$total_votos = $total_votos + $votacion[$calculo];
}
}

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: MOD Encuestas / Poll
« Reply #18 on: April 03, 2005, 02:30:32 AM »
Hola he puesto en las opciones k haya 0 minutos entre voto y voto pero me sale este error No puedes emitir otro voto, has votado recientemente xq?

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: MOD Encuestas / Poll
« Reply #19 on: April 03, 2005, 02:38:26 AM »
Hola he puesto en las opciones k haya 0 minutos entre voto y voto pero me sale este error No puedes emitir otro voto, has votado recientemente xq?

Hi,

i hope i have understand you. You mean when i have more then 0 Minutes to Poll i can reload and it goes???

Sorry, No! I have 1 Week between Poll in the ACP and when i Vote and see the Result then i can Reload the Page and have one more Vote.




at excitex2

Thanks, this Change works for the Other Problem

Quote
And another i see. When i click on "ANZEIGEN" (now to see the results, no vote) i see nothing.....
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline excitex2

  • Addicted member
  • ******
  • Posts: 1.590
  • He desactivado la galería y el buscador
    • View Profile
Re: MOD Encuestas / Poll
« Reply #20 on: April 03, 2005, 02:40:25 AM »
Saludos,,,

Has modificado el títuo de la encuesta ???

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

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: MOD Encuestas / Poll
« Reply #21 on: April 03, 2005, 02:45:04 AM »
I have made changes in the Templates and changes in the lang. Nothing more. I have upload the Original Template and it doesn´t work with it.
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: MOD Encuestas / Poll
« Reply #22 on: April 03, 2005, 04:38:05 AM »
si lo modifique por?

Offline excitex2

  • Addicted member
  • ******
  • Posts: 1.590
  • He desactivado la galería y el buscador
    • View Profile
Re: MOD Encuestas / Poll
« Reply #23 on: April 03, 2005, 04:50:39 AM »
Saludos,,,

Localiza en / locate in : encuestas_resultados.php

Code: [Select]
$variable_de_tiempo = $HTTP_COOKIE_VARS["Encuestas"];
if ($variable_de_tiempo != ""){
show_error_page($lang['plazo_voto']);
  exit;
}
else{
setcookie("Encuestas","$nombre[$resultado_historial]",time()+$plazo_votacion[$resultado_historial]);
}

Cambiar a : / Change to :

Code: [Select]
$plazo = $plazo_votacion[$resultado_historial];

switch ($plazo) {
case "0":
setcookie("Encuestas");
break;

case "1800":
setcookie("Encuestas","$nombre[$resultado_historial]",time()+$plazo);
break;

case "3600":
setcookie("Encuestas","$nombre[$resultado_historial]",time()+$plazo);
break;

case "86400":
setcookie("Encuestas","$nombre[$resultado_historial]",time()+$plazo);
break;

case "604800":
setcookie("Encuestas","$nombre[$resultado_historial]",time()+$plazo);
break;

case "1209600":
setcookie("Encuestas","$nombre[$resultado_historial]",time()+$plazo);
break;

case "1934400":
setcookie("Encuestas","$nombre[$resultado_historial]",time()+$plazo);
break;

case "2592000":
setcookie("Encuestas","$nombre[$resultado_historial]",time()+$plazo);
break;

}
$variable_de_tiempo = $HTTP_COOKIE_VARS["Encuestas"];
if ($variable_de_tiempo != ""){
show_error_page($lang['plazo_voto']);
  exit;
}

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

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: MOD Encuestas / Poll
« Reply #24 on: April 03, 2005, 01:37:55 PM »
No Effect, i think i must live with it..... :(

Thanks fpr the help!
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline excitex2

  • Addicted member
  • ******
  • Posts: 1.590
  • He desactivado la galería y el buscador
    • View Profile
Re: MOD Encuestas / Poll
« Reply #25 on: April 03, 2005, 03:06:03 PM »
Regards,,,

You are sure of credit I throw the modifications such and as they are indicated?
The script now works correctly, you can verify it in my gallery (eye is for adults, if you are minor cannot enter).
I would recommend to unload afresh the zip and to unload again them *.php.

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: MOD Encuestas / Poll
« Reply #26 on: April 04, 2005, 01:38:50 AM »
Hola Jef tiene razon cuando voto y va a la pagina de resultado el voto no esta contavilizado, pero luego cuando voy a ver resultado si que esta ... cual es el cambio que hay que hacer para arreglarlo?

Offline excitex2

  • Addicted member
  • ******
  • Posts: 1.590
  • He desactivado la galería y el buscador
    • View Profile
Re: MOD Encuestas / Poll
« Reply #27 on: April 04, 2005, 01:41:36 AM »
Saludos,,

Has leído los post de abajo?  ahí esta la modificación,,, pero yo te aconsejaría que bajaras de nuevo el zip y pasaras a tu servidor los php ya modificados.

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: MOD Encuestas / Poll
« Reply #28 on: April 04, 2005, 02:49:50 AM »
Ok thanks problema arreglado :)

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: MOD Encuestas / Poll
« Reply #29 on: April 04, 2005, 06:25:33 AM »
Hola habria alguna forma de mostrar la {opci_encuestas} en details.html?