Welcome, Guest. Please login or register.
Did you miss your activation email?
September 06, 2010, 09:44:45 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
121691 Posts in 17370 Topics by 9217 Members
Latest Member: darkforceheals
* Home Help Search Login Register
+  WebsiteBaker Community Forum
|-+  English
| |-+  Modules (Moderators: Argos, BerndJM)
| | |-+  AJAX Poll
Pages: [1] Go Down Print
Author Topic: AJAX Poll  (Read 8062 times)
Insa

Offline Offline

Posts: 17



« on: November 02, 2007, 12:53:41 PM »

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 03, 2007, 12:12:50 AM by Insa » Logged
macsmet

Offline Offline

Posts: 189


« Reply #1 on: November 02, 2007, 01: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

Offline Offline

Posts: 108



WWW
« Reply #2 on: November 02, 2007, 02: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, 02:31:54 PM by Eki » Logged
Insa

Offline Offline

Posts: 17



« Reply #3 on: November 02, 2007, 02: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

Offline Offline

Posts: 189


« Reply #4 on: November 02, 2007, 03: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, 03:33:29 PM by macsmet » Logged
Insa

Offline Offline

Posts: 17



« Reply #5 on: November 03, 2007, 12:10:38 AM »

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

Offline Offline

Posts: 352



« Reply #6 on: November 27, 2007, 05:41:55 PM »

post code in forum....
Logged
Beppi

Offline Offline

Posts: 8


« Reply #7 on: February 07, 2008, 08: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

Online Online

Posts: 2074


WWW
« Reply #8 on: February 15, 2008, 06: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

stories about What's on?
be part of the Tutorials-Project
visit the jQuery-Showroom
tu.sha

Offline Offline

Posts: 6


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

and how to call it from somewhere? not from page_content(); ?
Logged
durao

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

Offline Offline

Posts: 16



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

look at the signatur from tomhung  wink

Logged
aimeeish

Offline Offline

Posts: 28


« 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

Offline Offline

Posts: 16


« 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
coldman

Offline Offline

Posts: 1


« Reply #14 on: March 20, 2009, 05:56:30 PM »

 I  have  error 
Code:
This page contains the following errors:
error on line 110 at column 104: EntityRef: expecting ';'
Below is a rendering of the page up to the first error.
I'm used WebsiteBaker  Version 2.7 and this  ajax_poll_v1.02.zip
I see   source,  but  in  line 110  on view.php is all ok.

Do you know what is  wrong?

p.s Sorry for my English
Logged
Pages: [1] Go Up Print 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
-->