Firefox PHP

Topic Poll Module

Posted by Maurice Makaay 
Re: Topic Poll Module
July 25, 2007 10:42AM
I have a problem with unregistered voters...

Votes of registered users works fine, but if unregistered users submit their vote I'll get some safe-mode failure-messages. What can I do?

I'm running phorum v 5.1.23 an poll v 1.0.7.

Thank you
Re: Topic Poll Module
July 25, 2007 11:23AM
My best bet is that the problem is arising from the phorum cache system. That system is used for putting up an IP-block, so unregistered users cannot post multiple times from the same IP address within a certain time frame.

If you can disable safe_mode in PHP, then that is the easiest way to get rid of this failure. If you cannot disable it, then you might want to contact your hosting provider to find a solution, because they are apparently the ones that enforce this PHP policy on you.

Try searching for "safe_mode" or "safe mode" in the support forums. There have been other posts about this subject before.

Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Topic Poll Module
July 25, 2007 11:39AM
Hmm..ok, thank you...

The unregistered votes are counted. Not the findest way, but can anyone tell me, where to set "@"s to prevent the messages? I can´t stop the vote now and wait for the providers answer, its official :(

Thank you again and sorry for my stupid english ;)
Re: Topic Poll Module
July 25, 2007 03:29PM
Your functionality is broken now. If it's official, then that is probably bad. Adding @ is never a solution. If you still want to get rid of the messages by adding @'s, then try adding them to statements in include/cache.php. The error messages that you see should already give you a clue about the file in which the errors are triggered, so please carefully read those.

Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Topic Poll Module
July 27, 2007 06:47AM
Has anybody written a script that unserialises the meta field of a poll, and dumps voting data to the screen? I may need to check for suspicious voting activity :-) (eg: a slew of new votes from newly registered users that have never posted)

If I did detect such shenannigans, I'm thinking it could be fiddly to manually edit the meta field to revoke a vote too?

Anyway, I'm not too bothered by this, but if anyone has some existing code to share that would be cool.



My notable Phorum sites:
Movie Deaths Database - "review comments" system mostly powered by Phorum
Learn Chinese! - integrated forum quiz
Re: Topic Poll Module
September 02, 2007 02:23AM

I just upgraded Phorum to the latest stable version, and this module does not work anymore.
When adding an answer, I am redirected to the previous page, the redaction of the message.
Did I forget something?

Cactus : []
Re: Topic Poll Module
September 02, 2007 06:34AM
That was fixed in version 1.0.8, but unfortunately, I forgot to upload that version to this thread. My apologies. Download the new version from the start of this thread. That will save the day.

Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Topic Poll Module
September 02, 2007 12:32PM
Thank you Maurice for the fast answer.
It works fine now ;-)

Cactus : []
December 03, 2007 05:14PM
This problem takes place under Phorum 5.1.25 and topic_poll-1.0.8 (and ver. 1.0.7 too). As rule all works correct, but once I saw this problem. My poll message with 11 variants doesn't work - no polls is counted. I make investigation and localize the problem - this code in topic_poll.php:

list ($message_id, $message) = each($messages);
$handle = false;
if ($message["parent_id"] == 0 &&
isset($message["meta"]["mod_topic_poll"]) &&
(isset($_POST["topic_poll:revoke_vote"]) || 
isset($_POST["topic_poll:vote"]))) $handle = true;

if (! $handle) return $messages;

The last line returns $messages and stops handling of voting process because $message["meta"]["mod_topic_poll"] is not set (and all array $message["meta"] is empty)! But in DB it is set:

a:8:{s:14:"mod_topic_poll";a:9:{s:8:"question";s:1:"?";s:7:"answers";a:11:{i:0;s:22:"Аграрная партия России";i:1;s:50:"Всероссийская политическая партия Гражданская Сила";i:2;s:29:"Демократическая партия России";i:3;s:44:"Коммунистическая партия Российской Федерации";i:4;s:15:"СОЮЗ ПРАВЫХ СИЛ";i:5;s:32:"Партия социальной справедливости";i:6;s:40:"Либерально-демократическая партия России";i:7;s:44:"СПРАВЕДЛИВАЯ РОССИЯ: РОДИНА/ПЕНСИОНЕРЫ/ЖИЗНЬ";i:8;s:15:"ПАТРИОТЫ РОССИИ";i:9;s:49:"Всероссийская политическая партия «ЕДИНАЯ РОССИЯ»";i:10;s:55:"Российская объединенная демократическая партия «ЯБЛОКО»";}s:5:"votes";a:0:{}s:11:"total_votes";i:0;s:10:"votingtime";i:30;s:10:"permission";s:9:"anonymous";s:6:"active";i:1;s:8:"cache_id";i:4;s:8:"position";s:6:"before";}s:11:"recent_post";a:3:{s:7:"user_id";s:4:"4454";s:6:"author";s:6:"Avdeev";s:10:"message_id";s:6:"728710";}s:11:"message_ids";a:29:{i:0;i:728474;i:1;i:728477;i:2;i:728496;i:3;i:728497;i:4;i:728500;i:5;i:728502;i:6;i:728506;i:7;i:728508;i:8;i:728509;i:9;i:728510;i:10;i:728515;i:11;i:728528;i:12;i:728556;i:13;i:728562;i:14;i:728564;i:15;i:728567;i:16;i:728573;i:17;i:728574;i:18;i:728604;i:19;i:728615;i:20;i:728618;i:21;i:728621;i:22;i:728624;i:23;i:728638;i:24;i:728684;i:25;i:728691;i:26;i:728703;i:27;i:728704;i:28;i:728710;}s:21:"message_ids_moderator";a:29:{i:0;i:728474;i:1;i:728477;i:2;i:728496;i:3;i:728497;i:4;i:728500;i:5;i:728502;i:6;i:728506;i:7;i:728508;i:8;i:728509;i:9;i:728510;i:10;i:728515;i:11;i:728528;i:12;i:728556;i:13;i:728562;i:14;i:728564;i:15;i:728567;i:16;i:728573;i:17;i:728574;i:18;i:728604;i:19;i:728615;i:20;i:728618;i:21;i:728621;i:22;i:728624;i:23;i:728638;i:24;i:728684;i:25;i:728691;i:26;i:728703;i:27;i:728704;i:28;i:728710;}s:14:"show_signature";i:0;s:10:"edit_count";i:1;s:9:"edit_date";i:1196674321;s:13:"edit_username";s:4:"Гена";}

As I understand, it may be some problem in "list ($message_id, $message) = each($messages)" line or may be "$messages" comes to the function "phorum_mod_topic_poll_read()" already with incorrect "meta"... It seems to be some problems with parsing "meta" in such specific messages like above one.

P.S. I had this problem not only with message above, but also with another one (but it has many poll variants as above).

Edited 1 time(s). Last edit at 12/03/2007 05:15PM by Vit.A.
Re: Topic Poll Module
December 03, 2007 05:42PM
I understand!
Problem in array $message - then topic contains more then 1 message, $message = the last message of the topic and so has no "meta".
I fixed it adding
list ($message_id, $message) = each($messages);

Edited 1 time(s). Last edit at 12/03/2007 05:43PM by Vit.A.
Sorry, only registered users may post in this forum.

Click here to login