Firefox PHP

Poll Module

Posted by arlo 
pat
post poll to existing thread
October 07, 2004 02:26PM
Hi arlo,

Is there anything prohibiting this or did you just not build it in?

If the latter is true, could you provide some hints as to where to change the code to acomplish that behaviour?

thanx
pat
Re: post poll to existing thread
October 08, 2004 03:25AM
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.
Re: post poll to existing thread
October 08, 2004 04:34AM
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.
Re: Poll Module
October 14, 2004 10:16AM
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.
Re: Poll Module
October 14, 2004 01:59PM
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>&bull;<a class="PhorumNavLink" href="{URL->SEARCH}">{LANG->Search}</a>

with
<a class="PhorumNavLink" href="{URL->POST}">{LANG->NewTopic}</a>&bull;{IF NEWPOLLURL}<a class="PhorumNavLink" href="{NEWPOLLURL}">New Poll</a>{/IF}&bull;<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
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
Re: Poll Module
October 15, 2004 08:33AM
the poll-mod uses some unitialized variables and you seem to have tunes your error-reporting-level to the max. you should just lower it as these are only notices.


Thomas Seifert
Re: Poll Module
October 15, 2004 09:02AM
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?
Re: Poll Module
October 15, 2004 03:42PM
its just an result of the previous output.


Thomas Seifert
Re: post poll to existing thread
October 15, 2004 06:20PM
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
Sorry, only registered users may post in this forum.

Click here to login