当前位置: 首页>>代码示例>>PHP>>正文


PHP JEVHelper::getContact方法代码示例

本文整理汇总了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 '?';
 }
开发者ID:hriggs,项目名称:cs-website,代码行数:67,代码来源:jeventshtml.php


注:本文中的JEVHelper::getContact方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。