Welcome, Guest. Please login or register.
August 20, 2008, 05:18:47 PM

Login with username, password and session length
Search:     Advanced search
Please check out the Documentation available and use the advanced forum search, before posting in the forum - thanks.
Bitte lies zuerst die Dokumentation und benutze die Advanced Forensuche, bevor Du einen neuen Beitrag erstellst - danke.
Bekijk alstublieft eerst de Documentatie en gebruik de Advanced Forum Zoekfunctie, voor dat u een post maakt in het forum - Hartelijk dank.
60556 Posts in 9791 Topics by 5824 Members
Latest Member: blubb
* Home Help Search Login Register
+  Website Baker Community Forum
|-+  English
| |-+  Modules
| | |-+  AJAX Poll
Pages: [1] Go Down Print
Author Topic: AJAX Poll  (Read 3604 times)
Insa
Pending Apprentice Baker
**
Offline Offline

Posts: 12


244015
« on: November 02, 2007, 11:53:41 AM »

Hi!

I present new module: AJAX Poll v1.0.
All bugs pls send this topic. All translate files pls send too.

Demo: http://www.unlabeled.ru
Download: http://www.wb.unlabeled.ru/ajax_poll_v1.02.zip
Good reason use this module with http://forum.websitebaker.org/index.php/topic,7574.0.html

If you want use personal template, you may change default template settings or create file ajax_poll.php in template directory and paste this default text:
P/S/ Sorry my english. From Russia with love.

Code:
<?php
/*****************************************
VARS:
[QUESTION] - Poll question
[TOTAL_COL] - Total votes
[ANSWER] - Answer
[ANSWER_ID] - ID Answer
[ANSWER_NUM] - Number answer
[COL] - Votes
[PERSENT]  - Persents
TEXT LOCALE VARS:
[TEXT_QUESTION] - Text 'Question'
[TEXT_ANSWER] - Text 'Answer'
[TEXT_POLL] - Text 'Poll'
[TEXT_COL] - Text 'Votes'
[TEXT_PERSENT]  - Text 'Persents'
[TEXT_TOTAL_COL] - Text 'Total votes'
[TEXT_VIEW_RESULTS] - Text 'View results'
[TEXT_RESULTS] - Text 'Results'
[TEXT_REVOTE] - Text 'Revote'
[TEXT_VOTE]  - Text 'Vote'
********************************************/
/*FORM*/
$template_header "
<style>
.question {
font-size: 12px;
color: #003366;
}
.answer {
font-size: 10px;\n
color: #336699;\n
}
</style>
<h2>[TEXT_POLL]</h2>
<b><div class=\"question\">[QUESTION]</div></b>
"
;
$template_loop "<input type=\"radio\" name=\"ajax_poll_answer\" id=\"ajax_poll_answer_[ANSWER_NUM]\" style=\"width: 14px; height: 14px;\" value=\"[ANSWER_ID]\" onClick=\"select_answer(this.value)\" />\n<label for=\"ajax_poll_answer_[ANSWER_NUM]\" class=\"answer\">[ANSWER]</label><br />\n";
$template_footer "<input type=\"button\" value=\"[TEXT_VOTE]\" onclick=\"vote_ajax_poll();\"  style=\"width: 117px; margin-top: 5px;\" />\n";
/*RESULTS*/

$template_result_header "<style>
.question {
font-size: 12px;
color: #003366;
}
.revote {
font-size: 11px;
color: #003366;
}
.answer {
font-size: 10px;\n
color: #336699;\n
}
</style>

<h2>[TEXT_POLL]</h2>
<b><div class=\"question\">[QUESTION]</div></b><br/>"
;
$template_result_loop "<div class=\"answer\">[ANSWER_NUM].[ANSWER] ([PERSENT]%)</div>
<table width=\"[PERSENT]%\"><tr><td bgcolor=\"#999999\"></td></tr></table>"
;
$template_result_footer "<div class=\"answer\">[TEXT_TOTAL_COL]: [TOTAL_COL]</div>";
if (
$ajax_poll_revote){$template_result_footer .= "<br/><a href=\"javascript: revote_ajax_poll();\" class=\"Revote\">[TEXT_REVOTE]</a>";}
?>
« Last Edit: November 02, 2007, 11:12:50 PM by Insa » Logged
macsmet
Apprentice Baker
***
Offline Offline

Posts: 92


« Reply #1 on: November 02, 2007, 12:40:52 PM »

Hi, Working on a Dutch translation right now.
Installed it and that looks OK.
Got this error in my browser:
Parse error: syntax error, unexpected $end in .../modules/ajax_poll/view.php on line 324
Logged
Eki
Documentation Team
Junior Baker
******
Offline Offline

Posts: 107



WWW Email
« Reply #2 on: November 02, 2007, 01:29:26 PM »

Had a very quick look over it. I think that line 46:

Code:
if (!isset($poll_answer_id)){$poll_answer_id=$_GET['poll_answer_id'];

Should become:

Code:
if (!isset($poll_answer_id)){$poll_answer_id=$_GET['poll_answer_id'];}

(the bracket at the end)

But then there is still no output  huh

Also one other question: The page's template can be changed via the page-settings. Why specify the template again in the Modify Page screen?
« Last Edit: November 02, 2007, 01:31:54 PM by Eki » Logged
Insa
Pending Apprentice Baker
**
Offline Offline

Posts: 12


244015
« Reply #3 on: November 02, 2007, 01:56:35 PM »

Code:
if (!isset($poll_answer_id)){$poll_answer_id=$_GET['poll_answer_id'];}
I have corrected this mistake

For the given module the personal pattern, as in the module of news is used
Logged
macsmet
Apprentice Baker
***
Offline Offline

Posts: 92


« Reply #4 on: November 02, 2007, 02:27:06 PM »

Yes, that did it!
I tested the end date/time function but that doesn't work.
After saving the page it is not saved.

And what about vote again?
How does it work? I voted and cannot vote again on my poll.
The same for vote anonymous?

greetings,

MacSmet
« Last Edit: November 02, 2007, 02:33:29 PM by macsmet » Logged
Insa
Pending Apprentice Baker
**
Offline Offline

Posts: 12


244015
« Reply #5 on: November 02, 2007, 11:10:38 PM »

I tested the end date/time function but that doesn't work.
After saving the page it is not saved.

Thx, i fix this bug and upload new version.

And what about vote again?
How does it work? I voted and cannot vote again on my poll.
The same for vote anonymous?
If you want vote again, add next string to template results footer:
<br /><a href="javascript: revote_ajax_poll();">[TEXT_REVOTE]</a>
Logged
tomhung
Master Baker
*****
Offline Offline

Posts: 354


cave_crickett@hotmail.com cave+crickett gbosen
Email
« Reply #6 on: November 27, 2007, 04:41:55 PM »

post code in forum....
Logged
Beppi
Pending Apprentice Baker
**
Offline Offline

Posts: 8


« Reply #7 on: February 07, 2008, 07:21:02 PM »

Are there any news about this module?
I need it and it looks like sometimes it works, other times it doesn't display, and generally doesn't show as section.
Thanks.
Logged
erpe
Junior Baker
****
Online Online

Posts: 124



WWW
« Reply #8 on: February 15, 2008, 05:33:25 PM »

I installed the module Version 1.02 today and translated it into German.
It works with 1 exception: the poll question is not be displayed.
But  it seems to work in all other parts (not in the time and Date setting, I think only the "year" ist still functioning)

Is there anyone, who can help in case of displaying the Question?

Thanks for helping.
Logged

If YOU want to help children in Guatemala, visit:  von Brauck Foundation
tu.sha
Pending Apprentice Baker
**
Offline Offline

Posts: 6


« Reply #9 on: March 22, 2008, 06:23:23 PM »

and how to call it from somewhere? not from page_content(); ?
Logged
durao
Pending Apprentice Baker
**
Offline Offline

Posts: 8


« Reply #10 on: April 28, 2008, 12:11:07 PM »

The russian link you provided is not working.
Anywhere else I can download the zip file?

Tanx!!!
Logged
Pitti
Pending Apprentice Baker
**
Offline Offline

Posts: 16



WWW Email
« Reply #11 on: April 28, 2008, 03:50:01 PM »

look at the signatur from tomhung  wink

Logged
aimeeish
Pending Apprentice Baker
**
Offline Offline

Posts: 28


Email
« Reply #12 on: April 29, 2008, 05:18:57 AM »

I installed this via tomhung's sig. I got this:

XML Parsing Error: mismatched tag. Expected: </br>.
Location: ****
Line Number 34, Column 3:</td>
--^
Logged
Dreams
Pending Apprentice Baker
**
Offline Offline

Posts: 12


Email
« Reply #13 on: July 24, 2008, 02:39:42 AM »

It was hard for me to keep up and figure all of this out, but..  I am trying to hold a pageant, and want to use a poll for part of the judging. (public participation).

Id like to find a way to use a gallery mod, where people can click on the contestants picture, and have it open to a full bio, contest pictures, and a poll (1-10) where they can rate them.

Do you know which mods I could use for this?  The less work I have to do adding information, pictures etc, the better..lol

Thank you so m uch.
Logged
Pages: [1] Go Up Print 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!