Poll Module
Posted by arlo
post poll to existing thread October 07, 2004 02:26PM |
Registered: 18 years ago Posts: 683 |
Re: post poll to existing thread October 08, 2004 03:25AM |
Registered: 17 years ago Posts: 26 |
KICK BUTT! AWESOME MOD! JUST GOT IT WORKING!
I guess I installed an older version or something.
I got tired of it not working, so I deleted the WHOLE thing. REDOWNLOADED, REINSTALLED, and instead of typing everything in, I CUT and PASTED (to avoid stoopid human error). WORKS GREAT! THANKS! WOOOOOOT!
(User Edit :P)
Could you make 3 custom fields in the poll?
#1 - Boolean (False/True)
#2 - Boolean (False/True)
#2 - Text
These being something like
$AllowWritein (Boolean) Defaults to "False"
$SendWriteIn (Boolean) Defaults to "False"
$WriteInVote (Text($maxlen)) Defaults to $null
To where if someone wants to add a write-in vote area, they can. The vote counts towards voting, but the vote itself is sent via PM or eMail to the poll creator. (PM preferred) ~OR~ it could act as a reply to the poll, this would stop an over-abundance of mail from being generated on larger systems.
--------Pseudo Code--------
If $AllowWriteIn == True
..Get $WriteInVote
..If $SendWriteIn == True
......Send PollCreator Subject:{Poll ID} Body:$WriteInVote
....Else
......Post Reply $WriteInVote
..EndIf
EndIf
---------------------------</p>
Just an idea, the actual coding would probably be a little more complicated. But this is the general idea.
Heh, I give up on formatting, I'll use dots for spaces.
Edited 5 time(s). Last edit at 10/08/2004 03:52AM by Nix Marl.
I guess I installed an older version or something.
I got tired of it not working, so I deleted the WHOLE thing. REDOWNLOADED, REINSTALLED, and instead of typing everything in, I CUT and PASTED (to avoid stoopid human error). WORKS GREAT! THANKS! WOOOOOOT!
(User Edit :P)
Could you make 3 custom fields in the poll?
#1 - Boolean (False/True)
#2 - Boolean (False/True)
#2 - Text
These being something like
$AllowWritein (Boolean) Defaults to "False"
$SendWriteIn (Boolean) Defaults to "False"
$WriteInVote (Text($maxlen)) Defaults to $null
To where if someone wants to add a write-in vote area, they can. The vote counts towards voting, but the vote itself is sent via PM or eMail to the poll creator. (PM preferred) ~OR~ it could act as a reply to the poll, this would stop an over-abundance of mail from being generated on larger systems.
--------Pseudo Code--------
If $AllowWriteIn == True
..Get $WriteInVote
..If $SendWriteIn == True
......Send PollCreator Subject:{Poll ID} Body:$WriteInVote
....Else
......Post Reply $WriteInVote
..EndIf
EndIf
---------------------------</p>
Just an idea, the actual coding would probably be a little more complicated. But this is the general idea.
Heh, I give up on formatting, I'll use dots for spaces.
Edited 5 time(s). Last edit at 10/08/2004 03:52AM by Nix Marl.
Re: post poll to existing thread October 08, 2004 04:34AM |
Registered: 17 years ago Posts: 26 |
Re: Poll Module October 14, 2004 10:16AM |
Registered: 17 years ago Posts: 7 |
Hi,
I am new to php and very new to Phorum stuff.
Therefore, my question might be the noobiest of all times. Still, I am gonna ask it anyway :)
In the readme, it says that I should do three things. The first wasn't a problem... offcourse.
However, where do I paste the code in the post_form.tpl, list.tpl and read.tpl?
You say "on top of the message body is best"... I haven't got a clue as to where that might be. I have tried to open the sample files from your site, but that doesn't seem to work.
So, thanks for reading this, and thanks in advance for your answer...
Edited 1 time(s). Last edit at 10/14/2004 10:21AM by Quibuzz.
I am new to php and very new to Phorum stuff.
Therefore, my question might be the noobiest of all times. Still, I am gonna ask it anyway :)
In the readme, it says that I should do three things. The first wasn't a problem... offcourse.
However, where do I paste the code in the post_form.tpl, list.tpl and read.tpl?
You say "on top of the message body is best"... I haven't got a clue as to where that might be. I have tried to open the sample files from your site, but that doesn't seem to work.
So, thanks for reading this, and thanks in advance for your answer...
Edited 1 time(s). Last edit at 10/14/2004 10:21AM by Quibuzz.
October 14, 2004 01:59PM |
Registered: 18 years ago Posts: 666 |
Here are some examples of how you could do it, Quibuzz.
In your template folder:
read & list template files
replace
<a class="PhorumNavLink" href="{URL->POST}">{LANG->NewTopic}</a>•<a class="PhorumNavLink" href="{URL->SEARCH}">{LANG->Search}</a>
with
<a class="PhorumNavLink" href="{URL->POST}">{LANG->NewTopic}</a>•{IF NEWPOLLURL}<a class="PhorumNavLink" href="{NEWPOLLURL}">New Poll</a>{/IF}•<a class="PhorumNavLink" href="{URL->SEARCH}">{LANG->Search}</a>
post_form.tpl
where it says
<div class="PhorumStdBlock PhorumNarrowBlock">
<textarea name="body" rows="20" cols="50" style="width: 100%;">{POST->body}</textarea><br />
put above it
{IF POLLFORM}
<div class="PhorumStdBlock PhorumNarrowBlock">
{POLLFORM}
</div>
{/IF}
-------------------------------------------
"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
In your template folder:
read & list template files
replace
<a class="PhorumNavLink" href="{URL->POST}">{LANG->NewTopic}</a>•<a class="PhorumNavLink" href="{URL->SEARCH}">{LANG->Search}</a>
with
<a class="PhorumNavLink" href="{URL->POST}">{LANG->NewTopic}</a>•{IF NEWPOLLURL}<a class="PhorumNavLink" href="{NEWPOLLURL}">New Poll</a>{/IF}•<a class="PhorumNavLink" href="{URL->SEARCH}">{LANG->Search}</a>
post_form.tpl
where it says
<div class="PhorumStdBlock PhorumNarrowBlock">
<textarea name="body" rows="20" cols="50" style="width: 100%;">{POST->body}</textarea><br />
put above it
{IF POLLFORM}
<div class="PhorumStdBlock PhorumNarrowBlock">
{POLLFORM}
</div>
{/IF}
-------------------------------------------
"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
Re: Poll Module October 15, 2004 07:51AM |
Registered: 17 years ago Posts: 7 |
Thanks, I have progressed a little now.
I get the following error (a lot of times):
Notice: Undefined index: pollans in c:\program files\easyphp1-7\www\forum\mods\poll\poll.php on line 59
Notice: Undefined index: pollans in c:\program files\easyphp1-7\www\forum\mods\poll\poll.php on line 63
Any idea what that is? Also, I do get an option to enter a poll, but when I submit it, I get an XML error:
Only one top level element is allowed in an XML document. Error processing resource '[9.142.115.16];. Line 2, Position 2
<b>Notice</b>: Undefined variable: POST in <b>c:\program files\easyphp1-7\www\forum\mods\poll\poll.php</b> on line <b>39</b><br />
Does this mean anything to anyone?
Thanks again,
Q
I get the following error (a lot of times):
Notice: Undefined index: pollans in c:\program files\easyphp1-7\www\forum\mods\poll\poll.php on line 59
Notice: Undefined index: pollans in c:\program files\easyphp1-7\www\forum\mods\poll\poll.php on line 63
Any idea what that is? Also, I do get an option to enter a poll, but when I submit it, I get an XML error:
Only one top level element is allowed in an XML document. Error processing resource '[9.142.115.16];. Line 2, Position 2
<b>Notice</b>: Undefined variable: POST in <b>c:\program files\easyphp1-7\www\forum\mods\poll\poll.php</b> on line <b>39</b><br />
Does this mean anything to anyone?
Thanks again,
Q
Re: Poll Module October 15, 2004 08:33AM |
Admin Registered: 19 years ago Posts: 9,240 |
Re: Poll Module October 15, 2004 09:02AM |
Registered: 17 years ago Posts: 7 |
Ok, I can probably figure that out.
The second error seems more than just a notice, right?
Only one top level element is allowed in an XML document. Error processing resource '[9.142.115.16];. Line 2, Position 2
What does this mean?
The second error seems more than just a notice, right?
Only one top level element is allowed in an XML document. Error processing resource '[9.142.115.16];. Line 2, Position 2
What does this mean?
Re: Poll Module October 15, 2004 03:42PM |
Admin Registered: 19 years ago Posts: 9,240 |
October 15, 2004 06:20PM |
Registered: 18 years ago Posts: 666 |
Nix Marl Wrote:
-------------------------------------------------------
> Where it shows the
>
> Poll: {poll subject}
>
> How do we get it to show "Poll:" in bold like it
> does "Sticky:"? I tried editing the template and
> the language file, but it still comes out the
> same, or worse yet, it shows the tags instead.
I was wondering the same thing. You could go into poll.php of your mod and take out the part where it puts "Poll: " in the subject (not sure what all would have to be taken out.
I have a thing on my list templates so that if the post is an announcement or sticky, the icon for it will show instead of a carat.gif. I'm testing different IF statements so that if it's a poll, it'll show a poll icon (I found one online and modified it, since the old one was pretty ugly).
Arlo, any idea what IF statement would be on the list template to indicate a Poll other than listing it in Subject?
Also, I'm not sure what's up, but if someone hasn't voted, it bolds the first answer in the poll results.
-------------------------------------------
"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
-------------------------------------------------------
> Where it shows the
>
> Poll: {poll subject}
>
> How do we get it to show "Poll:" in bold like it
> does "Sticky:"? I tried editing the template and
> the language file, but it still comes out the
> same, or worse yet, it shows the tags instead.
I was wondering the same thing. You could go into poll.php of your mod and take out the part where it puts "Poll: " in the subject (not sure what all would have to be taken out.
I have a thing on my list templates so that if the post is an announcement or sticky, the icon for it will show instead of a carat.gif. I'm testing different IF statements so that if it's a poll, it'll show a poll icon (I found one online and modified it, since the old one was pretty ugly).
Arlo, any idea what IF statement would be on the list template to indicate a Poll other than listing it in Subject?
Also, I'm not sure what's up, but if someone hasn't voted, it bolds the first answer in the poll results.
-------------------------------------------
"Everything we see or seem, is but a dream within a dream." -Edgar Allan Poe
Sorry, only registered users may post in this forum.