function genSiteServiceMenu() { $bLogged = isLogged(); $aMenuItem = array(); $sMenuPopupId = ''; $sMenuPopupContent = ''; if ($bLogged) { bx_import('BxTemplMenuService'); $oMenu = new BxTemplMenuService(); if ($oMenu->aMenuInfo['memberID'] != 0) { $aProfile = getProfileInfo($oMenu->aMenuInfo['memberID']); } $sThumbSetting = getParam('sys_member_info_thumb_icon'); bx_import('BxDolMemberInfo'); $o = BxDolMemberInfo::getObjectInstance($sThumbSetting); $sThumbUrl = $o ? $o->get($aProfile) : ''; $o = BxDolMemberInfo::getObjectInstance($sThumbSetting . '_2x'); $sThumbTwiceUrl = $o ? $o->get($aProfile) : ''; if (!$sThumbTwiceUrl) { $sThumbTwiceUrl = $sThumbUrl; } $bThumb = !empty($sThumbUrl); $aMenuItem = array('bx_if:show_fu_thumb_image' => array('condition' => $bThumb, 'content' => array('image' => $sThumbUrl, 'image_2x' => $sThumbTwiceUrl)), 'bx_if:show_fu_thumb_icon' => array('condition' => !$bThumb, 'content' => array()), 'thumbnail' => get_member_icon($oMenu->aMenuInfo['memberID']), 'title' => getNickName($oMenu->aMenuInfo['memberID'])); $sMenuPopupId = 'sys-service-menu-' . time(); $sMenuPopupContent = $this->transBox($oMenu->getCode()); } return $GLOBALS['oSysTemplate']->parseHtmlByName('extra_service_menu_wrapper.html', array('bx_if:show_for_visitor' => array('condition' => !$bLogged, 'content' => array()), 'bx_if:show_for_user' => array('condition' => $bLogged, 'content' => $aMenuItem), 'menu_popup_id' => $sMenuPopupId, 'menu_popup_content' => $sMenuPopupContent)); }
/** * page code function */ function PageCompPageMainCode() { global $site; global $prof; $query = "\n\t\tSELECT\n\t\t\t`id_poll`,\n\t\t\t`id_profile`,\n\t\t\t`poll_question`,\n\t\t\t`Profiles`.*\n\t\tFROM `ProfilesPolls`\n\t\tLEFT JOIN `Profiles` ON\n\t\t\t`id_profile` = `Profiles`.`ID`\n\t\tWHERE\n\t\t\t`poll_status` = 'active'\n\t\t\tAND `poll_approval`\n\t\tORDER BY `id_poll` DESC\n\t\t"; //$query = "SELECT `ID`, `Question` FROM `polls_q` WHERE `Active` = 'on' ORDER BY `Question`"; $res = db_res($query); if ($res and mysql_num_rows($res)) { $ret = '<div class="clear_both"></div>'; while ($arr = mysql_fetch_array($res)) { $age_str = _t("_y/o", age($arr['DateOfBirth'])); $y_o_sex = $age_str . ' ' . _t("_" . $arr['Sex']); $poll_coutry = _t("__" . $prof['countries'][$arr['Country']]); $ret .= '<div class="pollBody">'; $ret .= '<div class="clear_both"></div>'; $ret .= '<div class="pollInfo">'; $ret .= get_member_icon($arr['id_profile'], 'left'); $ret .= '<div class="pollInfo_nickname">'; $ret .= _t('_Submitted by', $arr['NickName']); $ret .= '</div>'; $ret .= '<div class="pollInfo_info">'; $ret .= $y_o_sex . '<br />' . $poll_coutry; $ret .= '</div>'; $ret .= '</div>'; $ret .= '<div class="clear_both"></div>'; $ret .= ShowPoll($arr['id_poll']); $ret .= '<div class="clear_both"></div>'; $ret .= '</div>'; } $ret .= '<div class="clear_both"></div>'; } else { $ret = "<div align=center>" . _t("_No polls available") . "</div>\n"; } return $ret; }
function displayItem($aParams, &$aEntry) { $sSampleType = $aParams['sample_type']; $iViewerType = $aParams['viewer_type']; $iViewerId = isset($aParams['viewer_id']) ? (int) $aParams['viewer_id'] : 0; $bAdminPanel = $iViewerType == BX_TD_VIEWER_TYPE_ADMIN && (isset($aParams['admin_panel']) && $aParams['admin_panel'] || $sSampleType == 'admin'); $sModuleUri = $this->_oConfig->getUri(); $sLKLinkEdit = _t('_' . $sModuleUri . '_lcaption_edit'); $aTmplVars = array('id' => $this->_oConfig->getSystemPrefix() . $aEntry['id'], 'author_icon' => get_member_icon($aEntry['author_id'], 'left'), 'author_url' => getProfileLink($aEntry['author_id']), 'author_username' => getNickName($aEntry['author_id']), 'caption' => str_replace("\$", "$", $aEntry['caption']), 'class' => !in_array($sSampleType, array('view')) ? ' ' . $this->sCssPrefix . '-text-snippet' : '', 'date' => _format_when($aEntry['ago']), 'content' => str_replace("\$", "$", $aEntry['content']), 'link' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aEntry['uri'], 'bx_if:checkbox' => array('condition' => $bAdminPanel, 'content' => array('id' => $aEntry['id'])), 'bx_if:status' => array('condition' => $iViewerType == BX_TD_VIEWER_TYPE_MEMBER && $iViewerId == $aEntry['author_id'] || $iViewerType == BX_TD_VIEWER_TYPE_ADMIN, 'content' => array('status' => _t('_' . $sModuleUri . '_status_' . $aEntry['status']))), 'bx_if:edit_link' => array('condition' => $iViewerType == BX_TD_VIEWER_TYPE_MEMBER && $iViewerId == $aEntry['author_id'] || $iViewerType == BX_TD_VIEWER_TYPE_ADMIN, 'content' => array('edit_link_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'post/' . $aEntry['uri'], 'edit_link_caption' => $sLKLinkEdit))); return $this->parseHtmlByName('item.html', $aTmplVars); }
/** * Common public methods. * Is used to display events on the Wall. */ function getSystem($aEvent, $sDisplayType = BX_WALL_VIEW_TIMELINE) { $sHandler = $aEvent['type'] . '_' . $aEvent['action']; if (!$this->_oConfig->isHandler($sHandler)) { return ''; } $aResult = $this->_getSystemData($aEvent, $sDisplayType); $bResult = !empty($aResult); if ($bResult && isset($aResult['perform_delete']) && $aResult['perform_delete'] == true) { $this->_oDb->deleteEvent(array('id' => $aEvent['id'])); return ''; } else { if (!$bResult || $bResult && empty($aResult['content'])) { return ''; } } $sResult = ""; switch ($sDisplayType) { case BX_WALL_VIEW_TIMELINE: if (empty($aEvent['title']) && !empty($aResult['title']) || empty($aEvent['description']) && !empty($aResult['description'])) { $this->_oDb->updateEvent(array('title' => process_db_input($aResult['title'], BX_TAGS_STRIP), 'description' => process_db_input($aResult['description'], BX_TAGS_STRIP)), $aEvent['id']); } if (!in_array($aEvent['type'], array('profile', 'friend'))) { $sType = $aEvent['type']; $iObjectId = $aEvent['object_id']; if ($aEvent['action'] == 'comment_add') { $aContent = unserialize($aEvent['content']); $iObjectId = (int) $aContent['object_id']; } if ($this->_oConfig->isGrouped($aEvent['type'], $aEvent['action'], $iObjectId)) { $sType = isset($aResult['grouped']['group_cmts_name']) ? $aResult['grouped']['group_cmts_name'] : ''; $iObjectId = isset($aResult['grouped']['group_id']) ? (int) $aResult['grouped']['group_id'] : 0; } $oComments = new BxWallCmts($sType, $iObjectId); if ($oComments->isEnabled()) { $sComments = $oComments->getCommentsFirstSystem('comment', $aEvent['id']); } else { $sComments = $this->getDefaultComments($aEvent['id']); } } else { $sComments = $this->getDefaultComments($aEvent['id']); } $sResult = $this->parseHtmlByTemplateName('balloon', array('post_type' => $aEvent['type'], 'post_id' => $aEvent['id'], 'post_owner_icon' => get_member_thumbnail($aEvent['owner_id'], 'none'), 'post_content' => $aResult['content'], 'comments_content' => $sComments)); break; case BX_WALL_VIEW_OUTLINE: $sResult = $this->parseHtmlByContent($aResult['content'], array('post_id' => $aEvent['id'], 'post_owner_icon' => get_member_icon($aEvent['owner_id'], 'none'), 'comments_content' => $sComments)); break; } return $sResult; }
function getVendorInfoProfile($iId) { $sCurrencyCode = $this->_oConfig->getCurrencyCode(); $sCurrencySign = $this->_oConfig->getCurrencySign(); if ($iId == BX_PMT_ADMINISTRATOR_ID) { $iSiteId = $this->_oConfig->getSiteId(); return array('id' => BX_PMT_ADMINISTRATOR_ID, 'username' => BX_PMT_ADMINISTRATOR_USERNAME, 'profile_name' => getNickName($iSiteId), 'profile_icon' => get_member_icon($iSiteId), 'profile_url' => getProfileLink($iSiteId), 'status' => 'Active', 'currency_code' => $sCurrencyCode, 'currency_sign' => $sCurrencySign); } $sSql = "SELECT\n `tp`.`ID` AS `id`,\n `tp`.`NickName` AS `username`,\n '' AS `profile_name`,\n '' AS `profile_url`,\n `tp`.`Status` AS `status`,\n '" . $sCurrencyCode . "' AS `currency_code`,\n '" . $sCurrencySign . "' AS `currency_sign`\n FROM `Profiles` AS `tp`\n WHERE `tp`.`ID`='" . $iId . "'\n LIMIT 1"; $aVendor = $this->getRow($sSql); if (!empty($aVendor)) { $aVendor['profile_name'] = getNickName($aVendor['id']); $aVendor['profile_icon'] = get_member_icon($aVendor['id']); $aVendor['profile_url'] = getProfileLink($aVendor['id']); } return $aVendor; }
function displayList($aParams) { $sSampleType = $aParams['sample_type']; $iViewerId = isset($aParams['viewer_id']) ? (int) $aParams['viewer_id'] : 0; $iViewerType = $aParams['viewer_type']; $iStart = isset($aParams['start']) ? (int) $aParams['start'] : -1; $iPerPage = isset($aParams['count']) ? (int) $aParams['count'] : -1; $bShowEmpty = isset($aParams['show_empty']) ? $aParams['show_empty'] : true; $bAdminPanel = $iViewerType == BX_TD_VIEWER_TYPE_ADMIN && (isset($aParams['admin_panel']) && $aParams['admin_panel'] || $sSampleType == 'admin'); $sModuleUri = $this->_oConfig->getUri(); $aEntries = $this->_oDb->getEntries($aParams); if (empty($aEntries)) { return $bShowEmpty ? MsgBox(_t('_' . $sModuleUri . '_msg_no_results')) : ""; } $oTags = new BxDolTags(); $oCategories = new BxDolCategories(); //--- Language translations ---// $sLKLinkApprove = _t('_' . $sModuleUri . '_lcaption_approve'); $sLKLinkReject = _t('_' . $sModuleUri . '_lcaption_reject'); $sLKLinkEdit = _t('_' . $sModuleUri . '_lcaption_edit'); $sLKLinkDelete = _t('_' . $sModuleUri . '_lcaption_delete'); $sBaseUri = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri(); $sJsMainObject = $this->_oConfig->getJsObject(); $aResult['sample'] = $sSampleType; $aResult['bx_repeat:entries'] = array(); foreach ($aEntries as $aEntry) { $sVotes = ""; if ($this->_oConfig->isVotesEnabled() && $aEntry['is_vote'] == 1) { $oVotes = $this->_oModule->_createObjectVoting($aEntry['id']); $sVotes = $oVotes->getJustVotingElement(0, $aEntry['id']); } $aResult['bx_repeat:entries'][] = array('id' => $this->_oConfig->getSystemPrefix() . $aEntry['id'], 'author_icon' => get_member_icon($aEntry['author_id'], 'left'), 'caption' => str_replace("\$", "$", $aEntry['caption']), 'class' => !in_array($sSampleType, array('view')) ? ' ' . $this->sCssPrefix . '-text-snippet' : '', 'date' => getLocaleDate($aEntry['date']), 'content' => str_replace("\$", "$", $aEntry['content']), 'link' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aEntry['uri'], 'voting' => $sVotes, 'bx_if:checkbox' => array('condition' => $bAdminPanel, 'content' => array('id' => $aEntry['id'])), 'bx_if:status' => array('condition' => $iViewerType == BX_TD_VIEWER_TYPE_MEMBER && $iViewerId == $aEntry['author_id'] || $iViewerType == BX_TD_VIEWER_TYPE_ADMIN, 'content' => array('status' => _t('_' . $sModuleUri . '_status_' . $aEntry['status']))), 'bx_if:edit_link' => array('condition' => $iViewerType == BX_TD_VIEWER_TYPE_MEMBER && $iViewerId == $aEntry['author_id'] || $iViewerType == BX_TD_VIEWER_TYPE_ADMIN, 'content' => array('edit_link_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'post/' . $aEntry['uri'], 'edit_link_caption' => $sLKLinkEdit))); } $aResult['paginate'] = ''; if (!in_array($sSampleType, array('id', 'uri', 'view', 'search_unit'))) { if (!empty($sSampleType)) { $this->_updatePaginate($aParams); } $aResult['paginate'] = $this->oPaginate->getPaginate($iStart, $iPerPage); } $aResult['loading'] = LoadingBox($sModuleUri . '-' . $sSampleType . '-loading'); return $this->parseHtmlByName('list.html', $aResult); }
function displaySearchUnit($aData) { $sFileLink = $this->getCurrentUrl('file', $aData['id'], $aData['uri']); $sCategoryLink = $this->getCurrentUrl('category', $aData['categoryId'], $aData['categoryUri'], array('ownerId' => $aData['ownerId'], 'ownerName' => $aData['ownerName'])); // ownerPic $aUnit['ownerPic'] = get_member_icon($aData['ownerId'], 'left'); // category $aUnit['category'] = isset($aData['categoryName']) ? _t('_In') . ' <a href="' . $sCategoryLink . '">' . $aData['categoryName'] . '</a>' : ''; // comment(s) $aUnit['comment'] = isset($aData['countComment']) ? '<a href="' . $sFileLink . '">' . $aData['countComment'] . ' ' . _t('_comments') . '</a>' : ''; // tag if (isset($aData['tag'])) { $aTags = explode(',', $aData['tag']); foreach ($aTags as $sValue) { $sLink = $this->getCurrentUrl('tag', 0, $sValue); $aUnit['tag'] .= '<a href="' . $sLink . '">' . $sValue . '</a>, '; } } $aUnit['tag'] .= trim($aUnit['tag'], ', '); // rate if (!is_null($this->oRate) && $this->oRate->isEnabled()) { $aUnit['rate'] = $this->oRate->getJustVotingElement(0, 0, $aData['voting_rate']); } else { $aUnit['rate'] = ''; } // title $aUnit['title'] = isset($aData['title']) ? '<a href="' . $sFileLink . '">' . $aData['title'] . '</a>' : ''; // when $aUnit['when'] = defineTimeInterval($aData['date']); // from $aUnit['from'] = $aData['ownerId'] != 0 ? _t('_By') . ': <a href="' . getProfileLink($aData['ownerId']) . '">' . $aData['ownerName'] . '</a>' : _t('_By') . ': ' . _t('_Admin'); // view $aUnit['view'] = isset($aData['view']) ? _t("_Views") . ': ' . $aData['view'] : ''; // body $aUnit['body'] = isset($aData['bodyText']) ? process_html_output(strmaxtextlen(strip_tags($aData['bodyText']), 200)) : ''; return $GLOBALS['oSysTemplate']->parseHtmlByName('browseTextUnit.html', $aUnit, array('{', '}')); }
/** * Generate Comments Section * * @param $iElementID - Post ID * @param $iOwnerID - Owner ID * @return HTML presentation of data */ function PrintCommentSection($iElementID, $sCommentLbl = '') { global $prof; global $site; $sRetHtml = ''; $sCommentsC = $sCommentLbl == '' ? _t('_comments') : $sCommentLbl; $sSbjN = _t('_Subject'); $sPostedByC = _t('_Posted by'); $sDateC = _t('_Date'); $sLocationC = _t('_Location'); $sAdminLocalAreaC = _t('_AdminArea'); $sAdminC = _t('_Admin'); $sSureC = _t("_Are you sure"); $sPostCommentC = _t('_Post Comment'); $sLeaveCommentC = _t('_LeaveComment'); $sAddCommentC = _t('_Add comment'); $sEditC = _t('_Edit'); $sDeleteC = _t('_Delete'); $sCommentFriendsOnlyC = _t('_commenting_this_blog_allowed_only_for_friends'); $sReportC = _t('_Report'); $sPostDataSQL = $this->SelectionObjectSQL($iElementID); $aPostData = db_arr($sPostDataSQL); $iOwnerID = $aPostData['OwnerID']; //$bFriend = is_friends( $this->iVisitorID, $aPostData['OwnerID'] ); //$bOwner = ($this->iVisitorID==$aPostData['OwnerID']) ? true : false; $bCanPostComment = $this->GetPostNewCommentPermission($aPostData); $bCanPostCommentReport = $this->GetCommentReportPermission($aPostData); $sQuery = $this->SelectionCommentsObjectSQL($iElementID); $vSqlRes = db_res($sQuery); $sCommsHtml = ''; while ($aSqlResStr = mysql_fetch_assoc($vSqlRes)) { $aCommentData = $this->FillCommentsData($aSqlResStr); $aProfileInfo = getProfileInfo($aCommentData['ProfID']); $sPostedBy = $aCommentData['ProfID'] == 0 ? $sAdminC : '<a href="' . getProfileLink($aCommentData['ProfID']) . '">' . $aProfileInfo['NickName'] . '</a>'; $sCountryName = $aProfileInfo['Country'] == "" ? $sAdminLocalAreaC : _t('__' . $prof['countries'][$aProfileInfo['Country']]); $sCountryPic = $aProfileInfo['Country'] == '' ? '' : ' <img alt="' . $aProfileInfo['Country'] . '" src="' . ($site['flags'] . strtolower($aProfileInfo['Country'])) . '.gif"/>'; $sUserIcon = get_member_icon($aCommentData['ProfID'], 'left', true); $aCommentData['Text'] = $aCommentData['Text']; $sTimeAgo = _format_when($aCommentData['Time']); $sMessageBR = $this->ActionPrepareForEdit($aCommentData['Text']); $sFullPermissions = $this->GetElementFullPermission($aPostData, $aCommentData); $sAdminActions = ''; if ($sFullPermissions) { if ($this->iCType == 1) { $sAdminActions = <<<EOF <!-- <span class="comment_text_r"> --> <div class="comment_actions"> \t<a href="{$this->sCurrBrowsedFile}" onclick="javascript: UpdateField('EditCommentID',{$aCommentData['ID']});UpdateField('EAdvID',{$iElementID}); UpdateFieldStyle('answer_form_to_1','block');UpdateFieldTiny('commentText','{$sMessageBR}'); return false;">{$sEditC}</a>| \t<a href="{$_SERVER['PHP_SELF']}?ShowAdvertisementID={$aCommentData['ID']}" onclick="javascript: UpdateField('DeleteCommentID',{$aCommentData['ID']});UpdateField('DAdvID',{$iElementID});document.forms.command_delete_comment.submit(); return false;">{$sDeleteC}</a> <!-- </span> --> </div> EOF; } if ($this->iCType == 2) { $sAdminActions = <<<EOF <span class="comment_text_r"> \t<a href="{$this->sCurrBrowsedFile}" onclick="javascript: UpdateField('EditCommentID',{$aCommentData['ID']});UpdateField('EPostID',{$iElementID});UpdateFieldStyle('answer_form_to_1','block');UpdateFieldTiny('commentText','{$sMessageBR}'); return false;">{$sEditC}</a>| \t<a href="{$this->sCurrBrowsedFile}" onclick="javascript: UpdateField('DeleteCommentID',{$aCommentData['ID']});UpdateField('DPostID',{$iElementID});document.forms.command_delete_comment.submit(); return false;">{$sDeleteC}</a> </span> EOF; } } if ($bCanPostCommentReport) { if ($this->iCType == 1) { $sReport = <<<EOF <div class="comment_actions"> \t<a onclick="javascript: window.open( 'classifieds.php?commentID={$aCommentData['ID']}&clsID={$iElementID}&action=report', 'comment', 'width=500, height=380, menubar=no,status=no,resizable=yes,scrollbars=yes,toolbar=no,location=no' );return false;" href="#{$aCommentData['ID']}">{$sReportC}</a> </div> EOF; } } $sCommsHtml .= <<<EOF <div class="comment_row"> \t{$sUserIcon} \t{$sPostedBy} ({$sTimeAgo})<br /> \t{$aCommentData['Text']}<br /> \t{$sReport}<br /> \t{$sAdminActions} \t<div class="clear_both"></div> </div> EOF; } $sPostNewComm = ''; if ($bCanPostComment == true) { if ($this->iCType == 1) { $sPostNewComm = <<<EOF <form action="{$this->sCurrBrowsedFile}" method="post" name="post_comment_adv_form"> \t<input type="hidden" name="CommAdvertisementID" value="{$iElementID}" /> \t<textarea name="message" id="postNewComm" rows="5" cols="30" class="classfiedsTextArea"></textarea> \t<input id="postCommentAdv" name="postCommentAdv" type="submit" value="{$sPostCommentC}"/> </form> EOF; } if ($this->iCType == 2) { $sPostNewComm = <<<EOF <form action="{$this->sCurrBrowsedFile}?action=show_member_post&ownerID={$iOwnerID}&post_id={$iElementID}" method="post" name="post_comment_adv_form"> \t<input type="hidden" name="action" value="addcomment" /> \t<input type="hidden" name="CommPostID" value="{$iElementID}" /> \t<input type="hidden" name="ownerID" value="{$this->aBlogConf['ownerID']}" /> \t<textarea name="message" id="postNewComm" rows="5" cols="30" class="classfiedsTextArea"></textarea> \t<input id="postCommentPost" name="postCommentPost" type="submit" value="{$sPostCommentC}"/> </form> EOF; } } if ($sFullPermissions == true) { if ($this->iCType == 1) { $sAdminFormActions = <<<EOF <form action="{$this->sCurrBrowsedFile}" method="post" name="command_edit_comment_adv_form"> \t<input type="hidden" name="EditCommentID" id="EditCommentID" value=""/> \t<input type="hidden" name="EAdvID" id="EAdvID" value=""/> \t<textarea name="commentText" id="commentText" rows="20" cols="60" class="classfiedsTextArea" style="width:{$this->iBigThumbSize}px;"></textarea> \t<input type="submit" value="{$sPostCommentC}"/> </form> EOF; } if ($this->iCType == 2) { $sAdminFormActions = <<<EOF <form action="{$this->sCurrBrowsedFile}?action=show_member_post&ownerID={$iOwnerID}&post_id={$iElementID}" method="post" name="command_edit_comment_post_form"> \t<input type="hidden" name="action" value="editcomment" /> \t<input type="hidden" name="EditCommentID" id="EditCommentID" value=""/> \t<input type="hidden" name="EPostID" id="EPostID" value=""/> \t<input type="hidden" name="ownerID" value="{$this->aBlogConf['ownerID']}" /> \t<textarea name="commentText" id="commentText" rows="10" cols="60" class="classfiedsTextArea" style="width:{$this->iBigThumbSize}px;"></textarea> \t<input type="submit" value="{$sPostCommentC}"/> </form> <form action="{$this->sCurrBrowsedFile}?action=show_member_post&ownerID={$iOwnerID}&post_id={$iElementID}" method="post" name="command_delete_comment"> \t<input type="hidden" name="DeleteCommentID" id="DeleteCommentID" value=""/> \t<input type="hidden" name="DPostID" id="DPostID" value=""/> \t<input type="hidden" name="action" id="action" value="delete_comment" /> \t<input type="hidden" name="ownerID" value="{$this->aBlogConf['ownerID']}" /> </form> EOF; } } $sCommentActions = ''; if ($bCanPostComment == false && $aPostData['PostCommentPermission'] == 'friends') { $sImgFriend = <<<EOF <img src="{$site['icons']}lock32.gif" alt="{$sCommentFriendsOnlyC}" title="{$sCommentFriendsOnlyC}" class="marg_icon" style="margin-top:10px;" /> EOF; $sCommentActions = $sImgFriend . MsgBox($sCommentFriendsOnlyC); } else { $sCommentActions = <<<EOF <div id="add_comment_label"> \t<img src="{$site['icons']}add_comment.gif" alt="{$sAddCommentC}" title="{$sAddCommentC}" class="marg_icon" /> \t<a class="actions" onclick="document.getElementById('answer_form_to_0').style.display = 'block'; document.getElementById('add_comment_label').style.display = 'none'; return false;" href="{$this->sCurrBrowsedFile}">{$sAddCommentC}</a> </div> EOF; } $sCommentsContent = <<<EOF <div id="comments_section"> \t<div id="answer_form_to_0" style="display: none;"> \t\t{$sPostNewComm} \t</div> \t<div id="answer_form_to_1" style="display: none;"> \t\t{$sAdminFormActions} \t</div> \t{$sCommsHtml} \t{$sCommentActions} </div> EOF; $show_hide = $this->genShowHideItem('comments_section'); $sRetHtml = DesignBoxContent($sCommentsC, $sCommentsContent, 1, $show_hide); return $sRetHtml; }
function showFileInfo($aFile) { $sTitle = strlen($aFile['medTitle']) > 0 ? $aFile['medTitle'] : _t("_Untitled"); $iTime = defineTimeInterval($aFile['medDate']); $sNumberAlt = _t("_Views"); switch ($this->sType) { case 'photo': $sView = _t("_Photos"); $sEmbedCode = $this->sFilesUrl . $aFile['medID'] . '.' . $aFile['medExt']; break; case 'music': $sView = _t("_Music files"); $sNumberAlt = _t("_Playbacks"); $sEmbedCode = getEmbedCode('music', 'player', array('id' => $aFile['medID'], 'song' => 'true')); break; case 'video': $sView = _t("_Videos"); $sEmbedCode = getEmbedCode('movie', 'player', array('file' => $aFile['medID'])); break; } if ($aFile['medCount'] - 1 > 0) { $sLinkMore = '<a href="' . $this->getMoreFilesUrl($aFile['medProfId'], $aFile['NickName']) . '">' . $aFile['medCount'] . '</a>'; } else { $sLinkMore = $aFile['medCount']; } ob_start(); ?> <div id="videoInfo"> <div id="fileTop"> <div class="fileTitle"><?php echo $sTitle; ?> </div> <div class="userPic"> <?php echo get_member_icon($aFile['medProfId'], 'left'); ?> </div> <div class="fileUserInfo"> <a href="<?php echo getProfileLink($aFile['medProfId']); ?> "><?php echo $aFile['NickName']; ?> </a> </div> <div> <?php echo $sView; ?> : <b><?php echo $sLinkMore; ?> </b> </div> </div> <div class="clear_both"></div> <div id="serviceInfo"> <div> <?php echo _t("_Added"); ?> : <b><?php echo defineTimeInterval($aFile['medDate']); ?> </b> </div> <div> <?php echo $sNumberAlt; ?> : <?php echo $aFile['medViews']; ?> </div> <div> <?php echo _t("_URL"); ?> : <input type="text" onClick="this.focus(); this.select();" readonly="true" value="<?php echo $this->getFileUrl($aFile['medID'], $aFile['medUri']); ?> "/> </div> <div> <?php echo _t("_Embed"); ?> : <input type="text" onClick="this.focus(); this.select();" readonly="true" value="<?php echo htmlspecialchars($sEmbedCode); ?> "/> </div> <div> <?php echo _t("_Tags"); ?> : <?php echo $this->getTagLinks($aFile['medTags']); ?> </div> <div> <?php echo _t("_DescriptionMedia"); ?> : <?php echo $aFile['medDesc']; ?> </div> </div> </div> <?php $sCode = ob_get_clean(); return $sCode; }
function displayCartContent($aCartInfo, $iVendorId = BX_PMT_EMPTY_ID) { $iAdminId = $this->_oConfig->getAdminId(); $sJsObject = $this->_oConfig->getJsObject('cart'); if ($iVendorId != BX_PMT_EMPTY_ID) { $aCartInfo = array($aCartInfo); } $aVendors = array(); foreach ($aCartInfo as $aVendor) { //--- Get Providers ---// $aProviders = array(); $aVendorProviders = $this->_oDb->getVendorInfoProviders($aVendor['vendor_id']); foreach ($aVendorProviders as $aProvider) { $aProviders[] = array('name' => $aProvider['name'], 'caption' => $aProvider['caption'], 'checked' => empty($aProviders) ? 'checked="checked"' : ''); } //--- Get Items ---// $aItems = array(); foreach ($aVendor['items'] as $aItem) { $aItems[] = array('vendor_id' => $aVendor['vendor_id'], 'vendor_currency_code' => $aVendor['vendor_currency_code'], 'module_id' => $aItem['module_id'], 'item_id' => $aItem['id'], 'item_title' => $aItem['title'], 'item_url' => $aItem['url'], 'item_quantity' => $aItem['quantity'], 'item_price' => $aItem['quantity'] * $aItem['price'], 'js_object' => $sJsObject); } //--- Get Control Panel ---// $aButtons = array('pmt-checkout' => _t('_payment_btn_checkout'), 'pmt-delete' => _t('_payment_btn_delete')); $sControlPanel = BxTemplSearchResult::showAdminActionsPanel('items_from_' . $aVendor['vendor_id'], $aButtons, 'items', true, true); //--- Get General ---// $aVendors[] = array('box_width' => $aVendor['vendor_id'] == $iAdminId ? 260 : 310, 'vendor_id' => $aVendor['vendor_id'], 'bx_if:show_link' => array('condition' => !empty($aVendor['vendor_profile_url']), 'content' => array('vendor_username' => $aVendor['vendor_username'], 'vendor_url' => $aVendor['vendor_profile_url'], 'vendor_currency_code' => $aVendor['vendor_currency_code'], 'items_count' => $aVendor['items_count'], 'items_price' => $aVendor['items_price'])), 'bx_if:show_text' => array('condition' => empty($aVendor['vendor_profile_url']), 'content' => array('vendor_username' => $aVendor['vendor_username'], 'vendor_currency_code' => $aVendor['vendor_currency_code'], 'items_count' => $aVendor['items_count'], 'items_price' => $aVendor['items_price'])), 'vendor_icon' => get_member_icon($aVendor['vendor_id'] != -1 ? $aVendor['vendor_id'] : $this->_oDb->getFirstAdminId()), 'bx_repeat:providers' => $aProviders, 'bx_repeat:items' => $aItems, 'js_object' => $sJsObject, 'process_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'act_cart_submit/', 'control_panel' => $sControlPanel); } $this->addCss('cart.css'); $this->addJs('cart.js'); return $this->parseHtmlByName('cart.html', array_merge($this->_getJsContentCart(), array('bx_repeat:vendors' => $aVendors))); }
function getBlockCode_LoginSection($iBlockID, $sParams = '') { $sDolUrl = BX_DOL_URL_ROOT; $sAdminUrl = BX_DOL_URL_ADMIN; $sAdminPanelC = _t('_Admin Panel'); $sLogoutC = _t('_Log Out'); $sControlPanelC = _t('_Control Panel'); $sHelloMemberC = _t('_Hello member', getNickName($this->iMemberID)); $ret = ''; if (isAdmin()) { $ret .= <<<EOF <div class="logged_section_block"> <span><a href="{$sAdminUrl}index.php" class="logout">{$sAdminPanelC}</a></span> <span> | | </span> <span><a href="{$sDolUrl}logout.php?action=admin_logout" class="logout">{$sLogoutC}</a></span> </div> EOF; } elseif (isMember()) { $sMemberIcon = get_member_icon($memberID, 'left'); $ret .= <<<EOF <div class="logged_member_block"> {$sMemberIcon} <div class="hello_member bx-def-margin-sec-left"> {$sHelloMemberC}<br /> <a href="{$sDolUrl}member.php" class="logout">{$sControlPanelC}</a> <a href="{$sDolUrl}logout.php?action=member_logout" class="logout">{$sLogoutC}</a> </div> </div> EOF; } else { return getMemberLoginFormCode('login_box_form', $sParams); } return '<div class="dbContent bx-def-bc-margin">' . $ret . '</div>'; }
/** * Common public methods. * Is used to display events on the Wall. */ function getSystem($aEvent, $sDisplayType = BX_WALL_VIEW_TIMELINE) { $sHandler = $aEvent['type'] . '_' . $aEvent['action']; if (!$this->_oConfig->isHandler($sHandler)) { return ''; } $aResult = $this->_getSystemData($aEvent, $sDisplayType); $bResult = !empty($aResult); if ($bResult && isset($aResult['perform_delete']) && $aResult['perform_delete'] == true) { $this->_oDb->deleteEvent(array('id' => $aEvent['id'])); return ''; } else { if (!$bResult || $bResult && empty($aResult['content'])) { return ''; } } $sResult = ""; switch ($sDisplayType) { case BX_WALL_VIEW_TIMELINE: if (empty($aEvent['title']) && !empty($aResult['title']) || empty($aEvent['description']) && !empty($aResult['description'])) { $this->_oDb->updateEvent(array('title' => process_db_input($aResult['title'], BX_TAGS_STRIP), 'description' => process_db_input($aResult['description'], BX_TAGS_STRIP)), $aEvent['id']); } if (!in_array($aEvent['type'], array('profile', 'friend'))) { $sType = $aEvent['type']; $iObjectId = $aEvent['object_id']; if ($aEvent['action'] == 'comment_add') { $aContent = unserialize($aEvent['content']); $iObjectId = (int) $aContent['object_id']; } if ($this->_oConfig->isGrouped($aEvent['type'], $aEvent['action'], $iObjectId)) { $sType = isset($aResult['grouped']['group_cmts_name']) ? $aResult['grouped']['group_cmts_name'] : ''; $iObjectId = isset($aResult['grouped']['group_id']) ? (int) $aResult['grouped']['group_id'] : 0; } $oComments = new BxWallCmts($sType, $iObjectId); if ($oComments->isEnabled()) { $sComments = $oComments->getCommentsFirstSystem('comment', $aEvent['id']); } else { $sComments = $this->getDefaultComments($aEvent['id']); } } else { $sComments = $this->getDefaultComments($aEvent['id']); } $sResult = $this->parseHtmlByTemplateName('balloon', array('post_type' => $aEvent['type'], 'post_id' => $aEvent['id'], 'post_owner_icon' => get_member_thumbnail($aEvent['owner_id'], 'none'), 'post_content' => $aResult['content'], 'comments_content' => $sComments)); break; case BX_WALL_VIEW_OUTLINE: //--- Votes $sVote = ''; $oVote = $this->_oModule->_getObjectVoting($aEvent); if ($oVote->isVotingAllowed()) { $sVote = $oVote->getVotingOutline(); } //--- Repost $sRepost = ''; if ($this->_oModule->_isRepostAllowed($aEvent)) { $iOwnerId = $this->_oModule->_getAuthorId(); //--- in whose timeline the content will be shared $iObjectId = $this->_oModule->_oConfig->isSystem($aEvent['type'], $aEvent['action']) ? $aEvent['object_id'] : $aEvent['id']; $sRepost = $this->_oModule->serviceGetRepostElementBlock($iOwnerId, $aEvent['type'], $aEvent['action'], $iObjectId, array('show_do_repost_as_button_small' => true, 'show_do_repost_icon' => true, 'show_do_repost_label' => false)); } $sResult = $this->parseHtmlByContent($aResult['content'], array('post_id' => $aEvent['id'], 'post_owner_icon' => get_member_icon($aEvent['owner_id'], 'none'), 'post_vote' => $sVote, 'post_repost' => $sRepost)); break; } return $sResult; }
function getBlockCode_LoginSection() { global $logged; global $site; global $tmpl; $ret = ''; if ($logged['member']) { $ret .= '<div class="logged_member_block">'; $ret .= get_member_icon($memberID, 'none'); $ret .= '<div class="hello_member">'; $ret .= _t('_Hello member', getNickName($this->iMemberID)); $ret .= "<br>"; $ret .= '<a href="' . $site['url'] . 'member.php" class="logout">' . _t("_Control Panel") . '</a>'; $ret .= ' '; $ret .= '<a href="' . $site['url'] . 'logout.php?action=member_logout" class="logout">' . _t("_Log Out") . '</a>'; $ret .= '</div>'; $ret .= '</div>'; } elseif ($logged['admin']) { $ret .= '<div class="logged_section_block">'; $ret .= '<span>'; $ret .= '<a href="' . $site['url_admin'] . 'index.php" class="logout">Admin Panel</a>'; $ret .= '</span>'; $ret .= '<span>'; $ret .= '| |'; $ret .= '</span>'; $ret .= '<span>'; $ret .= '<a href="' . $site['url'] . 'logout.php?action=admin_logout" class="logout">' . _t("_Log Out") . '</a>'; $ret .= '</span>'; $ret .= '</div>'; } elseif ($logged['aff']) { $ret .= '<div class="logged_section_block">'; $ret .= '<span>'; $ret .= '<a href="' . $site['url'] . 'aff/index.php" class="logout">Affiliate Panel</a>'; $ret .= '</span>'; $ret .= '<span>'; $ret .= '| |'; $ret .= '</span>'; $ret .= '<span>'; $ret .= '<a href="' . $site['url'] . 'logout.php?action=aff_logout" class="logout">' . _t("_Log Out") . '</a>'; $ret .= '</span>'; $ret .= '</div>'; } elseif ($logged['moderator']) { $ret .= '<div class="logged_section_block">'; $ret .= '<span>'; $ret .= '<a href="' . $site['url'] . 'moderators/index.php" class="logout">Moderator Panel</a>'; $ret .= '</span>'; $ret .= '<span>'; $ret .= '| |'; $ret .= '</span>'; $ret .= '<span>'; $ret .= '<a href="' . $site['url'] . 'logout.php?action=moderator_logout" class="logout">' . _t("_Log Out") . '</a>'; $ret .= '</span>'; $ret .= '</div>'; } else { $text = ''; $mem = _t("_Member"); $table = "Profiles"; $login_page = "{$site['url']}member.php"; $join_page = "{$site['url']}join.php"; $forgot_page = "{$site['url']}forgot.php"; $template = "{$dir['root']}templates/tmpl_{$tmpl}/login_form.html"; $ret = PageCompLoginForm($text, $member, $mem, $table, $login_page, $join_page, $forgot_page, $template); } return $ret; }
function getItems() { $sContent = parent::getItems(); return $GLOBALS['oSysTemplate']->parseHtmlByName('extra_sm_thumbnail.html', array('bx_if:show_thumbail' => array('condition' => $this->aMenuInfo['memberID'] != 0, 'content' => array('thumbnail' => get_member_icon($this->aMenuInfo['memberID'], 'left'))), 'content' => $sContent)); }
function getCommon($aEvent) { $sPrefix = $this->_oConfig->getCommonPostPrefix(); if (strpos($aEvent['type'], $sPrefix) !== 0) { return ""; } if ((int) $aEvent['content'] > 0 && in_array($aEvent['type'], array($sPrefix . 'photos', $sPrefix . 'sounds', $sPrefix . 'videos'))) { $sMediaType = str_replace($sPrefix, '', $aEvent['type']); $aEvent = array_merge($aEvent, $this->_getCommonMedia($sMediaType, (int) $aEvent['content'])); if ((int) $aEvent['content'] > 0) { $aEvent['content'] = _t('_wall_content_not_ready'); } else { $this->_oDb->updateEvent(array('content' => process_db_input($aEvent['content'], BX_TAGS_VALIDATE), 'title' => process_db_input($aEvent['title'], BX_TAGS_STRIP), 'description' => process_db_input($aEvent['description'], BX_TAGS_STRIP)), $aEvent['id']); } } $aAuthor = $this->_oDb->getUser($aEvent['object_id']); $aVariables = array('author_thumbnail' => get_member_icon($aAuthor['id']), 'author_url' => getProfileLink($aAuthor['id']), 'author_username' => $aAuthor['username'], 'post_id' => $aEvent['id'], 'post_ago' => $aEvent['ago'], 'bx_if:post_delete' => array('condition' => $this->_isCommentDeleteAllowed(), 'content' => array('js_view_object' => $this->_sJsViewObject, 'post_id' => $aEvent['id'], 'post_delete_txt' => _t('_wall_post_delete'))), 'post_content' => $aEvent['content']); switch (str_replace($sPrefix, '', $aEvent['type'])) { case 'text': $aVariables = array_merge($aVariables, array('post_wrote' => _t("_wall_wrote"), 'post_content' => $aVariables['post_content'])); break; case 'link': $aVariables = array_merge($aVariables, array('post_wrote' => _t("_wall_shared_link"))); break; case 'photos': $aVariables = array_merge($aVariables, array('post_wrote' => _t("_wall_added_photo"))); break; case 'videos': $aVariables = array_merge($aVariables, array('post_wrote' => _t("_wall_added_video"))); break; case 'sounds': $aVariables = array_merge($aVariables, array('post_wrote' => _t("_wall_added_music"))); break; } $sType = isset($aEvent['action']) && empty($aEvent['action']) ? 'reply' : 'comment'; $oComments = new BxWallCmts($this->_oConfig->getCommentSystemName(), $aEvent['id']); $aVariables = array_merge($aVariables, array('comments_content' => $oComments->getCommentsFirst($sType))); return $this->_oTemplate->parseHtmlByTemplateName('balloon', $aVariables); }
function HelloMemberSection() { global $logged; global $site; ob_start(); if ($logged['member']) { $memberID = (int) $_COOKIE['memberID']; $iLet = getNewLettersNum($memberID); $sNewLet = $iLet > 0 ? '<b>(' . $iLet . ')</b>' : ''; ?> <div class="topMemberBlock"> <?php echo get_member_icon($memberID, 'right'); ?> <div class="hello_member"><?php echo _t('_Hello member', getNickName($memberID)); ?> </div> <div class="hello_actions"> <span><a href="<?php echo $site['url']; ?> member.php"><?php echo _t('_My account'); ?> </a></span> <span><a href="<?php echo $site['url']; ?> mail.php?mode=inbox"><?php echo _t('_My Mail'); ?> </a><?php echo ' ' . $sNewLet; ?> </span> <span><a href="<?php echo getProfileLink($memberID); ?> "><?php echo _t('_My Profile'); ?> </a></span> <span><a href="javascript:void(0);" onclick="window.open( '<?php echo $site['url']; ?> presence_pop.php' , 'Presence', 'width=224,height=600,toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=0,resizable=1');" ><?php echo _t('_RayPresence'); ?> </a></span> <span><a href="<?php echo $site['url']; ?> logout.php?action=member_logout"><?php echo _t('_Log Out2'); ?> </a></span> </div> </div> <?php } elseif ($logged['admin']) { ?> <div class="topMemberBlock"> <div class="thumbnail_block" style="float:right;position:relative;"> <img style="width: 45px; height: 45px; background-image: url(<?php echo getTemplateIcon('man_small.gif'); ?> );" src="<?php echo getTemplateIcon('spacer.gif'); ?> " alt="" /> </div> <div class="hello_member"><?php echo _t('_Hello member', 'admin'); ?> </div> <div class="hello_actions"> <span><a href="<?php echo $site['url_admin']; ?> index.php"><?php echo _t('_Admin Panel'); ?> </a></span> <span><a href="<?php echo $site['url']; ?> logout.php?action=admin_logout"><?php echo _t('_Log Out2'); ?> </a></span> </div> </div> <?php } else { //<a href="<_?= $site['url'] ?_>member.php"><_?= _t( '_Member Login' ) ?_></a> ?> <div class="topMemberBlock"> <div class="no_hello_actions"> <a href="<?php echo $site['url']; ?> join.php"><?php echo _t('_Join Now Top'); ?> </a> <a href="<?php echo $site['url']; ?> member.php" onclick="showItemEditForm('login_div'); $( '#login_div' ).show().load( '<?php echo $site['url']; ?> member.php?action=show_login_form&relocate=' + encodeURIComponent( window.location ) );return false;"><?php echo _t('_Member Login'); ?> </a> </div> </div> <?php } return ob_get_clean(); }
function PageCodeOutbox() { global $memberID; global $dir; global $site; global $tmpl; global $date_format; $query = "\r\n\t\tSELECT\r\n\t\t\t`Messages`.`ID`,\r\n\t\t\tUNIX_TIMESTAMP( `Date` ) AS `timestamp`,\r\n\t\t\tDATE_FORMAT(`Date`, '{$date_format}') AS `Date`,\r\n\t\t\t`Recipient`,\r\n\t\t\t`Profiles`.`NickName` AS `RecipientNickName`,\r\n\t\t\t`Subject`,\r\n\t\t\t`New`\r\n\t\tFROM `Messages`\r\n\t\tLEFT JOIN `Profiles` ON\r\n\t\t\t`Profiles`.`ID` = `Recipient`\r\n\t\tWHERE `Sender` = {$memberID}\r\n\t\tORDER BY `Date` DESC\r\n\t\t"; $rMsgs = db_res($query); if (!mysql_num_rows($rMsgs)) { return '<div class="no_result"><div>' . _t("_No messages in Outbox") . '</div></div>'; } // --- get template and replace headers --- $aReplace = array(); $aReplace['mailbox_header_img'] = '<img src="' . getTemplateIcon('outbox.gif') . '" class="mailbox_header_img" />'; //$aReplace['summary'] = _t( $aReplace['flag'] = _t('_Flag'); $aReplace['from'] = _t('_Recipient'); $aReplace['date'] = _t('_Date'); $aReplace['subject'] = _t('_Subject'); $aReplace['click_to_sort'] = _t('_Click to sort'); $aReplace['actions_l'] = ''; $aReplace['actions'] = ''; $ret = file_get_contents("{$dir['root']}templates/tmpl_{$tmpl}/mail_box.html"); foreach ($aReplace as $key => $val) { $ret = str_replace("__{$key}__", $val, $ret); } $aMyTmpl = preg_split("/\\{\\/?InsertRows\\}/", $ret); $tmplRow = $aMyTmpl[1]; $ret = "{$aMyTmpl[0]}{InsertRows /}{$aMyTmpl[2]}"; $InsertRows = ''; $tr_class = 'odd'; while ($aMsg = mysql_fetch_assoc($rMsgs)) { $sSubject = process_line_output(html2txt($aMsg['Subject'])); $aReplace = array(); $aReplace['tr_class'] = $tr_class; $aReplace['new_add'] = $aMsg['New'] ? 'new' : ''; $aReplace['ID'] = $aMsg['ID']; $aReplace['CheckBox'] = ''; $aReplace['Flag'] = '<img class="mailbox_flag_img" src="' . getTemplateIcon($aMsg['New'] ? 'not_readed.gif' : 'readed.gif') . '" title="' . _t($aMsg['New'] ? '_Not Readed' : '_Readed') . '" />'; $aReplace['From'] = '<center><div style="width:45px;">' . get_member_icon($aMsg['Recipient']) . "<div class=\"clear_both\"></div><!--{$aMsg['RecipientNickName']}--> <a href=\"" . getProfileLink($aMsg['Recipient']) . "\">{$aMsg['RecipientNickName']}</a>" . '</center>'; $aReplace['Date'] = "<!--{$aMsg['timestamp']}--> {$aMsg['Date']}"; $aReplace['Subject'] = "<!--{$sSubject}--> <a href=\"{$site['url']}messages_outbox.php?message={$aMsg['ID']}\">{$sSubject}</a>"; $sInsertRow = $tmplRow; foreach ($aReplace as $key => $val) { $sInsertRow = str_replace("{{$key}}", $val, $sInsertRow); } $sInsertRows .= $sInsertRow; $tr_class = $tr_class == 'odd' ? 'even' : 'odd'; } $ret = str_replace("{InsertRows /}", $sInsertRows, $ret); return $ret; }
function getComments($iReplyTo = 0) { global $site; $iPerPage = 5; //if( $iReplyTo ) $sqlLimit = ''; // navigation will be here very very soon /*else { $this -> comm_page = (int)$_GET['comm_page']; if( $this -> comm_page < 1 ) $this -> comm_page = 1; $sqlLimitFrom = ( $this -> comm_page - 1 ) * $iPerPage; $sqlLimit = "LIMIT $sqlLimitFrom, $iPerPage"; }*/ if ($iReplyTo == 0) { $sOrder = "ASC"; } else { $sOrder = "DESC"; } $sQuery = "\r\n\t\t\tSELECT\r\n\t\t\t\t`ProfilesComments`.`ID`,\r\n\t\t\t\t`ProfilesComments`.`Date`,\r\n\t\t\t\tUNIX_TIMESTAMP(`Date`) AS `UnixDate`,\r\n\t\t\t\t`ProfilesComments`.`IP`,\r\n\t\t\t\t`ProfilesComments`.`Text`,\r\n\t\t\t\t`ProfilesComments`.`New`,\r\n\t\t\t\t`ProfilesComments`.`ReplyTO`,\r\n\t\t\t\t`Profiles`.`ID` AS `senderID`,\r\n\t\t\t\t`Profiles`.`NickName` AS `senderNick`\r\n\t\t\tFROM `ProfilesComments`\r\n\t\t\tLEFT JOIN `Profiles` ON\r\n\t\t\t\t`ProfilesComments`.`Sender` = `Profiles`.`ID`\r\n\t\t\tWHERE\r\n\t\t\t\t`ProfilesComments`.`Recipient` = {$this->_iProfileID} AND\r\n\t\t\t\t`ReplyTO` = {$iReplyTo}\r\n\t\t\tORDER BY `Date` {$sOrder}\r\n\t\t\t{$sqlLimit}\r\n\t\t\t"; $rComments = db_res($sQuery); ob_start(); while ($aComment = mysql_fetch_assoc($rComments)) { ?> <div class="comment_row"> <div class="comment_author"> <?php echo get_member_icon($aComment['senderID']); ?> </div> <div class="comment_view"> <a href="<?php echo getProfileLink($aComment['senderID']); ?> "> <?php echo trim(process_line_output($aComment['senderNick'])); ?> </a> <?php echo '(' . $this->defineTimeInterval($aComment['UnixDate']) . ')'; ?> <?php if ($this->owner && $aComment['New']) { ?> <span class="commentNew"><?php echo _t("_new"); ?> </span> <?php db_res("UPDATE `ProfilesComments` SET `New` = '0' WHERE `ID` = {$aComment['ID']}"); } ?> </div> <div class="comment_text"> <?php echo process_smiles($aComment['Text']); ?> </div> <?php echo $this->getCommentActions($aComment['ID']); ?> </div> <?php echo $this->getAddCommentForm($aComment['ID']); if ($answers = $this->getComments($aComment['ID'])) { ?> <div id="replies_to_<?php echo $aComment['ID']; ?> " class="comment_replies"> <?php echo $answers; ?> </div> <?php } } return ob_get_clean(); }
function PageCompListMembers($list, $table, $sqlWho, $sqlWhom, $sqlSelectAdd = '', $sqlWhereAdd = '', $sqlOrderAdd = '') { global $memberID; global $site; global $dir; global $tmpl; $form = "{$table}_{$list}"; if ($list == '') { $query = "\n\t\t\tSELECT\n\t\t\t\tIF( `{$table}`.`{$sqlWho}` = {$memberID}, `{$table}`.`{$sqlWhom}`, `{$table}`.`{$sqlWho}` ) AS `{$sqlWhom}`,\n\t\t\t\t`Profiles`.`NickName`\n\t\t\t\t{$sqlSelectAdd}\n\t\t\tFROM `{$table}`\n\t\t\tLEFT JOIN `Profiles`\n\t\t\t\tON `Profiles`.`ID` = IF( `{$table}`.`{$sqlWho}` = {$memberID}, `{$table}`.`{$sqlWhom}`, `{$table}`.`{$sqlWho}` )\n\t\t\tWHERE\n\t\t\t\t( `{$table}`.`{$sqlWho}` = {$memberID} OR `{$table}`.`{$sqlWhom}` = {$memberID} )\n\t\t\t\t{$sqlWhereAdd}\n\t\t\tORDER BY {$sqlOrderAdd} `Profiles`.`NickName` ASC\n\t\t"; } else { $query = "\n\t\t\tSELECT\n\t\t\t\t`{$table}`.`{$sqlWho}`,\n\t\t\t\t`{$table}`.`{$sqlWhom}`,\n\t\t\t\t`Profiles`.`NickName`\n\t\t\t\t{$sqlSelectAdd}\n\t\t\tFROM `{$table}`\n\t\t\tLEFT JOIN `Profiles`\n\t\t\t\tON `Profiles`.`ID` = `{$table}`.`{$sqlWhom}`\n\t\t\tWHERE\n\t\t\t\t`{$table}`.`{$sqlWho}` = {$memberID}\n\t\t\t\t{$sqlWhereAdd}\n\t\t\tORDER BY {$sqlOrderAdd} `Profiles`.`NickName` ASC\n\t\t"; } $rMembers = db_res($query); if ($num_res = mysql_num_rows($rMembers)) { $sWhole = file_get_contents("{$dir['root']}templates/tmpl_{$tmpl}/contacts_tmpl.html"); $aMyTmpl = preg_split("/\\{\\/?InsertRows\\}/", $sWhole); $tmplRow = $aMyTmpl[1]; $sWhole = "{$aMyTmpl[0]}{InsertRows /}{$aMyTmpl[2]}"; $InsertRows = ''; $tr_class = 'odd'; while ($aMember = mysql_fetch_assoc($rMembers)) { $aReplace = array(); $aReplace['ID'] = $aMember[$sqlWhom]; $aReplace['CheckBoxName'] = "mem[{$aMember[$sqlWhom]}]"; if ($aMember[$sqlWhom] > 0) { $aReplace['Thumbnail'] = get_member_icon($aMember[$sqlWhom], 'left'); $aReplace['NickName'] = "<a href=\"" . getProfileLink($aMember[$sqlWhom]) . "\">{$aMember['NickName']}</a>"; $aReplace['SendGreet'] = sendKissPopUp($aMember[$sqlWhom]); $aReplace['SendMsg'] = "\n\t\t\t\t <a href=\"{$site['url']}compose.php?ID={$aMember[$sqlWhom]}\" title=\"" . _t('_Send Message') . "\">\n\t\t\t\t\t<img src=\"" . getTemplateIcon('compose.png') . "\" alt=\"" . _t('_Send Message') . "\" />\n\t\t\t\t </a>"; } else { $aReplace['Thumbnail'] = ''; $aReplace['NickName'] = _t('_Visitor'); $aReplace['SendGreet'] = ''; $aReplace['SendMsg'] = ''; } $aReplace['Times'] = $aMember['Number'] ? _t("_N times", $aMember['Number']) : ' '; $aReplace['PicNew'] = $aMember['New'] ? '<img src="' . getTemplateIcon('new.gif') . '" class="pic_new" />' : ''; $aReplace['Date'] = $aMember['Arrived'] ? $aMember['Arrived'] : ' '; $aReplace['tr_class'] = $tr_class; $sInsertRow = $tmplRow; foreach ($aReplace as $key => $val) { $sInsertRow = str_replace("{{$key}}", $val, $sInsertRow); } $sInsertRows .= $sInsertRow; $tr_class = $tr_class == 'odd' ? 'even' : 'odd'; } $aReplace = array(); $aReplace['InsertRows /'] = $sInsertRows; $aReplace['Self'] = $_SERVER['PHP_SELF'] . '?show=' . $_GET['show'] . '&list=' . $_GET['list']; $aReplace['FormName'] = "{$form}_form"; $aReplace['CheckAll'] = _t('_Check all'); $aReplace['UncheckAll'] = _t('_Uncheck all'); $aReplace['Actions'] = getButtons($form); foreach ($aReplace as $key => $val) { $sWhole = str_replace("{{$key}}", $val, $sWhole); } // unset "new" flag for kisses if ($table == 'VKisses' and $list == 'me') { db_res("UPDATE `VKisses` SET `New`='0' WHERE `Member`={$memberID} AND `New`='1'"); } } else { $sWhole = file_get_contents("{$dir['root']}templates/tmpl_{$tmpl}/contacts_tmpl_nores.html"); $aReplace = array(); $aReplace['NoResults'] = _t('_No members found here'); foreach ($aReplace as $key => $val) { $sWhole = str_replace("{{$key}}", $val, $sWhole); } } $sWhole = str_replace('{TableCaption}', getTableName($form, $num_res), $sWhole); return $sWhole; }
/** * Common public methods. * Is used to display events on the Wall. */ function getSystem($aEvent, $sDisplayType = BX_WALL_VIEW_TIMELINE) { $sResult = ""; $sHandler = $aEvent['type'] . '_' . $aEvent['action']; if (!$this->_oConfig->isHandler($sHandler)) { return ''; } $aHandler = $this->_oConfig->getHandlers($sHandler); if (empty($aHandler['module_uri']) && empty($aHandler['module_class']) && empty($aHandler['module_method'])) { $sMethod = 'display' . str_replace(' ', '', ucwords(str_replace('_', ' ', $aHandler['alert_unit'] . '_' . $aHandler['alert_action']))); if (!method_exists($this, $sMethod)) { return ''; } $aResult = $this->{$sMethod}($aEvent, $sDisplayType); } else { $aEvent['js_mode'] = $this->_oConfig->getJsMode(); $sMethod = $aHandler['module_method'] . ($sDisplayType == BX_WALL_VIEW_OUTLINE ? '_' . BX_WALL_VIEW_OUTLINE : ''); $aResult = BxDolService::call($aHandler['module_uri'], $sMethod, array($aEvent), $aHandler['module_class']); if (isset($aResult['save'])) { $this->_oDb->updateEvent($aResult['save'], $aEvent['id']); } } $bResult = !empty($aResult); if ($bResult && isset($aResult['perform_delete']) && $aResult['perform_delete'] == true) { $this->_oDb->deleteEvent(array('id' => $aEvent['id'])); return ''; } else { if (!$bResult || $bResult && empty($aResult['content'])) { return ''; } } $sIcon = $sComments = ""; switch ($sDisplayType) { case BX_WALL_VIEW_TIMELINE: $sIcon = get_member_thumbnail($aEvent['owner_id'], 'none'); if (empty($aEvent['title']) && !empty($aResult['title']) || empty($aEvent['description']) && !empty($aResult['description'])) { $this->_oDb->updateEvent(array('title' => process_db_input($aResult['title'], BX_TAGS_STRIP), 'description' => process_db_input($aResult['description'], BX_TAGS_STRIP)), $aEvent['id']); } if (!in_array($aEvent['type'], array('profile', 'friend')) && $aEvent['action'] != 'commentPost') { $sType = $aEvent['type']; $iObjectId = $aEvent['object_id']; if (strpos($iObjectId, ',') !== false) { $sType = isset($aResult['grouped']['group_cmts_name']) ? $aResult['grouped']['group_cmts_name'] : ''; $iObjectId = isset($aResult['grouped']['group_id']) ? (int) $aResult['grouped']['group_id'] : 0; } $oComments = new BxWallCmts($sType, $iObjectId); if ($oComments->isEnabled()) { $sComments = $oComments->getCommentsFirstSystem('comment', $aEvent['id']); } else { $sComments = $this->getDefaultComments($aEvent['id']); } } else { $sComments = $this->getDefaultComments($aEvent['id']); } break; case BX_WALL_VIEW_OUTLINE: $sIcon = get_member_icon($aEvent['owner_id'], 'none'); break; } return $this->parseHtmlByContent($aResult['content'], array('post_id' => $aEvent['id'], 'post_owner_icon' => $sIcon, 'comments_content' => $sComments)); }
/** * Function will generate received rows ; * * @return : Html presentation data ; */ function getProcessingRows() { global $oSysTemplate, $site, $oFunctions; // ** init some needed variables ; $sOutputHtml = ''; $sPageContent = ''; $sActionsList = ''; $sSettings = ''; $sShowSettings = true; $aRows = array(); // define the member's nickname; $sMemberNickName = getNickName($this->aCommunicatorSettings['member_id']); // all primary language's keys ; $aLanguageKeys = array('author' => _t('_Author'), 'type' => _t('_Type'), 'date' => _t('_Date'), 'click_sort' => _t('_Click to sort'), 'from_me' => _t('_From') . ' ' . $sMemberNickName, 'to_me' => _t('_To') . ' ' . $sMemberNickName, 'accept' => _t('_Add to Friend List'), 'reject' => _t('_Reject Invite'), 'delete' => _t('_Delete'), 'back_invite' => _t('_Back Invite'), 'hotlist_add' => _t('_Add to Hot List'), 'visitor' => _t('_Visitor'), 'unblock' => _t('_Unblock'), 'block' => _t('_Block')); // get all requests from DB ; switch ($this->aCommunicatorSettings['communicator_mode']) { case 'friends_requests': $aTypes = array('from' => _t('_MEMBERS_INVITE_YOU_FRIENDLIST'), 'to' => _t('_MEMBERS_YOU_INVITED_FRIENDLIST')); $aRows = $this->getRequests('sys_friend_list', $aTypes, ' AND `sys_friend_list`.`Check` = 0 '); break; case 'hotlist_requests': $aTypes = array('from' => _t('_MEMBERS_YOU_HOTLISTED'), 'to' => _t('_MEMBERS_YOU_HOTLISTED_BY')); $aRows = $this->getRequests('sys_fave_list', $aTypes); break; case 'greeting_requests': $aTypes = array('from' => _t('_MEMBERS_YOU_KISSED'), 'to' => _t('_MEMBERS_YOU_KISSED_BY'), 'specific_key' => '_N times'); $aRows = $this->getRequests('sys_greetings', $aTypes, null, 'Number'); break; case 'blocks_requests': $aTypes = array('from' => _t('_MEMBERS_YOU_BLOCKLISTED'), 'to' => _t('_MEMBERS_YOU_BLOCKLISTED_BY')); $aRows = $this->getRequests('sys_block_list', $aTypes); break; case 'friends_list': $aTypes = array('from' => _t('_Friend list'), 'to' => _t('_Friend list')); $aRows = $this->getRequests('sys_friend_list', $aTypes, ' AND `sys_friend_list`.`Check` = 1 OR ( `sys_friend_list`.`ID` = ' . $this->aCommunicatorSettings['member_id'] . ' AND `sys_friend_list`.`Check` = 1 )'); // set unvisible the settings block ; $sShowSettings = false; break; default: $aTypes = array('from' => _t('_MEMBERS_INVITE_YOU_FRIENDLIST'), 'to' => _t('_MEMBERS_YOU_INVITED_FRIENDLIST')); $aRows = $this->getRequests('sys_friend_list', $aTypes, ' AND `sys_friend_list`.`Check` = 0 '); } // ** Generate the page's pagination ; // fill array with all necessary `get` parameters ; $aNeededParameters = array('communicator_mode', 'person_switcher', 'sorting'); // collect the page's URL ; $sRequest = BX_DOL_URL_ROOT . 'communicator.php?action=get_page'; // add additional parameters ; foreach ($aNeededParameters as $sKey) { $sRequest .= (array_key_exists($sKey, $this->aCommunicatorSettings) and $this->aCommunicatorSettings[$sKey]) ? '&' . $sKey . '=' . $this->aCommunicatorSettings[$sKey] : null; } $sCuttedUrl = $sRequest; $sRequest .= '&page={page}&per_page={per_page}'; // create the pagination object ; $oPaginate = new BxDolPaginate(array('page_url' => $sRequest, 'count' => $this->iTotalRequestsCount, 'per_page' => $this->aCommunicatorSettings['per_page'], 'sorting' => $this->aCommunicatorSettings['sorting'], 'page' => $this->aCommunicatorSettings['page'], 'per_page_changer' => false, 'page_reloader' => true, 'on_change_page' => "if ( typeof oCommunicatorPage != 'undefined' ) oCommunicatorPage.getPaginatePage('{$sRequest}')", 'on_change_per_page' => "if ( typeof oCommunicatorPage != 'undefined' ) oCommunicatorPage.getPage(this.value, '{$sCuttedUrl}')")); $sPagination = $oPaginate->getPaginate(); $sPerPageBlock = $oPaginate->getPages(); // process received requests; if ($aRows) { $iIndex = 1; foreach ($aRows as $iKey => $aItems) { // if member not a visitor ; if ($aItems['member_id']) { // ** some member's information ; $aProfileInfo = getProfileInfo($aItems['member_id']); // member's Icon ; $sMemberIcon = get_member_icon($aProfileInfo['ID'], 'left'); // member's profile location ; $sMemberLocation = getProfileLink($aProfileInfo['ID']); // member's nickname ; $sMemberNickName = $aProfileInfo['NickName']; // define the member's age ; $sMemberAge = $aProfileInfo['DateOfBirth'] != "0000-00-00" ? _t("_y/o", age($aProfileInfo['DateOfBirth'])) : null; // define the member's country, sex, etc ... ; $sMemberCountry = $aProfileInfo['Country']; $sMemberFlag = $site['flags'] . strtolower($sMemberCountry) . $this->sMembersFlagExtension; $sMemberSexImg = $oFunctions->genSexIcon($aProfileInfo['Sex']); if ($sMemberCountry) { $sMemberCountryFlag = '<img src="' . $sMemberFlag . '" alt="' . $sMemberCountry . '" />'; } } else { // ** if it's a visitor // member's Icon ; $sMemberIcon = $aLanguageKeys['visitor']; // member's profile location ; $sMemberLocation = null; $sMemberSexImg = null; $sMemberAge = null; $sMemberCountryFlag = null; $sMemberCountry = null; } // color devider ; $sFiledCss = !($iIndex % 2) ? 'filled' : 'not_filled'; $aProcessedRows[] = array('filled_class' => $sFiledCss, 'row_value' => $aItems['member_id'], 'member_icon' => $sMemberIcon, 'member_location' => $sMemberLocation ? '<a href="' . $sMemberLocation . '">' . $sMemberNickName . '</a>' : null, 'member_sex_img' => $sMemberSexImg ? ' <img src="' . $sMemberSexImg . '" alt="' . $aProfileInfo['Sex'] . '" />' : null, 'member_age' => $sMemberAge, 'member_flag' => $sMemberCountryFlag, 'member_country' => $sMemberCountry, 'type' => $aItems['type'], 'message_date' => $aItems['date']); $iIndex++; } // init the sort toggle ellements ; switch ($this->aCommunicatorSettings['sorting']) { case 'date': $aSortToglleElements['date_sort_toggle'] = 'toggle_up'; break; case 'date_desc': $aSortToglleElements['date_sort_toggle'] = 'toggle_down'; break; case 'author': $aSortToglleElements['author_sort_toggle'] = 'toggle_up'; break; case 'author_desc': $aSortToglleElements['author_sort_toggle'] = 'toggle_down'; break; } // define the actions list for type of requests; switch ($this->aCommunicatorSettings['communicator_mode']) { case 'friends_requests': // define the person mode ; switch ($this->aCommunicatorSettings['person_switcher']) { case 'to': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['accept'], 'attrs' => array('onclick' => "if ( typeof oCommunicatorPage != 'undefined' ) oCommunicatorPage.sendAction('communicator_container', 'accept_friends_request', 'getProcessingRows')")), 1 => array('type' => 'button', 'value' => $aLanguageKeys['reject'], 'attrs' => array('onclick' => "if ( typeof oCommunicatorPage != 'undefined' ) oCommunicatorPage.sendAction('communicator_container', 'reject_friends_request', 'getProcessingRows')"))))); $oForm = new BxTemplFormView($aForm); $sActionsList = $oForm->getCode(); break; case 'from': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['back_invite'], 'attrs' => array('onclick' => "if ( typeof oCommunicatorPage != 'undefined' ) oCommunicatorPage.sendAction('communicator_container', 'delete_friends_request', 'getProcessingRows')"))))); $oForm = new BxTemplFormView($aForm); $sActionsList = $oForm->getCode(); break; } break; case 'hotlist_requests': // define the person mode ; switch ($this->aCommunicatorSettings['person_switcher']) { case 'to': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['hotlist_add'], 'attrs' => array('onclick' => "if ( typeof oCommunicatorPage != 'undefined' ) oCommunicatorPage.sendAction('communicator_container', 'add_hotlist', 'getProcessingRows')"))))); $oForm = new BxTemplFormView($aForm); $sActionsList = $oForm->getCode(); break; case 'from': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['delete'], 'attrs' => array('onclick' => "if ( typeof oCommunicatorPage != 'undefined' ) oCommunicatorPage.sendAction('communicator_container', 'delete_hotlisted', 'getProcessingRows')"))))); $oForm = new BxTemplFormView($aForm); $sActionsList = $oForm->getCode(); break; } break; case 'greeting_requests': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['delete'], 'attrs' => array('onclick' => "if ( typeof oCommunicatorPage != 'undefined' ) oCommunicatorPage.sendAction('communicator_container', 'delete_greetings', 'getProcessingRows')"))))); $oForm = new BxTemplFormView($aForm); $sActionsList = $oForm->getCode(); break; case 'blocks_requests': // define the person mode ; switch ($this->aCommunicatorSettings['person_switcher']) { case 'to': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['block'], 'attrs' => array('onclick' => "if ( typeof oCommunicatorPage != 'undefined' ) oCommunicatorPage.sendAction('communicator_container', 'block_unblocked', 'getProcessingRows')"))))); $oForm = new BxTemplFormView($aForm); $sActionsList = $oForm->getCode(); break; case 'from': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['unblock'], 'attrs' => array('onclick' => "if ( typeof oCommunicatorPage != 'undefined' ) oCommunicatorPage.sendAction('communicator_container', 'unblock_blocked', 'getProcessingRows')"))))); $oForm = new BxTemplFormView($aForm); $sActionsList = $oForm->getCode(); break; } break; case 'friends_list': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['delete'], 'attrs' => array('onclick' => "if ( typeof oCommunicatorPage != 'undefined' ) oCommunicatorPage.sendAction('communicator_container', 'reject_friends_request', 'getProcessingRows')"))))); $oForm = new BxTemplFormView($aForm); $sActionsList = $oForm->getCode(); break; } // processing the sort link ; $sSortLink = getClearedParam('sorting', $sCuttedUrl) . '&page=' . $this->aCommunicatorSettings['page'] . '&per_page=' . $this->aCommunicatorSettings['per_page']; // fill array with template keys ; $aTemplateKeys = array('from_me' => $aLanguageKeys['from_me'], 'to_me' => $aLanguageKeys['to_me'], 'selected_from' => $this->aCommunicatorSettings['person_switcher'] == 'from' ? 'checked="checked"' : null, 'selected_to' => $this->aCommunicatorSettings['person_switcher'] == 'to' ? 'checked="checked"' : null, 'per_page_block' => $sPerPageBlock, 'page_sort_url' => $sSortLink, 'sort_date' => $this->aCommunicatorSettings['sorting'] == 'date' ? 'date_desc' : 'date', 'sort_author' => $this->aCommunicatorSettings['sorting'] == 'author' ? 'author_desc' : 'author', 'date_sort_toggle_ellement' => $aSortToglleElements['date_sort_toggle'], 'author_sort_toggle_ellement' => $aSortToglleElements['author_sort_toggle'], 'author' => $aLanguageKeys['author'], 'type' => $aLanguageKeys['type'], 'date' => $aLanguageKeys['date'], 'click_sort' => $aLanguageKeys['click_sort'], 'bx_repeat:rows' => $aProcessedRows, 'actions_list' => $sActionsList, 'page_pagination' => $sPagination); $sPageContent = $oSysTemplate->parseHtmlByName($this->aUsedTemplates['communicator_page'], $aTemplateKeys); } else { $sPageContent = MsgBox(_t('_Empty')); } // ** Process the final template ; if ($sShowSettings) { // generate the page settings ; $aTemplateKeys = array('from_me' => $aLanguageKeys['from_me'], 'to_me' => $aLanguageKeys['to_me'], 'selected_from' => $this->aCommunicatorSettings['person_switcher'] == 'from' ? 'checked="checked"' : null, 'selected_to' => $this->aCommunicatorSettings['person_switcher'] == 'to' ? 'checked="checked"' : null); $sSettings = $oSysTemplate->parseHtmlByName($this->aUsedTemplates['communicator_settings'], $aTemplateKeys); } // fill array with template keys ; $aTemplateKeys = array('current_page' => 'communicator.php', 'communicator_mode' => $this->aCommunicatorSettings['communicator_mode'], 'communicator_person_mode' => $this->aCommunicatorSettings['person_switcher'], 'error_message' => bx_js_string(_t('_Please, select at least one message')), 'sure_message' => bx_js_string(_t('_Are you sure?')), 'settings' => $sSettings, 'per_page_block' => $sPerPageBlock, 'page_content' => $sPageContent); // construct the final template ; $sOutputHtml = $oSysTemplate->parseHtmlByName($this->aUsedTemplates['communicator_settings_page'], $aTemplateKeys); return $sOutputHtml; }
function PageCompFileInfo() { global $site; global $aFile; if ($aFile['medCount'] - 1 > 0) { $sLinkMore = '<a href="browseVideo.php?userID=' . $aFile['medProfId'] . '">' . $aFile['medCount'] . '</a>'; } else { $sLinkMore = $aFile['medCount']; } $sTitle = strlen($aFile['medTitle']) > 0 ? $aFile['medTitle'] : _t("_Untitled"); $sCode .= '<div id="videoInfo">'; $sCode .= '<div id="fileTop">'; $sCode .= '<div class="fileTitle">' . $sTitle . '</div>'; $sCode .= '<div class="userPic">' . get_member_icon($aFile['medProfId'], 'left') . '</div>'; $sCode .= '<div class="fileUserInfo"><a href="' . getProfileLink($aFile['medProfId']) . '">' . $aFile['NickName'] . '</a></div>'; $sCode .= '<div>' . _t("_Videos") . ': <b>' . $sLinkMore . '</b></div>'; $sCode .= '</div>'; $sCode .= '<div class="clear_both"></div>'; $sCode .= '<div id="serviceInfo">'; $sCode .= '<div>' . _t("_Added") . ': <b>' . defineTimeInterval($aFile['medDate']) . '</b></div>'; $sCode .= '<div>' . _t("_Views") . ': ' . $aFile['medViews'] . '</div>'; $sCode .= '<div>' . _t("_URL") . ': <input type="text" onClick="this.focus(); this.select();" readonly="true" value="' . $site['url'] . 'viewVideo.php?fileID=' . $aFile['medID'] . '"/></div>'; $sCode .= '<div>' . _t("_Embed") . ' : <input type="text" onClick="this.focus(); this.select();" readonly="true" value="' . htmlspecialchars(getEmbedCode('movie', 'player', array('file' => $aFile['medID']))) . '"></div>'; $sCode .= '<div>' . _t("_Tags") . ': ' . getTagLinks($aFile['medTags'], 'Video') . '</div>'; $sCode .= '<div>' . _t("_DescriptionMedia") . ': ' . $aFile['medDesc'] . '</div>'; $sCode .= '</div>'; $sCode .= '</div>'; return $sCode; }
/** * Function will generate the messages rows ; * * @return : Html presentation data ; */ function genMessagesRows() { global $oSysTemplate; global $oFunctions; global $site; // init some needed variables ; $sOutputHtml = null; $sMessageBoxActions = null; $sMessagesTypesList = null; $sPerPageBlock = null; $aSortToglleElements = array('date_sort_toggle', 'subject_sort_toggle', 'type_sort_toggle', 'author_sort_toggle'); $aMessageRows = array(); // language keys ; $aLanguageKeys = array('author' => _t('_Author'), 'type' => _t('_Type'), 'subject' => _t('_Subject'), 'date' => _t('_Date'), 'new' => _t('_new'), 'select' => _t('_Select'), 'all' => _t('_All'), 'none' => _t('_None'), 'read' => _t('_Read'), 'unread' => _t('_Unread'), 'delete' => _t('_Delete'), 'spam' => _t('_Spam report'), 'more' => _t('_More actions'), 'mark_read' => _t('_Mark as old'), 'mark_unread' => _t('_Mark as New'), 'restore' => _t('_Restore'), 'click_sort' => _t('_Click to sort'), 'recipient' => _t('_Recipient')); // get messages array ; $aMessages =& $this->getMessages(); // generate list of messages types if (is_array($this->aRegisteredMessageTypes) and !empty($this->aRegisteredMessageTypes)) { foreach ($this->aRegisteredMessageTypes as $iKey => $sRegisteredType) { $sChecked = null; if (!empty($this->aReceivedMessagesTypes) and in_array($sRegisteredType, $this->aReceivedMessagesTypes)) { $sChecked = ' checked="checked" '; } $aTemplateKeys = array('letters_type' => $sRegisteredType, 'letters_type_caption' => _t('_' . $sRegisteredType), 'checked' => $sChecked); $sMessagesTypesList .= $oSysTemplate->parseHtmlByName($this->aUsedTemplates['messages_types_list'], $aTemplateKeys); } unset($aTemplateKeys); } // processing all messages ; if (is_array($aMessages) and !empty($aMessages)) { // need for row devide ; $iIndex = 1; foreach ($aMessages as $iKey => $aItems) { // generate image and keyword for type of message ; $sTypeIcon = getTemplateIcon($this->sMessageIconPrefix . $aItems['Type'] . $this->sMessageIconExtension); $sTypeLang = _t('_' . $aItems['Type']); // get message's subject ; $sSubject = mb_strlen($aItems['Subject']) > $this->iMessageSubjectLength ? mb_substr($aItems['Subject'], 0, $this->iMessageSubjectLength) . '...' : $aItems['Subject']; // get message's description ; $sDescription = strip_tags($aItems['Text']); mb_strlen($sDescription) > $this->iMessageDescrLength ? $sDescription = mb_substr($sDescription, 0, $this->iMessageDescrLength) . '...' : null; // generate the `new` message's icon ; $sNewMessageImg = $aItems['New'] ? getTemplateIcon('new_message.png') : getTemplateIcon(null); // color devider ; $sFiledCss = !($iIndex % 2) ? 'filled' : 'not_filled'; $aProfileInfo = $this->aMailBoxSettings['mailbox_mode'] != 'outbox' ? getProfileInfo($aItems['Sender']) : getProfileInfo($aItems['Recipient']); $sMemberIcon = $this->aMailBoxSettings['mailbox_mode'] != 'outbox' ? get_member_icon($aItems['Sender'], 'left') : get_member_icon($aItems['Recipient'], 'left'); $sMemberLocation = $this->aMailBoxSettings['mailbox_mode'] != 'outbox' ? getProfileLink($aItems['Sender']) : getProfileLink($aItems['Recipient']); $sMemberNickName = $aProfileInfo['NickName']; $sMemberAge = $aProfileInfo['DateOfBirth'] != "0000-00-00" ? _t("_y/o", age($aProfileInfo['DateOfBirth'])) : null; $sMemberCountry = $aProfileInfo['Country']; $sMemberFlag = $site['flags'] . strtolower($sMemberCountry) . $this->sMembersFlagExtension; $sMemberSexImg = $oFunctions->genSexIcon($aProfileInfo['Sex']); if ($sMemberCountry) { $sMemberCountryFlag = '<img src="' . $sMemberFlag . '" alt="' . $sMemberCountry . '" />'; } // generate the message status ; $sMessageStatus = $aItems['New'] ? 'unread' : 'read'; $aMessageRows[] = array('message_id' => $aItems['ID'], 'message_status' => $sMessageStatus, 'message_owner' => $aItems['Sender'], 'message_link' => $aItems['ID'], 'message_page' => 'mail.php', 'member_icon' => $sMemberIcon, 'member_location' => $sMemberLocation, 'member_nickname' => $sMemberNickName, 'member_sex_img' => $sMemberSexImg, 'member_sex' => $aProfileInfo['Sex'], 'member_age' => $sMemberAge, 'member_flag' => $sMemberCountryFlag, 'member_country' => $sMemberCountry, 'message_type' => $sTypeLang, 'message_type_icon' => $sTypeIcon, 'message_subject' => $sSubject, 'message_new_img' => $sNewMessageImg, 'message_new' => $aLanguageKeys['new'], 'message_descr' => $sDescription, 'message_date' => $aItems['Date'], 'filled_class' => $sFiledCss); $iIndex++; } } // init sort toggle ellements ; switch ($this->aMailBoxSettings['sort_mode']) { case 'date': $aSortToglleElements['date_sort_toggle'] = 'toggle_up'; break; case 'date_desc': $aSortToglleElements['date_sort_toggle'] = 'toggle_down'; break; case 'subject': $aSortToglleElements['subject_sort_toggle'] = 'toggle_up'; break; case 'subject_desc': $aSortToglleElements['subject_sort_toggle'] = 'toggle_down'; break; case 'type': $aSortToglleElements['type_sort_toggle'] = 'toggle_up'; break; case 'type_desc': $aSortToglleElements['type_sort_toggle'] = 'toggle_down'; break; case 'author': $aSortToglleElements['author_sort_toggle'] = 'toggle_up'; break; case 'author_desc': $aSortToglleElements['author_sort_toggle'] = 'toggle_down'; break; } // generate the pagination ; $sRequest = BX_DOL_URL_ROOT . 'mail.php?'; // need for additional parameters ; $aGetParams = array('mode', 'sorting', 'messages_types'); if (is_array($aGetParams) and !empty($aGetParams)) { foreach ($aGetParams as $sValue) { if (isset($_GET[$sValue])) { $sRequest .= '&' . $sValue . '=' . $_GET[$sValue]; } } } $sCuttedUrl = $sRequest; $sRequest = $sRequest . '&page={page}&per_page={per_page}'; $oPaginate = new BxDolPaginate(array('page_url' => $sRequest, 'count' => $this->iTotalMessageCount, 'per_page' => $this->aMailBoxSettings['per_page'], 'sorting' => $this->aMailBoxSettings['sort_mode'], 'page' => $this->aMailBoxSettings['page'], 'per_page_changer' => false, 'page_reloader' => true, 'on_change_page' => "oMailBoxMessages.getPaginatePage('{$sRequest}')", 'on_change_per_page' => "oMailBoxMessages.getPage(this.value, '{$sCuttedUrl}')")); $sPagination = $oPaginate->getPaginate(); // generate messages section if (!empty($aMessageRows)) { $aTemplateKeys = array('per_page' => $this->aMailBoxSettings['per_page'], 'page_number' => $this->aMailBoxSettings['page'], 'page_mode' => $this->aMailBoxSettings['mailbox_mode'], 'messages_types' => $this->aMailBoxSettings['messages_types'], 'messages_types_list' => $sMessagesTypesList, 'per_page_block' => $oPaginate->getPages(), 'author' => $this->aMailBoxSettings['mailbox_mode'] != 'outbox' ? $aLanguageKeys['author'] : $aLanguageKeys['recipient'], 'type' => $aLanguageKeys['type'], 'subject' => $aLanguageKeys['subject'], 'date' => $aLanguageKeys['date'], 'click_sort' => $aLanguageKeys['click_sort'], 'bx_repeat:messages' => $aMessageRows, 'sort_date' => $this->aMailBoxSettings['sort_mode'] == 'date' ? 'date_desc' : 'date', 'sort_subject' => $this->aMailBoxSettings['sort_mode'] == 'subject' ? 'subject_desc' : 'subject', 'sort_type' => $this->aMailBoxSettings['sort_mode'] == 'type' ? 'type_desc' : 'type', 'sort_author' => $this->aMailBoxSettings['sort_mode'] == 'author' ? 'author_desc' : 'author', 'date_sort_toggle_ellement' => $aSortToglleElements['date_sort_toggle'], 'subject_sort_toggle_ellement' => $aSortToglleElements['subject_sort_toggle'], 'type_sort_toggle_ellement' => $aSortToglleElements['type_sort_toggle'], 'author_sort_toggle_ellement' => $aSortToglleElements['author_sort_toggle'], 'select' => $aLanguageKeys['select'], 'current_page' => 'mail.php', 'all_messages' => $aLanguageKeys['all'], 'none_messages' => $aLanguageKeys['none'], 'read_messages' => $aLanguageKeys['read'], 'unread_messages' => $aLanguageKeys['unread'], 'pagination_block' => $sPagination); // generate extended mailbox actions switch ($this->aMailBoxSettings['mailbox_mode']) { case 'inbox': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['spam'], 'attrs' => array('onclick' => 'if (typeof oMailBoxMessages != \'undefined\') oMailBoxMessages.spamMessages(\'messages_container\')')), 1 => array('type' => 'button', 'value' => $aLanguageKeys['delete'], 'attrs' => array('onclick' => 'if ( typeof oMailBoxMessages != \'undefined\' ) oMailBoxMessages.deleteMessages(\'messages_container\', \'genMessagesRows\')')), 2 => array('type' => 'select', 'values' => array('' => $aLanguageKeys['more'], 'unread' => $aLanguageKeys['mark_unread'], 'read' => $aLanguageKeys['mark_read']), 'attrs' => array('onchange' => 'if ( typeof oMailBoxMessages != \'undefined\' ) oMailBoxMessages.markMessages(this.value, \'genMessagesRows\')'))))); $oForm = new BxTemplFormView($aForm); $sMessageBoxActions = $oForm->getCode(); break; case 'outbox': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['delete'], 'attrs' => array('onclick' => 'if ( typeof oMailBoxMessages != \'undefined\' ) oMailBoxMessages.deleteMessages(\'messages_container\', \'genMessagesRows\')'))))); $oForm = new BxTemplFormView($aForm); $sMessageBoxActions = $oForm->getCode(); break; case 'trash': $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['restore'], 'attrs' => array('onclick' => 'if ( typeof oMailBoxMessages != \'undefined\' ) oMailBoxMessages.restoreMessages(\'messages_container\', \'genMessagesRows\')')), 1 => array('type' => 'button', 'value' => $aLanguageKeys['delete'], 'attrs' => array('onclick' => 'if ( typeof oMailBoxMessages != \'undefined\' ) oMailBoxMessages.hideDeletedMessages(\'messages_container\', \'genMessagesRows\')'))))); $oForm = new BxTemplFormView($aForm); $sMessageBoxActions = $oForm->getCode(); break; } $aTemplateKeys['messages_actions_block'] = $sMessageBoxActions; //return builded rows ; $sMessagesSection = $oSysTemplate->parseHtmlByName($this->aUsedTemplates['messages_box'], $aTemplateKeys); $sPerPageBlock = $oPaginate->getPages(); } else { $sMessagesSection = MsgBox(_t('_Empty')); } // generate mailboxe's top section ; $aTemplateKeys = array('per_page' => $this->aMailBoxSettings['per_page'], 'page_number' => $this->aMailBoxSettings['page'], 'page_mode' => $this->aMailBoxSettings['mailbox_mode'], 'messages_types' => $this->aMailBoxSettings['messages_types'], 'messages_sort' => $this->aMailBoxSettings['sort_mode'], 'messages_section' => $sMessagesSection, 'messages_types_list' => $sMessagesTypesList, 'per_page_block' => $sPerPageBlock); $sOutputHtml = $oSysTemplate->parseHtmlByName($this->aUsedTemplates['messages_top_section'], $aTemplateKeys); // return all builded data ; return $sOutputHtml; }
function genSubHeader($iTItemID, $iFirstID, $sCaption, $sDisplay, $sPicture = '') { $sLoginSection = $sSubElementCaption = $sProfStatusMessage = $sProfStatusMessageWhen = $sProfileActions = ''; $sCaptionWL = $sProfStatusMessageEl = $sMiddleImg = ''; if ($this->aMenuInfo['currentCustom'] == 0 && $iFirstID > 0) { $this->aMenuInfo['currentCustom'] = $iFirstID; } //comment need when take header for profile page if ($this->sCustomSubHeader == '' && $this->aMenuInfo['currentCustom'] > 0) { $sSubCapIcon = getTemplateIcon('_submenu_capt_right.gif'); $sSubElementCaption = _t($this->aTopMenu[$this->aMenuInfo['currentCustom']]['Caption']); $sCustomPic = $this->aTopMenu[$this->aMenuInfo['currentCustom']]['Picture']; $sPicture = $sCustomPic != '' ? $sCustomPic : $sPicture; $sMiddleImg = '<img src="' . $sSubCapIcon . '" />'; $sSubElementCaption = <<<EOF <font style="font-weight:normal;">{$sSubElementCaption}</font> EOF; } if (!isMember()) { $sLoginSection = $GLOBALS['oSysTemplate']->ParseHtmlByName('login_join.html', array()); } /////Picture//////// if ($this->sCustomSubHeader == '' && !empty($this->aMenuInfo['profileID'])) { $sPictureEl = get_member_icon($this->aMenuInfo['profileID'], 'left'); $sSubCapIcon = getTemplateIcon('_submenu_capt_right.gif'); $aProfInfo = getProfileInfo($this->aMenuInfo['profileID']); $sProfStatusMessage = process_line_output($aProfInfo['UserStatusMessage']); $sRealWhen = $aProfInfo['UserStatusMessageWhen'] != 0 ? $aProfInfo['UserStatusMessageWhen'] : time(); $sProfStatusMessageWhen = defineTimeInterval($sRealWhen); if ($this->aMenuInfo['memberID'] == $this->aMenuInfo['profileID']) { $aTmplVars = array('bx_if:show_script' => array('condition' => true, 'content' => array()), 'bx_if:show_when' => array('condition' => false && $sProfStatusMessage != '', 'content' => array('when' => $sProfStatusMessageWhen)), 'bx_if:show_update' => array('condition' => true, 'content' => array()), 'message' => $sProfStatusMessage != '' ? $sProfStatusMessage : _t('_sys_status_default')); $sProfStatusMessage = $GLOBALS['oSysTemplate']->parseHtmlByName('navigation_menu_status.html', $aTmplVars); } else { if ($sProfStatusMessage != '') { $aTmplVars = array('bx_if:show_script' => array('condition' => false, 'content' => array()), 'bx_if:show_when' => array('condition' => false && $sProfStatusMessage != '', 'content' => array('when' => $sProfStatusMessageWhen)), 'bx_if:show_update' => array('condition' => false, 'content' => array()), 'message' => $sProfStatusMessage); $sProfStatusMessage = $GLOBALS['oSysTemplate']->parseHtmlByName('navigation_menu_status.html', $aTmplVars); $sProfileActions = $this->getProfileActions($aProfInfo, $this->aMenuInfo['memberID']); } } } else { $sPictureEl = ''; if (!empty($sPicture) && false === strpos($sPicture, '.')) { $sPictureEl = '<i class="img_submenu sys-icon ' . $sPicture . '"></i>'; } elseif (!empty($sPicture)) { $sPictureEl = '<img class="img_submenu" src="' . getTemplateIcon($sPicture) . '" alt="" />'; } } if ($this->sCustomSubIconUrl && false === strpos($this->sCustomSubIconUrl, '.')) { $sPictureEl = '<i class="img_submenu sys-icon ' . $this->sCustomSubIconUrl . '"></i>'; } elseif ($this->sCustomSubIconUrl) { $sPictureEl = '<img class="img_submenu" src="' . $this->sCustomSubIconUrl . ' " alt="" />'; } /////Picture end//////// if (true) { // $sSubElementCaption != '') { $aAllSubMainLinks = array(); $sSubMainLinks = ''; if (!empty($this->aTopMenu[$iFirstID]['Link'])) { list($aAllSubMainLinks) = explode('|', $this->aTopMenu[$iFirstID]['Link']); $sSubMainLinks = $this->replaceMetas($aAllSubMainLinks); if (empty($sSubMainLinks)) { //try define the parent menu's item url $sSubMainLinks = $this->sSiteUrl . $this->aTopMenu[$this->aMenuInfo['currentTop']]['Link']; } $sSubMainOnclick = $this->replaceMetas($this->aTopMenu[$iFirstID]['Onclick']); } $sSubMainOnclick = !empty($sSubMainOnclick) ? ' onclick="' . $sSubMainOnclick . '"' : ''; $sCaption = <<<EOF <a href="{$sSubMainLinks}" {$sSubMainOnclick}>{$sCaption}</a> EOF; $sCaptionWL = $sCaption; } if ($this->sCustomSubHeader != '') { $sCaptionWL = $this->sCustomSubHeader; } if ($this->sCustomActions != '') { $sProfileActions = $this->sCustomActions; } $sSubmenu = $this->genSubItems($iTItemID); // array of keys $aTemplateKeys = array('submenu_id' => $iTItemID, 'display_value' => $sDisplay, 'picture' => $sPictureEl, 'caption' => $sCaptionWL, 'bx_if:show_status' => array('condition' => $sProfStatusMessage != '', 'content' => array('status' => $sProfStatusMessage)), 'bx_if:show_submenu' => array('condition' => $sProfStatusMessage == '' && $sSubmenu != '', 'content' => array('submenu' => $sSubmenu)), 'bx_if:show_empty' => array('condition' => $sProfStatusMessage == '' && $sSubmenu == '', 'content' => array('content' => '')), 'bx_if:show_submenu_bottom' => array('condition' => $sProfStatusMessage != '' && $sSubmenu != '', 'content' => array('submenu' => $sSubmenu)), 'login_section' => $sLoginSection, 'profile_actions' => $sProfileActions, 'injection_title_zone' => $sProfileActions); $this->sCode .= $GLOBALS['oSysTemplate']->parseHtmlByName('navigation_menu_sub_header.html', $aTemplateKeys); //--- BreadCrumb ---// $aBreadcrumb = array(); if ($iFirstID > 0 && $sCaption != '') { $aBreadcrumb[] = $sCaption; } if ($sSubElementCaption != '') { $aBreadcrumb[] = $sSubElementCaption; } $this->sBreadCrumb = $this->genBreadcrumb($aBreadcrumb); }
/** * Generate User Right Part for Blogs * * @param $aBlogsRes - Blog Array Data * @param $iView - type of view(1 is short view, 2 is full view, 3 is post view(short)) * @return HTML presentation of data */ function GenMemberDescrAndCat($aBlogsRes, $iCategID = -1) { global $site; $sEditBlogC = _t('_Edit'); $sDeleteBlogC = _t('_Delete'); $sSureC = _t("_Are you sure"); $sApplyChangesC = _t('_Apply Changes'); $sDescriptionC = _t('_Description'); $sCategoriesC = _t('_Categories'); $sCategoryC = _t('_Category'); $sTagsC = _t('_Tags'); $sEditCategoryC = _t('_edit_category'); $sAddCategoryC = _t('_add_category'); $sCommentsC = _t('_Comments'); $sPostsC = _t('_Posts'); $sNewC = ucfirst(_t('_new')); $iMemberID = $aBlogsRes['OwnerID']; $sCont = get_member_icon($aBlogsRes['OwnerID'], 'left'); //tested, right $sCountPostSQL = "\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM `BlogPosts`\n\t\t\tLEFT JOIN `BlogCategories` ON `BlogCategories`.`CategoryID` = `BlogPosts`.`CategoryID`\n\t\t\tWHERE `BlogCategories`.`OwnerId` = {$iMemberID}\n\t\t"; $aCountPost = db_arr($sCountPostSQL); $iCountPost = (int) $aCountPost[0]; //tested, right $sCountCommentsSQL = "\n\t\t\tSELECT COUNT( * ) \n\t\t\tFROM `BlogPostComments` \n\t\t\tLEFT JOIN `BlogPosts` ON `BlogPosts`.`PostID` = `BlogPostComments`.`PostID` \n\t\t\tLEFT JOIN `BlogCategories` ON `BlogCategories`.`CategoryID` = `BlogPosts`.`CategoryID` \n\t\t\tWHERE `BlogCategories`.`OwnerId` = {$iMemberID}\n\t\t"; $aCountComments = db_arr($sCountCommentsSQL); $iCountComments = (int) $aCountComments[0]; $sCategories = ''; $sCategoriesSQL = "\n\t\t\tSELECT * \n\t\t\tFROM `BlogCategories`\n\t\t\tWHERE `OwnerId` = {$iMemberID}\n\t\t"; $vCategories = db_res($sCategoriesSQL); $aTagsPost = array(); $sTagsVals = ''; if ($iCategID > 0) { $sPostsSQL = "SELECT `Tags`,`PostReadPermission`,`BlogCategories`.`OwnerID` FROM `BlogPosts`\n\t\t\t\tLEFT JOIN `BlogCategories` ON `BlogCategories`.`CategoryID` = `BlogPosts`.`CategoryID`\n\t\t\t\tWHERE `BlogCategories`.`CategoryID` = {$iCategID}"; } else { $sPostsSQL = "SELECT `Tags`,`PostReadPermission`,`BlogCategories`.`OwnerID` FROM `BlogPosts`\n\t\t\t\tLEFT JOIN `BlogCategories` ON `BlogCategories`.`CategoryID` = `BlogPosts`.`CategoryID`\n\t\t\t\tWHERE `BlogCategories`.`OwnerID` = {$aBlogsRes['OwnerID']}"; } $vTags = db_res($sPostsSQL); $aTagsPost = array(); while ($aPost = mysql_fetch_assoc($vTags)) { $bFriend = is_friends($this->aBlogConf['visitorID'], $aPost['OwnerID']); $bOwner = $this->aBlogConf['visitorID'] == $aPost['OwnerID'] ? true : false; if ('friends' == $aPost['PostReadPermission'] && !$bFriend && !$bOwner && !$this->bAdminMode) { } else { $sTagsCommas = trim($aPost['Tags']); $aTags = explode(',', $sTagsCommas); foreach ($aTags as $sTagKey) { if ($sTagKey != '') { if (isset($aTagsPost[$sTagKey])) { $aTagsPost[$sTagKey]++; } else { $aTagsPost[$sTagKey] = 1; } } } } } foreach ($aTagsPost as $varKey => $varValue) { $sTagImg = '<img src="' . $site['icons'] . 'tag.png" class="static_icon" alt="' . $varValue . '" /></span>'; $sTagName = '<a class="actions" href="' . $_SERVER['PHP_SELF'] . '?action=search_by_tag&tagKey=' . $varKey . '&ownerID=' . $iMemberID . '" style="text-transform:capitalize;" >' . $varKey . '</a> (' . $varValue . ')'; $sTagsImgName = $this->GenCenteredActionsBlock($sTagImg, $sTagName); $sTagsVals .= <<<EOF <div style="vertical-align:middle;height:25px;margin-bottom:5px;"> \t{$sTagsImgName} </div> EOF; } while ($aCategories = mysql_fetch_assoc($vCategories)) { $sCountPostCatSQL = "\n\t\t\t\tSELECT COUNT(*)\n\t\t\t\tFROM `BlogPosts`\n\t\t\t\tLEFT JOIN `BlogCategories` ON `BlogCategories`.`CategoryID` = `BlogPosts`.`CategoryID`\n\t\t\t\tWHERE `BlogCategories`.`CategoryID` = {$aCategories['CategoryID']}\n\t\t\t"; $aCountCatPost = db_arr($sCountPostCatSQL); $iCountCatPost = (int) $aCountCatPost[0]; $sAbilEditDelCateg = ''; if ($this->aBlogConf['visitorID'] == $aBlogsRes['OwnerID'] || $this->bAdminMode == TRUE) { $sDelAbilOnly = ''; if ($aCategories['CategoryType'] == 1) { $sDelAbilOnly = <<<EOF <a href="{$_SERVER['PHP_SELF']}" onclick="javascript: if (confirm('{$sSureC}')) {UpdateField('DeleteCategoryID','{$aCategories['CategoryID']}');document.forms.command_delete_category.submit(); } return false;"> \t<span style="vertical-align:middle;"><img src="{$site['icons']}categ_delete.png" style="border:0 solid;position:static;" alt="{$sDeleteBlogC} {$sCategoryC}" /></span> </a> EOF; } $sAbilEditDelCateg = <<<EOF <a href="{$_SERVER['PHP_SELF']}?action=edit_category&categoryID={$aCategories['CategoryID']}&ownerID={$iMemberID}" style="text-transform:none;"> \t<span style="vertical-align:middle;"><img src="{$site['icons']}categ_edit.png" style="border:0 solid;position:static;" alt="{$sEditCategoryC}" /></span> </a> EOF; $sAbilEditDelCateg .= $sDelAbilOnly; } $sCatPic = $aCategories['CategoryPhoto'] ? $site['blogImage'] . 'small_' . $aCategories['CategoryPhoto'] : "{$site['icons']}folder.png"; $sCatName = $aCategories['CategoryName']; $sSpacerName = $site['url'] . $this->sSpacerPath; $sCategories .= <<<EOF <div class="pic_centered"> \t<div class="clear_both"></div> \t<div class="cls_res_thumb" style="padding-right: 5px; padding-bottom: 5px;"> \t\t<div class="thumbnail_block"> \t\t\t<span style="vertical-align:middle;"> \t\t\t\t<img class="icons" src="{$sSpacerName}" style="border:0 solid;width: 25px; height: 25px; background-image:url({$sCatPic});" alt="" /> \t\t\t</span> \t\t</div> \t</div> \t<div class="cls_res_info_nowidth" style="width: 120px;"> \t\t<a class="actions" href="{$_SERVER['PHP_SELF']}?action=show_member_blog&ownerID={$iMemberID}&category={$aCategories['CategoryID']}">{$sCatName}</a> ({$iCountCatPost}) \t</div> \t<div class="cls_res_thumb" style="float: right; position: relative;width:48px;vertical-align:middle;"> \t\t<div class="cls_thumb"> \t\t\t<div class="thumbnail_block"> \t\t\t\t<span style="vertical-align:middle;"> \t\t\t\t\t{$sAbilEditDelCateg} \t\t\t\t</span> \t\t\t</div> \t\t</div> \t</div> \t<div class="clear_both"></div> </div> EOF; } $sActions = ''; if ($this->aBlogConf['visitorID'] == $aBlogsRes['OwnerID'] || $this->bAdminMode == TRUE) { $sDescrAct = $this->ActionPrepareForEdit($aBlogsRes['Description']); $sDescrAct = str_replace("\r\n", '', $sDescrAct); $sActions = <<<EOF <div class="caption_item"> \t<span style="vertical-align:middle;"><img src="{$site['icons']}description_edit.png" class="marg_icon" alt="{$sEditBlogC} {$sDescriptionC}" /></span> \t<a href="{$_SERVER['PHP_SELF']}" onclick="javascript: UpdateField('EditBlogID','{$aBlogsRes['ID']}'); UpdateField('Description','{$sDescrAct}'); UpdateField('EOwnerID','{$iMemberID}'); document.getElementById('edited_blog_div').style.display = 'block'; document.getElementById('SmallDesc').style.display = 'none'; return false;" style="text-transform:none;">{$sEditBlogC}</a> \t<a href="{$_SERVER['PHP_SELF']}" onclick="javascript: if (confirm('{$sSureC}')) {UpdateField('DeleteBlogID','{$aBlogsRes['ID']}');document.forms.command_delete_blog.submit(); } return false;" style="text-transform:none;">{$sDeleteBlogC}</a> </div> EOF; } $sProfLink = getProfileLink($aBlogsRes['OwnerID']); $sDescriptionContent = <<<EOF <div class="cls_res_thumb"> \t<div class="marg_both"> \t\t{$sCont} \t</div> </div> <a class="actions" href="{$sProfLink}">{$aBlogsRes['Nickname']}</a> <br />{$sPostsC}: {$iCountPost}<br />{$sCommentsC}: {$iCountComments}<br /> <span class="cls_res_info_p22" id="SmallDesc" style="display:block;text-align:justify;"> \t{$aBlogsRes['Description']} </span> <div class="clear_both"></div> <div id="edited_blog_div" style="display: none; position:relative;"> \t<form action="{$_SERVER['PHP_SELF']}" method="post" name="EditBlogForm"> \t\t<input type="hidden" name="action" id="action" value="edit_blog" /> \t\t<input type="hidden" name="EditBlogID" id="EditBlogID" value=""/> \t\t<input type="hidden" name="EOwnerID" id="EOwnerID" value=""/> \t\t<textarea name="Description" id="Description" rows="4" cols="10" class="classfiedsTextArea1" style="width:210px;height:85px;">{$aBlogsRes['Description']}</textarea> \t\t<div style="text-align:center"><input type="submit" value="{$sApplyChangesC}"/></div> \t</form> </div> EOF; $sDescriptionSect = DesignBoxContent(_t($sDescriptionC), $sDescriptionContent, 1, $sActions); $sCategoriesActions = ''; if ($this->aBlogConf['visitorID'] == $aBlogsRes['OwnerID']) { $sCategoriesActions = <<<EOF <div class="caption_item"> \t<span style="vertical-align:middle;"><img src="{$site['icons']}categ_add.png" class="marg_icon" alt="{$sAddCategoryC}" /></span> \t<a href="{$_SERVER['PHP_SELF']}?action=add_category&ownerID={$iMemberID}" style="text-transform:none;">{$sNewC}</a> </div> EOF; } $sCategoriesSect = DesignBoxContent(_t($sCategoriesC), $sCategories, 1, $sCategoriesActions); $sTagsSect = DesignBoxContent(_t($sTagsC), $sTagsVals, 1); return $sDescriptionSect . $sCategoriesSect . $sTagsSect; }
/** * Function will procces recived activites; * * @param : $aActivites (array); * @param : $sExtraStyles (string) - extra css styles; * @param : $bSetViewed (boolean) - if isset this parameter activity will; set as viwed; * @return : (mixed) - html presentation data or array; */ function _proccesActivites($aActivites, $sExtraStyles = '', $inArray = false, $bSetViewed = false, $sExtraCssClass = null) { $sOutputCode = null; $aProcessedActivites = array(); if (is_array($aActivites)) { foreach ($aActivites as $iKey => $aItems) { $aParams = unserialize($aItems['params']); if ($bSetViewed) { $this->_oDb->setViewed($aItems['id']); } // procces activity text; $sActivity = $this->_parseParameters(_t($aItems['lang_key']), $aParams); // define activity's sender; if ($aItems['sender_id']) { $aTemplateKeys = array('sender_thumb' => get_member_icon($aItems['sender_id'], 'none'), 'event_caption' => $sActivity, 'extra_styles' => $sExtraStyles, 'extra_css_class' => $sExtraCssClass, 'date_add' => getLocaleDate(strtotime($aItems['date']), BX_DOL_LOCALE_DATE)); $sTemplateName = 'activity.html'; } else { $aTemplateKeys = array('event_caption' => $sActivity, 'extra_styles' => $sExtraStyles, 'extra_css_class' => $sExtraCssClass, 'date_add' => getLocaleDate(strtotime($aItems['date']), BX_DOL_LOCALE_DATE)); $sTemplateName = 'non_member_activity.html'; } // build data; if (!$inArray) { $sOutputCode .= $this->_oTemplate->parseHtmlByName($sTemplateName, $aTemplateKeys); } else { $aProcessedActivites[] = array('event' => $this->_oTemplate->parseHtmlByName($sTemplateName, $aTemplateKeys)); } } } return !$inArray ? $sOutputCode : $aProcessedActivites; }
/** * Function will generate block with NEW messages. * NOTE. The block is displayed on "My Account" page. * * @return: Html presentation data */ function getBlockCode_NewMessages($bShowEmpty = true) { global $oSysTemplate; $aMessages = $this->getMessages(); if (empty($aMessages)) { return $bShowEmpty ? MsgBox(_t('_Empty')) : ''; } $aTmplVars = array('bx_repeat:messages' => array()); foreach ($aMessages as $aMessage) { $aTmplVars['bx_repeat:messages'][] = array('message_page' => 'mail.php', 'message_link' => $aMessage['ID'], 'member_icon' => get_member_icon($aMessage['Sender'], 'left'), 'member_nickname' => getNickName($aMessage['Sender']), 'message_ago' => _format_when($aMessage['DateUTS']), 'message_subject' => $aMessage['Subject']); } return $oSysTemplate->parseHtmlByName('mail_box_short.html', $aTmplVars); }
/** * Generate User Right Part for Blogs * * @param $aBlogsRes - Blog Array Data * @param $iView - type of view(1 is short view, 2 is full view, 3 is post view(short)) * @return HTML presentation of data */ function GenMemberDescrAndCat($aBlogsRes, $iCategID = 0) { global $dir; global $site; $sEditBlogC = _t('_Edit'); $sDeleteBlogC = _t('_Delete'); $sSureC = _t("_Are you sure"); $sApplyChangesC = _t('_Apply Changes'); $sDescriptionC = _t('_Description'); $sCategoriesC = _t('_Categories'); $sCategoryC = _t('_Category'); $sTagsC = _t('_Tags'); $sEditCategoryC = _t('_edit_category'); $sAddCategoryC = _t('_add_category'); $sCommentsC = _t('_Comments'); $sPostsC = _t('_Posts'); $sNewC = ucfirst(_t('_new')); $iMemberID = $aBlogsRes['OwnerID']; $sCont = get_member_icon($aBlogsRes['OwnerID'], 'left'); $sOwnerAddAp = $aBlogsRes['OwnerID'] == $this->aBlogConf['visitorID'] ? '' : "AND `PostStatus`='approval'"; //tested, right $sCountPostSQL = "\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM `BlogPosts`\n\t\t\tINNER JOIN `BlogCategories` ON `BlogCategories`.`CategoryID` = `BlogPosts`.`CategoryID`\n\t\t\tWHERE `BlogCategories`.`OwnerId` = {$iMemberID} {$sOwnerAddAp}\n\t\t"; $aCountPost = db_arr($sCountPostSQL); $iCountPost = (int) $aCountPost[0]; $oCmts = new BxDolCmts('blogposts', 0, 0); //tested, right $sCountCommentsSQL = "\n\t\t\tSELECT COUNT( * ) \n\t\t\tFROM `" . $oCmts->getCommentsTableName() . "` AS `tc`\n\t\t\tINNER JOIN `BlogPosts` ON `BlogPosts`.`PostID` = `tc`.`cmt_object_id` \n\t\t\tINNER JOIN `BlogCategories` ON `BlogCategories`.`CategoryID` = `BlogPosts`.`CategoryID` \n\t\t\tWHERE `BlogCategories`.`OwnerId` = {$iMemberID} {$sOwnerAddAp}\n\t\t"; $aCountComments = db_arr($sCountCommentsSQL); $iCountComments = (int) $aCountComments[0]; $sCategories = ''; $sCategoriesSQL = "\n\t\t\tSELECT * \n\t\t\tFROM `BlogCategories`\n\t\t\tWHERE `OwnerId` = {$iMemberID}\n\t\t"; $vCategories = db_res($sCategoriesSQL); $aTagsPost = array(); $sTagsVals = ''; if ($iCategID > 0) { $sPostsSQL = "SELECT `Tags`,`PostReadPermission`,`BlogCategories`.`OwnerID` FROM `BlogPosts`\n\t\t\t\tINNER JOIN `BlogCategories` ON `BlogCategories`.`CategoryID` = `BlogPosts`.`CategoryID`\n\t\t\t\tWHERE `BlogCategories`.`CategoryID` = {$iCategID} {$sOwnerAddAp}"; } else { $sPostsSQL = "SELECT `Tags`,`PostReadPermission`,`BlogCategories`.`OwnerID` FROM `BlogPosts`\n\t\t\t\tINNER JOIN `BlogCategories` ON `BlogCategories`.`CategoryID` = `BlogPosts`.`CategoryID`\n\t\t\t\tWHERE `BlogCategories`.`OwnerID` = {$aBlogsRes['OwnerID']} {$sOwnerAddAp}"; } $vTags = db_res($sPostsSQL); $aTagsPost = array(); while ($aPost = mysql_fetch_assoc($vTags)) { $bFriend = is_friends($this->aBlogConf['visitorID'], $aPost['OwnerID']); $bOwner = $this->aBlogConf['visitorID'] == $aPost['OwnerID'] ? true : false; if ('friends' == $aPost['PostReadPermission'] && !$bFriend && !$bOwner && !$this->bAdminMode) { } else { $sTagsCommas = trim($aPost['Tags']); $aTags = explode(',', $sTagsCommas); foreach ($aTags as $sTagKey) { if ($sTagKey != '') { if (isset($aTagsPost[$sTagKey])) { $aTagsPost[$sTagKey]++; } else { $aTagsPost[$sTagKey] = 1; } } } } } arsort($aTagsPost); $aTagsPost = array_slice($aTagsPost, 0, $this->iTopTagsCnt); $aProf = array('Permalink' => $aBlogsRes['Nickname'], 'Link' => $aBlogsRes['OwnerID']); foreach ($aTagsPost as $varKey => $varValue) { $sTagLink = $this->genBlogLink('search_by_tag', $aProf, '', '', $varKey); $sTagImg = '<img src="' . $site['icons'] . 'tag.png" class="static_icon" alt="' . $varValue . '" /></span>'; $sTagName = '<a class="actions" href="' . $sTagLink . '" style="text-transform:capitalize;" >' . $varKey . '</a> (' . $varValue . ')'; $sTagsImgName = $this->GenCenteredActionsBlock($sTagImg, $sTagName); $sTagsVals .= <<<EOF <div class="tag_el"> \t{$sTagsImgName} </div> EOF; } while ($aCategories = mysql_fetch_assoc($vCategories)) { $sCountPostCatSQL = "\n\t\t\t\tSELECT COUNT(*)\n\t\t\t\tFROM `BlogPosts`\n\t\t\t\tWHERE `BlogPosts`.`CategoryID` = {$aCategories['CategoryID']}\n\t\t\t\t{$sOwnerAddAp}\n\t\t\t"; $aCountCatPost = db_arr($sCountPostCatSQL); $iCountCatPost = (int) $aCountCatPost[0]; $sAbilEditDelCateg = ''; if ($this->aBlogConf['visitorID'] == $aBlogsRes['OwnerID'] || $this->bAdminMode == TRUE) { $sDelAbilOnly = ''; $sLink = $this->genBlogFormUrl(); if ($aCategories['CategoryType'] == 1) { $sDelAbilOnly = <<<EOF <a href="{$sLink}" onclick="javascript: if (confirm('{$sSureC}')) {UpdateField('DeleteCategoryID','{$aCategories['CategoryID']}');document.forms.command_delete_category.submit(); } return false;"> \t<span style="vertical-align:middle;"><img src="{$site['icons']}categ_delete.png" style="border:0 solid;position:static;" alt="{$sDeleteBlogC} {$sCategoryC}" /></span> </a> EOF; } $sAbilEditDelCateg = <<<EOF <a href="{$_SERVER['PHP_SELF']}?action=edit_category&categoryID={$aCategories['CategoryID']}&ownerID={$iMemberID}" style="text-transform:none;"> \t<span style="vertical-align:middle;"><img src="{$site['icons']}categ_edit.png" style="border:0 solid;position:static;" alt="{$sEditCategoryC}" /></span> </a> EOF; $sAbilEditDelCateg .= $sDelAbilOnly; } $sCatPic = $aCategories['CategoryPhoto'] && file_exists($dir['blogImage'] . 'small_' . $aCategories['CategoryPhoto']) ? $site['blogImage'] . 'small_' . $aCategories['CategoryPhoto'] : "{$site['icons']}folder.png"; $sCatName = $aCategories['CategoryName']; $sSpacerName = $site['url'] . $this->sSpacerPath; $aCat = array('Permalink' => $aCategories['CategoryUri'], 'Link' => $aCategories['CategoryID']); $sCatLink = $this->genBlogLink('show_member_blog', $aProf, $aCat); $sCategories .= <<<EOF <div class="pic_centered"> \t<div class="clear_both"></div> \t<div class="cls_res_thumb small_margined" > \t\t<div class="thumbnail_block"> \t\t\t<span style="vertical-align:middle;"> \t\t\t\t<img class="cls_categ_icon" src="{$sCatPic}" alt="" /> \t\t\t</span> \t\t</div> \t</div> \t<div class="cls_categ_name"> \t\t<a class="actions" href="{$sCatLink}">{$sCatName}</a> ({$iCountCatPost}) \t</div> \t<div class="cat_edit"> \t\t<div class="cls_thumb"> \t\t\t<div class="thumbnail_block"> \t\t\t\t<span style="vertical-align:middle;"> \t\t\t\t\t{$sAbilEditDelCateg} \t\t\t\t</span> \t\t\t</div> \t\t</div> \t</div> \t<div class="clear_both"></div> </div> EOF; } $sActions = ''; if ($this->aBlogConf['visitorID'] == $aBlogsRes['OwnerID'] || $this->bAdminMode == TRUE) { $sDescrAct = $this->ActionPrepareForEdit($aBlogsRes['Description']); $sDescrAct = str_replace("\r\n", '', $sDescrAct); $sLink = $this->genBlogFormUrl(); $sActions = <<<EOF <div class="caption_item"> \t<span style="vertical-align:middle;"><img src="{$site['icons']}description_edit.png" class="marg_icon" alt="{$sEditBlogC} {$sDescriptionC}" /></span> \t<a href="{$sLink}" onclick="javascript: UpdateField('EditBlogID','{$aBlogsRes['ID']}'); UpdateField('Description','{$sDescrAct}'); UpdateField('EOwnerID','{$iMemberID}'); document.getElementById('edited_blog_div').style.display = 'block'; document.getElementById('SmallDesc').style.display = 'none'; return false;" style="text-transform:none;">{$sEditBlogC}</a> \t<a href="{$sLink}" onclick="javascript: if (confirm('{$sSureC}')) {UpdateField('DeleteBlogID','{$aBlogsRes['ID']}');document.forms.command_delete_blog.submit(); } return false;" style="text-transform:none;">{$sDeleteBlogC}</a> </div> EOF; } $sProfLink = getProfileLink($aBlogsRes['OwnerID']); $sDescriptionContent = <<<EOF <div class="cls_res_thumb"> \t<div class="marg_both"> \t\t{$sCont} \t</div> </div> <a class="actions" href="{$sProfLink}">{$aBlogsRes['Nickname']}</a> <br />{$sPostsC}: {$iCountPost}<br />{$sCommentsC}: {$iCountComments}<br /> <span class="cls_res_info_p22" id="SmallDesc" style="display:block;text-align:justify;"> \t{$aBlogsRes['Description']} </span> <div class="clear_both"></div> <div id="edited_blog_div" style="display: none; position:relative;"> \t<form action="{$sLink}" method="post" name="EditBlogForm"> \t\t<input type="hidden" name="action" id="action" value="edit_blog" /> \t\t<input type="hidden" name="EditBlogID" id="EditBlogID" value=""/> \t\t<input type="hidden" name="EOwnerID" id="EOwnerID" value=""/> \t\t<textarea name="Description" id="Description" rows="3" cols="3" style="width:95%;height:50px;" onkeyup="if( this.value.length > 255 ) this.value = this.value.substr( 0, 255 );">{$aBlogsRes['Description']}</textarea> \t\t<div style="text-align:center"><input type="submit" value="{$sApplyChangesC}"/></div> \t</form> </div> EOF; $sDescriptionSect = DesignBoxContent(_t($sDescriptionC), $sDescriptionContent, 1, $sActions); $sCategoriesActions = ''; if ($this->aBlogConf['visitorID'] == $aBlogsRes['OwnerID']) { $sCategoriesActions = <<<EOF <div class="caption_item"> \t<span style="vertical-align:middle;"><img src="{$site['icons']}categ_add.png" class="marg_icon" alt="{$sAddCategoryC}" /></span> \t<a href="{$_SERVER['PHP_SELF']}?action=add_category&ownerID={$iMemberID}" style="text-transform:none;">{$sNewC}</a> </div> EOF; } $sCategoriesSect = DesignBoxContent(_t($sCategoriesC), $sCategories, 1, $sCategoriesActions); $sTagsSect = DesignBoxContent(_t($sTagsC), $sTagsVals, 1); return $sDescriptionSect . $sCategoriesSect . $sTagsSect; }
function getCommon($aEvent) { $sPrefix = $this->_oConfig->getCommonPostPrefix(); if (strpos($aEvent['type'], $sPrefix) !== 0) { return ''; } if (in_array($aEvent['type'], array($sPrefix . 'photos', $sPrefix . 'sounds', $sPrefix . 'videos'))) { $aContent = unserialize($aEvent['content']); $aEvent = array_merge($aEvent, $this->getCommonMedia($aContent['type'], (int) $aContent['id'])); if (empty($aEvent['content']) || (int) $aEvent['content'] > 0) { return ''; } } $aAuthor = $this->_oDb->getUser($aEvent['object_id']); $aVariables = array('author_url' => getProfileLink($aAuthor['id']), 'author_username' => getNickName($aAuthor['id']), 'bx_if:show_wall_owner' => array('condition' => (int) $aEvent['owner_id'] != (int) $aEvent['object_id'], 'content' => array('owner_url' => getProfileLink($aEvent['owner_id']), 'owner_username' => getNickName($aEvent['owner_id']))), 'post_id' => $aEvent['id'], 'post_owner_icon' => get_member_icon($aAuthor['id'], 'none'), 'post_content' => $aEvent['content']); switch (str_replace($sPrefix, '', $aEvent['type'])) { case 'text': $aVariables = array_merge($aVariables, array('post_content' => WordWrapStr($aVariables['post_content']))); break; case 'link': case 'photos': case 'videos': case 'sounds': break; } $oComments = new BxWallCmts($this->_oConfig->getCommentSystemName(), $aEvent['id']); $aVariables = array_merge($aVariables, array('comments_content' => $oComments->getCommentsFirst('comment'))); return $this->parseHtmlByTemplateName('balloon', $aVariables); }
/** * Function will generate the pool block; * * @param : $aPollInfo (array) - contain some poll's information ; [ id_poll ] - (integer) poll's Id; [ id_profile ] - (integer) poll's owner Id; [ PollDate ] - (string) poll's date creation; [ sec ] - (integer) poll's date creation in seconds; * @param : $bAjaxQuery (boolean) - if isset this param that script will use different template; */ function getPollBlock(&$aPollInfo, $bAjaxQuery = false, $bViewMode = false) { if (!$this->oPrivacy->check('view', $aPollInfo['id_poll'], $this->aPollSettings['member_id'])) { return $this->getPrivatePollBlock($aPollInfo); } // ** init some needed variables ; $sPollActions = null; $aMemberInfo = array(); // language keys ; $aLanguageKeys = array('results' => _t('_bx_poll_result'), 'delete' => _t('_bx_poll_delete'), 'edit' => _t('_bx_poll_edit'), 'active' => _t('_bx_poll_active'), 'sure' => _t('_Are you sure?'), 'by' => _t('_bx_poll_by'), 'poll' => _t('_bx_poll')); // get poll's owner information ; if ($aPollInfo['id_profile']) { $aMemberInfo = getProfileInfo($aPollInfo['id_profile']); // owner's nickname; $sNickName = $aMemberInfo['NickName']; // generate link to the owner's page ; if ($sNickName) { $sLinkPath = getProfileLink($aMemberInfo['ID']); $sOwnerLink = '<a href="' . $sLinkPath . '" class="small">' . $sNickName . '</a>'; } else { $sOwnerLink = _t('_Admin'); } } else { // if owner not site's member; $sOwnerLink = _t('_Admin'); } // ** generate the some of poll's information ; $sProfileIcon = $aMemberInfo ? get_member_icon($aMemberInfo['ID'], 'left') : get_member_icon(0, 'left'); $sDateAdd = getLocaleDate($aPollInfo['poll_date'], BX_DOL_LOCALE_DATE); // need to modify (move the top member's info to bottom) $aTemplateKeys = array('bx_if:start_tag' => array('condition' => !$bAjaxQuery, 'content' => array('uid' => $aPollInfo['id_poll'])), 'bx_if:manage_page' => array('condition' => $this->aPollSettings['mode'] == 'manage' || $this->aPollSettings['mode'] == 'pending' && $this->aPollSettings['member_id'] && $aPollInfo['id_profile'] == $aPollInfo['id_profile'], 'content' => array()), 'bx_if:end_tag' => array('condition' => !$bAjaxQuery, 'content' => array()), 'uid' => $aPollInfo['id_poll'], 'poll_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . '&action=show_poll_info&id=' . $aPollInfo['id_poll'], 'poll_picture' => $sProfileIcon, 'profile_link' => $sOwnerLink, 'date_add' => $sDateAdd, 'result' => $aLanguageKeys['results'], 'actions' => $sPollActions, 'by' => $aLanguageKeys['by'], 'l_t_side' => $this->_oTemplate->getIconUrl('l_t_corner.png'), 't_side' => $this->_oTemplate->getIconUrl('t_side.png'), 'r_t_side' => $this->_oTemplate->getIconUrl('r_t_corner.png'), 'pool_down_src' => $this->_oTemplate->getIconUrl('poll_down.png'), 'pool_up_src' => $this->_oTemplate->getIconUrl('poll_up.png'), 'l_m_side' => $this->_oTemplate->getIconUrl('l_m_side.png'), 'r_m_side' => $this->_oTemplate->getIconUrl('r_m_side.png'), 'l_b_side' => $this->_oTemplate->getIconUrl('l_b_corner.png'), 'b_side' => $this->_oTemplate->getIconUrl('b_side.png'), 'r_b_side' => $this->_oTemplate->getIconUrl('r_b_corner.png'), 'spacer' => $this->_oTemplate->getIconUrl('spacer.gif'), 'back' => $aLanguageKeys['poll']); $sTemplateName = !$bViewMode ? $this->aUsedTemplates['poll_block'] : $this->aUsedTemplates['poll_view_block']; $sOutputHtml = $this->_oTemplate->parseHtmlByName($sTemplateName, $aTemplateKeys); return $sOutputHtml; }