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

0 Members and 1 Guest are viewing this topic.

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
[MOD] Poll v2.0 (with ACP integration) NEW VERSION!!!
« on: March 17, 2005, 09:15:30 PM »
 Hello every one,,,
 MOD Poll this MOD was made by excitex2 in spanish I just translate the instructions and the admin.php, main.php language files.

     :arrow: v1.0 (March 17, 2005, 10:07)
        - First release
          5 fixed options
          Panel of control
          Modification of the name, the options and the polls.
          Visualization of results
          Graph of results.
          Poll and I return the index

     :arrow: v2.0 (March 31, 2005, 12:47)
        - Second release
          Personalizable
          10 variable options
          Panel of Control
          Modify the options, title and votes.
          Add new fields of options
          Erase fields of options.
          Save and to close poll
          Record of polls
          Erase previous polls
          Visualization of results
          Graph of results.
          Poll and come back to the page of results
          Menu of previous polls
          Option to restrict the access to the poll to users not registered
          Option to put term between votes.
          Format multi-language
          Annotations of minimal options.
          Warn of errors.


   :arrow: DEMO: http://www.girlsandgirls.tk/
                 
                 
                 


MOD Poll v2.0

 :arrow: Files to edit :
index.php
admin/backup.php
includes/constants.php
templates/<your templates>/home.html
lang/<your language>/admin.php
lang/<your language>/main.php

 :arrow: New Files :
encuestas.php
encuestas_resultados.php
encuestas_histo.php
install_encuestas.php
admin/plugins/admin_encuestas.php
templates/<your templates>/encuestas.html
templates/<your templates>/encuestas_result.html
templates/<your templates>/encuestas_histo_result.html

 :arrow: Othes Files
Groups of images for the poll graph.


 :arrow: Instalation :

 - Easy, 10 minutes.

1º) Download the files from here << Here >>

2º) Unzip the file

3º) Upload these files to the root :
encuestas.php
encuestas_resultados.php
encuestas_histo.php
install_encuestas.php


4º) Upload to templates/<your templates> :
encuestas.html
encuestas_result.html
encuestas_histo_result.html


5º) Upload to templates/<your templates>/images
All the images

6º) Upload to admin/plugins
admin_encuestas.php

 :arrow: Note: If you don't have a folder called plugings create one and put the files there

 :arrow: Modifications :

Important!! : Do Not execute install_encuestas.php until not having realized the changes and upload the new files.

7º) Open File : admin/backup.php

Find:
Code: [Select]
COMMENTS_TABLE, add after
Code: [Select]
ENCUESTAS_TABLE, Save changes

8º) Open Files :   includes/constants.php

Find:
Code: [Select]
define('COMMENTS_TABLE', $table_prefix.'comments');Add after
Code: [Select]
define('ENCUESTAS_TABLE', $table_prefix.'encuestas');Save changes

9º) Open : index.php

Find
Code: [Select]
require(ROOT_PATH.'includes/sessions.php');add after
Code: [Select]
include(ROOT_PATH.'encuestas.php');Save changes

10º) Open templates/<your templates>/home.html

Add

Code: [Select]
<tr><td class="row2"><p align="center">{opci_encuestas}</td></tr>whereever you want to place the poll

Save changes

11º) Open lang/<your language>/admin.php

Find:

Code: [Select]
?>
add before :
[
Code: [Select]
//-----------------------------------------------------
//------------------- Encuestas -----------------------
//-----------------------------------------------------
$lang['maximas_opciones'] = "10";
$lang['pregunta'] = "Name of the Poll :";
$lang['cerrar'] = "Close";
$lang['nueva_opcion'] = "New option";
$lang['nuevas_opciones'] = "new options";
$lang['cerrar_encuesta'] = "Close and Save";
$lang['borrar_opciones'] = "Delete options";
$lang['borrar_opcion'] = "Detete ";
$lang['add_opciones'] = "Add new optiones";
$lang['config_opciones'] = "Edit the number of options";
$lang['actualizar_encuestas'] = "Refresh Poll";
$lang['guardar_modificacion'] = "Save";
$lang['opcion'] = "Option";
$lang['control_encuestas'] = "Poll Control";
$lang['nombre_opcion'] = "Name of the option";
$lang['borrar_total'] = "Delete previous options";
$lang['actualizar_pagina'] = "Refresh page";
$lang['texto_visitas'] = "<b>You have modified the one who can vote in the poll, please updates the page </b>";
$lang['texto_guardar_modificacion'] = "<b>You have modified the poll, please it updates the page </b>";
$lang['texto_add_opcion'] = "<b>You have added news opciónes to the poll, please it updates the page  </b>";
$lang['texto_borrar_opciones'] = "<b>You have erased an option of the poll, please it updates the page  </b>";
$lang['texto_cerrar_encuestas'] = "<b>You have closed and saved the poll, and new ones has been created,
 please check the section </br><b><font color=\"FF0000\">Can vote </font></b> y <b><font color=\"FF0000\"> Time between the votes </font>
</b>,,, update the page  </b>";
$lang['texto_borrar_total'] = "<b>You have erased a previous poll of the record, please it updates the page </b>";
$lang['texto_aviso'] = "<b><font color=\"FF0000\">select an small quantity</font>It has been edit to".
"<font color=\"FF0000\">".$lang['maximas_opciones']."</font> options </b>";
$lang['texto_aviso_minimo'] = "<b><font color=\"FF0000\">You cannot erase any more options,</font> in order to be a poll, you have to have two options.</b>";
$lang['texto_aviso_total'] = "<b><font color=\"FF0000\">You have to choose a poll.</font></b>";
$lang['texto_pregunta'] = "Insert the name of the poll";
$lang['texto_opciones'] = "Insert the option";
$lang['visitas'] = "Can vote :";
$lang['aceptar'] = "Acept";
$lang['tiempo_votos'] = "Time between polls";
$lang['hora'] = "time";
$lang['dia'] = "day";
$lang['minutos'] = "minutes";
$lang['semana'] = "week";
$lang['semanas'] = "weeks";
$lang['mes'] = "month";

12º) Open lang/<your language>/main.php

Finde

Code: [Select]
?>
Add before :
Code: [Select]
//---------------------------------------------------------------------------
// ------------------------------- Encuestas --------------------------------
//---------------------------------------------------------------------------
$lang['hora'] = date("H:i");
$lang['dia_semana'] = array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
$lang['dia'] = date("j");
$lang['mes'] = array("December","January","February","March","April","May","June","July","August","September","October","November");
$lang['anyo'] = date("Y");
$lang['fecha'] = $lang['dia_semana'][date('w')]." - ".$lang['dia']." of ".$lang['mes'][date("n")]." of ".$lang['anyo']." at ".$lang['hora'];
$lang['autorizacion'] = "To be able to vote in the poll, you have that register first";
$lang['titulo'] = "Poll name :";
$lang['opciones'] = "Options";
$lang['recibido'] = "has recived :";
$lang['cerrado'] = "and closed the :";
$lang['comienzo'] = "This poll began :";
$lang['anteriores'] = "Previous polls :";
$lang['visualizar'] = "See polls";
$lang['puntuacion'] = "Punctuation";
$lang['porcentaje'] = "Percentage";
$lang['grafica'] = "Graph";
$lang['texto_opiniones'] = "Today, the opinions are the following ones:";
$lang['texto_total'] = "have answered a total";
$lang['texto_pregunta'] = "To the question : ";
$lang['texto_titulo'] = "Polls - Opinions";
$lang['texto_titulo_anteriores'] = "Polls - Opinions - Previous";
$lang['maximas_opciones'] = 10;
$lang['usuarios'] = "users";
$lang['encuestas'] = "Polls";
$lang['opinar'] = "Vote";
$lang['plazo_voto'] = "<p><b><font color=\"#FF0000\">No</font> You cannot submit another vote, have voted recently</b></p>";

OBSERVATIONS : This version is much more completed than the previous version, on having been more complex I have turned out to be the table of the data base forced to remake themr, in the previvious version was sequential and now it is linear to assume the record of the polls, therefore the users who have the version 1.0, they will have to erase the previous table as well as the files that do not coincide with this version, having present that, before erasing the information of the data base, from the panel of control to do a copy to hand of result of the poll and to introduce it manually in the new version, (they are not so manyr, they are 5 options and 5 polls).

Finally execute the install_encuestas.php , then go  to the panel of control and to enter the information of the form of the polls.


excitex2

« Last Edit: March 17, 2005, 10:07:12 PM by Chris »

b.o.fan

  • Guest
Re: [MOD] Poll v1.0 (with ACP integration)
« Reply #1 on: March 17, 2005, 11:50:39 PM »
great mod. but in german? or in english??

b.o.fan

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD] Poll v1.0 (with ACP integration)
« Reply #2 on: March 18, 2005, 12:39:58 AM »
The MOD has been translated to English

b.o.fan

  • Guest
Re: [MOD] Poll v1.0 (with ACP integration)
« Reply #3 on: March 18, 2005, 01:26:38 AM »
on monday i post my files with the german language!

an sometimes the english...

happy weekend   8) 8) 8)

@ascanio
i think it would be cool, if the user can see the result of his vote in the result_encuestas.php. and somethink like a IP-barrier:?:  ;-) the rest of the mod is VERY good :!:  :mrgreen: :D :mrgreen:

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: [MOD] Poll v1.0 (with ACP integration) NEW!!!
« Reply #4 on: March 18, 2005, 11:40:03 PM »

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [MOD] Poll v1.0 (with ACP integration) NEW!!!
« Reply #5 on: March 19, 2005, 12:21:18 AM »
Hi there,

thanks for this but what must i change to come to the Results after Vote.

Now i Vote and then load the index.php but i want after load the result Page...

And another

When you go to this -> http://www.terraristik-galerie.de/result_encuestas.php then you see that the Grafik is bigger by 0 Percent then by 1,75 Percent. What is wrong???

And in the ACP i have the Button Actualizar encuestas. What is the function? I see no changes when i click on 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] Poll v1.0 (with ACP integration) NEW!!!
« Reply #6 on: March 19, 2005, 02:18:22 AM »
I did not made the MOD I just translate it to english ... I don't know how to redirect the vote to results vote the Button Actualizar encuestas means Refresh Poll and what it does is to refresh the data when u have change the results in your admin panel

Offline excitex2

  • Addicted member
  • ******
  • Posts: 1.590
  • He desactivado la galería y el buscador
    • View Profile
Re: [MOD] Poll v1.0 (with ACP integration) NEW!!!
« Reply #7 on: March 19, 2005, 02:23:29 AM »
Saludos,,, / Grüsse,,,

localizar en / suchen in : /templates/tus_templates/encuestas.html

Quote
<form method="post" action="">

modificar a  / verändern zu :

Quote
<form method="post" action="result_encuestas.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] Poll v1.0 (with ACP integration) NEW!!!
« Reply #8 on: March 19, 2005, 02:38:03 AM »
Saludos,,, / Grüsse,,,

localizar en / suchen in : /templates/tus_templates/encuestas.html

Quote
<form method="post" action="">

modificar a  / verändern zu :

Quote
<form method="post" action="result_encuestas.php">

excitex2




Thanks but when i do this they count no Vote. I click Vote and come to the results but i see no Vote..... :(
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline syndrom

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: [MOD] Poll v1.0 (with ACP integration) NEW!!!
« Reply #9 on: March 19, 2005, 05:27:12 AM »
nice mod, thanks for it! :)
as b.o.fan said - it would be really nice when a user can only vote once (cookie and or IP).



Offline excitex2

  • Addicted member
  • ******
  • Posts: 1.590
  • He desactivado la galería y el buscador
    • View Profile
Re: [MOD] Poll v1.0 (with ACP integration) NEW!!!
« Reply #10 on: March 19, 2005, 06:04:47 PM »
Saludos,,, / Grüsse,,,

localizar en / suchen in : encuestas.php

Code: [Select]
$site_template->register_vars($register_array);
$cont=1;


if ($control == ok) {

if ($eleccion == resultado1)
{
$opci_control = 1;
}
else
if ($eleccion == resultado2)
{
$opci_control = 2;
}
else
if ($eleccion == resultado3)
{
$opci_control = 3;
}
else
if ($eleccion == resultado4)
{
$opci_control = 4;
}
else
if ($eleccion == resultado5)
{
$opci_control = 5;
}

$register_array = array();
 $sql = "UPDATE ".ENCUESTAS_TABLE."
         SET votos = votos + 1
  WHERE opci_nombre = '$opci_nombre[$opci_control]'";
$site_db->query($sql);
}

$site_template->register_vars("opci_encuestas", $opci_encuestas);
?>

modificar a  / verändern zu :

Code: [Select]
$site_template->register_vars($register_array);
$cont=1;
$site_template->register_vars("opci_encuestas", $opci_encuestas);
?>

localizar en / suchen in : result_encuestas.php

Code: [Select]
$sql = "SELECT *
           FROM ".ENCUESTAS_TABLE." 
          ORDER  BY opci_nombre";
$result = $site_db->query($sql);

$encuesta_cache = array();
while ($row = $site_db->fetch_array($result)) {
$maximo = $contador;
$opci_nombre[$contador] = $row["opci_nombre"];
$opci_valor[$contador] = $row["opci_valor"];
$votos[$contador] = $row["votos"];
$total_votos = $total_votos + $votos[$contador];
$contador++;
}

modificar a  / verändern zu :

Code: [Select]
$sql = "SELECT *
           FROM ".ENCUESTAS_TABLE." 
          ORDER  BY opci_nombre";
$result = $site_db->query($sql);

$encuesta_cache = array();
while ($row = $site_db->fetch_array($result)) {
$maximo = $contador;
$opci_nombre[$contador] = $row["opci_nombre"];
$opci_valor[$contador] = $row["opci_valor"];
$votos[$contador] = $row["votos"];
$total_votos = $total_votos + $votos[$contador];
$contador++;
}


if ($control == ok) {

if ($eleccion == resultado1)
{
$opci_control = 1;
}
else
if ($eleccion == resultado2)
{
$opci_control = 2;
}
else
if ($eleccion == resultado3)
{
$opci_control = 3;
}
else
if ($eleccion == resultado4)
{
$opci_control = 4;
}
else
if ($eleccion == resultado5)
{
$opci_control = 5;
}
$register_array = array();
 $sql = "UPDATE ".ENCUESTAS_TABLE."
          SET votos = votos + 1
  WHERE opci_nombre = '$opci_nombre[$opci_control]'";
$site_db->query($sql);

$contador = 0;
$cont = 1;

$sql = "SELECT *
           FROM ".ENCUESTAS_TABLE." 
          ORDER  BY opci_nombre";
$result = $site_db->query($sql);

$encuesta_cache = array();
while ($row = $site_db->fetch_array($result)) {
$maximo = $contador;
$opci_nombre[$contador] = $row["opci_nombre"];
$opci_valor[$contador] = $row["opci_valor"];
$votos[$contador] = $row["votos"];
$total_votos2 = $total_votos2 + $votos[$contador];
$contador++;
}
$total_votos = $total_votos2;
}

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] Poll v1.0 (with ACP integration) NEW!!!
« Reply #11 on: March 19, 2005, 10:53:03 PM »
Hi,

what do this Code????

I have searched in my encuestas.php and i don´t have this

Code: [Select]
$site_template->register_vars($register_array);
$cont=1;

if ($control == ok) {
while ($contar <= $maximo) {

if ($eleccion == $contar){
$opci_control = $contar;
}
$contar++;
}
$register_array = array();
$sql = "UPDATE ".ENCUESTAS_TABLE."
         SET votos = votos + 1
  WHERE opci_nombre = '$opci_nombre[$opci_control]'";
$site_db->query($sql);
}

$site_template->register_vars("opci_encuestas", $opci_encuestas);
?>

I have this

Code: [Select]
$site_template->register_vars($register_array);
$cont=1;

if ($control == ok) {

if ($eleccion == resultado1)
{
$opci_control = 1;
}
else
if ($eleccion == resultado2)
{
$opci_control = 2;
}
else
if ($eleccion == resultado3)
{
$opci_control = 3;
}
else
if ($eleccion == resultado4)
{
$opci_control = 4;
}
else
if ($eleccion == resultado5)
{
$opci_control = 5;
}

$register_array = array();
 $sql = "UPDATE ".ENCUESTAS_TABLE."
          SET votos = votos + 1
  WHERE opci_nombre = '$opci_nombre[$opci_control]'";
$site_db->query($sql);
}

$site_template->register_vars("opci_encuestas", $opci_encuestas);
?>
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] Poll v1.0 (with ACP integration) NEW!!!
« Reply #12 on: March 19, 2005, 11:25:43 PM »
Regards,,

Pedón for my English, I use a translator of the net.

 I sit the mistake, the code that I have put is of the new version that is I appear of going out. Already it is corrected
 The new version has a more complete great ACP and several options more to be able to form to our needs.
 The new version goes again:
  add fields
  remove fields
  save poll
  erase poll
 Record Poll ancient
 Etc, etc,

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] Poll v1.0 (with ACP integration) NEW!!!
« Reply #13 on: March 19, 2005, 11:34:15 PM »
Where i can find the new version??? Can i test it???
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] Poll v1.0 (with ACP integration) NEW!!!
« Reply #14 on: March 19, 2005, 11:43:19 PM »
Regards,,,

The new version will not be ended up to the next week.

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