Firefox PHP

Topic Poll Module

Posted by Maurice Makaay 
Re: Topic Poll Module
January 05, 2013 07:33PM
Thanks for this module.

How do i customize the code, like by default it shows 4 answer fields instead of 2 answer fields?
Re: Topic Poll Module
January 06, 2013 11:45AM
In topic_poll.php, an empty poll is initialized like this:
Language: PHP
// Initialize a new poll. $message["meta"]["mod_topic_poll"] = array ( "question" => "", "answers" => array( 0 => "", 1 => "" ), "votes" => array(), "total_votes" => 0, "votingtime" => 0, // in days, 0 for unlimited "permission" => "user", "active" => 1, "cache_id" => 0, );

By extending the "answers" array, you can add as many standard answers as you wish.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Topic Poll Module
September 23, 2024 09:46AM
Hi

Moving from PHP 7.4 to 8.3,
[23-Sep-2024 12:31:10 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function each() in /path/to/phorum/mods/topic_poll/topic_poll.php:389
Stack trace:
#0 /path/to/phorum/common.php(1909): phorum_mod_topic_poll_read()
#1 /path/to/phorum/read.php(754): phorum_hook()
#2 {main}
  thrown in /path/to/phorum/mods/topic_poll/topic_poll.php on line 389
The offending line is
Language: PHP
list ($message_id, $message) = each($messages);
and the cause is that each() was deprecated since 7.2 and was removed in 8.

Is there a newer version of the mod than 1.0.20?

Edit: I just realised I'm on the wrong topic, and I found 1.0.22 for 5.2. I'll test and get back on the proper topic if needed. The part below is still valid though.

On a totally different subject, I get "your IP address or network is blocked" for 45.66.41.68 and I had to use a VPN to get here. The IP space belongs to Inalan, a Greek fibre-only connectivity provider. Whatever the reason it is blocked, it is not me. Could you please unblock it?



Edited 1 time(s). Last edit at 09/23/2024 09:56AM by zenon.
Sorry, only registered users may post in this forum.

Click here to login