I have a temporary fix for Joomla 1.5.7 and CB 1.2 DTRegister Plugin tab. I say temporary because I am matching on the email address of the logged in user instead of the user_id. I am doing this because I noticed that the dtregister_user table is not writing the correct user_id, it appears to be writing them all as 0 (zero).
I replaced all of the code in /components/com_comprofiler/plugin/user/plug_dtregisterrecords/dtregister.plugin.php with the following code.
I have tested this on my site and it is now showing the events that the user has signed up for.
USE AT YOUR OWN RISK - Backup the original dtregister.plugin.php first
<?php
/*************************************************************************************
* Tab for Community Builder 1.2 User Profiles to display the registered events of
* the current users In DT Register
* Author: Scott Carney based upon the Joomgallery CB Tab as created by
* Author: Armin Hornung http://www.arminhornung.de
* Date: sept 2008
* Version: 1 (beta)
* Released under GNU GPL Public License http://www.gnu.org/copyleft/gpl.html
*************************************************************************************/
class getRegisteredEvents extends cbTabHandler {
function getDtregisteredTab() {
$this->cbTabHandler();
}
/**
* Main function, displays the DTRegister-Tab in Community Builder
**/
function getDisplayTab($tab,$user,$ui) {
global $database,$mosConfig_live_site, $mosConfig_absolute_path, $my, $mainframe;
$tag = \"Registered Events Tab for Community Builder and DTRegister.\";
$uid=intval( mosGetParam( $_REQUEST, \"uid\", 0 ) );
$params = $this->params;
// Determine # of pics for pagination
$database->setQuery(\"SELECT count(userId) FROM #__dtregister_user as a \"
. \"\\n WHERE a.userId = $user->id\");
$total=$database->loadResult();
// Pagination:
$startpage=1;
$entriesNumber=$params->get(\'number_entries\',10);
$pagingParams = $this->_getPaging(array(),array(\"entries_\"));
if ($pagingParams[\"entries_limitstart\"] === null)
$pagingParams[\"entries_limitstart\"] = \"0\";
if ($entriesNumber > $total)
$pagingParams[\"entries_limitstart\"] = \"0\";
// Start of Events table:
$return.= \"<table width=\'95%\' border=\'0\' cellspacing=\'5\' cellpadding=\'5\'>\";
$return .= \"<tr class=\'sectiontableheader\'>\";
$return .= \"<td align=\'left\'><strong><u>Event Title</u></strong></td>\";
$return .= \"<td align=\'left\'><strong><u>Date Registered</u></strong></td>\";
$return .= \"</tr>\";
// Main query:
// Note: Temporary Fix Match on email as dtregister_user is not capturing logged in user_id and is populating record as 0 in user_id field
$database->setQuery(
\"SELECT a.register_date,b.title,b.publish_up,c.email \"
. \"FROM #__users as c, #__dtregister_user as a \"
. \"INNER JOIN #__events as b ON a.eventId=b.id\"
. \"\\n WHERE c.id = $user->id\"
. \"\\n AND c.email = a.userEmail\"
. \"\\n ORDER BY a.register_date DESC\"
. \"\\n LIMIT \".($pagingParams[\"entries_limitstart\"]?$pagingParams[\"entries_limitstart\"]:\"0\").\",\".$entriesNumber);
$rows=$database->loadObjectList();
$return.= \"<tr class=\'sectiontableentry\'>\";
$rowcounter=0;
foreach ( $rows as $row1 ){
if ( ($rowcounter % 3 == 0) AND ($rowcounter <> 0) )
$return.=\"</tr><tr>\";
$return.= \"<tr class=\'sectiontableentry\'>\";
$return.= \"<td>\".$row1->title.\" ( \". mosFormatDate($row1->publish_up,\'%m-%d-%Y\') .\" )</td>\";
$return .= \"<td>\".mosFormatDate($row1->register_date,\'%m-%d-%Y\').\"</td>\";
$return.= \"</td>\";
$return .= \"</tr>\";
$rowcounter++;
}
if ( $rowcounter % 3 <> 0 ){
for ( $i=1; $i <= (3 - ($rowcounter % 3)); $i++ ) {
$return.= \"<td class=\'sectiontableentry\'> </td>\";
}
}
$return.= \"</tr></table>\";
// Pagination, if configured to show:
$showPagination = ($params->get(\'pagination\',\'1\')==\'1\');
if ($showPagination &&($entriesNumber < $total)) {
$return .= \"<div style=\'width:95%;text-align:center;\'>\"
.$this->_writePaging($pagingParams,\"DtregisteredTab_\",$entriesNumber,$total)
.\"</div>\";
}
return $return;
}
}
?>