Author Topic: [MOD] Poll v2.0 (with ACP integration) NEW VERSION!!!  (Read 205096 times)

0 Members and 1 Guest are viewing this topic.

Offline lachendepaul

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: [MOD] Poll v2.0 (with ACP integration) NEW VERSION!!!
« Reply #30 on: April 14, 2005, 04:24:42 PM »
Ok thanks, but you dont have an explanation?

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD] Poll v2.0 (with ACP integration) NEW VERSION!!!
« Reply #31 on: April 14, 2005, 05:31:42 PM »
not really, i don't know too much of php adn for me is working fine, sorry

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Poll v2.0 (with ACP integration) NEW VERSION!!!
« Reply #32 on: April 14, 2005, 06:32:34 PM »
Great job excitex2 , the MOD is working perfectly ...  :D
thank you for this great tool ...   :D

here a german version of ( hier eine deutsche Version von ) :
- lang/Your_language/admin.php
- lang/Your_language/main.php
- admin/plugin/admin_encuestas.php

admin.php
Code: [Select]
//-----------------------------------------------------
//--- Umfrage : Poll v2.0 ---
//-----------------------------------------------------
$lang['maximas_opciones'] = "10";
$lang['pregunta'] = "Name der Umfrage :";
$lang['cerrar'] = "Schließen";
$lang['nueva_opcion'] = "Neue Option";
$lang['nuevas_opciones'] = "Neue Optionen";
$lang['cerrar_encuesta'] = "Schließen / Sichern";
$lang['borrar_opciones'] = "Löschen von Optionen";
$lang['borrar_opcion'] = "Löschen der ";
$lang['add_opciones'] = "Neue Option hinzufügen";
$lang['config_opciones'] = "Ändern der Anzahl der Optionen";
$lang['actualizar_encuestas'] = "Aktualisieren der Umfrage";
$lang['guardar_modificacion'] = "Speichern der Änderung";
$lang['opcion'] = "Option";
$lang['control_encuestas'] = "Einstellung der Umfrage";
$lang['nombre_opcion'] = "Name der Option";
$lang['borrar_total'] = "Löschen vorheriger Umfragen";
$lang['actualizar_pagina'] = "Aktualisieren der Seite";
$lang['texto_visitas'] = "<b>Du hast in der Übersicht - Wer kann abstimmen - geändert : Bitte aktualisiere die Seite  </b>";
$lang['texto_guardar_modificacion'] = "<b>Du hast die Umfrage geändert : Bitte aktualisiere die Seite  </b>";
$lang['texto_add_opcion'] = "<b>Du hast neue Optionen der Umfrage hinzugefügt : Bitte aktualisiere die Seite </b>";
$lang['texto_borrar_opciones'] = "<b>Du hast eine Option der Umfrage gelöscht : Bitte aktualisiere die Seite </b>";
$lang['texto_cerrar_encuestas'] = "<b>Du hast die Umfrage geschlossen und gesichert und eine neue erstellt : Bitte aktualisiere </br><b><font color=\"FF0000\">Sie können Abstimmen</font></b> und <b><font color=\"FF0000\">Zeit zwischen den Abstimmungen</font>
</b>Bitte aktualisiere die Seite</b>";
$lang['texto_borrar_total'] = "<b>Du hast eine vorherige Umfrage gelöscht : Bitte aktualisiere die Seite</b>";
$lang['texto_aviso'] = "<b><font color=\"FF0000\">Es ist eine zu geringe Anzahl gewählt. </font>Ein Maximum wurde eingestellt".
"<font color=\"FF0000\">".$lang['maximas_opciones']."</font> Optionen </b>";
$lang['texto_aviso_minimo'] = "<b><font color=\"FF0000\">Du kannst nicht mehr Optionen löschen. <font> Es handelt sich um eine Abstimmung, zwei Optionen muss man zum wählen haben .</b>";
$lang['texto_aviso_total'] = "<b><font color=\"FF0000\">Du musst eine Umfrage wählen .</font></b>";
$lang['texto_pregunta'] = "Es setzt den Namen der Umfrage";
$lang['texto_opciones'] = "Setze die Option";
$lang['visitas'] = "Wer kann abstimmen :";
$lang['aceptar'] = "Akzeptieren";
$lang['tiempo_votos'] = "Zeit zwischen Abstimmungen :";
$lang['hora'] = "Stunde";
$lang['dia'] = "Tag";
$lang['minutos'] = "Minuten";
$lang['semana'] = "Woche";
$lang['semanas'] = "Wochen";
$lang['mes'] = "Monat";

main.php
Code: [Select]
//---------------------------------------------------------------------------
// --- Umfrage : Poll v2,0 ---
//---------------------------------------------------------------------------
$lang['hora'] = date("H:i");
$lang['dia_semana'] = array("Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Sonnabend");
$lang['dia'] = date("j");
$lang['mes'] = array("Dezember", "Januar", "Februar", "März", "April", "Mai", "Juni", "July", "August", "September", "Oktober", "November");
$lang['anyo'] = date("Y");
$lang['fecha'] = $lang['dia_semana'][date('w')]." - ".$lang['dia']." - ".$lang['mes'][date("n")]." von ".$lang['anyo']." - ".$lang['hora'];
$lang['autorizacion'] = "Um absimmen zu können, musst du dich vorher registiert haben";
$lang['titulo'] = "Umfrage :";
$lang['opciones'] = "Optionen";
$lang['recibido'] = "Es wurden abgegeben :";
$lang['cerrado'] = "Und wurde geschlossen :";
$lang['comienzo'] = "Diese Umfrage begann :";
$lang['anteriores'] = "Vorherige Umfragen :";
$lang['visualizar'] = "Ergebnis";
$lang['puntuacion'] = "Stimmen";
$lang['porcentaje'] = "Prozentsatz";
$lang['grafica'] = "Diagramm";
$lang['texto_opiniones'] = "Bis zum heutigen Tag waren die Meinungen hierzu wie folgt :";
$lang['texto_total'] = "Haben insgesamt geantwortet : ";
$lang['texto_pregunta'] = "Auf die Frage : ";
$lang['texto_titulo'] = "Umfrage - Ergebnisse";
$lang['texto_titulo_anteriores'] = "Zurückliegende Umfragen";
$lang['maximas_opciones'] = 10;
$lang['usuarios'] = "Besucher";
$lang['encuestas'] = "Umfrage";
$lang['opinar'] = "Vote";
$lang['plazo_voto'] = "<p><b><font color=\"#FF0000\">Nein</font>  - kein Abstimmen möglich - du hast gerade gewählt !</b></p>";

admin_encuestas.php
finde :
Code: [Select]
$hora = date("H:i");
$dia_semana = array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sábado");
$dia = date("j");
$mes = array("Diciembre","Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre");
$anyo = date("Y");
$fecha = $dia_semana[date('w')]." - ".$dia." de ".$mes[date("n")]." del ".$anyo." a las ".$hora;

und ersetze durch :
Code: [Select]
$hora = date("H:i");
$dia_semana = array("Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Sonnabend");
$dia = date("j");
$mes = array("Dezember", "Januar", "Februar", "März", "April", "Mai", "Juni", "July", "August", "September", "Oktober", "November");
$anyo = date("Y");
$fecha = $dia_semana[date('w')]." - ".$dia." - ".$mes[date("n")]." - ".$anyo." - ".$hora;

PS : Ein Spitzen-MOD mit sehr guten ACP-Einstellungsmöglichkeiten, Auswahlmöglichkeiten zurückliegender Umfragen auf der Website und vom Layout sehr gut vorbereitet zur Einarbeitung in das eigene Layout  ... bin begeistert ...  :D

mawenzi
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline lachendepaul

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: [MOD] Poll v2.0 (with ACP integration) NEW VERSION!!!
« Reply #33 on: April 14, 2005, 07:56:20 PM »
So i dont have the button to save the settings (you can read it a few message ago)
This is the script of admin_encuestas.php (only change the language):

Code: [Select]
<?php // PLUGIN_TITLE: Poll Control
$root_path = (eregi("\/plugins\/"$_SERVER['PHP_SELF'])) ? "./../../" "./../";
define('ROOT_PATH'$root_path);
require(
ROOT_PATH.'admin/admin_global.php');
show_admin_header();

#Insertamos valores en las variables de trabajo
$contador 1;
$cont 1;
$puntuacion $lang['field_rating'];
$pregunta $lang['pregunta'];
$cerrar $lang['cerrar'];
$nueva_opcion $lang['nueva_opcion'];
$nuevas_opciones $lang['nuevas_opciones'];
$cerrar_encuestas $lang['cerrar_encuesta'];
$borrar_opciones $lang['borrar_opciones'];
$add_opciones $lang['add_opciones'];
$config_opciones $lang['config_opciones'];
$actualizar_encuestas $lang['actualizar_encuestas'];
$guardar_modificacion $lang['guardar_modificacion'];
$opcion $lang['opcion'];
$control_encuestas $lang['control_encuestas'];
$borrar $lang['delete'];
$agregar $lang['add'];
$borrar_opcion $lang['borrar_opcion'];
$nombre_opcion $lang['nombre_opcion']; 
$hora date("H:i");
$dia_semana = array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sábado");
$dia date("j");
$mes = array("Diciembre","Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre");
$anyo date("Y");
$fecha $dia_semana[date('w')]." - ".$dia." de ".$mes[date("n")]." del ".$anyo." a las ".$hora;
$borrar_total $lang['borrar_total'];
$actualizar_pagina $lang['actualizar_pagina'];
$texto_visitas $lang['texto_visitas'];
$texto_guardar_modificacion $lang['texto_guardar_modificacion'];
$texto_add_opcion $lang['texto_add_opcion'];
$texto_borrar_opciones $lang['texto_borrar_opciones'];
$texto_cerrar_encuestas $lang['texto_cerrar_encuestas'];
$texto_borrar_total $lang['texto_borrar_total'];
$texto_aviso $lang['texto_aviso'];
$maximas_opciones $lang['maximas_opciones'];
$texto_aviso_minimo $lang['texto_aviso_minimo'];
$texto_aviso_total $lang['texto_aviso_total'];
$texto_pregunta $lang['texto_pregunta'];
$texto_opciones $lang['texto_opciones'];
$visitantes $lang['visitas'];
$usuarios_registrados $lang['userlevel_registered'];
$todos $lang['all'];
$aceptar $lang['aceptar'];
$tiempo_votos $lang['tiempo_votos'];
$hora $lang['hora'];
$dias $lang['dia'];
$minutos $lang['minutos'];
$semana $lang['semana'];
$semanas $lang['semanas'];
$mes $lang['mes'];

//////////////////////////////////////////////////////////////
/////////////// Presentacion de la encuesta //////////////////
//////////////////////////////////////////////////////////////
 
#Creamos 1ª parte de la plantilla de presentación de resultados y abrimos el formulario

echo <<<ESQUEMA
<form method="post" action="admin_encuestas.php">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td class="tableborder">
<table cellpadding="3" cellspacing="1" border="0" width="100%">
<tr class="tableheader">
<td colspan="2"><b><span class="tableheader">
$control_encuestas</span></b></a>
</td>
</tr>
ESQUEMA;

#Realizamos lectura de la base de datos
$sql "SELECT *
           FROM "
.ENCUESTAS_TABLE."  
          ORDER  BY orden"
;
$result $site_db->query($sql);
$encuesta_cache = array();

#Pasamos valores de la lectura a las variables
while ($row $site_db->fetch_array($result)) {
$orden[$contador] = $row["orden"];
$nombre[$contador] = $row["nombre"];
$fecha_inicio[$contador] = $row["fecha_inicio"];
$fecha_cierre[$contador] = $row["fecha_cierre"];
$visitante[$contador] = $row["visitante"];
$plazo_votacion[$contador] = $row["plazo_votacion"];
$valor[1][$contador] = $row["opcion_1"];
$votos[1][$contador] = $row["votos_1"];
$valor[2][$contador] = $row["opcion_2"];
$votos[2][$contador] = $row["votos_2"];
$valor[3][$contador] = $row["opcion_3"];
$votos[3][$contador] = $row["votos_3"];
$valor[4][$contador] = $row["opcion_4"];
$votos[4][$contador] = $row["votos_4"];
$valor[5][$contador] = $row["opcion_5"];
$votos[5][$contador] = $row["votos_5"];
$valor[6][$contador] = $row["opcion_6"];
$votos[6][$contador] = $row["votos_6"];
$valor[7][$contador] = $row["opcion_7"];
$votos[7][$contador] = $row["votos_7"];
$valor[8][$contador] = $row["opcion_8"];
$votos[8][$contador] = $row["votos_8"];
$valor[9][$contador] = $row["opcion_9"];
$votos[9][$contador] = $row["votos_9"];
$valor[10][$contador] = $row["opcion_10"];
$votos[10][$contador] = $row["votos_10"];
$ultimo_registro $contador;
$contador++;
}
//#Pasamos valores de la lectura a las variables

#Seleccionamos el título o pregunta de la encuesta y creamos la plantilla
echo <<<ESQUEMA1
<tr class="tablerow">
<td><p class="rowtitle">
$pregunta</p></td>
<td><p><input type="text" size="59" name="nombre_de_la_encuesta" value="
$nombre[$ultimo_registro]"></p></td>
</tr>
ESQUEMA1;

#Realizamos bucle para leer las 10 opciones y las 10 votaciones
while ($cont <= $maximas_opciones){

#Controlamos los class de las tablas
if ( $lin == 1){
$linea "tablerow";
$lin 0;
}
//cerramos el condicional '( $lin == 1)'
else
{
$linea "tablerow2";
$lin 1;
//cerramos el 'else'

#Pasamos valores a las variables que admite este tipo de código HTML echo <<<bla,bla
$valores[$cont] = $valor[$cont][$ultimo_registro];
$votaciones[$cont] = $votos[$cont][$ultimo_registro];

#Verificamos que sólo se impriman los campos que tengan valores insertados
if ($valores[$cont] !=""){

#Calculamos cuantas opciones hay ya insertadas
$total_opciones++;

#Creamos el cuerpo principaL de la plantilla e insertamos la totalidad de los registros
echo <<<ESQUEMA2
<tr class="$linea">
<td><p class=
$linea><b>$cont ª $opcion</b></p></td>
<td><p><input type="text" size="30" name="valor_es[
$cont]" value="$valores[$cont]">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>
$puntuacion :</b>&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" size="4" name="votacion[$cont]" value=$votaciones[$cont]></p></td>
</tr>
ESQUEMA2;

}
//cerramos el condicional 'if'
$cont++;

}
//cerramos el bucle 'while ($cont <= $maximas_opciones)'

#Confeccionamos el final de la plantilla e insertamos los botones de guardar y actulalizar cerramos el form y tablas
echo <<<ESQUEMA3
<td colspan="2" align="center">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
 <tr>
   <td width="50%" align = "center"> <input type="submit" value="
$guardar_modificacion" class="button">

<!-- Creamos la variable de control para la modificación de registros en la base de datos -->
 <input type="hidden" name = "control" value="modificar"></td><td width="50%" align = "center"></form>
 <form method="post" action="admin_encuestas.php"><input type="submit" value=" 
$actualizar_encuestas " class="button">
</td></tr>
</form>
  </tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
ESQUEMA3;

//////////////////////////////////////////////////////////////
//////////////////// CONFIGURAR ENCUESTAS ////////////////////
//////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////
//////////////////// Añadir nuevas opciones////////////////////
//////////////////////////////////////////////////////////////

#Iniciamos plantilla para las configuraciones de opiniones , iniciamos el formulario y creamos un select con 8 opciones
echo <<<ESQUEMA4
<br></br>

<!-- creamos el formulario para añadir nuevas opciones -->
<form method="post" action="admin_encuestas.php">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
  <tr>
    <td class="tableborder">
    <table cellpadding="3" cellspacing="1" border="0" width="100%">
      <tr class="tableheader">
<td colspan="2"><b><span class="tableheader">
$config_opciones</span></b></a>
</td>
</tr>
  <tr class="tablerow2">
        <td >
        <p class="tablerow2"><b>
$add_opciones :</b></td>
        <td >
$agregar <SELECT name=insercion>
             <option value=1>1 
$nueva_opcion</option>  
             <option value=2>2 
$nuevas_opciones</option>  
             <option value=3>3 
$nuevas_opciones</option>  
             <option value=4>4 
$nuevas_opciones</option>  
             <option value=5>5 
$nuevas_opciones</option>  
             <option value=6>6 
$nuevas_opciones</option>  
             <option value=7>7 
$nuevas_opciones</option>  
             <option value=8>8 
$nuevas_opciones</option>  
        </select>

<!-- Damos valor a la variable control para ejecutar la rutina de insertar registros en la base de datos -->
         <input type="hidden" name = "control" value="insertar_opcion">
         <input type="submit" value="
$agregar" class="button"></td></form>
      </tr>
ESQUEMA4;

//////////////////////////////////////////////////////////////
/////////////////////// Borrar opciones///////////////////////
//////////////////////////////////////////////////////////////

echo <<<ESQUEMA5
<!-- Creamos el formulario para el borrado de registros en la base de datos -->
      <tr class="tablerow"><form method="post" action="admin_encuestas.php">
        <td >

        <p class="tablerow"><b>
$borrar_opciones :</b></td>
        <td >
$borrar_opcion : <SELECT name=borrado>
ESQUEMA5;

#Confeccionamos el select para la elección de borrado de opciones

FOR ($opciones_a_borrar=1;$opciones_a_borrar<=$maximas_opciones;$opciones_a_borrar++){

if (
$valores[$opciones_a_borrar] !=""){
echo 
"\n";

echo <<<ESQUEMA6
        <option value=$opciones_a_borrar>$opciones_a_borrar ª $opcion</option>  
ESQUEMA6;
}

}
echo <<<ESQUEMA7
</select>

<!-- Damos valor a la variable de control y cerramos el form -->
     <input type="hidden" name = "control" value="delete_opcion">
     <input type="submit" value="
$borrar" class="button">
</td></form>
      </tr>
ESQUEMA7;

//////////////////////////////////////////////////////////////
////////////////// Cerrar y Guardar encuestas ////////////////
//////////////////////////////////////////////////////////////

echo <<<ESQUEMA8

<!-- Creamos el formulario para el cerrar y guardar la encuesta en la base de datos -->
      <tr class="tablerow2">
<form method="post" action="admin_encuestas.php">
        <td >
        <p class="tablerow2"><b>
$cerrar_encuestas :</b></td>
<input type="hidden" name = "control" value="cerrar_guardar">
        <td><input type="text" size="59" name="encuesta" value="
$nombre[$ultimo_registro]">
 <input type="submit" value="
$cerrar" class="button"></td>
 </tr></form>
ESQUEMA8;

//////////////////////////////////////////////////////////////
///////////////// Borrar encuestas antiguas //////////////////
//////////////////////////////////////////////////////////////

echo  <<<ESQUEMA9

<!-- Creamos el formulario para el borrado difinitivo de registros en la base de datos -->
<tr class="tablerow">
<form method="post" action="admin_encuestas.php">
        <td >
        <p class="tablerow"><b>
$borrar_total :</b></td>
        <td><SELECT name=borrado_total>
ESQUEMA9;

#Realizamos lectura de la base de datos
$sql3 "SELECT *
           FROM "
.ENCUESTAS_TABLE."  
         ORDER  BY orden"
;
$resultado $site_db->query($sql3);
$encuesta_cache2 = array();

#Pasamos valores de la lectura a las variables
while ($row $site_db->fetch_array($resultado)) {
$orden_encuesta[$lectura] = $row["orden"];
$nombre_encuesta[$lectura] = $row["nombre"];
$fecha_cierre_encuesta[$lectura] = $row["fecha_cierre"];

if (
$fecha_cierre_encuesta[$lectura] != ""){
echo <<<ESQUEMA10
<option value=$orden_encuesta[$lectura]$nombre_encuesta[$lectura] - $fecha_cierre_encuesta[$lectura] </option>  
ESQUEMA10;
}

$lectura++;
}
// Cerramos el bucle "while ($row = $site_db->fetch_array($result2))" 

echo <<<ESQUEMA11
</select>
  <input type="hidden" name = "control" value="liquidar_encuesta">
  <input type="submit" value="
$borrar" class="button"></td></form>

</tr>
 
ESQUEMA11;

//////////////////////////////////////////////////////////////
////////////// Tipo de visitante que pueden votar ////////////
//////////////////////////////////////////////////////////////

echo <<<ESQUEMA12

<tr class="tablerow2">
<form method="post" action="admin_encuestas.php">
<td><p class="tablerow2"><b>
$visitantes</b></td> 
<td><SELECT name=visitas>

ESQUEMA12;

if (
$visitante[$ultimo_registro] == 0){

echo <<<ESQUEMA13
<option value="0" selected="selected"> $todos</option>  
<option value="1"> 
$usuarios_registrados</option>
ESQUEMA13;

}
else {

echo <<<ESQUEMA14
<option value="1" selected="selected"> $usuarios_registrados</option>
<option value="0" > 
$todos</option>  
ESQUEMA14;

}

echo <<<ESQUEMA15
</select>  
<input type="hidden" name = "control" value="quien_puede_votar">
<input type="submit" value="
$aceptar" class="button">
</td></form>
</tr> 

ESQUEMA15;

//////////////////////////////////////////////////////////////
/////////////////// Tiempo entre votaciones //////////////////
//////////////////////////////////////////////////////////////

$eleccion $plazo_votacion[$ultimo_registro];

switch (
$eleccion) {
case 
"0":
$seleccion0 "selected=\"selected\"";
break;

case 
"1800":
$seleccion30 "selected=\"selected\"";
break;

case 
"3600":
$seleccion1h "selected=\"selected\"";
break;

case 
"86400":
$seleccion1d "selected=\"selected\"";
break;

case 
"604800":
$seleccion1s "selected=\"selected\"";
break;

case 
"1209600":
$seleccion2s "selected=\"selected\"";
break;

case 
"1934400":
$seleccion3s "selected=\"selected\"";
break;

case 
"2592000":
$seleccion1m "selected=\"selected\"";
break;

}

echo <<<ESQUEMA16

<tr class="tablerow">
<form method="post" action="admin_encuestas.php">
<td><p class="tablerow"><b>
$tiempo_votos</b></td> 
<td><SELECT name=tiempo_votaciones>
<option value="0" 
$seleccion0> 0 $minutos</option>  
<option value="1800" 
$seleccion30> 30 $minutos</option>  
<option value="3600" 
$seleccion1h> 1 $hora</option>
<option value="86400" 
$seleccion1d> 1 $dias</option>  
<option value="604800" 
$seleccion1s> 1 $semana</option>
<option value="1209600" 
$seleccion2s> 2 $semanas</option>  
<option value="1934400" 
$seleccion3s> 3 $semanas</option>
<option value="2592000" 
$seleccion1m> 1 $mes</option>  
</select>  
<input type="hidden" name = "control" value="tiempo_entre_votos">
<input type="submit" value="
$aceptar" class="button">
</td></form>
</tr> 
ESQUEMA16;

//////////////////////////////////////////////////////////////
///////////////  FINALIZACION DE LAS TABLAS //////////////////
//////////////////////////////////////////////////////////////

echo <<<ESQUEMAFINAL

</table>
    </td>
  </tr>
</table>
<p></p>

ESQUEMAFINAL;

//////////////////////////////////////////////////////////////
// Rutinas de modificación de registros de la base de datos //
//////////////////////////////////////////////////////////////
if ($control == modificar) {

for (
$verif=1;$verif<=$maximas_opciones;$verif++){
$nuevo $valor_es[$verif];
$controlar $nuevo[0];

if (
$controlar == " "){
$controlar ltrim($nuevo" "); 
$valor_es[$verif] = $controlar;
}
if (
$valor_es[$verif]  == ""){
$votacion[$verif] = 0;
}
}

$register_array = array(); 
 
$sql "UPDATE ".ENCUESTAS_TABLE.
           SET  orden = '
$orden[$ultimo_registro]', nombre = '$nombre_de_la_encuesta', visitante = '$visitante[$ultimo_registro]',
 plazo_votacion = '
$plazo_votacion[$ultimo_registro]', fecha_inicio = '$fecha_inicio[$ultimo_registro]', fecha_cierre = '$fecha_cierre[$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);

echo <<<FINAL

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
  <tr>
    <td width="50%" align="center">
        <form method="post" action="admin_encuestas.php">
      <p>
$texto_guardar_modificacion &nbsp;&nbsp;&nbsp; <input type="submit" value=" $actualizar_pagina " class="button">&nbsp;&nbsp;
      </p>
    </form>
    </td>
  </tr>
</table>
FINAL;
}

//////////////////////////////////////////////////////////////
// Rutinas de insertar nuevos registros en la base de datos //
//////////////////////////////////////////////////////////////
if ($control == insertar_opcion) {

if ((
$total_opciones+$insercion)<=$maximas_opciones){ 

$final 1;
FOR (
$comienzo=1;$comienzo<=$maximas_opciones;$comienzo++){

if (
$valor[$comienzo][$ultimo_registro] != ""){
$valor_es[$comienzo] = $valor[$comienzo][$ultimo_registro];
$votacion[$comienzo] = $votos[$comienzo][$ultimo_registro];
}
else {
if (
$final<=$insercion){
$valor_es[$comienzo] = $texto_opciones
$votacion[$comienzo] = '0';
$final++;
}
}

}

$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_cierre[$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);

echo <<<FINAL2

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
  <tr>
    <td width="50%" align="center">
        <form method="post" action="admin_encuestas.php">
      <p> 
$texto_add_opcion&nbsp;&nbsp;&nbsp; <input type="submit" value=" $actualizar_pagina " class="button">&nbsp;&nbsp;
      </p>
    </form>
    </td>
  </tr>
</table>
FINAL2;
}
else
{
echo <<<AVISOS
<p></p>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
  <tr>
    <td width="50%" align="center">
     <p>
$texto_aviso</p>
    </td>
  </tr>
</table>
AVISOS;

}
}

////////////////////////////////////////////////////////
// Rutina de borrado de registros de la base de datos //
////////////////////////////////////////////////////////

if ($control == delete_opcion) {

if (
$total_opciones>=3){

$acabar 1;
FOR (
$principio=1;$principio<=$maximas_opciones;$principio++){

if (
$principio != $borrado){
$valor_es[$principio] = $valor[$principio][$ultimo_registro];
$votacion[$principio] = $votos[$principio][$ultimo_registro];
}
// Cerramos el condicional "if ($principio != $borrado)"

else {
$valor_es[$principio] = ""
$votacion[$principio] = '0';
}
//Cerramos el " else "

}// Cerramos el bucle "FOR ($principio=1;$principio<=$maximas_opciones;$principio++){"

$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_cierre[$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);

echo <<<FINAL3
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
  <tr>
    <td width="50%" align="center">
        <form method="post" action="admin_encuestas.php">
      <p>
$texto_borrar_opciones &nbsp;&nbsp;&nbsp; <input type="submit" value=" $actualizar_pagina " class="button">&nbsp;&nbsp;
      </p>
    </form>
    </td>
  </tr>
</table>
FINAL3;
}
// Cerramos el condicional "if (($total_opciones>=2)"
else
{
echo <<<AVISO_MINIMO
<P></p>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
  <tr>
    <td width="50%" align="center">
     <p>
$texto_aviso_minimo</p>
    </td>
  </tr>
</table>
AVISO_MINIMO;
}
// Cerramos el " else "
}// Cerramos el condicional "if ($control == delete_opcion)"

////////////////////////////////////////////////////////
//       Rutina de cerrar y guardar la encuesta       //
////////////////////////////////////////////////////////
if ($control == cerrar_guardar) {

FOR (
$inicio=1;$inicio<=$maximas_opciones;$inicio++){
$valor_es[$inicio] = $valor[$inicio][$ultimo_registro];
$votacion[$inicio] = $votos[$inicio][$ultimo_registro];
}

$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', 
 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);

//setcookie("Encuestas");// Borramos cookie de control de votaciones

$sql5 "INSERT INTO ".ENCUESTAS_TABLE.
(orden, nombre, visitante, plazo_votacion, fecha_inicio, fecha_cierre, opcion_1, votos_1, opcion_2, votos_2, opcion_3, votos_3, opcion_4, votos_4,
opcion_5, votos_5, opcion_6, votos_6, opcion_7, votos_7, opcion_8,votos_8, opcion_9, votos_9,  opcion_10, votos_10)
VALUES ('','
$texto_pregunta', '0', '0', '$fecha', '', 'Opcion_1', 0, 'Opcion_2', 0, 'Opcion_3', 0, 'Opcion_4', 0, 'Opcion_5', 0, '', 0, '', 0, '', 0, '', 0, '', 0)";
$site_db->query($sql5);

echo <<<FINAL5

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
  <tr>
    <td width="50%" align="center">
        <form method="post" action="admin_encuestas.php">
      <p>
$texto_cerrar_encuestas &nbsp;&nbsp;&nbsp; <input type="submit" value=" $actualizar_pagina " class="button">&nbsp;&nbsp;
      </p>
    </form>
    </td>
  </tr>
</table>
FINAL5;

}

//////////////////////////////////////////////////////////////
// Rutina de borrado total de registros de la base de datos //
//////////////////////////////////////////////////////////////

if ($control == liquidar_encuesta) {

if (
$borrado_total>=1){
$sql "DELETE FROM ".ENCUESTAS_TABLE."
        WHERE orden = '
$borrado_total'";
$site_db->query($sql); 
echo <<<FINAL

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
  <tr>
    <td width="50%" align="center">
        <form method="post" action="admin_encuestas.php">
      <p>
$texto_borrar_total &nbsp;&nbsp;&nbsp; <input type="submit" value=" $actualizar_pagina " class="button">&nbsp;&nbsp;
      </p>
    </form>
    </td>
  </tr>
</table>
FINAL;
}
else
{
echo <<<AVISO_TOTAL
<p></p>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
  <tr>
    <td width="50%" align="center">
     <p>
$texto_aviso_total</p>
    </td>
  </tr>
</table>
AVISO_TOTAL;
}

}

//////////////////////////////////////////////////////////////
////////////// Rutina para quien puede votar en la encuesta //////////////
//////////////////////////////////////////////////////////////

if ($control == quien_puede_votar) {

FOR (
$iniciando=1;$iniciando<=$maximas_opciones;$iniciando++){
$valor_es[$iniciando] = $valor[$iniciando][$ultimo_registro];
$votacion[$iniciando] = $votos[$iniciando][$ultimo_registro];
}

$register_array = array(); 
 
$sql "UPDATE ".ENCUESTAS_TABLE.
           SET  orden = '
$orden[$ultimo_registro]', nombre = '$nombre[$ultimo_registro]', visitante = '$visitas',
 plazo_votacion = '
$plazo_votacion[$ultimo_registro]', fecha_inicio = '$fecha_inicio[$ultimo_registro]', fecha_cierre = '$fecha_cierre[$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);

echo <<<FINALVISITAS

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
  <tr>
    <td width="50%" align="center">
        <form method="post" action="admin_encuestas.php">
      <p>
$texto_visitas &nbsp;&nbsp;&nbsp; <input type="submit" value=" $actualizar_pagina " class="button">&nbsp;&nbsp;
      </p>
    </form>
    </td>
  </tr>
</table>
FINALVISITAS;

}

//////////////////////////////////////////////////////////////
////////////// Rutina para tiempo entre votaciones//////////////
//////////////////////////////////////////////////////////////

if ($control == tiempo_entre_votos) {

FOR (
$iniciado=1;$iniciado<=$maximas_opciones;$iniciado++){
$valor_es[$iniciado] = $valor[$iniciado][$ultimo_registro];
$votacion[$iniciado] = $votos[$iniciado][$ultimo_registro];
}

$register_array = array(); 
 
$sql "UPDATE ".ENCUESTAS_TABLE.
           SET  orden = '
$orden[$ultimo_registro]', nombre = '$nombre[$ultimo_registro]', visitante = '$visitante[$ultimo_registro]',
 plazo_votacion = '
$tiempo_votaciones', fecha_inicio = '$fecha_inicio[$ultimo_registro]', fecha_cierre = '$fecha_cierre[$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);

echo <<<FINALVISITAS

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
  <tr>
    <td width="50%" align="center">
        <form method="post" action="admin_encuestas.php">
      <p>
$texto_visitas &nbsp;&nbsp;&nbsp; <input type="submit" value=" $actualizar_pagina " class="button">&nbsp;&nbsp;
      </p>
    </form>
    </td>
  </tr>
</table>
FINALVISITAS;

}

?>





Why i am the only one who dont have that button!!

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Poll v2.0 (with ACP integration) NEW VERSION!!!
« Reply #34 on: April 14, 2005, 11:16:56 PM »
@ lachendepaul

my suggestion :
- delete the Poll (encuestas) table from the database
- install the MOD again without any change
- and finally execute the install_encuestas.php
- if the MOD works for you - then change your language

( was also necessary with me (like my suggestion), I had forgotten to copy a file on the server ... but now everything works in the best way )

mawenzi
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline lachendepaul

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: [MOD] Poll v2.0 (with ACP integration) NEW VERSION!!!
« Reply #35 on: April 18, 2005, 07:12:45 PM »
It does not work still at this moment.
I miss still my SAVE button.

I the database has removed and reinstall.
I have entirely removed script and also again reinstall.

I have not adapted the language right now!!

Some what I have had adapt is:
$root_path = (eregi("\/plugins\/", $_SERVER['PHP_SELF'])) ? "./../../" : "./../";

This because he dont saw the rootpath.
So i dont have the save button right now!

Who haves the same problem?
Who haves an answer to fix this??

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD] Poll v2.0 (with ACP integration) NEW VERSION!!!
« Reply #36 on: April 18, 2005, 07:16:16 PM »
it is not a save bottum it is a refresh button, nobody has get this problem so i think u miss something in the instalation

Offline lachendepaul

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: [MOD] Poll v2.0 (with ACP integration) NEW VERSION!!!
« Reply #37 on: April 18, 2005, 07:27:58 PM »
Why? because everything works fine of the script!
But i cant refresh, so the same question still there..

Offline lachendepaul

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: [MOD] Poll v2.0 (with ACP integration) NEW VERSION!!!
« Reply #38 on: April 18, 2005, 07:29:14 PM »
Can you send me the admin page??
I find 2 versions in the script.. (one in the attachement, one in the message with a link)

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD] Poll v2.0 (with ACP integration) NEW VERSION!!!
« Reply #39 on: April 18, 2005, 09:11:51 PM »
what admin page?

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Poll v2.0 (with ACP integration) NEW VERSION!!!
« Reply #40 on: April 18, 2005, 09:16:55 PM »
@ lachendepaul

do you save the admin_encuestas.php in in folder /admin/plugins/ ...  :?:
I will send you my admin_encuestas.php via PM.

mawenzi
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline lachendepaul

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: [MOD] Poll v2.0 (with ACP integration) NEW VERSION!!!
« Reply #41 on: April 20, 2005, 08:55:55 AM »
I copy your page and it still doesnt work! (admin_encuestas.php)
That is the only page for the admin! So what can i do now?


Offline lachendepaul

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: [MOD] Poll v2.0 (with ACP integration) NEW VERSION!!!
« Reply #42 on: April 20, 2005, 09:02:04 AM »
And when i vote i see this in encuestas_resultados.php

Offline lachendepaul

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: [MOD] Poll v2.0 (with ACP integration) NEW VERSION!!!
« Reply #43 on: April 20, 2005, 09:02:43 AM »
atachment

Offline excitex2

  • Addicted member
  • ******
  • Posts: 1.590
  • He desactivado la galería y el buscador
    • View Profile
Re: [MOD] Poll v2.0 (with ACP integration) NEW VERSION!!!
« Reply #44 on: April 20, 2005, 11:53:59 PM »
Regards,,,

 I use a translator of the net.
.
You have had to commit some mistake in the installation, or, there has been a mistake in the exhaust of the ZIP.
I suggest him to unload again the ZIP and install again the MOD.

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