Request: List all active polls

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Ideas Centre
Locked
borgo2000
Registered User
Posts: 8
Joined: Tue Jun 05, 2007 11:15 pm

Request: List all active polls

Post by borgo2000 »

Hello boys

what about a simple mod to show all active polls on a single page ????

It will be very usefull

Greetings from Italy

Andrea
User avatar
IoanFilipov
Translator
Posts: 40
Joined: Wed May 02, 2007 7:40 pm

Re: Request: List all active polls

Post by IoanFilipov »

Something like this?

Code: Select all

<?
    /*** phpBB3 - Last Polls System ***/

    //Author: Ioan Filipov

    //Email: jonidev@gmail.com

    //Date: 06.06.2007

    //------------------------------

    //Edit these parameters:

    //MySQL server adress
    $host="localhost";

    //Username
    $user="";

    //Password
    $pass="";

    //Database
    $db="";

    //Table prefix
    $table="phpbb3_";

    //Show last x polls
    $laforums="10";


    $link=mysql_connect($host, $user, $pass);
    $db=mysql_select_db($db);
    $query="select * from $table".topics."  WHERE poll_start > '0' order by poll_start desc limit 0,$laforums";
    $query2="select config_name,config_value from $table".config." where config_name = 'server_name' limit 0,1";
    $result2=mysql_query($query2);
    $row2 = mysql_fetch_array($result2);
    extract($row2);
    $result=mysql_query($query);
    while ($row=mysql_fetch_array($result)) {
    extract($row);
        echo "<a href='http://".$config_value."/viewtopic.php?f=".$forum_id."&t=".$topic_id."' target='_blank'>".$poll_title."</a>\n";
    }

    //-------------------------- END
    ?>
borgo2000
Registered User
Posts: 8
Joined: Tue Jun 05, 2007 11:15 pm

Re: Request: List all active polls

Post by borgo2000 »

Great.

Thnak u a lots
gezapeti
Registered User
Posts: 1
Joined: Thu Jul 14, 2011 9:09 am

Re: Request: List all active polls

Post by gezapeti »

Hi!

Can somebody extends the script so the generated page contain answers too?

Thanks in advance.
Locked

Return to “[3.0.x] MOD Requests”