Ok, finally got around to this. Here's what I did:
1. Create polls_members.php
Just make a copy of the polls.php file.
1.1 Strip out all the functions at the bottom.
1.2 Add this line to include the profiles.inc.php:
require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );
1.3 Change the page code line to point to this new function, PollPages():
$_page_cont[$_ni]['page_main_code'] = PollPages( );
1.4 Add this new function and set $max_num to however many polls you want per page:
function PollPages( )
{
$max_num = 10;
$query = "
SELECT
`id_poll`,
`id_profile`,
`Profiles`.*
FROM `ProfilesPolls`
LEFT JOIN `Profiles` ON
`id_profile` = `Profiles`.`ID`
WHERE
`poll_status` = 'active'
AND `poll_approval`
";
$query .= " ORDER BY id_poll DESC";
$aNum = db_arr( "SELECT COUNT(`id_poll`) FROM `ProfilesPolls` ");
$num = (int)$aNum[0];
if( $num )
{
$pages = ceil( $num / $max_num );
$page = (int)$_GET['page'];
if( $page < 1 )
$page = 1;
if( $page > $pages )
$page = $pages;
$sqlLimitFrom = ( $page - 1 ) * $max_num;
$sqlLimit = " LIMIT $sqlLimitFrom, $max_num";
$poll_res = db_res( $query.$sqlLimit );
while ( $poll_arr = mysql_fetch_array( $poll_res ) )
{
$sPic = get_member_icon( $poll_arr['ID'], 'left');
$sPoll = ShowPoll( $poll_arr['id_poll'] );
$sNickName = $poll_arr['NickName'];
$sNickNameLnk = getProfileLink($poll_arr['ID']);
$ret .= <<<EOF
<div class="blog_block">
<div class="icon_block">
{$sPic}
</div>
<div class="blog_wrapper_n" style="width:80%;border:1px dashed #CCCCCC;">
<div class="blog_subject_n">
<a href="{$sNickName}" class="bottom_text">
{$sNickName}
</a>
</div>
<div class="blogSnippet">
{$sPoll}
</div>
</div>
</div>
<div class="clear_both"></div>
EOF;
}
if( $pages > 1 )
{
$pagination =
'<div class="photos_pages">'.
genPagination( $pages, $page, $_SERVER['PHP_SELF']."?page={page}" ).
'</div>';
$ret = $pagination . $ret . $pagination;
}
}
return $ret;
}
Perhaps with resizing the widths a bit, you should have room for a skyscraper advertisement on the side too if you want.
2. Add the "View All" buttons to the Poll block on the homepage:
2.1 Open templates/base/scripts/BxBaseIndex.php
In function getBlockCode_ProfilePoll() find the section:
$ret .= <<<EOF
<div class="blog_block">
<div class="icon_block">
{$sPic}
</div>
<div class="blog_wrapper_n" style="width:80%;border:1px dashed #CCCCCC;">
<div class="blog_subject_n">
<a href="{$sNickName}" class="bottom_text">
{$sNickName}
</a>
</div>
<div class="blogSnippet">
{$sPoll}
</div>
</div>
</div>
EOF;
}
}
and after that add (just before the function return statement):
if( $mode == 'admin' )
$ret .= '<br /><center><b><a href="polls.php">View All</a></b></center>';
else
$ret .= '<center><b><a href="polls_members.php">View All</a></b></center>';
That will add a "View All" button that points to the site polls on the Site Polls tab and points to the Profile Polls page for the latest, random, and top poll tabs.
3. Add the Profile Polls page in the Admin|Buiders|Menu Builder.
Add the entry for the new page in and set the language key. I renamed "All Polls" to "Site Polls" too.
Hope that helps.