本文整理匯總了PHP中JEVHelper::getContact方法的典型用法代碼示例。如果您正苦於以下問題:PHP JEVHelper::getContact方法的具體用法?PHP JEVHelper::getContact怎麽用?PHP JEVHelper::getContact使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JEVHelper
的用法示例。
在下文中一共展示了JEVHelper::getContact方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getUserMailtoLink
public static function getUserMailtoLink($evid, $userid, $admin = false, $event)
{
$db = JFactory::getDBO();
static $arr_userids;
static $arr_evids;
$cfg = JEVConfig::getInstance();
if (!$arr_userids) {
$arr_userids = array();
}
if (!$arr_evids) {
$arr_evids = array();
}
$agenda_viewmail = $cfg->get('com_mailview');
$agenda_viewmail |= $admin;
if ($userid) {
if (!isset($arr_userids[$userid])) {
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
$userdet = JEVHelper::getContact($userid);
$contactlink = "";
if ($userdet) {
if (isset($userdet->slug) && $userdet->slug && $agenda_viewmail == '1') {
$contactlink = JRoute::_('index.php?option=com_contact&view=contact&id=' . $userdet->slug . '&catid=' . $userdet->catslug);
$contactlink = '<a href="' . $contactlink . '" title="' . JText::_('JEV_EMAIL_TO_AUTHOR') . '" target="_blank" >' . $userdet->contactname . '</a>';
} else {
if ($userdet->email && $agenda_viewmail == '1') {
//$contactlink = '<a href="mailto:' . $userdet->email
//. '" title="' . JText::_('JEV_EMAIL_TO_AUTHOR') . '">'
//. $userdet->username . '</a>';
if ($params->get('contact_display_name', 0) == 1) {
$contactlink = JHTML::_('email.cloak', $userdet->email, 1, $userdet->name, 0);
} else {
$contactlink = JHTML::_('email.cloak', $userdet->email, 1, $userdet->username, 0);
}
} else {
if ($params->get('contact_display_name', 0) == 1) {
$contactlink = $userdet->name;
} else {
$contactlink = $userdet->username;
}
}
}
}
$arr_userids[$userid] = $contactlink;
}
return $arr_userids[$userid];
} else {
if (!isset($arr_evids[$evid])) {
$contactlink = JText::_('JEV_ANONYME');
$anonplugin = JPluginHelper::getPlugin("jevents", "jevanonuser");
if ($anonplugin) {
$db = JFactory::getDBO();
$db->setQuery("SELECT a.* FROM #__jev_anoncreator as a LEFT JOIN #__jevents_repetition as r on a.ev_id=r.eventid where r.rp_id=" . intval($evid) . " LIMIT 1");
$anonrow = $db->loadObject();
if ($anonrow) {
if ($agenda_viewmail == '1') {
$contactlink = JHTML::_('email.cloak', $anonrow->email, 1, $anonrow->name, 0);
} else {
$contactlink = $anonrow->name;
}
}
}
$arr_evids[$evid] = $contactlink;
}
return $arr_evids[$evid];
}
return '?';
}