/** * Overridding IcmsPersistable::toArray() method to add a few info * * @return array of tribetopic info */ public function toArray() { $ret = parent::toArray(); $ret['last_post_time'] = formatTimestamp($this->getVar('last_post_time', 'e'), 'm'); $ret['poster_uname'] = icms_member_user_Handler::getUserLink($this->getVar('poster_uid')); $ret['userCanEditAndDelete'] = $this->userCanEditAndDelete(); $ret['itemLink'] = str_replace($this->handler->_itemname . '.php?', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&', $ret['itemLink']); $ret['itemUrl'] = str_replace($this->handler->_itemname . '.php?', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&', $ret['itemUrl']); $ret['editItemLink'] = str_replace($this->handler->_itemname . '.php?op=mod', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&op=modtribetopic', $this->getEditItemLink(false, true, true)); $ret['deleteItemLink'] = str_replace($this->handler->_itemname . '.php?op=del', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&op=deltribetopic', $this->getDeleteItemLink(false, true, true)); // build last post link $module = icms::handler("icms_module")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE); $start = ''; if ($this->getVar('replies') + 1 > $module->config['tribepostsperpage']) { $start = '&start=' . ($this->getVar('replies') + 1 - ($this->getVar('replies') + 1) % $module->config['tribepostsperpage']); } $ret['lastItemLink'] = '<a href="' . $ret['itemUrl'] . $start . '#post' . $this->getVar('last_post_id') . '"><img src="' . $this->handler->_moduleUrl . 'images/comments.gif" title="' . _MD_PROFILE_TRIBETOPIC_SHOW_LAST_POST . '" style="vertical-align:middle;" /></a>'; // build toggle close item link if ($this->getVar('closed')) { // link to reopen the topic $ret['closedIcon'] = '<img src="' . $this->handler->_moduleUrl . 'images/lock.gif" title="' . _MD_PROFILE_TRIBETOPIC_CLOSE . '" style="vertical-align:middle;" />'; $ret['toggleCloseLink'] = '<a href="' . $ret['itemUrl'] . '&op=toggleclose"><img src="' . $this->handler->_moduleUrl . 'images/unlock.gif" title="' . _MD_PROFILE_TRIBETOPIC_REOPEN . '" style="vertical-align:middle;" /></a>'; } else { // link to close the topic $ret['toggleCloseLink'] = '<a href="' . $ret['itemUrl'] . '&op=toggleclose"><img src="' . $this->handler->_moduleUrl . 'images/lock.gif" title="' . _MD_PROFILE_TRIBETOPIC_CLOSE . '" style="vertical-align:middle;" /></a>'; } return $ret; }
function b_profile_friends_show($options) { global $xoTheme; if (!empty(icms::$user)) { $profile_friendship_handler = icms_getModuleHandler('friendship', basename(dirname(dirname(__FILE__))), 'profile'); $friends = $profile_friendship_handler->getFriendships(0, 0, icms::$user->getVar('uid'), 0, PROFILE_FRIENDSHIP_STATUS_ACCEPTED); if (count($friends) == 0) { return; } $block = array(); $i = 0; foreach ($friends as $friend) { $friend_uid = icms::$user->getVar('uid') == $friend['friend1_uid'] ? $friend['friend2_uid'] : $friend['friend1_uid']; $block['friends'][$i]['uname'] = icms_member_user_Handler::getUserLink($friend_uid); $block['friends'][$i]['friend_uid'] = $friend_uid; $block['friends'][$i]['sort'] = icms_member_user_Object::getUnameFromId($friend_uid); $i++; } if (isset($block['friends']) && count($block['friends']) > 0) { usort($block['friends'], 'sortFriendsArray'); } // adding PM javascript, $xoTheme cannot be used in this place because jQuery is not yet loaded if (count($block['friends']) > 0) { $block['jQuery'] = 'jQuery(document).ready(function(){jQuery("a.block-profile-pm").colorbox({width:600, height:395, iframe:true});});'; } } return $block; }
/** * Overridding IcmsPersistable::toArray() method to add a few info * * @global array $icmsConfigUser user configuration * @return array of tribetopic info */ public function toArray() { global $icmsConfigUser; $ret = parent::toArray(); $ret['post_time'] = formatTimestamp($this->getVar('post_time', 'e'), 'm'); $ret['poster_uname'] = icms_member_user_Handler::getUserLink($this->getVar('poster_uid')); $ret['userCanEditAndDelete'] = $this->userCanEditAndDelete(); $thisUser = icms::handler('icms_member')->getUser($this->getVar('poster_uid')); if (is_object($thisUser)) { // get poster avatar $avatar = $thisUser->gravatar(); if ($icmsConfigUser['avatar_allow_gravatar'] || strpos($avatar, 'http://www.gravatar.com/avatar/') === false) { $ret['poster_avatar'] = '<img src="' . $thisUser->gravatar() . '" />'; } // get poster signature if (trim($thisUser->getVar('user_sig')) && $this->getVar('attachsig')) { $ret['poster_signature'] = icms_core_DataFilter::checkVar($thisUser->getVar('user_sig', 'N'), 'html', 'output'); } } // rewrite edit and delete item links to work with tribes.php $ret['editItemLink'] = str_replace($this->handler->_itemname . '.php?op=mod', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&topic_id=' . $this->getVar('topic_id') . '&op=edittribepost', $this->getEditItemLink(false, true, true)); $ret['deleteItemLink'] = str_replace($this->handler->_itemname . '.php?op=del', 'tribes.php?tribes_id=' . $this->getVar('tribes_id') . '&topic_id=' . $this->getVar('topic_id') . '&op=deltribepost', $this->getDeleteItemLink(false, true, true)); return $ret; }
/** * @deprecated Use icms_member_user_Handler instead * @todo Remove this function in version 1.4 */ function icms_getLinkedUnameFromId($userid, $name = FALSE, $users = array(), $withContact = FALSE) { icms_core_Debug::setDeprecated('icms_member_user_Handler::getUserLink', sprintf(_CORE_REMOVE_IN_VERSION, '1.4')); return icms_member_user_Handler::getUserLink($userid, $name, $users, $withContact); }
public function __construct(&$db) { parent::__construct($db); $this->_deprecated = icms_core_Debug::setDeprecated('icms_member_user_Handler', sprintf(_CORE_REMOVE_IN_VERSION, '1.4')); }
/** * return audio sender * * @return str linked username */ public function getAudioSender() { return icms_member_user_Handler::getUserLink($this->getVar('uid_owner', 'e')); }
/** * get linked user name for this friend * * @return string linked user name */ public function getFriendLinkedUname() { return icms_member_user_Handler::getUserLink($this->getFriendUid()); }
/** * Create a link to the user profile associated with the rating * * @return string * @see icms_member_user_Handler::getUserLink */ public function getUnameValue() { return icms_member_user_Handler::getUserLink($this->getVar('uid')); }
/** * get linked tribeuser user name from id * * @return str linked user name */ public function getTribeuserSender() { return icms_member_user_Handler::getUserLink($this->getVar('user_id', 'e')); }
$i++; } // finally sort the array usort($rtn, 'sortList'); $icmsTpl->assign('tribes', $rtn); unset($tribes); // get awaiting approvals if ($isOwner) { $profile_tribeuser_handler = icms_getmodulehandler('tribeuser', basename(dirname(__FILE__)), 'profile'); $tribeusers = $profile_tribeuser_handler->getApprovals($ownTribes); $rtn = array(); $i = 0; foreach ($tribeusers as $tribeuser) { $rtn[$i]['tribeuser_id'] = $tribeuser['tribeuser_id']; $rtn[$i]['uid'] = $tribeuser['user_id']; $rtn[$i]['uname'] = icms_member_user_Handler::getUserLink($tribeuser['user_id']); $rtn[$i]['tribes_id'] = $tribeuser['tribe_id']; $rtn[$i]['tribe_itemLink'] = $tribeuser['tribe_itemLink']; $i++; } $icmsTpl->assign('tribes_approvals', $rtn); $icmsTpl->assign('lang_approvals', _MD_PROFILE_TRIBES_APPROVALS); $icmsTpl->assign('lang_approve', _MD_PROFILE_TRIBEUSER_APPROVE); unset($tribeusers); } // get invitations if ($isOwner) { $tribeusers = $profile_tribeuser_handler->getInvitations($uid); $rtn = array(); $i = 0; foreach ($tribeusers as $tribeuser) {
$content_content_handler = icms_getModuleHandler('content', basename(dirname(__FILE__)), 'content'); if (icms::$module->config['default_page'] == 0) { // At which record shall we start display $clean_start = isset($_GET['start']) ? (int) $_GET['start'] : 0; $clean_content_uid = isset($_GET['uid']) ? (int) $_GET['uid'] : false; $clean_content_tags = isset($_GET['tag']) ? filter_input(INPUT_GET, 'tag', FILTER_SANITIZE_MAGIC_QUOTES) : false; $clean_content_pid = isset($_GET['pid']) ? (int) $_GET['pid'] : ($clean_content_uid || $clean_content_tags ? false : 0); $content = $content_content_handler->getContents($clean_start, icms::$module->config['contents_limit'], $clean_content_uid, $clean_content_tags, false, $clean_content_pid); $icmsTpl->assign('content_contents', $content); if ($clean_content_uid !== false) { $contents_count = $content_content_handler->getContentsCount($clean_content_uid); $pagenav = new icms_view_PageNav($contents_count, icms::$module->config['contents_limit'], $clean_start, 'start', 'uid=' . $clean_content_uid); } else { /** * @todo this is a bug because it's not taking into concideration view permissions, ... */ $contents_count = $content_content_handler->getCount(); $pagenav = new icms_view_PageNav($contents_count, icms::$module->config['contents_limit'], $clean_start, 'start'); } $icmsTpl->assign('navbar', $pagenav->renderNav()); if ($clean_content_uid) { $icmsTpl->assign('content_category_path', sprintf(_CO_CONTENT_CONTENT_FROM_USER, icms_member_user_Handler::getUserLink($clean_content_uid))); } } else { $content = $content_content_handler->getContents(0, 1, false, false, icms::$module->config['default_page']); $icmsTpl->assign('content_contents', $content); } $icmsTpl->assign('showInfo', icms::$module->config['show_contentinfo']); $icmsTpl->assign('content_module_home', '<a href="' . ICMS_URL . '/modules/' . icms::$module->getVar('dirname') . '">' . icms::$module->getVar('name') . '</a>'); $xoTheme->addStylesheet(ICMS_URL . '/modules/content/include/content.css'); include_once 'footer.php';
/** * Retrieving the name of the author of the content, linked to his profile * * @return str name of the author of the content */ function content_uid() { return icms_member_user_Handler::getUserLink($this->getVar('content_uid', 'e')); }