public function onInTrackbox($trackitems, $params) { //Get helper class require_once JPATH_SITE . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'playjoom' . DIRECTORY_SEPARATOR . 'tracktimeinfo' . DIRECTORY_SEPARATOR . 'helper.php'; if ($trackitems->add_datetime != '' && $trackitems->add_datetime != "0000-00-00 00:00:00") { $DisplayAdd = plgTracktimeinfoHelper::GetTimeInfoList($trackitems, $params, 'add'); } else { $DisplayAdd = null; } if ($trackitems->mod_datetime != '' && $trackitems->mod_datetime != "0000-00-00 00:00:00") { $DisplayMod = plgTracktimeinfoHelper::GetTimeInfoList($trackitems, $params, 'mod'); } else { $DisplayMod = null; } if ($trackitems->access_datetime != '' && $trackitems->access_datetime != "0000-00-00 00:00:00") { $DisplayAccess = plgTracktimeinfoHelper::GetTimeInfoList($trackitems, $params, 'access'); } else { $DisplayAccess = null; } $html = ''; if ($DisplayAdd != '' || $DisplayMod != '' || $DisplayAccess != '') { //Output plugin content $html .= '<div class="details_middle">'; $html .= '<h4 class="trackdetails_title">Track Time Info</h4>'; $html .= '<ul class="trackplugin_list">'; $html .= $DisplayAdd; $html .= $DisplayMod; $html .= $DisplayAccess; $html .= '</ul>'; $html .= '</div>'; } else { $html = null; } return $html; }
static function GetTimeInfoList($trackitems, $params, $Type) { switch ($Type) { case 'add': /* * Time info for Add Track */ //Check for user name if ($trackitems->add_user != '') { $AddUserName = '******' . JText::_('PLG_PLAYJOOM_BY_USER') . ' ' . $trackitems->add_user; } else { $AddUserName = null; } /* * *********DISTANCE******************** */ if ($params->get('viewtype_for_addtrack_time', 3) == 2 && $trackitems->add_datetime != '' && $trackitems->add_datetime != '0000-00-00 00:00:00') { $Display = '<li>' . JText::_('PLG_PLAYJOOM_ADD_TRACK') . ' ' . plgTracktimeinfoHelper::AgeOfTrack(substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "add_value"), 8, 2), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "add_value"), 5, 2), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "add_value"), 0, 4), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "add_value"), 11, 8)) . ' ' . JText::_('TCE_PLG_DISTANCE_AGO') . $AddUserName . '</li>'; } elseif ($params->get('viewtype_for_addtrack_time', 3) == 3 && $trackitems->add_datetime != '' && $trackitems->add_datetime != '0000-00-00 00:00:00') { $Display = '<li>' . JText::_('PLG_PLAYJOOM_ADD_TRACK') . ' ' . plgTracktimeinfoHelper::AgeOfTrack(substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "add_value"), 8, 2), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "add_value"), 5, 2), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "add_value"), 0, 4), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "add_value"), 11, 8)) . ' ' . JText::_('TCE_PLG_DISTANCE_AGO') . ' ' . JText::_('PLG_PLAYJOOM_AT') . ' ' . plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "add") . $AddUserName . '</li>'; } elseif ($params->get('viewtype_for_addtrack_time', 3) == 1 && $trackitems->add_datetime != '' && $trackitems->add_datetime != '0000-00-00 00:00:00') { $Display = '<li>' . JText::_('PLG_PLAYJOOM_ADD_TRACK') . ' ' . JText::_('PLG_PLAYJOOM_AT') . ' ' . plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "add") . '</li>'; } else { $Display = null; } break; case 'mod': /* * Time info for Mod Track */ //Check for user name if ($trackitems->mod_user != '') { $ModUserName = '******' . JText::_('PLG_PLAYJOOM_BY_USER') . ' ' . $trackitems->mod_user; } else { $ModUserName = null; } /* * *********DISTANCE******************** */ if ($params->get('viewtype_for_modtrack_time', 0) == 2 && $trackitems->mod_datetime != '' && $trackitems->mod_datetime != '0000-00-00 00:00:00') { $Display = '<li>' . JText::_('PLG_PLAYJOOM_MOD_TRACK') . ' ' . plgTracktimeinfoHelper::AgeOfTrack(substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "mod_value"), 8, 2), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "mod_value"), 5, 2), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "mod_value"), 0, 4), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "mod_value"), 11, 8)) . ' ' . JText::_('TCE_PLG_DISTANCE_AGO') . $ModUserName . '</li>'; } elseif ($params->get('viewtype_for_modtrack_time', 0) == 3 && $trackitems->add_datetime != '' && $trackitems->add_datetime != '0000-00-00 00:00:00') { $Display = '<li>' . JText::_('PLG_PLAYJOOM_MOD_TRACK') . ' ' . plgTracktimeinfoHelper::AgeOfTrack(substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "mod_value"), 8, 2), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "mod_value"), 5, 2), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "mod_value"), 0, 4), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "mod_value"), 11, 8)) . ' ' . JText::_('TCE_PLG_DISTANCE_AGO') . ' ' . JText::_('PLG_PLAYJOOM_AT') . ' ' . plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "mod") . $ModUserName . '</li>'; } elseif ($params->get('viewtype_for_modtrack_time', 0) == 1 && $trackitems->mod_datetime != '' && $trackitems->mod_datetime != '0000-00-00 00:00:00') { $Display = '<li>' . JText::_('PLG_PLAYJOOM_MOD_TRACK') . ' ' . JText::_('PLG_PLAYJOOM_AT') . ' ' . plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "mod") . '</li>'; } else { $Display = null; } break; case 'access': /* * Time info for Access Track */ /* * *********DISTANCE******************** */ if ($params->get('viewtype_for_access_time', 2) == 2 && $trackitems->access_datetime != '' && $trackitems->access_datetime != '0000-00-00 00:00:00') { $Display = '<li>' . JText::_('PLG_PLAYJOOM_ACCESS_TRACK') . ' ' . plgTracktimeinfoHelper::AgeOfTrack(substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "access_value"), 8, 2), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "access_value"), 5, 2), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "access_value"), 0, 4), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "access_value"), 11, 8)) . ' ' . JText::_('TCE_PLG_DISTANCE_AGO') . '</li>'; } elseif ($params->get('viewtype_for_access_time', 2) == 3 && $trackitems->access_datetime != '' && $trackitems->access_datetime != '0000-00-00 00:00:00') { $Display = '<li>' . JText::_('PLG_PLAYJOOM_ACCESS_TRACK') . ' ' . plgTracktimeinfoHelper::AgeOfTrack(substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "access_value"), 8, 2), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "access_value"), 5, 2), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "access_value"), 0, 4), substr(plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "access_value"), 11, 8)) . ' ' . JText::_('TCE_PLG_DISTANCE_AGO') . ' ' . JText::_('PLG_PLAYJOOM_AT') . ' ' . plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "access") . '</li>'; } elseif ($params->get('viewtype_for_access_time', 2) == 1 && $trackitems->access_datetime != '' && $trackitems->access_datetime != '0000-00-00 00:00:00') { $Display = '<li>' . JText::_('PLG_PLAYJOOM_ACCESS_TRACK') . ' ' . JText::_('PLG_PLAYJOOM_AT') . ' ' . plgTracktimeinfoHelper::ConformDateFormat($trackitems, $params, "access") . '</li>'; } else { $Display = null; } break; } return $Display; }