function getLatestNews() { $iNewsOnHome = $this->oTemplConfig->iMaxNewsOnIndex; $query = "\r\n\t\t\tSELECT\r\n\t\t\t\t`ID`,\r\n\t\t\t\t`Text`,\r\n\t\t\t\t`Header`,\r\n\t\t\t\t`Date`\r\n\t\t\tFROM\r\n\t\t\t\t`News`\r\n\t\t\tORDER BY `Date` DESC\r\n\r\n\t\t\tLIMIT {$iNewsOnHome}\r\n\t\t;"; $rNews = $this->oDb->getAll($query); if (!is_array($rNews['0'])) { return _t_action('_No news available'); } $ret = ''; foreach ($rNews as $aNews) { $ret .= ' <div class="indexNewsBlock"> <div class="indexNewsHeader"> <a href="' . $this->aSite['url'] . 'news_view.php?ID=' . process_line_output($aNews['ID']) . '"> ' . strmaxtextlen(process_line_output($aNews['Header']), $this->oTemplConfig->iNewsHeader) . ' </a> </div> <div class="indexNewsText"> ' . strmaxtextlen(process_html_output($aNews['Text']), $this->oTemplConfig->iNewsPreview) . ' </div> <div class="indexNewsDate"> ' . process_line_output($aNews['Date']) . ' </div> </div> '; } $ret .= '<div class="indexNewsArchive"><a href="' . $this->aSite['url'] . 'news.php">' . _t("_Read news in archive") . '</a></div>'; return $ret; }
/** * page code function */ function PageCompPageMainCode() { global $site; global $short_date_format; $messageID = (int) $_GET['message']; $memberID = (int) $_COOKIE['memberID']; $sender_sql = "SELECT `Sender` FROM `Messages` WHERE `Recipient` = '{$memberID}' AND `ID` = '{$messageID}'"; $sender_arr = db_arr($sender_sql); $senderID = (int) $sender_arr['Sender']; $message_sql = "SELECT m.`Text`, m.`Subject`, DATE_FORMAT( m.`Date`, '{$short_date_format}' ) AS `Date`, p.Status FROM `Messages` AS m LEFT JOIN Profiles AS p ON m.Sender = p.ID WHERE m.`ID` = '{$messageID}' AND `Recipient` = '{$memberID}'"; // Did you find me, Smoge? I see you... $message_arr = db_arr($message_sql); $ret = ''; $ret .= '<div class="profile_ditails_block">'; $ret .= ProfileDetails($senderID); $ret .= '<div class="clear_both"></div>'; $ret .= '</div>'; $ret .= '<div class="m_block">'; $ret .= '<div class="m_subject_date">'; $ret .= '<div class="name">'; $ret .= _t('_Date') . ':'; $ret .= '</div>'; $ret .= '<div class="value">'; $ret .= $message_arr['Date']; $ret .= '</div>'; $ret .= '<div class="name">'; $ret .= _t('_Subject') . ':'; $ret .= '</div>'; $ret .= '<div class="value">'; $ret .= process_smiles(process_line_output($message_arr['Subject'])); $ret .= '</div>'; $ret .= '</div>'; $ret .= '<div class="m_text">'; $ret .= process_html_output($message_arr['Text'], 150); $ret .= '</div>'; $ret .= '<div class="clear_both"></div>'; $ret .= '</div>'; if ($message_arr['Status'] == 'Active') { $ret .= '<div class="reply">'; $ret .= '<a href="' . $site['url'] . 'compose.php?ID=' . $senderID . '&messageID=' . $messageID . '&subject=' . process_smiles(process_line_output($message_arr['Subject'])) . '">Reply</a>'; $ret .= '</div>'; $ret .= '<div class="reply">'; $ret .= "<a onClick=\"javascript:window.open( 'list_pop.php?action=spam&ID=" . $senderID . "', '', 'width=500,height=200,menubar=no,status=no,resizeable=no,scrollbars=no,toolbar=no,location=no' );\" href=\"javascript:void(0)\">" . _t('_Spam report') . "</a>"; $ret .= '</div>'; $ret .= '<div class="reply">'; $ret .= '<a href="messages_inbox.php?action=delete&message=' . $messageID . '">' . _t('_Delete') . '</a>'; $ret .= '</div>'; $ret .= '<div class="clear_both"></div>'; } else { $ret .= ''; } //$ret .= '</div>'; //#################################################### $ret .= '<div style="position:relative; height:20px;"></div>'; $ret .= PageCorespondence($memberID, $senderID); $ret .= '<div class="clear_both"></div>'; return $ret; }
/** * page code function */ function PageCompPageMainCode() { global $site; $messageID = (int) $_GET['message']; $memberID = (int) $_COOKIE['memberID']; $sender_sql = "SELECT `Recipient` FROM `Messages` WHERE `Sender` = '{$memberID}' AND `ID` = '{$messageID}'"; $sender_arr = db_arr($sender_sql); $senderID = $sender_arr['Recipient']; $message_sql = "SELECT m.`Text`, m.`Subject`, DATE_FORMAT( m.`Date`, '%Y-%m-%d' ) AS `Date`, p.Status FROM `Messages` AS m LEFT JOIN Profiles AS p ON m.Recipient = p.ID WHERE m.`ID` = '{$messageID}'"; // AND`Sender` = '$senderID'"; $message_arr = db_arr($message_sql); $ret = ''; $ret .= '<div class="profile_ditails_block">'; $ret .= ProfileDetails($senderID); $ret .= '<div class="clear_both"></div>'; $ret .= '</div>'; $ret .= '<div class="m_block">'; $ret .= '<div class="m_subject_date">'; $ret .= '<div class="name">'; $ret .= _t('_Date') . ':'; $ret .= '</div>'; $ret .= '<div class="value">'; $ret .= $message_arr['Date']; $ret .= '</div>'; $ret .= '<div class="name">'; $ret .= _t('_Subject') . ':'; $ret .= '</div>'; $ret .= '<div class="value">'; $ret .= process_smiles(process_line_output($message_arr['Subject'])); $ret .= '</div>'; $ret .= '</div>'; $ret .= '<div class="m_text">'; $ret .= process_html_output($message_arr['Text'], 80); $ret .= '</div>'; $ret .= '<div class="clear_both"></div>'; $ret .= '</div>'; //$ret .= '<div class="reply_block">'; if ($message_arr['Status'] == 'Active') { $ret .= '<div class="reply">'; $ret .= '<a href="' . $site['url'] . 'compose.php?ID=' . $senderID . '">Write new Message</a>'; $ret .= '</div>'; $ret .= '<div class="clear_both"></div>'; } else { $ret .= ''; } //#################################################### $ret .= '<div style="position:relative; height:20px;"></div>'; $ret .= PageCorespondence($memberID, $senderID); $ret .= '<div class="clear_both"></div>'; return $ret; }
/** * 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 GenIPBlackListTable() { $sSQL = "SELECT *, FROM_UNIXTIME(`LastDT`) AS `LastDT_U` FROM `sys_ip_list` ORDER BY `From` ASC"; $rIPList = db_res($sSQL); $aTmplVarsItems = array(); while ($aIPList = mysql_fetch_assoc($rIPList)) { $iID = (int) $aIPList['ID']; $sFrom = long2ip($aIPList['From']); $sTo = $aIPList['To'] == 0 ? '' : long2ip($aIPList['To']); $sType = process_html_output($aIPList['Type']); $sLastDT_Formatted = getLocaleDate($aIPList['LastDT'], BX_DOL_LOCALE_DATE); $sLastDT = preg_replace('/([\\d]{2}):([\\d]{2}):([\\d]{2})/', '$1:$2', $aIPList['LastDT_U']); $sDesc = process_html_output($aIPList['Desc']); $sDescAttr = bx_html_attribute(bx_js_string($aIPList['Desc'], BX_ESCAPE_STR_APOS)); $aTmplVarsItems[] = array('id' => $iID, 'from' => $sFrom, 'to' => $sTo, 'type' => $sType, 'date' => $sLastDT, 'date_uf' => $sLastDT_Formatted, 'description' => $sDesc, 'description_attr' => $sDescAttr, 'delete_action_url' => bx_append_url_params($this->_sActionUrl, array('action' => 'apply_delete', 'id' => $iID))); } if (empty($aTmplVarsItems)) { return MsgBox(_t('_Empty')); } return $GLOBALS['oAdmTemplate']->parseHtmlByName('ip_blacklist_list_filters.html', array('bx_repeat:items' => $aTmplVarsItems)); }
function printNewsPanel($iLimit = 0, $iPreview = 128) { global $site; $php_date_format = getParam('php_date_format'); // news $news_limit_chars = getParam("max_news_preview"); $bNewsFriendly = getParam('permalinks_news') == 'on' ? true : false; $news_res = getNewsList($iLimit); $news_count = db_arr("SELECT COUNT(*) FROM `News`"); $news_counter = $news_count['0']; $ret = ''; if ($news_counter > 0) { while ($news_arr = mysql_fetch_assoc($news_res)) { $ret .= '<div class="newsWrap">'; $ret .= '<div class="newsHead">'; $ret .= '<a href="' . getNewsUrl($news_arr['newsID'], $news_arr['NewsUri'], $bNewsFriendly) . '">'; $ret .= process_line_output($news_arr['Header']); $ret .= '</a>'; $ret .= '</div>'; //$ret .= '<div class="newsInfo"><img src="' . getTemplateIcon( 'clock.gif' ) . '" />' . date( $php_date_format, $news_arr['Date'] ) . '</div>'; $ret .= '<div class="newsInfo"><img src="' . getTemplateIcon('clock.gif') . '" />' . LocaledDataTime($news_arr['Date']) . '</div>'; $ret .= '<div class="newsText">'; //$ret .= process_text_withlinks_output( $news_arr['Snippet'] ); $ret .= process_html_output($news_arr['Snippet']); $ret .= '</div>'; $ret .= '</div>'; } if ($news_counter > $max_news_on_home) { $sNewsLink = $bNewsFriendly ? $site['url'] . 'news/' : $site['url'] . 'news.php'; $ret .= '<div class="newsReadMore">'; $ret .= '<a href="' . $sNewsLink . '">' . _t("_Read news in archive") . '</a>'; $ret .= '</div>'; } } else { $ret .= '<div class="no_result"><div>' . _t("_No news available") . '</div></div>'; } return $ret; }
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('{', '}')); }
function getArticle($iArticleID) { global $short_date_format; if (!(int) $iArticleID) { return ''; } else { $sArticleQuery = "\n\t\t\t\tSELECT\n\t\t\t\t\t\t`Title`,\n\t\t\t\t\t\t`Text`,\n\t\t\t\t\t\t`Articles`.`CategoryID`,\n\t\t\t\t\t\tDATE_FORMAT( `Date`, '{$short_date_format}' ) AS Date,\n\t\t\t\t\t\t`ArticlesID`,\n\t\t\t\t\t\t`CategoryName`,\n\t\t\t\t\t\t`ArticleFlag`\n\t\t\t\tFROM\n\t\t\t\t\t\t`Articles`\n\t\t\t\tINNER JOIN `ArticlesCategory` ON `Articles`.`CategoryID` = `ArticlesCategory`.`CategoryID`\n\t\t\t\tWHERE\n\t\t\t\t\t\t`ArticlesID` = '{$iArticleID}'\n\t\t\t\tLIMIT 1;\n\n\t\t"; } $aArticle = db_arr($sArticleQuery); $ret = ''; $ret .= '<div class="navigationLinks">' . "\n"; $ret .= '<span>' . "\n"; $ret .= '<a href="articles.php">' . "\n"; $ret .= 'Articles' . "\n"; $ret .= '</a>' . "\n"; $ret .= '</span>' . "\n"; $ret .= '<span>' . "\n"; $ret .= '>' . "\n"; $ret .= '</span>' . "\n"; $ret .= '<span>' . "\n"; $ret .= '<a href="articles.php?catID=' . $aArticle['CategoryID'] . '&action=viewcategory">' . "\n"; $ret .= process_line_output($aArticle['CategoryName']) . "\n"; $ret .= '</a>' . "\n"; $ret .= '</span>' . "\n"; $ret .= '<span>' . "\n"; $ret .= '>' . "\n"; $ret .= '</span>' . "\n"; $ret .= '<span>' . "\n"; $ret .= process_line_output($aArticle['Title']) . "\n"; $ret .= '</span>' . "\n"; $ret .= '</div>' . "\n"; $ret .= '<div class="articleBlock">' . "\n"; $ret .= '<div class="mainTitle">' . "\n"; $ret .= process_line_output($aArticle['Title']) . "\n"; $ret .= '</div>' . "\n"; $ret .= '<div class="date">' . "\n"; $ret .= $aArticle['Date'] . "\n"; $ret .= '</div>' . "\n"; $ret .= '<div>' . "\n"; if ($aArticle['ArticleFlag'] == 'HTML') { $ret .= process_html_output($aArticle['Text']) . "\n"; } else { $ret .= process_text_output($aArticle['Text']) . "\n"; } $ret .= '</div>' . "\n"; $ret .= '</div>' . "\n"; return $ret; }
function getArticle($iArticleID) { global $short_date_format; $sArticlesC = _t('_Articles'); if (!(int) $iArticleID) { return ''; } else { $sArticleQuery = "\r\n\t\t\t\t\tSELECT `Title`, `Text`, `Articles`.`CategoryID`, DATE_FORMAT( `Date`, '{$short_date_format}' ) AS Date,\r\n\t\t\t\t\t\t\t`ArticlesID`, `CategoryName`, `ArticleFlag`, `ownerID`\r\n\t\t\t\t\tFROM `Articles`\r\n\t\t\t\t\tINNER JOIN `ArticlesCategory` ON `Articles`.`CategoryID` = `ArticlesCategory`.`CategoryID`\r\n\t\t\t\t\tWHERE `ArticlesID` = '{$iArticleID}'\r\n\t\t\t\t\tLIMIT 1;\r\n\t\t\t"; } $aArticle = db_arr($sArticleQuery); $sCategoryName = process_line_output($aArticle['CategoryName']); $sTitle = process_line_output($aArticle['Title']); $sText = ''; if ($aArticle['ArticleFlag'] == 'HTML') { $sText = process_html_output($aArticle['Text']) . "\n"; } else { $sText = process_text_output($aArticle['Text']) . "\n"; } $ret = <<<EOF <div class="navigationLinks"> \t<span><a href="articles.php">{$sArticlesC}</a></span> \t<span>></span> \t<span><a href="articles.php?catID={$aArticle['CategoryID']}&action=viewcategory">{$sCategoryName}</a></span> \t<span>></span> \t<span>{$sTitle}</span> </div> <div class="articleBlock"> \t<div class="mainTitle">{$sTitle}</div> \t<div class="date">{$aArticle['Date']}</div> \t<div>{$sText}</div> </div> EOF; return $ret; }
function getPostOverviewBlock() { $iMemberID = (int) $this->aViewingPostInfo['OwnerID']; $aBlogInfo = $this->_oDb->getBlogInfo($iMemberID); $sBlogDescription = '<div class="blog_desc bx-def-margin-sec-top">' . process_html_output($aBlogInfo['Description']) . '</div>'; $aAuthor = getProfileInfo($iMemberID); $aVars = array('author_unit' => get_member_thumbnail($aAuthor['ID'], 'none', true), 'fields' => $sBlogDescription); if ($this->iPostViewType == 3 && $this->iViewingPostID > 0) { require_once $this->_oConfig->getClassPath() . 'BxBlogsSearchUnit.php'; $oBlogSearch = new BxBlogsSearchUnit(); bx_import('BxDolCategories'); bx_import('BxDolTags'); $oCategories = new BxDolCategories(); $oTags = new BxDolTags(); $sCats = ''; $aCategories = $oCategories->explodeTags($this->aViewingPostInfo['Categories']); $aCatLinks = array(); if (count($aCategories) > 0) { foreach ($aCategories as $iKey => $sCatValue) { $sCatLink = $oBlogSearch->getCurrentUrl('category', title2uri(trim($sCatValue)), title2uri(trim($sCatValue)), array('ownerId' => $iMemberID, 'blogOwnerName' => $aAuthor['NickName'])); $aCatLinks[] = '<a href="' . $sCatLink . '" rel="nofollow">' . $sCatValue . '</a>'; } $sCats = implode(", ", $aCatLinks); } $sTags = ''; $aTags = $oTags->explodeTags($this->aViewingPostInfo['Tags']); $aTagLinks = array(); if (count($aTags) > 0) { foreach ($aTags as $sTagKey) { if ($sTagKey != '') { $sTagLink = $oBlogSearch->getCurrentUrl('tag', $iPostID, title2uri(trim($sTagKey))); $aTagLinks[] = '<a href="' . $sTagLink . '" title="' . $sTagKey . '" rel="nofollow">' . $sTagKey . '</a>'; } } $sTags = implode(", ", $aTagLinks); } $aVars['date'] = getLocaleDate($this->aViewingPostInfo['PostDate'], BX_DOL_LOCALE_DATE_SHORT); $aVars['date_ago'] = defineTimeInterval($this->aViewingPostInfo['PostDate'], false); $aVars['cats'] = $sCats; $aVars['tags'] = $sTags; $aVars['fields'] = ''; return $this->_oTemplate->parseHtmlByName('entry_view_block_info.html', $aVars); } return $this->_oTemplate->parseHtmlByName('entry_view_empty_block_info.html', $aVars); }
/** * Generate presentation Advertisement code with images and other * * @param $iID ID of Advertisement * @return HTML presentation of data */ function ActionPrintAdvertisement($iID) { global $site; global $aPreValues; $iAdvertisementID = (int) $iID; $sRetHtml = ''; $sSiteUrl = BX_DOL_URL_ROOT; if ($this->bAdminMode && $iAdvertisementID > 0) { $iFeaturedStatus = $this->_oDb->getFeaturedStatus($iAdvertisementID); $iNewStatus = $iFeaturedStatus == 1 ? 0 : 1; if (bx_get('do') == 'cfs') { $this->_oDb->UpdateFeatureStatus($iAdvertisementID, $iNewStatus); } } $aSqlResStr = $this->_oDb->getAdInfo($iAdvertisementID); if ($aSqlResStr) { $iOwnerID = (int) $aSqlResStr['IDProfile']; $bPossibleToView = $this->oPrivacy->check('view', $iAdvertisementID, $this->_iVisitorID); if ($this->isAllowedView($iOwnerID, true) == false || $bPossibleToView == false) { return $this->_oTemplate->displayAccessDenied(); } bx_import('BxDolViews'); new BxDolViews('ads', $iAdvertisementID); $aNameRet = getProfileInfo($aSqlResStr['IDProfile']); $sCountryName = $aSqlResStr['Country']; $sCountryPic = $sCountryName == '' ? '' : ' <img alt="' . $sCountryName . '" src="' . ($site['flags'] . strtolower($sCountryName)) . '.gif"/>'; $sCountryName = _t($aPreValues['Country'][$sCountryName]['LKey']); $sPostedByC = _t('_bx_ads_Posted_by'); $sPhoneC = _t('_Phone'); $sDetailsC = _t('_bx_ads_Details'); $sUserOtherListC = _t('_bx_ads_Users_other_listing'); $sActionsC = _t('_Actions'); $sSureC = _t('_Are_you_sure'); $sPostedBy .= '<div class="cls_res_info">'; $sPostedBy .= $sPostedByC . ': <span style="color:#333333;"><a href="' . getProfileLink($aNameRet['ID']) . '">' . $aNameRet['NickName'] . '</a></span>'; $sPostedBy .= '</div>'; if ($aNameRet['Phone'] != "") { $sPostedBy .= '<div class="cls_res_info">'; $sPostedBy .= $sPhoneC . ": <div class=\"clr3\">{$aNameRet['Phone']}</div>"; $sPostedBy .= '</div>'; } $sTimeAgo = defineTimeInterval($aSqlResStr['DateTime_UTS'], false); $aTags = array(); $aTagsLinks = array(); $aTags = preg_split("/[;,]/", $aSqlResStr['Tags']); foreach ($aTags as $sTag) { $sSubLink = $this->bUseFriendlyLinks ? "ads/tag/" : $this->sHomeUrl . "classifieds_tags.php?tag="; $sTagS = htmlspecialchars(title2uri($sTag)); $aTagsLinks[] = '<a href="' . "{$sSubLink}{$sTagS}" . '">' . $sTag . '</a>'; } $sTags .= implode(", ", $aTagsLinks); $sMemberActionForms = ''; if ($this->_iVisitorID > 0 && $this->_iVisitorID != $aNameRet['ID']) { //print Send PM button and other actions if (getParam('bx_ads_enable_paid') == 'on') { $sMemberActionForms .= <<<EOF <form action="{$this->sCurrBrowsedFile}" name="BuyNowForm" method="post"> <input type="hidden" name="BuyNow" value="BuyNow" /> <input type="hidden" name="IDAdv" value="{$iAdvertisementID}" /> <input type="hidden" name="IDSeller" value="{$aSqlResStr['IDProfile']}" /> </form> EOF; } $sMemberActionForms .= <<<EOF <form action="{$sSiteUrl}mail.php" name="post_pm" id="post_pm" method="get"> <input type="hidden" name="mode" value="compose" /> <input type="hidden" name="recipient_id" value="{$aSqlResStr['IDProfile']}" /> <input type="hidden" name="subject" value="{$aSqlResStr['Subject']}" /> </form> EOF; } $sEntryUrl = $this->genUrl($iAdvertisementID, $aSqlResStr['EntryUri'], 'entry'); $sMediaIDs = $this->_oDb->getMediaOfAd($iAdvertisementID); if ($sMediaIDs != '') { $aReadyMedia = explode(',', $sMediaIDs); $sPictureSectContent = $this->_blockPhoto($aReadyMedia, $iOwnerID); } $sPictureSect = $sPictureSectContent != '' ? DesignBoxContent(_t('_bx_ads_Ad_photos'), $sPictureSectContent, 1) : ''; $this->sTAPhotosContent = $sPictureSectContent; bx_import('BxDolSubscription'); $oSubscription = BxDolSubscription::getInstance(); $aButton = $oSubscription->getButton($this->_iVisitorID, $this->_oConfig->getUri(), '', $iAdvertisementID); $aActionKeys = array('BaseUri' => $this->_oConfig->getBaseUri(), 'visitor_id' => $this->_iVisitorID, 'owner_id' => $aNameRet['ID'], 'admin_mode' => "'" . $this->bAdminMode . "'", 'ads_id' => $iAdvertisementID, 'ads_status' => $aSqlResStr['Status'], 'ads_act_type' => $aSqlResStr['Status'] == 'active' ? 'inactive' : 'active', 'ads_featured' => (int) $aSqlResStr['Featured'], 'sure_label' => $sSureC, 'ads_entry_url' => $sEntryUrl, 'only_menu' => 0, 'sbs_ads_title' => $aButton['title'], 'sbs_ads_script' => $aButton['script'], 'TitleShare' => $this->isAllowedShare($aSqlResStr) ? _t('_Share') : ''); $sActionsTable = $GLOBALS['oFunctions']->genObjectsActions($aActionKeys, 'bx_ads', false); $sSubsAddon = $oSubscription->getData(); $sActionsSectContent = $sSubsAddon . $sMemberActionForms . $sActionsTable; $sActionsSect = $this->_iVisitorID > 0 || $this->bAdminMode ? DesignBoxContent($sActionsC, $sActionsSectContent, 1) : ''; $this->sTAActionsContent = $this->_iVisitorID > 0 || $this->bAdminMode ? $sActionsSectContent : ''; bx_import('Cmts', $this->_aModule); $this->oCmtsView = new BxAdsCmts($this->_oConfig->getCommentSystemName(), $iAdvertisementID); $sCommentsSectContent = $this->oCmtsView->getExtraCss(); $sCommentsSectContent .= $this->oCmtsView->getExtraJs(); $sCommentsSectContent .= !$this->oCmtsView->isEnabled() ? '' : $this->oCmtsView->getCommentsFirst(); $this->sTACommentsContent = $sCommentsSectContent; $sCommSect = DesignBoxContent($aCaptions['Comments'], $sCommentsSectContent, 1); $sUserOtherListing = $this->getMemberAds($aSqlResStr['IDProfile'], 2, $iAdvertisementID); $sDataTimeFormatted = getLocaleDate($aSqlResStr['DateTime_UTS']); $iViews = (int) $aSqlResStr['Views']; $sOwnerThumb = get_member_thumbnail($aSqlResStr['IDProfile'], 'none', true); $sAdsMessage = process_html_output($aSqlResStr['Message']); $sCategLink = $this->bUseFriendlyLinks ? BX_DOL_URL_ROOT . 'ads/cat/' . $aSqlResStr['CEntryUri'] : "{$this->sCurrBrowsedFile}?bClassifiedID={$aSqlResStr['CatID']}"; $sSCategLink = $this->bUseFriendlyLinks ? BX_DOL_URL_ROOT . 'ads/subcat/' . $aSqlResStr['SEntryUri'] : "{$this->sCurrBrowsedFile}?bSubClassifiedID={$aSqlResStr['SubID']}"; $aSubjVariables = array('author_unit' => $sOwnerThumb, 'date' => $sDataTimeFormatted, 'date_ago' => $sTimeAgo, 'cats' => $this->_oTemplate->parseHtmlByTemplateName('category', array('cat_link' => $sCategLink, 'sub_cat_link' => $sSCategLink, 'cat_name' => $aSqlResStr['Name'], 'sub_cat_name' => $aSqlResStr['NameSub'])), 'tags' => $sTags, 'fields' => ''); $sSubjectSectContent = $this->_oTemplate->parseHtmlByName('entry_view_block_info.html', $aSubjVariables); $sSubjectSect = DesignBoxContent(_t('_Info'), $sSubjectSectContent, 1); $this->sTAInfoContent = $sSubjectSectContent; $sDescriptionContent = '<div class="dbContent bx-def-bc-margin bx-def-font-large">' . $sAdsMessage . '</div>'; $sDescriptionSect = DesignBoxContent(_t('_Description'), $sDescriptionContent, 1); $this->sTADescription = $sDescriptionContent; //adding form $aForm = array('form_attrs' => array('name' => 'custom_values_form', 'action' => $oAds->sCurrBrowsedFile), 'inputs' => array('Country' => array('type' => 'value', 'name' => 'Country', 'caption' => _t('_Country'), 'value' => $sCountryName . $sCountryPic), 'City' => array('type' => 'value', 'name' => 'City', 'caption' => _t('_City'), 'value' => $aSqlResStr['City']))); if ($aSqlResStr['CustomFieldName1'] && $aSqlResStr['CustomFieldValue1']) { $aForm['inputs']['Custom1'] = array('type' => 'value', 'name' => 'Custom1', 'caption' => $aSqlResStr['CustomFieldName1'], 'value' => $aSqlResStr['Unit1'] . $aSqlResStr['CustomFieldValue1']); } if ($aSqlResStr['CustomFieldName2'] && $aSqlResStr['CustomFieldValue2']) { $aForm['inputs']['Custom2'] = array('type' => 'value', 'name' => 'Custom2', 'caption' => $aSqlResStr['CustomFieldName2'], 'value' => $aSqlResStr['Unit2'] . $aSqlResStr['CustomFieldValue2']); } $oForm = new BxTemplFormView($aForm); $sOtherInfoContent = $oForm->getCode(); $sOtherInfoSect = DesignBoxContent(_t('_bx_ads_Custom_Values'), $sOtherInfoContent, 1); $this->sTAOtherInfo = $sOtherInfoContent; $bPossibleToRate = $this->oPrivacy->check('rate', $iAdvertisementID, $this->_iVisitorID); $oVotingView = new BxTemplVotingView('ads', $iAdvertisementID); $iVote = $oVotingView && $oVotingView->isEnabled() && $bPossibleToRate ? 1 : 0; $sVotePostRating = $oVotingView->getBigVoting($iVote); $sRatingSect = DesignBoxContent(_t('_Rate'), $sVotePostRating, 1); $this->sTARateContent = '<div class="bx-def-bc-margin">' . $sVotePostRating . '</div>'; $sOtherListingContent = <<<EOF <div class="dbContent"> {$sUserOtherListing} </div> EOF; $sSPaginateActions = <<<EOF <div class="paginate bx-def-padding-left bx-def-padding-right"> <div class="view_all"> <a href="{$this->sCurrBrowsedFile}" onclick="document.forms['UsersOtherListingForm'].submit(); return false;">{$sUserOtherListC}</a> <form action="{$this->sCurrBrowsedFile}" name="UsersOtherListingForm" method="post"> <input type="hidden" name="UsersOtherListing" value="1" /> <input type="hidden" name="IDProfile" value="{$aSqlResStr['IDProfile']}" /> </form> </div> <div class="pages_section"></div> </div> EOF; $sOtherListingSect = DesignBoxContent($sUserOtherListC, $sOtherListingContent . $sSPaginateActions, 1); $this->sTAOtherListingContent = $sOtherListingContent . $sSPaginateActions; $sHomeLink = $this->bUseFriendlyLinks ? BX_DOL_URL_ROOT . 'ads/' : "{$this->sCurrBrowsedFile}?Browse=1"; $sBrowseAllAds = _t('_bx_ads_Browse_All_Ads'); $sBreadCrumbs = <<<EOF <div class="breadcrumbs"> <a href="{$sHomeLink}">{$sBrowseAllAds}</a> / <a href="{$sCategLink}">{$aSqlResStr['Name']}</a> / <a href="{$sSCategLink}">{$aSqlResStr['NameSub']}</a> </div> EOF; $aBlocks[1] .= $sActionsSect; $aBlocks[1] .= $sSubjectSect; $aBlocks[1] .= $sRatingSect; $aBlocks[1] .= $sOtherListingSect; $aBlocks[2] .= $sPictureSect; $aBlocks[2] .= $sCommSect; $sRetHtml = <<<EOF {$sBreadCrumbs} <div> <div class="clear_both"></div> <div class="cls_info_left"> {$aBlocks['1']} </div> <div class="cls_info"> {$sDescriptionSect} {$aBlocks['2']} </div> <div class="clear_both"></div> </div> <div class="clear_both"></div> EOF; bx_import('BxDolAlerts'); $oZ = new BxDolAlerts('ads', 'view', $iAdvertisementID, $this->_iVisitorID); $oZ->alert(); $sAdCover = $this->getAdCover($aSqlResStr['Media'], 'icon'); if ($sAdCover != '' && $aSqlResStr['Media']) { $GLOBALS['oTopMenu']->setCustomSubIconUrl($sAdCover); } $GLOBALS['oTopMenu']->setCustomSubHeader(htmlspecialchars($aSqlResStr['Subject'])); $GLOBALS['oTopMenu']->setCustomBreadcrumbs(array(_t('_bx_ads_Ads') => $sHomeLink, $aSqlResStr['Subject'] => '')); $this->_oTemplate->setPageDescription(htmlspecialchars($aSqlResStr['Subject'])); $this->_oTemplate->addPageKeywords(htmlspecialchars($aSqlResStr['Tags'])); } return $sRetHtml; }
/** * Prints payment provider setup help message * * @param int $providerID - payment provider ID * * @return string - HTML content of help body * * */ function PPShowHelp($providerID) { $styles = <<<EOS \tp.help_text \t{ \t\tfont-family: Arial; \t\tfont-size: small; \t\tfont-weight: normal; \t\tcolor: black; \t\ttext-align: justify; \t} \tp.help_caption \t{ \t\tfont-family: Arial; \t\tfont-size: medium; \t\tfont-weight: bold; \t\tcolor: black; \t\ttext-align: left; \t} EOS; ob_start(); $providerRes = db_res("SELECT `Caption`, `Help` FROM `PaymentProviders` WHERE `ID` = {$providerID}"); $providerArr = mysql_fetch_assoc($providerRes); ?> <h3 style="font-family: Arial; font-size: large; font-weight: normal; color: black;"><b><?php echo process_line_output($providerArr['Caption']); ?> </b> setup instructions</h3> <?php echo process_html_output($providerArr['Help'], 255); $content = ob_get_contents(); ob_end_clean(); return PopupPageTemplate('Payment provider setup instructions', $content, '', $styles); }
function GenIPBlackListTable() { $sSitePluginsUrl = BX_DOL_URL_PLUGINS; $sFromC = _t('_From'); $sToC = _t('_To'); $sTypeC = _t('_adm_ipbl_IP_Role'); $sDescriptionC = _t('_Description'); $sDatatimeC = _t('_adm_ipbl_Date_of_finish'); $sActionC = _t('_Action'); $sEditC = _t('_Edit'); $sDeleteC = _t('_Delete'); $sSQL = "SELECT *, FROM_UNIXTIME(`LastDT`) AS `LastDT_U` FROM `sys_ip_list` ORDER BY `From` ASC"; $rIPList = db_res($sSQL); $sRows = ''; while ($aIPList = mysql_fetch_assoc($rIPList)) { $iID = (int) $aIPList['ID']; $sFrom = long2ip($aIPList['From']); $sTo = $aIPList['To'] == 0 ? '' : long2ip($aIPList['To']); $sType = process_html_output($aIPList['Type']); $sLastDT_Formatted = getLocaleDate($aIPList['LastDT'], BX_DOL_LOCALE_DATE); $sLastDT = preg_replace('/([\\d]{2}):([\\d]{2}):([\\d]{2})/', '$1:$2', $aIPList['LastDT_U']); $sDesc = process_html_output($aIPList['Desc']); $sRows .= <<<EOF <tr> <td class="bx-def-border">{$sFrom}</td> <td class="bx-def-border">{$sTo}</td> <td class="bx-def-border">{$sType}</td> <td class="bx-def-border">{$sLastDT_Formatted}</td> <td class="bx-def-border">{$sDesc}</td> <td class="bx-def-border"> <a href="javascript:void(0)" onclick="ip_accept_values_to_form('{$iID}', '{$sFrom}', '{$sTo}', '{$sType}', '{$sLastDT}', '{$sDesc}'); return false;">{$sEditC}</a> | <a href="{$this->_sActionUrl}?action=apply_delete&id={$iID}">{$sDeleteC}</a> </td> </tr> EOF; } if (!$sRows) { return MsgBox(_t('_Empty')); } return <<<EOF <table style="width:99%; border-collapse:collapse;" cellpadding="4"> <tr> <td class="bx-def-border">{$sFromC}</td> <td class="bx-def-border">{$sToC}</td> <td class="bx-def-border">{$sTypeC}</td> <td class="bx-def-border">{$sDatatimeC}</td> <td class="bx-def-border">{$sDescriptionC}</td> <td class="bx-def-border">{$sActionC}</td> </tr> {$sRows} </table> <div class="clear_both"></div> <script type="text/javascript"> function ip_accept_values_to_form(id_val, from_val, to_val, type_val, lastdt_val, desc_val) { \$('.form_input_hidden[name="id"]').val(id_val); \$('.form_input_text[name="from"]').val(from_val); \$('.form_input_text[name="to"]').val(to_val); \$('.form_input_select[name="type"]').val(type_val); \$('.form_input_datetime[name="LastDT"]').val(lastdt_val); \$('.form_input_text[name="desc"]').val(desc_val); } </script> EOF; }
function PageCompGroupsContent($sCaption) { global $site; global $date_format; $php_date_format = getParam('php_date_format'); $mode = $_REQUEST['groups_mode']; if ($mode != 'rand' and $mode != 'latest') { $mode = 'latest'; } $menu = '<div class="dbTopMenu">'; foreach (array('latest', 'rand') as $myMode) { switch ($myMode) { case 'latest': $OrderBy = '`created` DESC'; $sTabTitle = _t('_Latest'); break; case 'rand': $OrderBy = 'RAND()'; $sTabTitle = _t('_Random'); break; } if ($mode == $myMode) { $sqlOrderBy = $OrderBy; $menu .= "\r\n\t\t\t<div class=\"active\">{$sTabTitle}</div>"; } else { $menu .= "\r\n\t\t\t<div class=\"notActive\">\r\n\t\t\t\t<a href=\"{$_SERVER['PHP_SELF']}?groups_mode={$myMode}\" class=\"top_members_menu\" onclick=\"getHtmlData( 'show_groups', this.href+'&show_only=groups'); return false;\">{$sTabTitle}</a>\r\n\t\t\t</div>"; } } $menu .= ' <div class="clear_both"></div> </div>'; $aTotalNum = db_arr("\r\n\t\tSELECT\r\n\t\t\tCOUNT(*) FROM `Groups`\r\n\t\tWHERE\r\n\t\t\t`status` = 'Active'\r\n\t\t"); $iTotalNum = $aTotalNum[0]; if ($iTotalNum) { //$iResPerPage = (int)getParam("max_groups_on_home"); $iResPerPage = (int) getParam("max_blogs_on_home"); //$iResPerPage = 3; $iTotalPages = ceil($iTotalNum / $iResPerPage); $page = (int) $_REQUEST['groups_page']; if ($page < 1 or $mode == 'rand') { $page = 1; } if ($page > $iTotalPages) { $page = $iTotalPages; } $sqlLimitFrom = ($page - 1) * $iResPerPage; //$iBlogLimitChars = (int)getParam("max_classified_preview"); $iBlogLimitChars = (int) getParam("max_blog_preview"); //$iBlogLimitChars = 50; $sBlogQuery = "\r\n\t\t\tSELECT DISTINCT `Groups`.`ID`, `Groups`.`Name`,\r\n\t\t\tLEFT(`Groups`.`Desc`, {$iBlogLimitChars}) as 'Desc_f', \r\n\t\t\tUNIX_TIMESTAMP( `Groups`.`created` ) as `DateTime_f`,\r\n\t\t\t`Profiles`.`NickName`,\r\n\t\t\t`GroupsCateg`.`Name` AS 'CategName', `GroupsCateg`.`ID` AS `CategID`\r\n\t\t\tFROM `Groups`\r\n\t\t\tLEFT JOIN `GroupsCateg` ON `GroupsCateg`.`ID` = `Groups`.`categID` \r\n\t\t\tLEFT JOIN `Profiles` ON `Profiles`.`ID` = `Groups`.`creatorID` \r\n\t\t\tWHERE\r\n\t\t\t`Groups`.`Status` = 'Active'\r\n\t\t\tORDER BY {$sqlOrderBy}\r\n\t\t\tLIMIT {$sqlLimitFrom}, {$iResPerPage}\r\n\t\t"; $rBlog = db_res($sBlogQuery); $ret = ''; $oEvents = new BxDolEvents(); $ret .= '<div class="clear_both"></div>'; while ($arr = mysql_fetch_array($rBlog)) { $sPic = $oEvents->GetGroupPicture($arr['ID']); $sLinkMore = ''; if (strlen($arr['Desc']) == $iBlogLimitChars) { $sLinkMore = "... <a href=\"" . $site['url'] . "group.php?ID=" . $arr['ID'] . "\">" . _t('_Read more') . "</a>"; } $ret .= ' <div class="icon_block"> ' . $sPic . ' </div> <div class="blog_wrapper_n"> <div class="blog_subject_n"> <a href="' . $site['url'] . 'group.php?ID=' . $arr['ID'] . '" class="bottom_text">' . process_line_output($arr['Name']) . '</a> </div> <div class="blog_author">' . '<span>' . _t('_By Author', $arr['NickName'], $arr['NickName']) . '</span>' . '<span><img src="' . getTemplateIcon('clock.gif') . '" />' . date($php_date_format, $arr['DateTime_f']) . '</span>' . '<span>' . _t('_in Category', getTemplateIcon('folder_small.png'), 'groups_browse.php?categID=' . $arr['CategID'], process_line_output($arr['CategName'])) . '</span>' . '</div> <div class="blog_text">' . strip_tags(process_html_output($arr['Desc_f'])) . $sLinkMore . '</div> </div>'; } $ret .= '<div class="clear_both"></div>'; } else { $ret .= '<div class="no_result"><div>' . _t("_No groups available") . '</div></div>'; } if ($iTotalPages > 1) { $ret .= ' <div class="dbBottomMenu">'; if ($page > 1) { $prevPage = $page - 1; $ret .= "\r\n\t\t\t\t<a href=\"{$_SERVER['PHP_SELF']}?groups_mode={$mode}&groups_page={$prevPage}\"\r\n\t\t\t\t class=\"backMembers\"\r\n\t\t\t\t onclick=\"getHtmlData( 'show_groups', this.href+'&show_only=groups'); return false;\">" . _t('_Back') . "</a>\r\n\t\t\t"; } if ($page < $iTotalPages) { $nextPage = $page + 1; $ret .= "\r\n\t\t\t\t<a href=\"{$_SERVER['PHP_SELF']}?groups_mode={$mode}&groups_page={$nextPage}\"\r\n\t\t\t\t class=\"moreMembers\"\r\n\t\t\t\t onclick=\"getHtmlData( 'show_groups', this.href+'&show_only=groups'); return false;\">" . _t('_Next') . "</a>\r\n\t\t\t"; } $ret .= ' <div class="clear_both"></div> </div>'; } return DesignBoxContent(_t($sCaption), $ret, 1, $menu); }
function displaySearchUnit($aResSQL) { $iVisitorID = (int) $_COOKIE['memberID']; $oMain = $this->getBlogsMain(); $sTagsSmallIcon = $sClockIcon = $sCommentsIcon = $sCategoryIcon = ''; if ($oMain->_oTemplate) { $sTagsSmallIcon = $oMain->_oTemplate->getIconUrl('tgs.png'); $sClockIcon = $oMain->_oTemplate->getIconUrl('clock.png'); $sCommentsIcon = $oMain->_oTemplate->getIconUrl('comments.png'); $sCategoryIcon = $oMain->_oTemplate->getIconUrl('folder_small.png'); } $iPostID = (int) $aResSQL['id']; $sBlogsImagesUrl = BX_BLOGS_IMAGES_URL; $bPossibleToView = $oMain->oPrivacy->check('view', $iPostID, $oMain->_iVisitorID); if (!$bPossibleToView) { return $oMain->_oTemplate->parseHtmlByName('browse_unit_private.html', array('extra_css_class' => '')); } $sCategories = $aResSQL['Categories']; $aCategories = $oMain->getTagLinks($aResSQL['Categories'], 'category', CATEGORIES_DIVIDER); $sFriendStyle = ''; $sPostVote = ''; $sPostMode = ''; $sVotePostRating = $this->oRate->getJustVotingElement(0, 0, $aResSQL['Rate']); $aProfileInfo = getProfileInfo($aResSQL['ownerId']); $sOwnerNickname = process_line_output($aProfileInfo['NickName']); $sCategoryName = $aResSQL['Categories']; $sPostLink = $this->getCurrentUrl('file', $iPostID, $aResSQL['uri']) . $sCategoryUrlAdd; $sAllCategoriesLinks = ''; if (count($aCategories) > 0) { foreach ($aCategories as $iKey => $sCatValue) { $sCatLink = $this->getCurrentUrl('category', title2uri($sCatValue), title2uri($sCatValue), array('ownerId' => $aResSQL['ownerId'], 'ownerName' => $sOwnerNickname)); $sCatName = process_line_output($sCatValue); $aAllCategoriesLinks[] = '<a href="' . $sCatLink . '">' . $sCatName . '</a>'; } $aAllCategoriesLinkHrefs = implode(", ", $aAllCategoriesLinks); $sAllCategoriesLinks = <<<EOF <span class="margined"> \t<span>{$aAllCategoriesLinkHrefs}</span> </span> EOF; } $sAdminCheck = $sAdminStatus = ''; if ($this->bShowCheckboxes) { $sAdminCheck = <<<EOF <div class="browseCheckbox"><input id="ch{$iPostID}" type="checkbox" name="bposts[]" value="{$iPostID}" /></div> EOF; $sPostStatus = process_line_output($aResSQL['PostStatus']); $sAdminStatus = <<<EOF ({$sPostStatus}) EOF; } $sPostCaption = process_line_output($aResSQL['title']); $sPostCaptionHref = <<<EOF <a class="actions" href="{$sPostLink}">{$sPostCaption}</a>{$sAdminStatus} EOF; if ($this->iPostViewType == 3) { $sFriendStyle = "2"; $sPostMode = '_post'; $sPostCaptionHref = '<div class="actions">' . $sPostCaption . '</div>'; } $sDateTime = defineTimeInterval($aResSQL['date']); //$oCmtsView = new BxTemplCmtsView ('blogposts', (int)$iPostID); $iCommentsCnt = (int) $aResSQL['CommentsCount']; $sAuthor = ''; if ($this->iPostViewType == 2) { $sAuthor = getProfileLink($aResSQL['ownerId']); $sAuthor = '<a href="' . $sAuthor . '">' . $sOwnerNickname . '</a>'; } $sTagsCommas = $aResSQL['tag']; //$aTags = split(',', $sTagsCommas); $aTags = preg_split("/[;,]/", $sTagsCommas); //search by tag skiping if ($this->sSearchedTag != '' && in_array($this->sSearchedTag, $aTags) == false) { return; } $sTagsHrefs = ''; $aTagsHrefs = array(); foreach ($aTags as $sTagKey) { if ($sTagKey != '') { $sTagLink = $this->getCurrentUrl('tag', $iPostID, htmlspecialchars(title2uri($sTagKey))); $sTagsHrefAny = <<<EOF <a href="{$sTagLink}" title="{$sTagKey}">{$sTagKey}</a> EOF; $aTagsHrefs[] = $sTagsHrefAny; } } $sTagsHrefs = implode(", ", $aTagsHrefs); $sTags = <<<EOF <span class="margined"> \t<span>{$sTagsHrefs}</span> </span> EOF; $sPostText = process_html_output($aResSQL['bodyText']); //$sPostText = addslashes( clear_xss( trim( process_pass_data($aResSQL['bodyText'])))); $bFriend = is_friends($iVisitorID, $aResSQL['ownerId']); $bOwner = $iVisitorID == $aResSQL['ownerId'] ? true : false; $sOwnerThumb = $sPostPicture = ''; if ($aResSQL['PostPhoto'] && $this->iPostViewType == 3) { $sSpacerName = getTemplateIcon('spacer.gif'); $sPostPicture = <<<EOF <div class="marg_both_left"> \t<img alt="{$aResSQL['PostPhoto']}" style="width:{$this->iThumbSize}px; height:{$this->iThumbSize}px; background-image: url({$sBlogsImagesUrl}big_{$aResSQL['PostPhoto']});cursor:pointer;" src="{$sSpacerName}" onclick="javascript: window.open( '{$sBlogsImagesUrl}orig_{$aResSQL['PostPhoto']}', 'blog post', 'width={$this->iImgSize}, height={$this->iImgSize}, menubar=no,status=no,resizable=yes,scrollbars=yes,toolbar=no,location=no' );" /> </div> EOF; } if ($this->iPostViewType == 4) { $sOwnerThumb = $GLOBALS['oFunctions']->getMemberIcon($aResSQL['ownerId'], 'left'); } if ($this->iPostViewType == 4 || $this->iPostViewType == 1) { $iBlogLimitChars = (int) getParam('max_blog_preview'); $iBlogLimitChars = 200; if (strlen($aResSQL['bodyText']) > $iBlogLimitChars) { //$sLinkMore = "... <a href=\"".$sPostLink."\">"._t('_Read more')."</a>"; $sLinkMore = ''; $sPostText = html_entity_decode(process_line_output($aResSQL['bodyText'])); $sPostText = mb_substr(strip_tags($sPostText), 0, $iBlogLimitChars); } } $aUnitReplace = array(); $aUnitReplace['checkbox'] = $sAdminCheck; $aUnitReplace['post_caption'] = $sPostCaptionHref; $aUnitReplace['author'] = $sAuthor; $aUnitReplace['clock_icon'] = $sClockIcon; $aUnitReplace['post_date'] = strtolower($sDateTime); $aUnitReplace['category_icon'] = $sCategoryIcon; $aUnitReplace['all_categories'] = $sAllCategoriesLinks; $aUnitReplace['comments_icon'] = $sCommentsIcon; $aUnitReplace['comments_count'] = $iCommentsCnt; $aUnitReplace['post_tags'] = $sTags; $aUnitReplace['friend_style'] = $sFriendStyle; $aUnitReplace['post_uthumb'] = $sOwnerThumb; $aUnitReplace['post_picture2'] = $sPostPicture; $aUnitReplace['post_description'] = $sPostText; $aUnitReplace['post_vote'] = $sVotePostRating; $aUnitReplace['post_mode'] = $sPostMode; return $oMain->_oTemplate->parseHtmlByTemplateName('blogpost_unit', $aUnitReplace); }
function printNews($news_arr) { if ($news_arr) { $sCode = '<div class="news_cont">'; $sCode .= '<div class="news_header">' . process_line_output($news_arr['Header']) . '</div>'; $sCode .= '<div class="news_date">' . $news_arr['Date'] . '</div>'; //$sCode .= '<div class="news_snippet">'.process_text_output( $news_arr['Snippet'] ).'</div>'; $sCode .= '<div class="news_snippet">' . process_html_output($news_arr['Snippet']) . '</div>'; //$sCode .= '<div class="news_text">'.process_text_withlinks_output( $news_arr['Text'] ).'</div></div>'; $sCode .= '<div class="news_text">' . process_html_output($news_arr['Text']) . '</div></div>'; } else { $sCode = MsgBox(_t('_No news available')); } return $sCode; }
function getAlbumInfo(&$aInfo) { $aForm = array('form_attrs' => array('id' => $this->_oConfig->getMainPrefix() . '_album_view_form'), 'params' => array('remove_form' => true), 'inputs' => array('location' => array('type' => 'value', 'value' => bx_linkify(process_text_output($aInfo['Location'])), 'caption' => _t('_Location')), 'description' => array('type' => 'value', 'value' => bx_linkify(process_html_output($aInfo['Description'])), 'caption' => _t('_Description')), 'date' => array('type' => 'value', 'value' => getLocaleDate($aInfo['Date'], BX_DOL_LOCALE_DATE_SHORT) . ' (' . defineTimeInterval($aInfo['Date'], false) . ')', 'caption' => _t('_Date')))); $aForm['inputs'] = array_filter($aForm['inputs'], function ($aInput) { return !!$aInput['value']; }); $oForm = new BxTemplFormView($aForm); return array($oForm->getCode(), array(), array(), false); }
function GenIPBlackListTable() { $sSitePluginsUrl = BX_DOL_URL_PLUGINS; $sFromC = _t('_From'); $sToC = _t('_To'); $sTypeC = _t('_adm_ipbl_IP_Role'); $sDescriptionC = _t('_Description'); $sDatatimeC = _t('_adm_ipbl_Date_of_finish'); $sActionC = _t('_Action'); $sEditC = _t('_Edit'); $sDeleteC = _t('_Delete'); $sType0C = _t('_adm_ipbl_Type0_desc'); $sType1C = _t('_adm_ipbl_Type1_desc'); $sType2C = _t('_adm_ipbl_Type2_desc'); $sSQL = "SELECT *, FROM_UNIXTIME(`LastDT`) AS `LastDT_U` FROM `sys_ip_list` ORDER BY `From` ASC"; $rIPList = db_res($sSQL); $sTitle = ''; $iIpListType = (int) getParam('ipListGlobalType'); switch ($iIpListType) { case 1: $sTitle = '<h2>' . $sType1C . '</h2>'; break; case 2: $sTitle = '<h2>' . $sType2C . '</h2>'; break; case 0: default: $sTitle = '<h2>' . $sType0C . '</h2>'; break; } $sRows = ''; while ($aIPList = mysql_fetch_assoc($rIPList)) { $iID = (int) $aIPList['ID']; $sFrom = long2ip($aIPList['From']); $sTo = $aIPList['To'] == 0 ? '' : long2ip($aIPList['To']); $sType = process_html_output($aIPList['Type']); //$sDates = explode(' ', $aIPList['LastDT_U']); $sLastDT = $aIPList['LastDT_U']; //list($iYear, $iMonth, $iDay) = explode( '-', $sDates[0]); $sDesc = process_html_output($aIPList['Desc']); $sRows .= <<<EOF <tr> \t<td>{$sFrom}</td> \t<td>{$sTo}</td> \t<td>{$sType}</td> \t<td>{$sLastDT}</td> \t<td>{$sDesc}</td> \t<td> \t\t<a href="javascript:void(0)" onclick="ip_accept_values_to_form('{$iID}', '{$sFrom}', '{$sTo}', '{$sType}', '{$sLastDT}', '{$sDesc}'); return false;">{$sEditC}</a> | \t\t<a href="{$this->_sActionUrl}?action=apply_delete&id={$iID}">{$sDeleteC}</a> \t</td> </tr> EOF; } return <<<EOF {$sTitle} <table style="width:99%;" border="1" cellpadding="2" cellspacing="1" style="border-collapse: collapse"> \t<tr> \t\t<td>{$sFromC}</td> \t\t<td>{$sToC}</td> \t\t<td>{$sTypeC}</td> \t\t<td>{$sDatatimeC}</td> \t\t<td>{$sDescriptionC}</td> \t\t<td>{$sActionC}</td> \t</tr> \t{$sRows} </table> <div class="clear_both"></div> <script type="text/javascript"> \tfunction ip_accept_values_to_form(id_val, from_val, to_val, type_val, lastdt_val, desc_val) { \t\t\$('.form_input_hidden[name="id"]').val(id_val); \t\t\$('.form_input_text[name="from"]').val(from_val); \t\t\$('.form_input_text[name="to"]').val(to_val); \t\t\$('.form_input_select[name="type"]').val(type_val); \t\t\$('.form_input_datetime[name="LastDT"]').val(lastdt_val); \t\t\$('.form_input_text[name="desc"]').val(desc_val); \t} </script> EOF; }
function GenAnyBlockContent($sOrder = 'latest', $iProfileID = 0, $sLimit = "LIMIT 5") { global $site; $php_date_format = getParam('php_date_format'); $iBlogLimitChars = (int) getParam("max_blog_preview"); $sClockIcon = getTemplateIcon('clock.gif'); $sOrderS = ''; switch ($sOrder) { case 'latest': $sOrderS = 'ORDER BY `Groups`.`created` DESC'; break; case 'rand': $sOrderS = 'ORDER BY RAND()'; break; } $sProfileS = '1'; $sGrpJoin = ''; if ($iProfileID > 0) { $sGrpJoin = 'INNER JOIN `GroupsMembers` ON `GroupsMembers`.`groupID`=`Groups`.`ID` '; $sProfileS = <<<EOF `GroupsMembers`.`memberID` = '{$iProfileID}' AND `GroupsMembers`.`status` = 'Active' EOF; } else { $sProfileS = "`Groups`.`Status` = 'Active'"; } //INNER JOIN `GroupsCateg` ON `GroupsCateg`.`ID` = `Groups`.`categID` //`GroupsCateg`.`Name` AS 'CategName', `GroupsCateg`.`Uri` as `CategUri` $sQuery = "\r\n\t\t\tSELECT DISTINCT `Groups`.`ID`, `Groups`.`Name`, `Groups`.`Uri`, `Groups`.`categID` AS `CategID`,\r\n\t\t\tLEFT(`Groups`.`Desc`, {$iBlogLimitChars}) as 'Desc_f', \r\n\t\t\tUNIX_TIMESTAMP( `Groups`.`created` ) as `DateTime_f`,\r\n\t\t\t`Profiles`.`NickName`\r\n\t\t\tFROM `Groups`\r\n\t\t\tINNER JOIN `Profiles` ON `Profiles`.`ID` = `Groups`.`creatorID` \r\n\t\t\t{$sGrpJoin}\r\n\t\t\tWHERE\r\n\t\t\t{$sProfileS}\r\n\t\t\t{$sOrderS}\r\n\t\t\t{$sLimit}\r\n\t\t"; //print $sQuery; $rBlog = db_res($sQuery); $sRet = ''; $sFolderIco = getTemplateIcon('folder_small.png'); $oEvents = new BxDolEvents(); $sRet .= '<div class="clear_both"></div>'; while ($arr = mysql_fetch_array($rBlog)) { $sPic = $this->GetGroupPicture($arr['ID']); $aCategInfo = db_arr("SELECT `GroupsCateg`.`Name` AS 'CategName', `GroupsCateg`.`Uri` as `CategUri` FROM `GroupsCateg` WHERE `ID`='{$arr['CategID']}' LIMIT 1;"); $sCategName = $aCategInfo['CategName']; $sCategUri = $aCategInfo['CategUri']; $sLinkMore = ''; $sGroupLink = $this->getGroupUrl($arr['ID'], $arr['Uri']); if (strlen($arr['Desc']) == $iBlogLimitChars) { $sLinkMore = "... <a href=\"" . $sGroupLink . "\">" . _t('_Read more') . "</a>"; } $sAuthor = $iProfileID > 0 ? '' : '<span>' . _t('_By Author', $arr['NickName'], $arr['NickName']) . '</span>'; $sName = process_line_output($arr['Name']); $sDateF = date($php_date_format, $arr['DateTime_f']); //$sDateF = LocaledDataTime( $arr['DateTime_f'], 3 ); $sCategory = _t('_in Category', $sFolderIco, $this->getGroupsCategUrl($arr['CategID'], $sCategUri), process_line_output($sCategName)); $sDescr = strip_tags(process_html_output($arr['Desc_f'])); $sRet .= <<<EOF <div> \t<div class="icon_block"> \t\t{$sPic} \t</div> \t<div class="blog_wrapper_n"> \t\t<div class="blog_subject_n"> \t\t\t<a href="{$sGroupLink}" class="bottom_text"> \t\t\t\t{$sName} \t\t\t</a> \t\t</div> \t\t<div class="blogInfo"> \t\t\t{$sAuthor} \t\t\t<span> \t\t\t\t<img src="{$sClockIcon}" alt="" />{$sDateF} \t\t\t</span> \t\t\t<span>{$sCategory}</span> \t\t</div> \t\t<div class="blog_text"> \t\t\t{$sDescr}{$sLinkMore} \t\t</div> \t</div> </div> <div class="clear_both"></div> EOF; } return $sRet; }