コード例 #1
0
ファイル: stage.back.php プロジェクト: highfidelity/love
function GetLove($limit, $justUser)
{
    global $user;
    if (!defined('LIVE_FEED_ROTATION_DELAY')) {
        $rotationDelay = 5000;
    } else {
        $rotationDelay = LIVE_FEED_ROTATION_DELAY;
    }
    // Get user
    $userid = $user->getId();
    //if we have no user, just return empty array
    if (!$userid) {
        return json_encode(array());
    }
    if ($justUser === true) {
        $username = $user->getUsername();
        $query = "SELECT `giver`,`receiver`,`why`,TIMESTAMPDIFF(SECOND,at,NOW()) as delta\n    \t\t      FROM `" . LOVE . "`\n\tWHERE `company_id` = " . (array_key_exists('company_id', $_SESSION) ? $_SESSION['company_id'] : MAIN_COMPANY) . "\n    \t\t      AND `private` = 0\n    \t\t      AND at > DATE_SUB(NOW(), INTERVAL 31 DAY)\n    \t\t      AND (`giver` = '{$username}' OR `receiver` = '{$username}')\n    \t\t      ORDER BY `at` DESC LIMIT {$limit}";
    } else {
        $query = "SELECT `giver`,`receiver`,`why`,TIMESTAMPDIFF(SECOND,at,NOW()) as delta\n    \t\t      FROM `" . LOVE . "`\n\tWHERE `company_id` = " . (array_key_exists('company_id', $_SESSION) ? $_SESSION['company_id'] : MAIN_COMPANY) . "\n    \t\t      AND `private` = 0\n    \t\t      AND at > DATE_SUB(NOW(), INTERVAL 31 DAY)\n    \t\t      ORDER BY `at` DESC LIMIT {$limit}";
    }
    $rt = mysql_query($query) or error_log("GetLove: " . mysql_error() . "\n" . $query);
    $result = array();
    while ($row = mysql_fetch_assoc($rt)) {
        $why = strip_tags(stripslashes($row['why']));
        $givername = getNickName($row['giver']);
        $receivername = getNickName($row['receiver']);
        $result[] = array($givername, $receivername, $why, $row['delta']);
    }
    return json_encode(array("rotationDelay" => $rotationDelay, "result" => $result));
}
コード例 #2
0
ファイル: BxPmtTemplate.php プロジェクト: Arvindvi/dolphin
 function displayOrders($sType, $aParams)
 {
     if (empty($aParams['per_page'])) {
         $aParams['per_page'] = $this->_oConfig->getPerPage('orders');
     }
     $sJsObject = $this->_oConfig->getJsObject('orders');
     $sMethodNameInfo = 'get' . ucfirst($sType) . 'Orders';
     $aOrders = $this->_oDb->{$sMethodNameInfo}($aParams);
     if (empty($aOrders)) {
         return MsgBox(_t('_payment_txt_empty'));
     }
     $aAdministrator = $this->_oDb->getVendorInfoProfile(BX_PMT_ADMINISTRATOR_ID);
     //--- Get Orders ---//
     $aResultOrders = array();
     foreach ($aOrders as $aOrder) {
         if (empty($aOrder['user_id']) || empty($aOrder['user_name'])) {
             $aOrder['user_name'] = $aAdministrator['profile_name'];
             $aOrder['user_url'] = $aAdministrator['profile_url'];
         } else {
             $aOrder['user_name'] = getNickName($aOrder['user_id']);
             $aOrder['user_url'] = getProfileLink($aOrder['user_id']);
         }
         $aResultOrders[] = array_merge($aOrder, array('type' => $sType, 'bx_if:show_link' => array('condition' => !empty($aOrder['user_url']), 'content' => array('user_name' => $aOrder['user_name'], 'user_url' => $aOrder['user_url'])), 'bx_if:show_text' => array('condition' => empty($aOrder['user_url']), 'content' => array('user_name' => $aOrder['user_name'])), 'bx_if:pending' => array('condition' => $sType == BX_PMT_ORDERS_TYPE_PENDING, 'content' => array('id' => $aOrder['id'], 'order' => $aOrder['order'])), 'bx_if:processed' => array('condition' => $sType == BX_PMT_ORDERS_TYPE_PROCESSED || $sType == BX_PMT_ORDERS_TYPE_HISTORY, 'content' => array('order' => $aOrder['order'])), 'products' => $aOrder['products'], 'items' => $aOrder['items'], 'js_object' => $sJsObject));
     }
     //--- Get Paginate Panel ---//
     $sPaginatePanel = "";
     $sMethodNameCount = 'get' . ucfirst($sType) . 'OrdersCount';
     if (($iCount = $this->_oDb->{$sMethodNameCount}($aParams)) > $aParams['per_page']) {
         $oPaginate = new BxDolPaginate(array('page_url' => 'javascript:void(0);', 'start' => $aParams['start'], 'count' => $iCount, 'per_page' => $aParams['per_page'], 'per_page_step' => 2, 'per_page_interval' => 3, 'page_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . ($sType == BX_PMT_ORDERS_TYPE_HISTORY ? 'history' : 'orders') . '/', 'on_change_page' => $sJsObject . ".changePage('" . $sType . "', {start}, {per_page}, " . $aParams['seller_id'] . ")"));
         $sPaginatePanel = $oPaginate->getPaginate();
     }
     return $this->parseHtmlByName($sType . '_orders.html', array('bx_repeat:orders' => $aResultOrders, 'paginate_panel' => $sPaginatePanel));
 }
コード例 #3
0
 /**
  * Get processed message
  *
  * @param $aMessages array
  * @param $bDeleteAllowed boolean
  * @param $bBlockAllowed boolean
  * @return text
  */
 function getProcessedMessages($aMessages = array(), $bDeleteAllowed = false, $bBlockAllowed = false)
 {
     global $oFunctions;
     if (!$aMessages) {
         return;
     }
     $sOutputCode = '';
     $aLanguageKeys = array('by' => _t('_bx_shoutbox_by'), 'visitor' => _t('_Visitor'), 'delete' => _t('_bx_shoutbox_delete_message'), 'sure' => _t('_Are_you_sure'), 'block' => _t('_bx_shoutbox_block_ip'));
     foreach ($aMessages as $iKey => $aItems) {
         $sMemberIcon = '';
         $aProfileInfo = $aItems['OwnerID'] > 0 ? getProfileInfo($aItems['OwnerID']) : array();
         // define some profile's data;
         if ($aProfileInfo) {
             $sNickName = getNickName($aProfileInfo['ID']);
             $sLink = getProfileLink($aItems['OwnerID']);
             $sMemberIcon = $oFunctions->getMemberIcon($aItems['OwnerID']);
         } else {
             $sLink = 'javascript:void(0)';
             $sNickName = $aLanguageKeys['visitor'];
         }
         $aKeys = array('owner_icon' => $sMemberIcon, 'message' => WordWrapStr($aItems['Message']), 'by' => $aLanguageKeys['by'], 'owner_nick' => $sNickName, 'date' => defineTimeInterval($aItems['DateTS'], true, true), 'owner_link' => $sLink, 'bx_if:delete_allowed' => array('condition' => $bDeleteAllowed, 'content' => array('delete_cpt' => bx_html_attribute($aLanguageKeys['delete']), 'sure_cpt' => bx_js_string($aLanguageKeys['sure']), 'message_id' => $aItems['ID'])), 'bx_if:block_allowed' => array('condition' => $bBlockAllowed, 'content' => array('block_cpt' => bx_html_attribute($aLanguageKeys['block']), 'sure_cpt' => bx_js_string($aLanguageKeys['sure']), 'message_id' => $aItems['ID'])));
         $sTemplateName = $aProfileInfo ? 'message.html' : 'visitor_message.html';
         $sOutputCode .= $this->parseHtmlByName($sTemplateName, $aKeys);
     }
     return $sOutputCode;
 }
コード例 #4
0
ファイル: Love.class.php プロジェクト: highfidelity/love
 public function getLoveHistory($page, $justUser = false)
 {
     $front = Frontend::getInstance();
     $page--;
     $l = $this->getLimit() * $page;
     $where = '';
     $sql = "SELECT count(*) " . "FROM " . LOVE_LOVE;
     $res = mysql_query($sql);
     $row = mysql_fetch_row($res);
     $loves = $row[0];
     $sql = "SELECT count(*) " . "FROM " . LOVE_LOVE . " " . "WHERE " . LOVE_LOVE . ".receiver = '" . $front->getUser()->getUsername() . "' " . "OR " . LOVE_LOVE . ".giver = '" . $front->getUser()->getUsername() . "' " . ($sql .= $justUser ? '' : "OR " . LOVE_LOVE . ".company_id = '" . $front->getUser()->getCompany_id() . "' ");
     $sql .= $where . " " . "ORDER BY id DESC";
     $res = mysql_query($sql);
     $row = mysql_fetch_row($res);
     $count = $row[0];
     $cPages = ceil($count / $this->getLimit());
     $sql = "SELECT id,giver,receiver,why,private,TIMESTAMPDIFF(SECOND,at,NOW()) as delta " . "FROM " . LOVE_LOVE . " " . "WHERE " . LOVE_LOVE . ".receiver = '" . $front->getUser()->getUsername() . "' " . "OR " . LOVE_LOVE . ".giver = '" . $front->getUser()->getUsername() . "' ";
     $sql .= $justUser ? '' : "OR " . LOVE_LOVE . ".company_id = '" . $front->getUser()->getCompany_id() . "' ";
     $sql .= $where . " " . "ORDER BY id DESC " . "LIMIT " . $l . "," . $this->getLimit();
     $res = mysql_query($sql);
     // Construct json for history
     $this->pages = array(array($page, $cPages, number_format($loves)));
     for ($i = 1; $row = mysql_fetch_assoc($res); $i++) {
         $givernickname = getNickName($row['giver']);
         $givernickname = !empty($givernickname) ? $givernickname : $row['giver'];
         $receivernickname = getNickName($row['receiver']);
         $receivernickname = !empty($receivernickname) ? $receivernickname : $row['receiver'];
         $why = $row['why'];
         if ($row['private']) {
             $why .= " (love sent quietly)";
         }
         $history[] = array("id" => $row['id'], "giver" => $row['giver'], "giverNickname" => $givernickname, "receiver" => $row['receiver'], "receiverNickname" => $receivernickname, "why" => $why, "delta" => Utils::relativeTime($row['delta']));
     }
     return $history;
 }
コード例 #5
0
 function genSiteServiceMenu()
 {
     $bLogged = isLogged();
     $aMenuItem = array();
     $sMenuPopupId = '';
     $sMenuPopupContent = '';
     $bShowVisitor = false;
     bx_import('BxTemplMenuService');
     $oMenu = new BxTemplMenuService();
     if ($bLogged) {
         $aProfile = getProfileInfo($oMenu->aMenuInfo['memberID']);
         $sThumbSetting = getParam('sys_member_info_thumb_icon');
         bx_import('BxDolMemberInfo');
         $o = BxDolMemberInfo::getObjectInstance($sThumbSetting);
         $sThumbUrl = $o ? $o->get($aProfile) : '';
         $bThumb = !empty($sThumbUrl);
         $o = BxDolMemberInfo::getObjectInstance($sThumbSetting . '_2x');
         $sThumbTwiceUrl = $o ? $o->get($aProfile) : '';
         if (!$sThumbTwiceUrl) {
             $sThumbTwiceUrl = $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()), 'title' => getNickName($oMenu->aMenuInfo['memberID']));
         $sMenuPopupId = 'sys-service-menu-' . time();
         $sMenuPopupContent = $this->transBox($oMenu->getCode());
     } else {
         $aItems = $oMenu->getItemsArray();
         if (!empty($aItems)) {
             $bShowVisitor = true;
             $bLoginOnly = $aItems[0]['name'] == 'LoginOnly';
             $aMenuItem = array('caption' => $bLoginOnly ? $aItems[0]['caption'] : _t('_sys_sm_join_or_login'), 'icon' => $bLoginOnly ? $aItems[0]['icon'] : 'user', 'script' => $aItems[0]['script'], 'bx_if:show_fu_thumb_image' => array('condition' => false, 'content' => array()), 'bx_if:show_fu_thumb_icon' => array('condition' => false, 'content' => array()), 'title' => '');
         }
     }
     return $GLOBALS['oSysTemplate']->parseHtmlByName('extra_service_menu_wrapper.html', array('bx_if:show_for_visitor' => array('condition' => !$bLogged && $bShowVisitor, 'content' => $aMenuItem), 'bx_if:show_for_user' => array('condition' => $bLogged, 'content' => $aMenuItem), 'menu_popup_id' => $sMenuPopupId, 'menu_popup_content' => $sMenuPopupContent));
 }
コード例 #6
0
ファイル: BxDolAlbums.php プロジェクト: dalinhuang/shopexts
 function addAlbum($aData = array(), $bCheck = true)
 {
     if ($bCheck) {
         $iCheck = $this->_checkAlbumExistence($aData);
         if ($iCheck != 0) {
             return $iCheck;
         }
     }
     $iOwner = (int) $aData['owner'];
     if (isset($aData['AllowAlbumView'])) {
         $iAllowAlbumView = (int) $aData['AllowAlbumView'];
     } elseif (strpos($aData['caption'], getNickName($iOwner)) !== false) {
         $iAllowAlbumView = BX_DOL_PG_ALL;
     } else {
         $iAllowAlbumView = BX_DOL_PG_NOBODY;
     }
     $aFields = array('Caption' => $aData['caption'], 'Uri' => $this->getCorrectUri($aData['caption'], $iOwner, $bCheck), 'Location' => $aData['location'], 'Description' => $aData['description'], 'AllowAlbumView' => $iAllowAlbumView, 'Type' => $this->sType, 'Owner' => $iOwner, 'Status' => getParam('sys_album_auto_app') == 'on' ? 'active' : 'passive', 'Date' => time(), 'LastObjId' => isset($aData['lastObjId']) ? (int) $aData['last_obj'] : 0);
     $sqlBegin = "";
     $sqlCond = "";
     $sqlBody = $this->_getSqlPart($aFields);
     $sqlBegin = "INSERT INTO ";
     $sqlQuery = "{$sqlBegin} `{$this->sAlbumTable}` SET {$sqlBody} {$sqlCond}";
     $GLOBALS['MySQL']->res($sqlQuery);
     return $GLOBALS['MySQL']->lastId();
 }
コード例 #7
0
 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));
 }
コード例 #8
0
 /**
  * @description : function will generate profile block (used the profile template );
  * @return : Html presentation data ;
  */
 function PrintSearhResult($aProfileInfo, $aCoupleInfo = '', $aExtendedKey = null, $sTemplateName = '', $oCustomTemplate = null)
 {
     global $site;
     global $aPreValues;
     $iVisitorID = getLoggedId();
     $bExtMode = !empty($_GET['mode']) && $_GET['mode'] == 'extended' || !empty($_GET['search_result_mode']) && $_GET['search_result_mode'] == 'ext';
     $isShowMatchPercent = $bExtMode && $iVisitorID && $iVisitorID != $aProfileInfo['ID'] && getParam('view_match_percent') && getParam('enable_match');
     $sProfileThumb = get_member_thumbnail($aProfileInfo['ID'], 'none', !$bExtMode, 'visitor');
     $sProfileMatch = $isShowMatchPercent ? $GLOBALS['oFunctions']->getProfileMatch($iVisitorID, $aProfileInfo['ID']) : '';
     $sProfileNickname = '<a href="' . getProfileLink($aProfileInfo['ID']) . '">' . getNickName($aProfileInfo['ID']) . '</a>';
     $sProfileInfo = $GLOBALS['oFunctions']->getUserInfo($aProfileInfo['ID']);
     $sProfileDesc = strmaxtextlen($aProfileInfo['DescriptionMe'], 130);
     $sProfileZodiac = $bExtMode && getParam('zodiac') ? $GLOBALS['oFunctions']->getProfileZodiac($aProfileInfo['DateOfBirth']) : '';
     $sProfile2ASc1 = $sProfile2ASc2 = $sProfile2Nick = $sProfile2Desc = $sProfile2Info = $sProfile2Zodiac = '';
     if ($aCoupleInfo) {
         $sProfile2Nick = '<a href="' . getProfileLink($aCoupleInfo['ID']) . '">' . getNickName($aCoupleInfo['ID']) . '</a>';
         $sProfile2Info = $GLOBALS['oFunctions']->getUserInfo($aCoupleInfo['ID']);
         $sProfile2Desc = strmaxtextlen($aCoupleInfo['DescriptionMe'], 130);
         $sProfile2Zodiac = $bExtMode && getParam('zodiac') ? $GLOBALS['oFunctions']->getProfileZodiac($aCoupleInfo['DateOfBirth']) : '';
         $sProfile2ASc1 = 'float:left;width:31%;margin-right:10px;';
         $sProfile2ASc2 = 'float:left;width:31%;display:block;';
     } else {
         $sProfile2ASc2 = 'display:none;';
     }
     $aKeys = array('thumbnail' => $sProfileThumb, 'match' => $sProfileMatch, 'nick' => $sProfileNickname, 'info' => $sProfileInfo, 'i_am_desc' => $sProfileDesc, 'zodiac_sign' => $sProfileZodiac, 'nick2' => $sProfile2Nick, 'info2' => $sProfile2Info, 'i_am_desc2' => $sProfile2Desc, 'zodiac_sign2' => $sProfile2Zodiac, 'add_style_c1' => $sProfile2ASc1, 'add_style_c2' => $sProfile2ASc2);
     if ($aExtendedKey and is_array($aExtendedKey) and !empty($aExtendedKey)) {
         foreach ($aExtendedKey as $sKey => $sValue) {
             $aKeys[$sKey] = $sValue;
         }
     } else {
         $aKeys['ext_css_class'] = '';
     }
     return $oCustomTemplate ? $oCustomTemplate->parseHtmlByName($sTemplateName, $aKeys) : $GLOBALS['oSysTemplate']->parseHtmlByName($sTemplateName, $aKeys);
 }
コード例 #9
0
 function __construct($oMain, $sMsgNoUsers)
 {
     $aVisitorsPreapare = $oMain->_oDb->getPotentialVisitors($oMain->_iProfileId);
     $aVisitors = array();
     foreach ($aVisitorsPreapare as $k => $r) {
         $aVisitors[] = array('Icon' => $GLOBALS['oFunctions']->getMemberIcon($r['ID'], 'left'), 'Link' => getProfileLink($r['ID']), 'NickName' => getNickName($r['ID']), 'ID' => $r['ID']);
     }
     $aVars = array('bx_repeat:rows' => $aVisitors, 'msg_no_users' => $aVisitors ? '' : $sMsgNoUsers);
     $aCustomForm = array('form_attrs' => array('name' => 'form_inviter', 'action' => '', 'method' => 'post'), 'params' => array('db' => array('submit_name' => 'submit_form')), 'inputs' => array('inviter_users' => array('type' => 'custom', 'content' => $oMain->_oTemplate->parseHtmlByName('inviter', $aVars), 'name' => 'inviter_users', 'caption' => _t('_sys_invitation_step_select_users'), 'info' => _t('_sys_invitation_step_select_users_info'), 'required' => false, 'db' => array('pass' => 'Int')), 'inviter_emails' => array('type' => 'textarea', 'name' => 'inviter_emails', 'caption' => _t('_sys_invitation_step_additional_emails'), 'info' => _t('_sys_invitation_step_additional_emails_info'), 'db' => array('pass' => 'Xss')), 'inviter_text' => array('type' => 'textarea', 'name' => 'inviter_text', 'caption' => _t('_sys_invitation_step_invitation_text'), 'info' => _t('_sys_invitation_step_invitation_text_info'), 'db' => array('pass' => 'Xss')), 'Submit' => array('type' => 'submit', 'name' => 'submit_form', 'value' => _t('_Submit'))));
     parent::__construct($aCustomForm);
 }
コード例 #10
0
ファイル: BxFdbTemplate.php プロジェクト: noormcs/studoro
 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("\$", "&#36;", $aEntry['caption']), 'class' => !in_array($sSampleType, array('view')) ? ' ' . $this->sCssPrefix . '-text-snippet' : '', 'date' => _format_when($aEntry['ago']), 'content' => str_replace("\$", "&#36;", $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);
 }
コード例 #11
0
 function parseContent($sContent, $aKeys, $iMemberId = 0)
 {
     $aResultKeys = $this->getDefaultKeys();
     if ($iMemberId != 0) {
         $aProfile = getProfileInfo($iMemberId);
         $aResultKeys = array_merge($aResultKeys, array('recipientID' => $aProfile['ID'], 'RealName' => getNickName($aProfile['ID']), 'NickName' => getNickName($aProfile['ID']), 'RecipientUrl' => getProfileLink($aProfile['ID']), 'Email' => $aProfile['Email'], 'Password' => $aProfile['Password'], 'SiteName' => getParam('site_title')));
     }
     if (is_array($aKeys)) {
         $aResultKeys = array_merge($aResultKeys, $aKeys);
     }
     return $GLOBALS['oSysTemplate']->parseHtmlByContent($sContent, $aResultKeys, array('<', '>'));
 }
コード例 #12
0
    /**
     * return html for data unit for some day, it is:
     * - icon 32x32 with link if data have associated image
     * - data title with link if data have no associated image
     */
    function getUnit(&$aData)
    {
        //global $oFunctions;
        $iProfileID = (int) $aData['ID'];
        $sName = getNickName($iProfileID);
        $sUrl = getProfileLink($iProfileID);
        return <<<EOF
<div style="width:95%;">
    <a title="{$sName}" href="{$sUrl}">{$sName}</a>
</div>
EOF;
    }
コード例 #13
0
    /**
     * return html for data unit for some day, it is:
     * - icon 32x32 with link if data have associated image, use $GLOBALS['oFunctions']->sysIcon() to return small icon
     * - data title with link if data have no associated image
     */
    function getUnit(&$aData)
    {
        //global $oFunctions;
        $iProfileID = (int) $aData['ID'];
        $sName = getNickName($iProfileID);
        $sUrl = getProfileLink($iProfileID);
        //$sIcon = get_member_icon($iProfileID, 'none', true);
        //return $sIcon;
        //return $oFunctions->sysIcon($sIcon, $sName, $sUrl);
        return <<<EOF
<div style="width:95%;">
\t<a title="{$sName}" href="{$sUrl}">{$sName}</a>
</div>
EOF;
    }
コード例 #14
0
 function getBlockCode_UpcomingPhoto()
 {
     $aEvent = $this->oDb->getUpcomingEvent(getParam('bx_events_main_upcoming_event_from_featured_only') ? true : false);
     if (!$aEvent) {
         return false;
     }
     $aAuthor = getProfileInfo($aEvent['ResponsibleID']);
     $a = array('ID' => $aEvent['ResponsibleID'], 'Avatar' => $aEvent['PrimPhoto']);
     $aImage = BxDolService::call('photos', 'get_image', array($a, 'file'), 'Search');
     bx_events_import('Voting');
     $oRating = new BxEventsVoting('bx_events', (int) $aEvent['ID']);
     $sEventUrl = BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aEvent['EntryUri'];
     $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'] : '', 'event_url' => $sEventUrl)), 'event_url' => $sEventUrl, 'event_title' => $aEvent['Title'], 'event_start_in' => $this->oMain->_formatDateInBrowse($aEvent), 'author_title' => _t('_From'), 'author_username' => getNickName($aAuthor['ID']), 'author_url' => getProfileLink($aAuthor['ID']), 'rating' => $oRating->isEnabled() ? $oRating->getJustVotingElement(true, $aEvent['ID']) : '', 'participants' => $aEvent['FansCount'], 'country_city' => $this->oMain->_formatLocation($aEvent, true, true), 'place' => $aEvent['Place']);
     return $this->oTemplate->parseHtmlByName('main_event', $aVars);
 }
コード例 #15
0
 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);
 }
コード例 #16
0
 function getBlockCode_LatestFeaturedProduct()
 {
     $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');
     bx_store_import('Voting');
     $oRating = new BxStoreVoting('bx_store', $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'] : '', 'product_url' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aDataEntry['uri'])), 'product_url' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aDataEntry['uri'], 'product_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']) : '', 'created' => defineTimeInterval($aDataEntry['created']), 'price_range' => $this->oMain->_formatPriceRange($aDataEntry));
     return $this->oTemplate->parseHtmlByName('latest_featured_product', $aVars);
 }
コード例 #17
0
ファイル: BxPmtTemplate.php プロジェクト: dalinhuang/shopexts
 function displayOrder($sType, $iId)
 {
     $sMethodName = 'get' . ucfirst($sType);
     $aOrder = $this->_oDb->{$sMethodName}(array('type' => 'id', 'id' => $iId));
     $aSeller = $this->_oDb->getVendorInfoProfile((int) $aOrder['seller_id']);
     $aResult = array('client_name' => getNickName($aOrder['client_id']), 'client_url' => getProfileLink($aOrder['client_id']), 'bx_if:show_link' => array('condition' => !empty($aSeller['profile_url']), 'content' => array('seller_name' => $aSeller['username'], 'seller_url' => $aSeller['profile_url'])), 'bx_if:show_text' => array('condition' => empty($aSeller['profile_url']), 'content' => array('seller_name' => $aSeller['username'])), 'order' => $aOrder['order'], 'provider' => $aOrder['provider'], 'error' => $aOrder['error_msg'], 'date' => $aOrder['date_uf'], 'bx_repeat:items' => array());
     if ($sType == BX_PMT_ORDERS_TYPE_PENDING) {
         $aItems = BxPmtCart::items2array($aOrder['items']);
     } else {
         $aItems = BxPmtCart::items2array($aOrder['seller_id'] . '_' . $aOrder['module_id'] . '_' . $aOrder['item_id'] . '_' . $aOrder['item_count']);
     }
     foreach ($aItems as $aItem) {
         $aInfo = BxDolService::call((int) $aItem['module_id'], 'get_cart_item', array($aOrder['client_id'], $aItem['item_id']));
         $aResult['bx_repeat:items'][] = array('bx_if:link' => array('condition' => !empty($aInfo['url']), 'content' => array('title' => $aInfo['title'], 'url' => $aInfo['url'])), 'bx_if:text' => array('condition' => empty($aInfo['url']), 'content' => array('title' => $aInfo['title'])), 'quantity' => $aItem['item_count'], 'price' => $aInfo['price'], 'currency_code' => $aSeller['currency_code']);
     }
     return $this->parseHtmlByName($sType . '_order.html', $aResult);
 }
コード例 #18
0
ファイル: BxPmtDb.php プロジェクト: Arvindvi/dolphin
 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;
 }
コード例 #19
0
 function unit($aData, $sTemplateName, &$oVotingView, $isShort = false)
 {
     if (null == $this->_oMain) {
         $this->_oMain = BxDolModule::getInstance('BxGroupsModule');
     }
     if (!$this->_oMain->isAllowedView($aData)) {
         $aVars = array('extra_css_class' => 'bx_groups_unit');
         return $this->parseHtmlByName('twig_unit_private', $aVars);
     }
     $sImage = '';
     if ($aData['thumb']) {
         $a = array('ID' => $aData['author_id'], 'Avatar' => $aData['thumb']);
         $aImage = BxDolService::call('photos', 'get_image', array($a, 'browse'), 'Search');
         $sImage = $aImage['no_image'] ? '' : $aImage['file'];
     }
     $aVars = array('id' => $aData['id'], 'thumb_url' => $sImage ? $sImage : $this->getImageUrl('no-image-thumb.png'), 'group_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aData['uri'], 'group_title' => $aData['title'], 'created' => defineTimeInterval($aData['created']), 'fans_count' => $aData['fans_count'], 'country_city' => $this->_oMain->_formatLocation($aData), 'snippet_text' => $this->_oMain->_formatSnippetText($aData), 'bx_if:full' => array('condition' => !$isShort, 'content' => array('author' => getNickName($aData['author_id']), 'author_url' => $aData['author_id'] ? getProfileLink($aData['author_id']) : 'javascript:void(0);', 'created' => defineTimeInterval($aData['created']), 'rate' => $oVotingView ? $oVotingView->getJustVotingElement(0, $aData['id'], $aData['rate']) : '&#160;')));
     return $this->parseHtmlByName($sTemplateName, $aVars);
 }
コード例 #20
0
 function unit($aData, $sTemplateName, &$oVotingView, $isShort = false)
 {
     if (null == $this->_oMain) {
         $this->_oMain = BxDolModule::getInstance('BxEventsModule');
     }
     if (!$this->_oMain->isAllowedView($aData)) {
         $aVars = array();
         return $this->parseHtmlByName('twig_unit_private', $aVars);
     }
     $sImage = '';
     if ($aData['PrimPhoto']) {
         $a = array('ID' => $aData['ResponsibleID'], 'Avatar' => $aData['PrimPhoto']);
         $aImage = BxDolService::call('photos', 'get_image', array($a, 'browse'), 'Search');
         $sImage = $aImage['no_image'] ? '' : $aImage['file'];
     }
     $aVars = array('id' => $aData['ID'], 'thumb_url' => $sImage ? $sImage : $this->getImageUrl('no-image-thumb.png'), 'event_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aData['EntryUri'], 'event_title' => $aData['Title'], 'event_start' => $this->_oMain->_formatDateInBrowse($aData), 'spacer' => getTemplateIcon('spacer.gif'), 'participants' => $aData['FansCount'], 'country_city' => $this->_oMain->_formatLocation($aData), 'snippet_text' => $this->_oMain->_formatSnippetText($aData), 'bx_if:full' => array('condition' => !$isShort, 'content' => array('author' => $aData['ResponsibleID'] ? getNickName($aData['ResponsibleID']) : _t('_bx_events_admin'), 'author_url' => $aData['ResponsibleID'] ? getProfileLink($aData['ResponsibleID']) : 'javascript:void(0);', 'rate' => $oVotingView ? $oVotingView->getJustVotingElement(0, $aData['ID'], $aData['Rate']) : '&#160;')));
     $aVars = array_merge($aVars, $aData);
     return $this->parseHtmlByName($sTemplateName, $aVars);
 }
コード例 #21
0
 function actionGetCurrentImage($iPicId)
 {
     $iPicId = (int) $iPicId;
     if ($iPicId > 0) {
         bx_import('Search', $this->_aModule);
         $oMedia = new BxPhotosSearch();
         $aInfo = $oMedia->serviceGetPhotoArray($iPicId, 'file');
         $aInfo['ownerUrl'] = getProfileLink($aInfo['owner']);
         $aInfo['ownerName'] = getNickName($aInfo['owner']);
         $aInfo['date'] = defineTimeInterval($aInfo['date']);
         $oMedia->getRatePart();
         $aInfo['rate'] = $oMedia->oRate->getJustVotingElement(0, 0, $aInfo['rate']);
         $aLinkAddon = $oMedia->getLinkAddByPrams();
         $oPaginate = new BxDolPaginate(array('count' => (int) $_GET['total'], 'per_page' => 1, 'page' => (int) $_GET['page'], 'on_change_page' => 'getCurrentImage({page})'));
         $aInfo['paginate'] = $oPaginate->getPaginate();
         header('Content-Type:text/javascript; charset=utf-8');
         echo json_encode($aInfo);
     }
 }
コード例 #22
0
 function getContacts($sUser, $sPwd)
 {
     $aRet = array();
     if (!($iId = BxDolXMLRPCUtil::checkLogin($sUser, $sPwd))) {
         return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct"));
     }
     $aAll = array();
     $aContacts = array();
     // hot list
     $r = db_res("SELECT `p`.`ID` FROM `Profiles` AS `p`\n            INNER JOIN `sys_fave_list` AS `h` ON (`h`.`Profile` = `p`.`ID`)\n            WHERE `h`.`ID` = {$iId}");
     while ($aRow = $r->fetch()) {
         $aAll[$aRow['ID']] = $aRow;
     }
     // mail contacts received
     $r = db_res("SELECT `p`.`ID` FROM `Profiles` AS `p`\n            INNER JOIN `sys_messages` AS `m` ON (`m`.`Sender` = `p`.`ID`)\n            WHERE `p`.`ID` != {$iId} AND `m`.`Recipient` = {$iId}");
     while ($aRow = $r->fetch()) {
         $aAll[$aRow['ID']] = $aRow;
     }
     // mail contacts sent
     $r = db_res("SELECT `p`.`ID` FROM `Profiles` AS `p`\n            INNER JOIN `sys_messages` AS `m` ON (`m`.`Recipient` = `p`.`ID`)\n            WHERE `p`.`ID` != {$iId} AND `m`.`Sender` = {$iId}");
     while ($aRow = $r->fetch()) {
         $aAll[$aRow['ID']] = $aRow;
     }
     // friends 1
     $r = db_res("SELECT `p`.`ID` FROM `sys_friend_list` AS `fr`\n            LEFT JOIN `Profiles` AS `p` ON (`p`.`ID` = `fr`.`Profile`)\n            WHERE `fr`.`ID` = '{$iId}' AND `fr`.`Profile` != {$iId} AND `fr`.`Check` = '1'");
     while ($aRow = $r->fetch()) {
         $aAll[$aRow['ID']] = $aRow;
     }
     // friends 2
     $r = db_res("SELECT `p`.`ID` FROM `sys_friend_list` AS `fr`\n            LEFT JOIN `Profiles` AS `p` ON (`p`.`ID` = `fr`.`ID`)\n            WHERE `fr`.`Profile` = '{$iId}' AND `fr`.`ID` != {$iId} AND `fr`.`Check` = '1'");
     while ($aRow = $r->fetch()) {
         $aAll[$aRow['ID']] = $aRow;
     }
     bx_import('BxDolAlerts');
     $oZ = new BxDolAlerts('mobile', 'contacts', $iId, 0, array('contacts_data' => $aAll));
     $oZ->alert();
     foreach ($aAll as $aRow) {
         $a = array('ID' => new xmlrpcval($aRow['ID']), 'Nick' => new xmlrpcval(getUsername($aRow['ID'])), 'UserTitle' => new xmlrpcval(getNickName($aRow['ID'])));
         $aContacts[] = new xmlrpcval($a, 'struct');
     }
     return new xmlrpcval($aContacts, "array");
 }
コード例 #23
0
 function getBlockCode_RateObject()
 {
     $sMainPrefix = $this->oConfig->getMainPrefix();
     $this->oMedia->oModule->_defineActions();
     $aCheck = checkAction($this->iViewer, $this->oMedia->oModule->_defineActionName('view'));
     if ($aCheck[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED) {
         $sCode = MsgBox(_t('_' . $sMainPrefix . '_forbidden'));
     } else {
         $aData = $this->getRateObject();
         if (count($aData) > 0) {
             $oVotingView = new BxTemplVotingView($this->sType, $aData[0]['id']);
             $aUnit = array('url' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'rate', 'fileBody' => $this->getRateFile($aData), 'ratePart' => $oVotingView->isEnabled() ? $oVotingView->getBigVoting() : '', 'fileTitle' => $aData[0]['title'], 'fileUri' => $this->oMedia->getCurrentUrl('file', $aData[0]['id'], $aData[0]['uri']), 'fileWhen' => defineTimeInterval($aData[0]['date']), 'fileFrom' => getNickName($aData[0]['ownerId']), 'fileFromLink' => getProfileLink($aData[0]['ownerId']));
             $sCode = $this->oMedia->oTemplate->parseHtmlByName('rate_object.html', $aUnit);
             checkAction($this->iViewer, $this->oMedia->oModule->_defineActionName('view'), true);
         } else {
             $sCode = MsgBox(_t('_' . $sMainPrefix . '_no_file_for_rate'));
         }
     }
     return array($sCode, array(), array(), false);
 }
コード例 #24
0
 function actionGetCurrentImage($iPicId)
 {
     $iPicId = (int) $iPicId;
     if ($iPicId > 0) {
         require_once 'BxPhotosSearch.php';
         $oMedia = new BxPhotosSearch();
         $aInfo = $oMedia->serviceGetPhotoArray($iPicId, 'file');
         $aInfo['ownerUrl'] = getProfileLink($aInfo['owner']);
         $aInfo['ownerName'] = getNickName($aInfo['owner']);
         $aInfo['date'] = defineTimeInterval($aInfo['date']);
         $oMedia->getRatePart();
         $aInfo['rate'] = $oMedia->oRate->getJustVotingElement(0, 0, $aInfo['rate']);
         $aLinkAddon = $oMedia->getLinkAddByPrams();
         $oPaginate = new BxDolPaginate(array('count' => (int) $_GET['total'], 'per_page' => 1, 'page' => (int) $_GET['page'], 'info' => false, 'per_page_changer' => false, 'page_reloader' => false, 'on_change_page' => 'getCurrentImage({page})'));
         $aInfo['paginate'] = $oPaginate->getPaginate();
         header('Content-Type:text/javascript');
         $oJSON = new Services_JSON();
         echo $oJSON->encode($aInfo);
     }
 }
コード例 #25
0
 /**
  * @description : function will generate profile block (used the profile template );
  * @return      : Html presentation data ;
  */
 function PrintSearhResult($aProfileInfo, $aCoupleInfo = '', $aExtendedKey = null, $sTemplateName = '', $oCustomTemplate = null)
 {
     global $site;
     global $aPreValues;
     $iVisitorID = getLoggedId();
     $bExtMode = !empty($_GET['mode']) && $_GET['mode'] == 'extended' || !empty($_GET['search_result_mode']) && $_GET['search_result_mode'] == 'ext';
     $isShowMatchPercent = $bExtMode && $iVisitorID && $iVisitorID != $aProfileInfo['ID'] && getParam('view_match_percent') && getParam('enable_match');
     $bPublic = $bExtMode ? bx_check_profile_visibility($aProfileInfo['ID'], $iVisitorID, true) : true;
     if ($bPublic && $iVisitorID != $aProfileInfo['ID'] && !isAdmin()) {
         $oPrivacy = new BxDolPrivacy('sys_page_compose_privacy', 'id', 'user_id');
         $iBlockID = $GLOBALS['MySQL']->getOne("SELECT `ID` FROM `sys_page_compose` WHERE `Page` = 'profile' AND `Func` = 'Description' AND `Column` != 0");
         $iPrivacyId = (int) $GLOBALS['MySQL']->getOne("SELECT `id` FROM `sys_page_compose_privacy` WHERE `user_id`='{$aProfileInfo['ID']}' AND `block_id`='{$iBlockID}' LIMIT 1");
         $bPublic = !$iBlockID || !$iPrivacyId || $oPrivacy->check('view_block', $iPrivacyId, $iVisitorID);
     }
     $sProfileThumb = get_member_thumbnail($aProfileInfo['ID'], 'none', !$bExtMode, 'visitor');
     $sProfileMatch = $isShowMatchPercent ? $GLOBALS['oFunctions']->getProfileMatch($iVisitorID, $aProfileInfo['ID']) : '';
     $sProfileNickname = '<a href="' . getProfileLink($aProfileInfo['ID']) . '">' . getNickName($aProfileInfo['ID']) . '</a>';
     $sProfileInfo = $GLOBALS['oFunctions']->getUserInfo($aProfileInfo['ID']);
     $sProfileDesc = $bPublic ? strmaxtextlen($aProfileInfo['DescriptionMe'], 130) : _t('_sys_profile_private_text_title');
     $sProfileZodiac = $bPublic && $bExtMode && getParam('zodiac') ? $GLOBALS['oFunctions']->getProfileZodiac($aProfileInfo['DateOfBirth']) : '';
     $sProfile2ASc1 = $sProfile2ASc2 = $sProfile2Nick = $sProfile2Desc = $sProfile2Info = $sProfile2Zodiac = '';
     if ($aCoupleInfo) {
         $sProfile2Nick = '<a href="' . getProfileLink($aCoupleInfo['ID']) . '">' . getNickName($aCoupleInfo['ID']) . '</a>';
         $sProfile2Info = $GLOBALS['oFunctions']->getUserInfo($aCoupleInfo['ID']);
         $sProfile2Desc = $bPublic ? strmaxtextlen($aCoupleInfo['DescriptionMe'], 130) : _t('_sys_profile_private_text_title');
         $sProfile2Zodiac = $bPublic && $bExtMode && getParam('zodiac') ? $GLOBALS['oFunctions']->getProfileZodiac($aCoupleInfo['DateOfBirth']) : '';
         $sProfile2ASc1 = 'float:left;width:31%;margin-right:10px;';
         $sProfile2ASc2 = 'float:left;width:31%;display:block;';
     } else {
         $sProfile2ASc2 = 'display:none;';
     }
     $aKeys = array('thumbnail' => $sProfileThumb, 'match' => $sProfileMatch, 'nick' => $sProfileNickname, 'info' => $sProfileInfo, 'i_am_desc' => $sProfileDesc, 'zodiac_sign' => $sProfileZodiac, 'nick2' => $sProfile2Nick, 'info2' => $sProfile2Info, 'i_am_desc2' => $sProfile2Desc, 'zodiac_sign2' => $sProfile2Zodiac, 'add_style_c1' => $sProfile2ASc1, 'add_style_c2' => $sProfile2ASc2);
     if ($aExtendedKey and is_array($aExtendedKey) and !empty($aExtendedKey)) {
         foreach ($aExtendedKey as $sKey => $sValue) {
             $aKeys[$sKey] = $sValue;
         }
     } else {
         $aKeys['ext_css_class'] = '';
     }
     return $oCustomTemplate ? $oCustomTemplate->parseHtmlByName($sTemplateName, $aKeys) : $GLOBALS['oSysTemplate']->parseHtmlByName($sTemplateName, $aKeys);
 }
コード例 #26
0
 function _getMessages($sUser, $sPwd, $isInbox)
 {
     $aRet = array();
     if (!($iId = BxDolXMLRPCUtil::checkLogin($sUser, $sPwd))) {
         return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct"));
     }
     $aMsgs = array();
     if ($isInbox) {
         $sWhere = "`Recipient` = '{$iId}' AND NOT FIND_IN_SET('recipient', `Trash`)";
     } else {
         $sWhere = "`Sender` = '{$iId}' AND NOT FIND_IN_SET('sender', `Trash`)";
     }
     $sFieldsAdd = $isInbox ? ", `m`.`Sender` AS `AuthorID`" : ", `m`.`Recipient` AS `AuthorID` ";
     $r = db_res("SELECT\n                `m`.`ID`, UNIX_TIMESTAMP(`m`.`Date`) AS `Date`, `m`.`Sender`, `m`.`Recipient`, `m`.`Subject`, `m`.`New` {$sFieldsAdd}\n            FROM `sys_messages` AS `m`\n            INNER JOIN `Profiles` as `p` ON (`p`.`ID` = `m`.`Sender`)\n            WHERE {$sWhere}\n            ORDER BY `Date` DESC");
     while ($aRow = $r->fetch()) {
         $sIcon = BxDolXMLRPCUtil::getThumbLink($isInbox ? $aRow['Sender'] : $aRow['Recipient'], 'thumb');
         $aMsg = array('ID' => new xmlrpcval($aRow['ID']), 'Date' => new xmlrpcval(defineTimeInterval($aRow['Date'])), 'Sender' => new xmlrpcval($aRow['Sender']), 'Recipient' => new xmlrpcval($aRow['Recipient']), 'Subject' => new xmlrpcval($aRow['Subject']), 'New' => new xmlrpcval($aRow['New']), 'Nick' => new xmlrpcval(getUsername($aRow['AuthorID'])), 'UserTitleInterlocutor' => new xmlrpcval(getNickName($aRow['AuthorID'])), 'Thumb' => new xmlrpcval($sIcon));
         $aMsgs[] = new xmlrpcval($aMsg, 'struct');
     }
     return new xmlrpcval($aMsgs, "array");
 }
コード例 #27
0
 function __construct()
 {
     $this->sName = 'bottom';
     $this->sDbTable = 'sys_menu_bottom';
     $this->sCacheKey = 'sys_menu_bottom';
     $this->aMenuInfo = array();
     if (isMember()) {
         $this->aMenuInfo['memberID'] = getLoggedId();
         $this->aMenuInfo['memberNick'] = getNickName($this->aMenuInfo['memberID']);
         $this->aMenuInfo['memberPass'] = getPassword($this->aMenuInfo['memberID']);
         $this->aMenuInfo['memberLink'] = getProfileLink($this->aMenuInfo['memberID']);
         $this->aMenuInfo['visible'] = 'memb';
     } else {
         $this->aMenuInfo['memberID'] = 0;
         $this->aMenuInfo['memberNick'] = '';
         $this->aMenuInfo['memberPass'] = '';
         $this->aMenuInfo['memberLink'] = '';
         $this->aMenuInfo['visible'] = 'non';
     }
     $this->aItems = array();
     $this->oPermalinks = new BxDolPermalinks();
 }
コード例 #28
0
ファイル: BxAvaModule.php プロジェクト: noormcs/studoro
 /**
  * Html to display on profile wall, when user uploads new avatar
  * @param $aEvent - wall event parameters
  * @return html to post on profile's wall
  */
 function serviceGetWallPost($aEvent)
 {
     $aProfile = getProfileInfo($aEvent['owner_id']);
     if (empty($aProfile)) {
         return array('perform_delete' => true);
     }
     if ($aProfile['Status'] != 'Active') {
         return "";
     }
     $sCss = '';
     if ($aEvent['js_mode']) {
         $sCss = $this->_oTemplate->addCss('wall_post.css', true);
     } else {
         $this->_oTemplate->addCss('wall_post.css');
     }
     $sOwner = getNickName((int) $aEvent['owner_id']);
     $sText = _t('_bx_ava_wall_' . $aEvent['action']);
     $aVars = array('cpt_user_name' => $sOwner, 'cpt_added_new' => $sText, 'cpt_object' => _t('_bx_ava_wall_object'), 'post_id' => $aEvent['id']);
     return array('title' => $sOwner . ' ' . $sText . ' ' . _t('_bx_ava_wall_object'), 'description' => '', 'content' => $sCss . $this->_oTemplate->parseHtmlByName('wall_post', $aVars));
 }
コード例 #29
0
 function getBlockCode_Author()
 {
     $aOwner = array('medProfId' => $this->aInfo['Owner'], 'NickName' => getNickName($this->aInfo['Owner']));
     return $this->oTemplate->getFileAuthor($aOwner);
 }
コード例 #30
0
 function displayFriendAccept($aEvent)
 {
     $aOwner = $this->_oDb->getUser($aEvent['owner_id']);
     $aFriend = $this->_oDb->getUser($aEvent['object_id']);
     if (empty($aOwner) || empty($aFriend)) {
         return array('perform_delete' => true);
     }
     if ($aOwner['status'] != 'Active' || $aFriend['status'] != 'Active') {
         return "";
     }
     $sOwner = getNickName((int) $aEvent['owner_id']);
     $iFriend = (int) $aFriend['id'];
     $sFriend = getNickName($iFriend);
     return array('title' => $sOwner . ' ' . _t('_wall_friends_with') . ' ' . $aFriend['username'], 'description' => '', 'content' => $this->parseHtmlByName('f_accept.html', array('cpt_user_name' => $sOwner, 'cpt_friend_url' => getProfileLink($aFriend['id']), 'cpt_friend_name' => $sFriend, 'cnt_friend' => get_member_thumbnail($iFriend, 'none', true), 'post_id' => $aEvent['id'])));
 }