Re: Topic Poll Module August 07, 2009 05:19PM |
Registered: 17 years ago Posts: 12 |
The AMIPP forum is Phorum version 5.1.22 and has been running for some years now.
As the newish admin I would like to start a poll.
The forum had been hacked by a previous admin in various folders and files.
I understand that I need version 5.1.23 to use a poll.
How may I retain the appearance and content of the AMIPP forum and add a poll to it please?
Many thanks in advance
Mike
As the newish admin I would like to start a poll.
The forum had been hacked by a previous admin in various folders and files.
I understand that I need version 5.1.23 to use a poll.
How may I retain the appearance and content of the AMIPP forum and add a poll to it please?
Many thanks in advance
Mike
Re: Topic Poll Module August 08, 2009 03:41AM |
Registered: 18 years ago Posts: 131 |
Quote
welshmike
The forum had been hacked by a previous admin in various folders and files.
I understand that I need version 5.1.23 to use a poll.
How may I retain the appearance and content of the AMIPP forum and add a poll to it please?
Hi Mike,
You should avoid hacks in the main code. Phorum is built is such a way that you can do everything using modules, then upgrading is a piece of cake.
My recommendation:
1. move all the hacks in one or several modules.
2. upgrade Phorum
3. install whatever module you want, such as the poll one, and keep putting your hacks in modules.
Cactus : [www.cactuspro.com]
Re: Topic Poll Module October 07, 2010 05:46PM |
Registered: 13 years ago Posts: 62 |
Re: Topic Poll Module October 07, 2010 06:59PM |
Admin Registered: 20 years ago Posts: 8,532 |
Why a different hook? The way in which the poll is put in the message is directed by a combination of HTML and CSS. You need to modify that to get a different output.
I am not sure if you can get things to work like you want it with only some CSS changes, but I would start out with making the poll smaller and letting it use float:right as a style to let it align to the right hand side.
If the HTML code is not providing enough handles to make the formatting do what you like, then you'll have to modify the HTML formatting code in topic_poll.php.
In the default output, there is a poll separator (a line that separates the two of them). This line is created by the mods/topic_poll/templates/emerald/body_and_poll_separator.tpl. You probably want to get rid of this separator. You can do so by copying the module's emerald template to a directory that uses the same directory name as your main template. Then you can modify the template files in your custom module template directory.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
I am not sure if you can get things to work like you want it with only some CSS changes, but I would start out with making the poll smaller and letting it use float:right as a style to let it align to the right hand side.
If the HTML code is not providing enough handles to make the formatting do what you like, then you'll have to modify the HTML formatting code in topic_poll.php.
In the default output, there is a poll separator (a line that separates the two of them). This line is created by the mods/topic_poll/templates/emerald/body_and_poll_separator.tpl. You probably want to get rid of this separator. You can do so by copying the module's emerald template to a directory that uses the same directory name as your main template. Then you can modify the template files in your custom module template directory.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Topic Poll Module October 07, 2010 11:14PM |
Registered: 13 years ago Posts: 62 |
I suppose I thought a different hook would put it in the "header" of the post messages. As it is now it's positioned below that and above the body of the message, pushing the message down quite a ways. I already have a template going and I made an attempt at it by setting it's positioning to relative. That didn't do much so I tried using negative top, left values but the overflow appears to be hidden and it doesn't do much about the textarea still being down so low. What if I absolutely positioned it? I suppose I just have to tinker around with it for a while. I just wanted to make sure there wasn't an easier way of going about it with hooks and what not. Thanks.
Re: Topic Poll Module October 08, 2010 06:18PM |
Registered: 13 years ago Posts: 62 |
I'm not quite sure where the form is submitting the votes. There's nothing in the form action attribute. I've removed the radio buttons and replaced them with image submit buttons so that voting requires a single click. I need to know where this form is being submitted to so that I can modify the script to handle this change. At least that's what I think I'm suppose to do. Thanks!
Re: Topic Poll Module October 08, 2010 07:14PM |
Admin Registered: 20 years ago Posts: 8,532 |
An empty action means that the form is posted to the currently active URL. There's nothing special about that. But why do you need to know the action URL? You have to POST the data, so you need a form anyway. Why not fill a form variable with the correct value and trigger a post on the poll form?
Processing of the vote is done from the "read" hook in the poll module (function: phorummod_topic_poll_read)
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Processing of the vote is done from the "read" hook in the poll module (function: phorummod_topic_poll_read)
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Topic Poll Module October 08, 2010 09:01PM |
Registered: 13 years ago Posts: 62 |
I see. As you can probably already tell, I'm a novice programmer. I'm not use to the whole template system. I guess I just needed to see how the script handeled the vote to figure out what's wrong with my code. This is the major thing I changed in voting_form.tpl:
<table border="0" cellpadding="0" cellspacing="0">
{LOOP POLL->ANSWERS}
<tr>
<td valign="top">
<input type="image" name="topic_poll:vote"
src = "<?php echo($PHORUM["http_path"].'/mods/topic_poll/images/'); ?>{IF POLL->ANSWERS->ID "0"}bright_light_bulb.png{ELSEIF POLL->ANSWERS->ID "1"}light_bulb.png{/IF}"
alt = "{POLL->ANSWERS->ANSWER}"
title = "{POLL->ANSWERS->ANSWER}"
width = "30px"
height = "30px"
id="topic_poll_answer_{POLL->ANSWERS->ID}"
class="topic_poll_button"
value="{POLL->ANSWERS->ID}" />
</td>
</tr>
{/LOOP POLL->ANSWERS}
</table>
{POLL->ANSWERS->ID} is the value being passed through depending on which button you click. Am I doing this correctly?
<table border="0" cellpadding="0" cellspacing="0">
{LOOP POLL->ANSWERS}
<tr>
<td valign="top">
<input type="image" name="topic_poll:vote"
src = "<?php echo($PHORUM["http_path"].'/mods/topic_poll/images/'); ?>{IF POLL->ANSWERS->ID "0"}bright_light_bulb.png{ELSEIF POLL->ANSWERS->ID "1"}light_bulb.png{/IF}"
alt = "{POLL->ANSWERS->ANSWER}"
title = "{POLL->ANSWERS->ANSWER}"
width = "30px"
height = "30px"
id="topic_poll_answer_{POLL->ANSWERS->ID}"
class="topic_poll_button"
value="{POLL->ANSWERS->ID}" />
</td>
</tr>
{/LOOP POLL->ANSWERS}
</table>
{POLL->ANSWERS->ID} is the value being passed through depending on which button you click. Am I doing this correctly?
Re: Topic Poll Module October 09, 2010 04:58AM |
Admin Registered: 20 years ago Posts: 8,532 |
The issue has little to do with templating. It's about HTML forms. Im you use an image based submit button, you might have to do some server-side work to get the correct value. Some browsers will include click coordinates in the field data, so you can determine server side where the image was clicked exactly. As a result, the value is not what the topic_poll module expects.
I didn't check, but this is the first thing that comes to mind. You might want to investigate the content of $_POST to see if my assumption is right. Check what $_POST["topic_poll:vote"] is set to. If there is coordinate data included in the value, then you'll have to strip that data before the topic poll module trips over it.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
I didn't check, but this is the first thing that comes to mind. You might want to investigate the content of $_POST to see if my assumption is right. Check what $_POST["topic_poll:vote"] is set to. If there is coordinate data included in the value, then you'll have to strip that data before the topic poll module trips over it.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Topic Poll Module October 11, 2010 05:27PM |
Registered: 13 years ago Posts: 62 |
Sorry, only registered users may post in this forum.