/** * @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); }
function unit($aData, $sTemplateName, &$oVotingView) { if (null == $this->_oMain) { $this->_oMain = BxDolModule::getInstance('BxStoreModule'); } if (!$this->_oMain->isAllowedView($aData)) { $aVars = array('extra_css_class' => 'bx_store_unit'); return $this->parseHtmlByName('browse_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']; } $sPrice = ''; if ('Free' == $aData['price_range']) { $sPrice = _t('_bx_store_free_product'); } else { $sPrice = str_replace('.00', '', sprintf($aData['price_range'], getParam('pmt_default_currency_sign'), getParam('pmt_default_currency_sign'))); } $aVars = array('id' => $aData['id'], 'thumb_url' => $sImage ? $sImage : $this->getIconUrl('no-photo.png'), 'product_url' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aData['uri'], 'product_title' => $aData['title'], 'created' => defineTimeInterval($aData['created']), 'author' => $aData['author_id'] ? $aData['NickName'] : _t('_bx_store_admin'), 'author_url' => $aData['author_id'] ? getProfileLink($aData['author_id']) : 'javascript:void(0);', 'price_range' => $sPrice); $aVars['rate'] = $oVotingView ? $oVotingView->getJustVotingElement(0, $aData['id'], $aData['rate']) : ' '; return $this->parseHtmlByName($sTemplateName, $aVars); }
function _checkProfileMatch($iProfileId, $sAction) { $aProfile = getProfileInfo($iProfileId); if ($aProfile['Status'] == 'Active' && ($aProfile['UpdateMatch'] || $sAction == 'join')) { $oDb = new BxDolDb(); // clear field "UpdateMatch" $oDb->query("UPDATE `Profiles` SET `UpdateMatch` = 0 WHERE `ID`= {$iProfileId}"); // clear cache $oDb->query("DELETE FROM `sys_profiles_match`"); // get send mails $aSendMails = $oDb->getRow("SELECT `profiles_match` FROM `sys_profiles_match_mails` WHERE `profile_id` = {$iProfileId}"); $aSend = !empty($aSendMails) ? unserialize($aSendMails['profiles_match']) : array(); $aProfiles = getMatchProfiles($iProfileId); foreach ($aProfiles as $iProfId) { if (!isset($aSend[(int) $iProfId])) { $oEmailTemplate = new BxDolEmailTemplates(); $aMessage = $oEmailTemplate->parseTemplate('t_CupidMail', array('StrID' => $iProfId, 'MatchProfileLink' => getProfileLink($iProfileId)), $iProfId); $aProfile = getProfileInfo($iProfId); if (!empty($aProfile) && $aProfile['Status'] == 'Active') { $oDb->query("INSERT INTO `sys_sbs_queue`(`email`, `subject`, `body`) VALUES('" . $aProfile['Email'] . "', '" . process_db_input($aMessage['subject'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION) . "', '" . process_db_input($aMessage['body'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION) . "')"); } $aSend[(int) $iProfId] = 0; } } if (empty($aSendMails)) { $oDb->query("INSERT INTO `sys_profiles_match_mails`(`profile_id`, `profiles_match`) VALUES({$iProfileId}, '" . serialize($aSend) . "')"); } else { $oDb->query("UPDATE `sys_profiles_match_mails` SET `profiles_match` = '" . serialize($aSend) . "' WHERE `profile_id` = {$iProfileId}"); } } }
/** * 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; }
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)); }
function GenStoredMemIPs() { $sCntSQL = "SELECT COUNT(*) FROM `sys_ip_members_visits`"; //////////////////////////// $iTotalNum = db_value($sCntSQL); if (!$iTotalNum) { return MsgBox(_t('_Empty')); } $iPerPage = (int) $_GET['per_page']; if (!$iPerPage) { $iPerPage = 10; } $iCurPage = (int) $_GET['page']; if ($iCurPage < 1) { $iCurPage = 1; } $sLimitFrom = ($iCurPage - 1) * $iPerPage; $sqlLimit = "LIMIT {$sLimitFrom}, {$iPerPage}"; //////////////////////////// $sSQL = "SELECT *, UNIX_TIMESTAMP(`DateTime`) AS `DateTimeTS` FROM `sys_ip_members_visits` ORDER BY `DateTime` DESC {$sqlLimit}"; $rIPList = db_res($sSQL); $aTmplVarsItems = array(); while ($aIPList = mysql_fetch_assoc($rIPList)) { $iID = (int) $aIPList['ID']; $sFrom = long2ip($aIPList['From']); $sLastDT = getLocaleDate($aIPList['DateTimeTS'], BX_DOL_LOCALE_DATE); $sMember = $aIPList['MemberID'] ? '<a href="' . getProfileLink($aIPList['MemberID']) . '">' . getNickname($aIPList['MemberID']) . '</a>' : ''; $aTmplVarsItems[] = array('from' => $sFrom, 'bx_if:show_profile_link' => array('condition' => !empty($aIPList['MemberID']), 'content' => array('href' => getProfileLink($aIPList['MemberID']), 'caption' => getNickname($aIPList['MemberID']))), 'date' => $sLastDT); } $oPaginate = new BxDolPaginate(array('page_url' => $GLOBALS['site']['url_admin'] . 'ip_blacklist.php?mode=list&page={page}&per_page={per_page}', 'count' => $iTotalNum, 'per_page' => $iPerPage, 'page' => $iCurPage)); return $GLOBALS['oAdmTemplate']->parseHtmlByName('ip_blacklist_list_ips.html', array('bx_repeat:items' => $aTmplVarsItems, 'paginate' => $oPaginate->getPaginate())); }
/** * send "tell a friend" email */ function SendTellFriend($iSenderID = 0) { global $profileID; $sRecipient = clear_xss($_POST['friends_emails']); $sSenderName = clear_xss($_POST['name']); $sSenderEmail = clear_xss($_POST['email']); if (strlen(trim($sRecipient)) <= 0) { return 0; } if (strlen(trim($sSenderEmail)) <= 0) { return 0; } $sLinkAdd = $iSenderID > 0 ? 'idFriend=' . $iSenderID : ''; $rEmailTemplate = new BxDolEmailTemplates(); if ($profileID) { $aTemplate = $rEmailTemplate->getTemplate('t_TellFriendProfile', $profileID); $Link = getProfileLink($profileID, $sLinkAdd); } else { $aTemplate = $rEmailTemplate->getTemplate('t_TellFriend'); $Link = BX_DOL_URL_ROOT; if (strlen($sLinkAdd) > 0) { $Link .= '?' . $sLinkAdd; } } $aPlus = array('Link' => $Link, 'FromName' => $sSenderName); return sendMail($sRecipient, $aTemplate['Subject'], $aTemplate['Body'], '', $aPlus); }
/** * send "tell a friend" email */ function SendTellFriend($iSenderID = 0) { global $profileID; $sSenderEmail = clear_xss(bx_get('sender_email')); if (strlen(trim($sSenderEmail)) <= 0) { return 0; } $sSenderName = clear_xss(bx_get('sender_name')); $sSenderLink = $iSenderID != 0 ? getProfileLink($iSenderID) : BX_DOL_URL_ROOT; $sRecipientEmail = clear_xss(bx_get('recipient_email')); if (strlen(trim($sRecipientEmail)) <= 0) { return 0; } $sLinkAdd = $iSenderID > 0 ? 'idFriend=' . $iSenderID : ''; $rEmailTemplate = new BxDolEmailTemplates(); if ($profileID) { $aTemplate = $rEmailTemplate->getTemplate('t_TellFriendProfile', getLoggedId()); $Link = getProfileLink($profileID, $sLinkAdd); } else { $aTemplate = $rEmailTemplate->getTemplate('t_TellFriend', getLoggedId()); $Link = BX_DOL_URL_ROOT; if (strlen($sLinkAdd) > 0) { $Link .= '?' . $sLinkAdd; } } return sendMail($sRecipientEmail, $aTemplate['Subject'], $aTemplate['Body'], '', array('Link' => $Link, 'SenderName' => $sSenderName, 'SenderLink' => $sSenderLink)); }
function send_cupid_email($aAnyProf, $iSelCupID) { global $site; $message = getParam("t_CupidMail"); $subject = getParam('t_CupidMail_subject'); $subject = addslashes($subject); $recipient = $aAnyProf['Email']; $headers = "From: {$site['title']} <{$site['email_notify']}>"; $headers2 = "-f{$site['email_notify']}"; $message = str_replace("<SiteName>", $site['title'], $message); $message = str_replace("<Domain>", $site['url'], $message); $message = str_replace("<RealName>", $aAnyProf['NickName'], $message); $message = str_replace("<StrID>", $aAnyProf['ID'], $message); $message = str_replace("<MatchProfileLink>", getProfileLink($iSelCupID), $message); $message = addslashes($message); if ('Text' == $aAnyProf['EmailFlag']) { $message = html2txt($message); } if ('HTML' == $aAnyProf['EmailFlag']) { $headers = "MIME-Version: 1.0\r\n" . "Content-type: text/html; charset=UTF-8\r\n" . $headers; } $sql = "INSERT INTO `NotifyQueue` SET `Email` = {$aAnyProf['ID']}, Msg = 0, `From` = 'ProfilesMsgText', Creation = NOW(), MsgText = '{$message}', MsgSubj = '{$subject}'"; $res = db_res($sql); return true; }
function getBaseUrl() { $aEntry = getProfileInfo($this->getId()); if (empty($aEntry) || !is_array($aEntry)) { return ''; } return getProfileLink($aEntry['ID']); }
function blockInfo(&$aEvent) { if (null == $this->_oMain) { $this->_oMain = BxDolModule::getInstance('BxEventsModule'); } $aAuthor = getProfileInfo($aEvent['ResponsibleID']); $aVars = array('author_unit' => $GLOBALS['oFunctions']->getMemberThumbnail($aAuthor['ID'], 'none', true), 'date' => getLocaleDate($aEvent['Date'], BX_DOL_LOCALE_DATE_SHORT), 'date_ago' => defineTimeInterval($aEvent['Date'], false), 'cats' => $this->parseCategories($aEvent['Categories']), 'tags' => $this->parseTags($aEvent['Tags']), 'location' => $this->_oMain->_formatLocation($aEvent, true, true), 'fields' => $this->blockFields($aEvent), 'author_username' => $aAuthor ? $aAuthor['NickName'] : _t('_bx_events_admin'), 'author_url' => $aAuthor ? getProfileLink($aAuthor['ID']) : 'javascript:void(0)'); return $this->parseHtmlByName('block_info', $aVars); }
function nm_home_tabs($cats, $width = 463, $height = 210) { $cats = explode(',', $cats); $cat = get_category_by_slug($cats[0]); $cat = get_category($cat->category_parent); echo '<div id="tab-instance-' . $cat->slug . '" class="tabs" style="width: ' . $width . 'px;"><ul class="tabs-nav">'; $class = ' class="tabs-nav-active"'; //Generate the nav from the cats foreach ($cats as $cat) { $cat = get_category_by_slug($cat); echo '<li><a id="a-' . $cat->slug . '"' . $class . ' href="javascript:show_home_tab(\'a-' . $cat->slug . '\')">' . $cat->name . '</a></li>'; $class = ''; } echo '</ul><div class="tabs-content" style="height: ' . $height . 'px;">'; foreach ($cats as $cat) { echo '<ul id="ul-' . $cat . '" class="tabs-content-ul">'; //Check if is older then 3 days, if is then order by rand $orderby = ''; query_posts('showposts=1&category_name=' . $cat); if (have_posts()) { while (have_posts()) { the_post(); $older = date('YMD'); $days_since = floor((date('U') - get_the_time('U')) / 86400); if ($days_since >= 4) { $orderby = '&orderby=rand'; } } } query_posts('showposts=5&category_name=' . $cat . $orderby); if (have_posts()) { while (have_posts()) { the_post(); global $post; echo '<li class="tabs-content-item"> <h4><a href="' . get_permalink() . '">' . $post->post_title . '</a></h4>' . '<a href="' . get_permalink() . '">' . article_image($post->ID, 'small', true) . '</a>'; echo '<p>'; wswwpx_content_extract('', '15', '15', 2, '', '', TRUE, FALSE); echo '</p>'; echo '<p class="tabs-content-meta">'; echo '<a href="' . get_permalink() . '">'; comments_number('No Comments', '1 Comment', '% Comments'); echo '</a> | Posted: '; the_time('l, F jS, Y'); echo ' | By: <a href="' . getProfileLink($post->post_author) . '">'; the_author(); echo '</a>'; echo '</p>'; echo '</li>'; } } echo '</ul>'; } echo '</div> </div>'; }
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); }
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); }
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('<', '>')); }
/** * 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; }
/** * Constructor */ public function __construct($iProfileID = 0) { $sKey = getParam('sys_akismet_api_key'); if ($sKey) { require_once BX_DIRECTORY_PATH_PLUGINS . 'akismet/Akismet.class.php'; $this->oAkismet = new Akismet(BX_DOL_URL_ROOT, $sKey); $aProfile = getProfileInfo($iProfileID); if ($aProfile) { $this->oAkismet->setCommentAuthor($aProfile['NickName']); $this->oAkismet->setCommentAuthorEmail($aProfile['Email']); $this->oAkismet->setCommentAuthorURL(getProfileLink($aProfile['ID'])); } } }
function getVendorInfoProfile($iId) { $sCurrencyCode = $this->_oConfig->getCurrencyCode(); $sCurrencySign = $this->_oConfig->getCurrencySign(); if ($iId == BX_PMT_ADMINISTRATOR_ID) { return array('id' => BX_PMT_ADMINISTRATOR_ID, 'username' => _t('_payment_txt_username_' . BX_PMT_ADMINISTRATOR_USERNAME), 'profile_url' => '', 'status' => 'Active', 'currency_code' => $sCurrencyCode, 'currency_sign' => $sCurrencySign); } $sSql = "SELECT \n\t `tp`.`ID` AS `id`,\n\t `tp`.`NickName` AS `username`,\n\t '' AS `profile_url`,\n\t `tp`.`Status` AS `status`,\n\t '" . $sCurrencyCode . "' AS `currency_code`,\n\t '" . $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_url'] = getProfileLink($aVendor['id']); } return $aVendor; }
function GenStoredMemIPs() { $sFromC = _t('_From'); $sMemberC = _t('_Member'); $sDatatimeC = _t('_Date'); $sCaptionC = _t('_adm_ipbl_Stored_members_caption'); $sRes = '<br /><h2>' . $sCaptionC . '</h2>'; $sTableRes .= <<<EOF <table style="width:99%;" border="1" cellpadding="2" cellspacing="1" style="border-collapse: collapse"> \t<tr> \t\t<td>{$sFromC}</td> <td>{$sMemberC}</td> \t\t<td>{$sDatatimeC}</td> \t</tr> EOF; $sCntSQL = "SELECT COUNT(*) FROM `sys_ip_members_visits`"; //////////////////////////// $iTotalNum = db_value($sCntSQL); if (!$iTotalNum) { return $sRes . MsgBox(_t('_Empty')); } $iPerPage = (int) $_GET['per_page']; if (!$iPerPage) { $iPerPage = 10; } $iCurPage = (int) $_GET['page']; if ($iCurPage < 1) { $iCurPage = 1; } $sLimitFrom = ($iCurPage - 1) * $iPerPage; $sqlLimit = "LIMIT {$sLimitFrom}, {$iPerPage}"; //////////////////////////// $sSQL = "SELECT * FROM `sys_ip_members_visits` ORDER BY `DateTime` ASC {$sqlLimit}"; $rIPList = db_res($sSQL); while ($aIPList = mysql_fetch_assoc($rIPList)) { $iID = (int) $aIPList['ID']; $sFrom = long2ip($aIPList['From']); $sLastDT = $aIPList['DateTime']; $sMember = $aIPList['MemberID'] ? '<a href="' . getProfileLink($aIPList['MemberID']) . '">' . getNickname($aIPList['MemberID']) . '</a>' : ''; $sTableRes .= "<tr><td>{$sFrom}</td><td>{$sMember}</td><td>{$sLastDT}</td></tr>"; } $sTableRes .= <<<EOF </table> <div class="clear_both"></div> <br /> EOF; $sRequest = $GLOBALS['site']['url_admin'] . 'ip_blacklist.php?page={page}&per_page={per_page}'; $oPaginate = new BxDolPaginate(array('page_url' => $sRequest, 'count' => $iTotalNum, 'per_page' => $iPerPage, 'page' => $iCurPage, 'per_page_changer' => true, 'page_reloader' => true, 'on_change_page' => null, 'on_change_per_page' => null)); return $sRes . $sTableRes . $oPaginate->getPaginate(); }
function getBlockCode_UpcomingPhoto() { $aEvent = $this->oDb->getUpcomingEvent(getParam('bx_events_main_upcoming_event_from_featured_only') ? true : false); if (!$aEvent) { return MsgBox(_t('_Empty')); } $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']); $aVars = array('image_url' => !$aImage['no_image'] && $aImage['file'] ? $aImage['file'] : $this->oTemplate->getIconUrl('no-photo-110.png'), 'image_title' => !$aImage['no_image'] && $aImage['title'] ? $aImage['title'] : '', 'event_url' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aEvent['EntryUri'], 'event_title' => $aEvent['Title'], 'event_start' => getLocaleDate($aEvent['EventStart']), 'event_start_in' => defineTimeInterval($aEvent['EventStart']), 'author_title' => _t('_From'), 'author_username' => $aAuthor['NickName'], 'author_url' => getProfileLink($aAuthor['ID']), 'rating' => $oRating->isEnabled() ? $oRating->getJustVotingElement(true, $aEvent['ID']) : '', 'participants' => $aEvent['FansCount'], 'country_city' => '<a href="' . $this->oConfig->getBaseUri() . 'browse/country/' . strtolower($aEvent['Country']) . '">' . _t($GLOBALS['aPreValues']['Country'][$aEvent['Country']]['LKey']) . '</a>' . (trim($aEvent['City']) ? ', ' . $aEvent['City'] : ''), 'place' => $aEvent['Place'], 'flag_image' => genFlag($aEvent['Country'])); return $this->oTemplate->parseHtmlByName('main_event', $aVars); }
function getFileInfo($aInfo) { if (empty($aInfo)) { return ''; } $aMediaInfo = array(); $aMediaInfo['memberPic'] = get_member_thumbnail($aInfo['medProfId'], 'none', false); $aMediaInfo['memberUrl'] = getProfileLink($aInfo['medProfId']); $aMediaInfo['memberNick'] = $aInfo['NickName']; $aMediaInfo['dateIcon'] = $this->getIconUrl('clock.png'); $aMediaInfo['dateInfo'] = getLocaleDate($aInfo['medDate'], BX_DOL_LOCALE_DATE_SHORT); $aMediaInfo['dateInfoAgo'] = defineTimeInterval($aInfo['medDate']); return $this->parseHtmlByName('media_info.html', $aMediaInfo); }
function GenStoredMemIPs() { $sRes = ''; $sFromC = _t('_From'); $sMemberC = _t('_Member'); $sDatatimeC = _t('_Date'); $sTableRes .= <<<EOF <table style="width:99%; border-collapse:collapse;" cellpadding="4" style="border-collapse: collapse"> <tr> <td class="bx-def-border">{$sFromC}</td> <td class="bx-def-border">{$sMemberC}</td> <td class="bx-def-border">{$sDatatimeC}</td> </tr> EOF; $sCntSQL = "SELECT COUNT(*) FROM `sys_ip_members_visits`"; //////////////////////////// $iTotalNum = db_value($sCntSQL); if (!$iTotalNum) { return $sRes . MsgBox(_t('_Empty')); } $iPerPage = (int) $_GET['per_page']; if (!$iPerPage) { $iPerPage = 10; } $iCurPage = (int) $_GET['page']; if ($iCurPage < 1) { $iCurPage = 1; } $sLimitFrom = ($iCurPage - 1) * $iPerPage; $sqlLimit = "LIMIT {$sLimitFrom}, {$iPerPage}"; //////////////////////////// $sSQL = "SELECT *, UNIX_TIMESTAMP(`DateTime`) AS `DateTimeTS` FROM `sys_ip_members_visits` ORDER BY `DateTime` DESC {$sqlLimit}"; $rIPList = db_res($sSQL); while ($aIPList = mysql_fetch_assoc($rIPList)) { $iID = (int) $aIPList['ID']; $sFrom = long2ip($aIPList['From']); $sLastDT = getLocaleDate($aIPList['DateTimeTS'], BX_DOL_LOCALE_DATE); $sMember = $aIPList['MemberID'] ? '<a href="' . getProfileLink($aIPList['MemberID']) . '">' . getNickname($aIPList['MemberID']) . '</a>' : ''; $sTableRes .= "<tr><td class='bx-def-border'>{$sFrom}</td><td class='bx-def-border'>{$sMember}</td><td class='bx-def-border'>{$sLastDT}</td></tr>"; } $sTableRes .= <<<EOF </table> <div class="clear_both"></div> EOF; $sRequest = $GLOBALS['site']['url_admin'] . 'ip_blacklist.php?mode=list&page={page}&per_page={per_page}'; $oPaginate = new BxDolPaginate(array('page_url' => $sRequest, 'count' => $iTotalNum, 'per_page' => $iPerPage, 'page' => $iCurPage, 'per_page_changer' => true, 'page_reloader' => true, 'on_change_page' => null, 'on_change_per_page' => null)); $sContent = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $sRes . $sTableRes)); return $sContent . $oPaginate->getPaginate(); }
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); }
/** * 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; }
/** * page code function */ function PageCompPageMainCode() { global $short_date_format; $story_id = (int) $_GET['ID']; $out = ""; $query = "SELECT `Profiles`.`ID`, DATE_FORMAT(`Stories`.`Date`, '{$short_date_format}' ) AS 'Date', `Stories`.`Header`, `Stories`.`Text`, `Profiles`.`NickName` FROM `Stories` LEFT JOIN `Profiles` ON (`Stories`.`Sender` = `Profiles`.`ID`) WHERE `Stories`.`ID` = {$story_id} ORDER BY `Stories`.`Date` DESC"; $arr = db_arr($query); if (!$arr) { return "<center>" . _t("_No success story available.") . "</center>"; } $story_header = process_text_output($arr['Header']); $story_text = process_html_output($arr['Text']); $out .= "\r\n\t\t<table width=\"100%\" cellpadding=4 cellspacing=4><td align=center class=text2>\r\n\t\t\t<td>\r\n\t\t\t\t<table cellspacing=1 cellpadding=2 class=small width=100%>\r\n\t\t\t\t\t<tr class=panel>\r\n\t\t\t\t\t\t<td align=center width=15%>{$arr['Date']}</td>\r\n\t\t\t\t\t\t<td align=center width=15%><a href='" . getProfileLink($arr['ID']) . "'>{$arr['NickName']}</td>\r\n\t\t\t\t\t\t<td aling=left> <b>{$story_header}</b></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t\t<table cellspacing=1 cellpadding=2 class=small width=100%>\r\n\t\t\t\t\t<tr class=panel>\r\n\t\t\t\t\t\t<td aling=left>{$story_text}</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t</td>\r\n\t\t</table>\n"; return $out; }
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); }
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_LatestFeaturedGroup() { $aDataEntry = $this->oDb->getLatestFeaturedItem(); if (!$aDataEntry) { return MsgBox(_t('_Empty')); } $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_groups_import('Voting'); $oRating = new BxGroupsVoting('bx_groups', $aDataEntry['id']); $aVars = array('image_url' => !$aImage['no_image'] && $aImage['file'] ? $aImage['file'] : $this->oTemplate->getIconUrl('no-photo-110.png'), 'image_title' => !$aImage['no_image'] && $aImage['title'] ? $aImage['title'] : '', 'group_url' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aDataEntry['uri'], 'group_title' => $aDataEntry['title'], 'author_title' => _t('_From'), 'author_username' => $aAuthor['NickName'], 'author_url' => getProfileLink($aAuthor['ID']), 'rating' => $oRating->isEnabled() ? $oRating->getJustVotingElement(true, $aDataEntry['id']) : ''); return $this->oTemplate->parseHtmlByName('latest_featured_group', $aVars); }
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`= ?\n LIMIT 1"; $aVendor = $this->getRow($sSql, [$iId]); 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 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']) : ' '))); return $this->parseHtmlByName($sTemplateName, $aVars); }