function getBlockCode_LatestFeaturedGroup() { $aDataEntry = $this->oDb->getLatestFeaturedItem(); if (!$aDataEntry) { return false; } $aAuthor = getProfileInfo($aDataEntry['author_id']); $sImageUrl = ''; $sImageTitle = ''; $a = array('ID' => $aDataEntry['author_id'], 'Avatar' => $aDataEntry['thumb']); $aImage = BxDolService::call('photos', 'get_image', array($a, 'file'), 'Search'); ml_clonetwo_import('Voting'); $oRating = new MlClonetwoVoting('ml_clonetwo', $aDataEntry['id']); $aVars = array('bx_if:image' => array('condition' => !$aImage['no_image'] && $aImage['file'], 'content' => array('image_url' => !$aImage['no_image'] && $aImage['file'] ? $aImage['file'] : '', 'image_title' => !$aImage['no_image'] && $aImage['title'] ? $aImage['title'] : '', 'group_url' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aDataEntry['uri'])), 'group_url' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aDataEntry['uri'], 'group_title' => $aDataEntry['title'], 'author_title' => _t('_From'), 'author_username' => getNickName($aAuthor['ID']), 'author_url' => getProfileLink($aAuthor['ID']), 'rating' => $oRating->isEnabled() ? $oRating->getJustVotingElement(true, $aDataEntry['id']) : '', 'fans_count' => $aDataEntry['fans_count'], 'country_city' => $this->oMain->_formatLocation($aDataEntry, false, true)); return $this->oTemplate->parseHtmlByName('latest_featured_group', $aVars); }
function getBlockCode_Browse() { ml_clonetwo_import('SearchResult'); $o = new MlClonetwoSearchResult('user', process_db_input($this->_aProfile['NickName'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION)); $o->aCurrent['rss'] = 0; $o->sBrowseUrl = "browse/my"; $o->aCurrent['title'] = _t('_ml_clonetwo_page_title_my_clonetwo'); if ($o->isError) { return DesignBoxContent(_t('_ml_clonetwo_block_users_clonetwo'), MsgBox(_t('_Empty')), 1); } if ($s = $o->processing()) { $this->_oTemplate->addCss(array('unit.css', 'twig.css', 'main.css')); return $s; } else { return DesignBoxContent(_t('_ml_clonetwo_block_users_clonetwo'), MsgBox(_t('_Empty')), 1); } }
function blockFields(&$aDataEntry) { $sRet = '<table class="bx_groups_fields">'; ml_clonetwo_import('FormAdd'); $oForm = new MlClonetwoFormAdd($GLOBALS['oMlClonetwoModule'], $_COOKIE['memberID']); foreach ($oForm->aInputs as $k => $a) { if (!isset($a['display']) || !$aDataEntry[$k]) { continue; } $sRet .= '<tr><td class="bx_groups_field_name bx-def-font-grayed bx-def-padding-sec-right" valign="top">' . $a['caption'] . '</td><td class="bx_groups_field_value">'; if (is_string($a['display']) && is_callable(array($this, $a['display']))) { $sRet .= call_user_func_array(array($this, $a['display']), array($aDataEntry[$k])); } else { if (0 == strcasecmp($k, 'country')) { $sRet .= _t($GLOBALS['aPreValues']['Country'][$aDataEntry[$k]]['LKey']); } else { $sRet .= $aDataEntry[$k]; } } $sRet .= '</td></tr>'; } $sRet .= '</table>'; return $sRet; }
<?php /** * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/ * CC-BY License - http://creativecommons.org/licenses/by/3.0/ */ ml_clonetwo_import('FormEdit'); class MlClonetwoFormUploadMedia extends MlClonetwoFormEdit { function MlClonetwoFormUploadMedia($oMain, $iProfileId, $iEntryId, &$aDataEntry, $sMedia, $aMediaFields) { parent::MlClonetwoFormEdit($oMain, $iProfileId, $iEntryId, $aDataEntry); foreach ($this->_aMedia as $k => $a) { if ($k == $sMedia) { continue; } unset($this->_aMedia[$k]); } array_push($aMediaFields, 'Submit', 'id'); foreach ($this->aInputs as $k => $a) { if (in_array($k, $aMediaFields)) { continue; } unset($this->aInputs[$k]); } } }
function getBlockCode_Comments() { ml_clonetwo_import('Cmts'); $o = new MlClonetwoCmts('ml_clonetwo', (int) $this->aDataEntry['id']); if (!$o->isEnabled()) { return ''; } return $o->getCommentsFirst(); }
<?php /** * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/ * CC-BY License - http://creativecommons.org/licenses/by/3.0/ */ ml_clonetwo_import('FormAdd'); class MlClonetwoFormEdit extends MlClonetwoFormAdd { function MlClonetwoFormEdit($oMain, $iProfileId, $iEntryId, &$aDataEntry) { parent::MlClonetwoFormAdd($oMain, $iProfileId, $iEntryId, $aDataEntry['thumb']); $aFormInputsId = array('id' => array('type' => 'hidden', 'name' => 'id', 'value' => $iEntryId)); bx_import('BxDolCategories'); $oCategories = new BxDolCategories(); $oCategories->getTagObjectConfig(); $this->aInputs['categories'] = $oCategories->getGroupChooser('ml_clonetwo', (int) $iProfileId, true, $aDataEntry['categories']); $this->aInputs = array_merge($this->aInputs, $aFormInputsId); } }