Hi
Does anyone know how to create a 'My Matches' block that I can insert as a PHP block? I did have it working in an earlier version as:
$thismemID = $_COOKIE['memberID'];
$thisprofileID = getLoggedId();
if ($thismemID==$thisprofileID){
require_once( BX_DIRECTORY_PATH_INC . 'match.inc.php');
bx_import('BxBaseSearchProfile');
$oSearchProfile = new BxBaseSearchProfile();
echo '<div class="bx_sys_default_padding">';
$aProfiles = getMatchProfiles($thisprofileID);
if ($aProfiles){
echo '<p>Possible matches</p>';
foreach ($aProfiles as $iProfId)
{
// echo $iProfId . '<br />';
$aOnline = array();
if (isset($iProfId['is_online'])) {
$aOnline['is_online'] = $iProfId['is_online'];
}
$sProfileThumb = get_member_thumbnail( $iProfId, 'none', '', 'visitor', '' );
echo $sProfileThumb;
}
} else {
echo '<p>No matches found. Update your profile to find more matches.</p>';
}
echo '</div>';
}
but it stopped working, possibly due to the recent upgrade - it kept returning no matches when there were matches. I want to add paging as well and so have been playing with (on 7.0.4):
$thismemID = $_COOKIE['memberID'];
$iProfileId = getLoggedId();
if ($thismemID==$iProfileId){
require_once( BX_DIRECTORY_PATH_INC . 'match.inc.php');
echo '<div class="bx_sys_default_padding">';
$aProfiles = getMatchProfiles($thisprofileID);
if ($aProfiles){
$sBaseUri = '';
$sTopLinksUri = '';
$sPaginateUri = '';
foreach ($_REQUEST as $sKey => $sVal)
{
switch ($sKey)
{
case 'page':
$sPaginateUri .= '&page=' . $sVal;
break;
case 'per_page':
$sPaginateUri .= '&per_page=' . $sVal;
break;
case 'sort':
$sPaginateUri .= '&sort=' . $sVal;
break;
case 'mode':
$sTopLinksUri .= '&mode=' . $sVal;
break;
}
}
$aPaginate = array(
'page_url' => $sBaseUri . $sTopLinksUri . '&page={page}&per_page={per_page}&sort={sorting}',
'info' => true,
'page_links' => true,
'per_page' => isset($_REQUEST['per_page']) ? (int)$_REQUEST['per_page'] : 25,
'sorting' => $sSort,
'count' => count($aProfiles),
'page' => isset($_REQUEST['page']) ? (int)$_REQUEST['page'] : 1,
'page_reloader' => true,
'per_page_changer' => true
);
$oPaginate = new BxDolPaginate($aPaginate);
for ($i = ($aPaginate['page'] - 1) * $aPaginate['per_page'];
$i < $aPaginate['page'] * $aPaginate['per_page'] && $i < $aPaginate['count']; $i++)
{
$iProfId = getProfileInfo($aProfiles[$i]);
$aOnline = array();
if (isset($iProfId['is_online'])) {
$aOnline['is_online'] = $iProfId['is_online'];
}
$sProfileThumb = get_member_thumbnail( $iProfId, 'none', '', 'visitor', '' );
echo $sProfileThumb;
$iIndex++;
}
} else {
echo '<p>No matches found. Update your profile to find more matches.</p>';
}
echo '</div>';
}
but this also returns no matches when there are matches. Am I barking up the wrong tree?
