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; }
function getPageMainCode() { global $oTemplConfig; $ret = ''; $aPhotoConf = array(); $aPhotoConf['profileID'] = (int) $_REQUEST['ID']; $aPhotoConf['visitorID'] = (int) $_COOKIE['memberID']; $aPhotoConf['isOwner'] = $aPhotoConf['profileID'] == $aPhotoConf['visitorID'] ? true : false; $check_res = checkAction($aPhotoConf['visitorID'], ACTION_ID_USE_GALLERY); if ($check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED) { $ret = ' <table width="100%" cellpadding="4" cellspacing="4" border="0"> <tr> <td align="center">' . $check_res[CHECK_ACTION_MESSAGE] . '</td> </tr> </table>'; return $ret; } $oMedia = new BxDolMedia(); $oMedia->iProfileID = $aPhotoConf['profileID']; $oMedia->sMediaType = isset($_REQUEST['show']) ? $_REQUEST['show'] : 'video'; $oMedia->BxDolMedia(); $oMedia->getActiveMediaArray(); $ret .= ProfileDetails($oMedia->iProfileID); $ret .= '<div class="clear_both"></div>'; if ($oTemplConfig->customize['media_gallery']['showMediaTabs']) { $ret .= '<div class="choiseBlock">'; $ret .= getMediaTabs($oMedia->sMediaType, $oMedia->aMediaConfig); $ret .= '</div>'; } //print_r( $oMedia -> aMedia); $i = 1; foreach ($oMedia->aMedia as $aValue) { $ret .= '<div class="mediaBlock">'; $ret .= '<div class="mediaTitleVA">'; $ret .= process_line_output($aValue['med_title']); $ret .= '</div>' . "\n"; $ret .= '<div class="mediaActions">'; $ret .= '<span>'; $ret .= '<a href="' . $oMedia->getMediaLink($aValue) . '">'; $ret .= _t('_download'); $ret .= '</a>'; $ret .= '</span>'; /* $ret .= '<span>'; $ret .= '<a href="' . $_SERVER['PHP_SELF'] . '?show=' . $oMedia -> sMediaType . '&action=delete&mediaID=' . $aValue['med_id'] . '">'; $ret .= _t('_delete'); $ret .= '</a>'; $ret .= '</span>'; */ $ret .= '</div>' . "\n"; $ret .= '</div>' . "\n"; if ($i >= $oMedia->aMediaConfig['max'][$oMedia->sMediaType]) { break; } $i++; } $ret .= ''; return $ret; }
function getMediaPage() { global $dir; global $tmpl; require_once BX_DIRECTORY_PATH_INC . 'profiles.inc.php'; $this->getMediaArray(); $ret = '<div class="clear_both"></div>'; $tmplBlock = file_get_contents("{$dir['root']}templates/tmpl_{$tmpl}/media_page_block.html"); $i = 1; foreach ($this->aMedia as $aValue) { $block = $tmplBlock; $aReplace['media_title'] = process_line_output($aValue['med_title']); $aReplace['media_icon'] = '<img src="' . getTemplateIcon($this->sMediaType . '.jpg') . '" />'; $aReplace['nickname'] = ''; $aReplace['download'] = '<a href="' . $this->getMediaLink($aValue) . '">' . _t('_download') . '</a>'; $aReplace['delete'] = '<a href="' . $_SERVER['PHP_SELF'] . '?show=' . $this->sMediaType . '&action=delete&mediaID=' . $aValue['med_id'] . '" onclick="return confirm(\'' . _t('_are you sure?') . '\');">' . _t('_delete') . '</a>'; foreach ($aReplace as $key => $val) { $block = str_replace("__{$key}__", $val, $block); } $ret .= $block; if ($i++ >= $this->aMediaConfig['max'][$this->sMediaType]) { break; } } $ret .= '<div class="clear_both"></div>'; return $ret; }
/** * Function will generate field for input memeber's status text; * * @param : $iMemberID (integer) - logged member's Id; * @return : Html presentation data; */ function getStatusField($iMemberId) { global $oSysTemplate; $aMemberInfo = getProfileInfo($iMemberId); $sStatusMessage = process_line_output($aMemberInfo['UserStatusMessage']); $aTemplateKeys = array('status_message' => $sStatusMessage); return $oSysTemplate->parseHtmlByName('member_menu_status_text_field.html', $aTemplateKeys); }
/** * get a quote from the database * returns HTML text that represents quote - text and author */ function quote_get() { global $quote_table; global $quote_html; $arr = db_arr("SELECT `Text`, `Author` FROM {$quote_table} ORDER BY RAND() LIMIT 1"); $ret = $quote_html; $ret = str_replace('%Text%', process_text_output($arr['Text']), $ret); $ret = str_replace('%Author%', process_line_output($arr['Author']), $ret); return $ret; }
/** * Print news */ function MemberPrintNewsList() { global $news_limit_chars; global $short_date_format; global $tmpl; $query = "\n\t\tSELECT\n\t\t\t`ID`,\n\t\t\t`Header`,\n\t\t\t`Snippet`,\n\t\t\tDATE_FORMAT(`Date`, '{$short_date_format}' ) AS 'Date'\n\t\tFROM `News`\n\t\tORDER BY `Date` DESC\n\t\t"; $res = db_res($query); ob_start(); if (!mysql_num_rows($res)) { ?> <div class="no_news"> <?php echo _t("_No news available"); ?> </div> <?php } else { while ($news_arr = mysql_fetch_array($res)) { ?> <div class="news_cont"> <div class="clear_both"></div> <div class="news_header"> <a href="<?php echo "{$site['url']}news_view.php?ID={$news_arr['ID']}"; ?> "> <?php echo process_line_output($news_arr['Header']); ?> </a> </div> <div class="news_date"><?php echo $news_arr['Date']; ?> </div> <div class="news_snippet"> <?php echo process_text_output($news_arr['Snippet']); ?> </div> <div class="clear_both"></div> </div> <?php } } return ob_get_clean(); }
function MemberPrintNews() { global $site; global $short_date_format; $res = db_res("SELECT `ID`, DATE_FORMAT(`Date`, '{$short_date_format}' ) AS 'Date', `Header`, `Text` FROM `News` ORDER BY `Date` DESC"); if (!$res) { return; } echo "<table cellspacing=1 cellpadding=2 class=small width='100%'>\n"; if (!mysql_num_rows($res)) { echo "<tr class=panel><td align=center>No news available.</td></tr>\n"; } while ($news_arr = mysql_fetch_array($res)) { $news_header = process_line_output($news_arr['Header']); echo "\n\t\t\t<tr >\n\t\t\t\t<td align=center width=15%>\n\t\t\t\t\t<a href=\"news.php?edit_id={$news_arr['ID']}\">Edit</a> |\n\t\t\t\t\t<a href=\"news.php?action=delete&delete_id={$news_arr['ID']}\">Delete</a>\n\t\t\t\t</td>\n\t\t\t\t<td align=center width=15%>{$news_arr['Date']}</td>\n\t\t\t\t<td aling=left> <a target='_blank' href='{$site['url']}news_view.php?ID={$news_arr['ID']}'>{$news_header}</a></td>\n\t\t\t</tr>\n"; } echo "</table>\n"; }
function getMediaPage($iMediaID = 0) { global $votes_pic; $ret = ''; //$ret .= $this -> getJSCode(); if (0 < $this->iMediaCount) { $iMediaID = 0 < $iMediaID ? $iMediaID : $this->aMedia['0']['PrimPhoto']; $aCurPhoto = $this->getElementArrayByID($iMediaID); if (empty($aCurPhoto)) { $sPhotoUrl = getTemplateIcon($this->sSexPic); } else { $ret .= '<div class="mediaTitle" id="sTitleDiv">'; $ret .= stripcslashes(process_line_output($aCurPhoto['med_title'])); $ret .= '</div>'; $iPhotoID = $aCurPhoto['med_id']; $sPhotoUrl = $this->sMediaUrl . 'photo_' . $aCurPhoto['med_file']; $iPhotoRating = $this->getRating($aCurPhoto['med_rating_sum'], $aCurPhoto['med_rating_count']); } } else { $sPhotoUrl = getTemplateIcon($this->sSexPic); } $ret .= $this->getJSCode($aCurPhoto); $ret .= '<div class="photoBlock" id="photoKeeper">'; $style = ' width:' . $this->aMediaConfig['size']['photoWidth'] . 'px;' . 'height:' . $this->aMediaConfig['size']['photoHeight'] . 'px;' . 'background-image:url(' . $sPhotoUrl . ');'; $ret .= '<img src="' . getTemplateIcon('spacer.gif') . '" style="' . $style . '" class="photo" alt="" id="temPhotoID" />'; //$ret .= '<img src="' . getTemplateIcon('spacer.gif') . '" style="' . $style . '" class="photo" alt="" onload="return setImage();" id="temPhotoID" />'; $ret .= '</div>'; $sJsArray = ''; $iPhotosCount = 0; $sIconsList = $this->_getIconsList($sJsArray, $iPhotosCount); $oVotingView = new BxTemplVotingView('media', (int) $aCurPhoto['med_id']); //if( $iPhotosCount && getParam('votes_pic') == 'on' && $oVotingView->isEnabled()) if ($iPhotosCount && $votes_pic && $oVotingView->isEnabled()) { $ret .= '<div class="votingBlock">' . $oVotingView->getBigVoting() . '</div>'; } $ret .= '<div class="iconBlock">'; $ret .= $sIconsList; $ret .= '</div>'; $ret .= '<script type="text/javascript">' . $sJsArray . '</script>'; return $ret; }
function MemberPrintNews() { global $site; global $short_date_format; $bNewsFriendly = getParam('permalinks_news') == 'on' ? true : false; $res = getNewsList(); if (!$res) { return; } echo "<table cellspacing=1 cellpadding=2 class=small width='100%'>\n"; if (!mysql_num_rows($res)) { echo "<tr class=panel><td align=center>No news available.</td></tr>\n"; } while ($news_arr = mysql_fetch_array($res)) { $news_header = process_line_output($news_arr['Header']); $sNewsUrl = getNewsUrl($news_arr['newsID'], $news_arr['NewsUri'], $bNewsFriendly); echo "\r\n\t\t\t<tr >\r\n\t\t\t\t<td align=center width=15%>\r\n\t\t\t\t\t<a href=\"news.php?edit_id={$news_arr['newsID']}\">Edit</a> |\r\n\t\t\t\t\t<a href=\"news.php?action=delete&delete_id={$news_arr['newsID']}\">Delete</a>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td align=center width=15%>" . date(str_replace('%', '', $short_date_format), $news_arr['Date']) . "</td>\r\n\t\t\t\t<td aling=left> <a target='_blank' href='{$sNewsUrl}'>{$news_header}</a></td>\r\n\t\t\t</tr>\n"; } echo "</table>\n"; }
/** * page code function */ function PageCompPageMainCode() { global $tmpl; $links_res = db_res("SELECT * FROM `Links`"); if (!mysql_num_rows($links_res)) { $out .= "<div class=\"no_links\">" . _t("_NO_LINKS") . "</div>\n"; } else { while ($link_arr = mysql_fetch_array($links_res)) { $link_url = process_line_output($link_arr['URL'], 1000); $link_title = process_line_output($link_arr['Title']); $link_desc = process_text_output($link_arr['Description']); $out .= "<div class=\"links_cont\">\n"; $out .= "<div class=\"clear_both\"></div>\n"; $out .= "<div class=\"links_header\">"; $out .= "<a href=\"{$link_url}\">{$link_title}</a></div>\n"; $out .= "<div class=\"links_snippet\">{$link_desc}</div>\n"; $out .= "<div class=\"clear_both\"></div></div>\n"; } } return $out; }
function MemberPrintPolls() { global $site; $res = db_res("SELECT `ID`, `Question`, `Active` FROM `polls_q` ORDER BY `Active`, `Question` DESC"); if (!$res) { return; } echo "<table cellspacing=1 cellpadding=2 class=small width='100%'>\n"; if (!mysql_num_rows($res)) { echo "<tr class=panel><td align=center>No polls available.</td></tr>\n"; } while ($poll_arr = mysql_fetch_array($res)) { if ($poll_arr['Active'] == 'on') { $active = "<td width=15 bgcolor=green> </td>"; } else { $active = "<td width=15 bgcolor=red> </td>"; } $poll_question = process_line_output($poll_arr['Question']); echo "\n\t\t\t<tr class=panel>\n\t\t\t\t{$active}\n\t\t\t\t<td align=center width=15%>\n\t\t\t\t\t<a href=\"polls.php?edit_id={$poll_arr['ID']}\">Edit</a> |\n\t\t\t\t\t<a href=\"polls.php?action=delete&delete_id={$poll_arr['ID']}\">Delete</a>\n\t\t\t\t</td>\n\t\t\t\t<td aling=left> <a target='_blank' href='{$site['url']}poll.php?ID={$poll_arr['ID']}'>{$poll_question}</a></td>\n\t\t\t</tr>\n"; } echo "</table>\n"; }
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; }
/** * page code function */ function PageCompPageMainCode() { global $site; global $short_date_format; $out = ""; $query = "SELECT `Stories`.`ID`, `Profiles`.`ID` as `MembID`, DATE_FORMAT(`Stories`.`Date`, '{$short_date_format}' ) AS 'Date', `Stories`.`Header`, `Stories`.`Text`, `Profiles`.`ID` as `prID`, `Profiles`.`NickName` FROM `Stories` INNER JOIN `Profiles` ON (`Stories`.`Sender` = `Profiles`.`ID`) WHERE `Stories`.`active` = 'on' ORDER BY `Stories`.`Date` DESC"; $res = db_res($query); if (!$res) { return 0; } $out .= "\n\t\t<br />\n\t\t<div align=left> <a href=\"" . $site['url'] . "story.php\">" . _t("_post my feedback") . "</a></div>\n\t\t<br />\n\t\t<table width=\"100%\" cellspacing=1 cellpadding=2 class=small width=100%>"; $num = mysql_num_rows($res); if (!$num) { $out .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td><center>" . _t("_NO_STORIES") . "</center></td>\n\t\t\t\t</tr>"; } else { while ($arr = mysql_fetch_array($res)) { $story_header = process_line_output($arr['Header']); $out .= "\n\t\t\t\t<tr class=panel>\n\t\t\t\t\t<td align=center width=15%>{$arr['Date']}</td>\n\t\t\t\t\t<td align=center width=15%><a href=\"" . getProfileLink($arr['prID']) . "\">{$arr['NickName']}</a></td>\n\t\t\t\t\t<td aling=left> <a href='story_view.php?ID={$arr['ID']}'>{$story_header}</a></td>\n\t\t\t\t</tr>"; } } $out .= "\n\t\t</table>\n"; return $out; }
function getExistedBannersBlock() { $sClicksC = _t('_adm_bann_clicks'); $sImpressionsC = _t('_adm_bann_impressions'); $sPreviewC = _t('_Preview'); $sEditC = _t('_Edit'); $sDeleteC = _t('_Delete'); // Get banner info from database. $banners_res = db_res("SELECT * FROM `sys_banners` ORDER BY `ID` DESC"); $sExistedBanners = MsgBox(_t('_Empty')); if (mysql_num_rows($banners_res)) { $sExistedBanners = "<table cellspacing=1 cellpadding=2 border=0 class=small1 width=100%>"; while ($banns_arr = mysql_fetch_array($banners_res)) { $imp = db_arr("SELECT COUNT(*) FROM `sys_banners_shows` WHERE `ID` = '{$banns_arr['ID']}'"); $clicks = db_arr("SELECT COUNT(*) FROM `sys_banners_clicks` WHERE `ID` = '{$banns_arr['ID']}'"); $class = !$banns_arr['Active'] ? 'table_err' : 'panel'; $sBannerTitle = process_line_output($banns_arr['Title']); $sExistedBanners .= <<<EOF <tr class={$class}> \t<td> \t\t(<a href="banners.php?action=preview&banner_id={$banns_arr['ID']}">{$sPreviewC}</a> | \t\t\t<a href="banners.php?banner_id={$banns_arr['ID']}">{$sEditC}</a> | \t\t\t<a href="banners.php?banner_id={$banns_arr['ID']}&action=delete">{$sDeleteC}</a>) \t\t\t{$sBannerTitle} \t\t</a> \t</td> \t<td><b>{$clicks[0]}</b> {$sClicksC} </td> \t<td><b>{$imp[0]}</b> {$sImpressionsC} </td> </tr> EOF; } $sExistedBanners .= "</table>"; } $sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $sExistedBanners)); return DesignBoxContent(_t('_adm_mmi_banners'), $sResult, 1); }
function getRatingPhoto($aPhoto) { global $max_photo_width, $max_photo_height, $dir, $site; $sFileSrc = $dir['profileImage'] . $aPhoto['med_prof_id'] . '/photo_' . $aPhoto['med_file']; if (extFileExists($sFileSrc)) { $sPhotoUrl = $site['profileImage'] . $aPhoto['med_prof_id'] . '/photo_' . $aPhoto['med_file']; } else { header('Location:' . $_SERVER['PHP_SELF']); } $ret = ''; $ret .= '<div class="mediaTitle">'; $ret .= process_line_output($aPhoto['med_title']); $ret .= '</div>'; $ret .= '<div class="photoBlock" style="text-align:center;">'; $ret .= '<img src="' . getTemplateIcon('spacer.gif') . '" style="width:' . $max_photo_width . 'px; height:' . $max_photo_height . 'px; background-image:url(' . $sPhotoUrl . ');" class="photo" />'; $ret .= '</div>'; return $ret; }
function get_member_icon($ID, $float = 'none', $bDrawMargin = FALSE) { global $site; require_once BX_DIRECTORY_PATH_ROOT . 'profilePhotos.php'; //$sSexSql = "SELECT `Sex` FROM `Profiles` WHERE `ID` = '{$ID}'"; $aSexSql = getProfileInfo($ID); //db_arr( $sSexSql ); $oPhoto = new ProfilePhotos($ID); $oPhoto->getActiveMediaArray(); $aFile = $oPhoto->getPrimaryPhotoArray(); if (extFileExists($oPhoto->sMediaDir . 'icon_' . $aFile['med_file'])) { $sFileName = $oPhoto->sMediaUrl . 'icon_' . $aFile['med_file']; } else { if ($aSexSql['Sex'] == 'female' or $aSexSql['Sex'] == 'Female') { $sSexPic = 'woman_small.gif'; } elseif ($aSexSql['Sex'] == 'male' or $aSexSql['Sex'] == 'Male') { $sSexPic = 'man_small.gif'; } else { $sSexPic = 'visitor_small.gif'; } $sFileName = getTemplateIcon($sSexPic); } $sMarginsAddon = $bDrawMargin ? " margin-right:10px;margin-bottom:10px; " : ''; $style = 'width:' . $oPhoto->aMediaConfig['size']['iconWidth'] . 'px;' . 'height:' . $oPhoto->aMediaConfig['size']['iconHeight'] . 'px;' . 'background-image:url(' . $sFileName . ');'; $ret = ''; $ret .= '<div class="thumbnail_block" style="float:' . $float . '; position:relative; ">'; $ret .= "<a href=\"" . getProfileLink($ID) . "\">"; $ret .= '<img src="' . getTemplateIcon('spacer.gif') . '" style="' . $sMarginsAddon . $style . '" alt="' . process_line_output($aFileName['med_title']) . '" />'; $ret .= '</a>'; $ret .= '</div>'; return $ret; }
function PageCodeOutbox() { global $memberID; global $dir; global $site; global $tmpl; global $date_format; $query = "\r\n\t\tSELECT\r\n\t\t\t`Messages`.`ID`,\r\n\t\t\tUNIX_TIMESTAMP( `Date` ) AS `timestamp`,\r\n\t\t\tDATE_FORMAT(`Date`, '{$date_format}') AS `Date`,\r\n\t\t\t`Recipient`,\r\n\t\t\t`Profiles`.`NickName` AS `RecipientNickName`,\r\n\t\t\t`Subject`,\r\n\t\t\t`New`\r\n\t\tFROM `Messages`\r\n\t\tLEFT JOIN `Profiles` ON\r\n\t\t\t`Profiles`.`ID` = `Recipient`\r\n\t\tWHERE `Sender` = {$memberID}\r\n\t\tORDER BY `Date` DESC\r\n\t\t"; $rMsgs = db_res($query); if (!mysql_num_rows($rMsgs)) { return '<div class="no_result"><div>' . _t("_No messages in Outbox") . '</div></div>'; } // --- get template and replace headers --- $aReplace = array(); $aReplace['mailbox_header_img'] = '<img src="' . getTemplateIcon('outbox.gif') . '" class="mailbox_header_img" />'; //$aReplace['summary'] = _t( $aReplace['flag'] = _t('_Flag'); $aReplace['from'] = _t('_Recipient'); $aReplace['date'] = _t('_Date'); $aReplace['subject'] = _t('_Subject'); $aReplace['click_to_sort'] = _t('_Click to sort'); $aReplace['actions_l'] = ''; $aReplace['actions'] = ''; $ret = file_get_contents("{$dir['root']}templates/tmpl_{$tmpl}/mail_box.html"); foreach ($aReplace as $key => $val) { $ret = str_replace("__{$key}__", $val, $ret); } $aMyTmpl = preg_split("/\\{\\/?InsertRows\\}/", $ret); $tmplRow = $aMyTmpl[1]; $ret = "{$aMyTmpl[0]}{InsertRows /}{$aMyTmpl[2]}"; $InsertRows = ''; $tr_class = 'odd'; while ($aMsg = mysql_fetch_assoc($rMsgs)) { $sSubject = process_line_output(html2txt($aMsg['Subject'])); $aReplace = array(); $aReplace['tr_class'] = $tr_class; $aReplace['new_add'] = $aMsg['New'] ? 'new' : ''; $aReplace['ID'] = $aMsg['ID']; $aReplace['CheckBox'] = ''; $aReplace['Flag'] = '<img class="mailbox_flag_img" src="' . getTemplateIcon($aMsg['New'] ? 'not_readed.gif' : 'readed.gif') . '" title="' . _t($aMsg['New'] ? '_Not Readed' : '_Readed') . '" />'; $aReplace['From'] = "<!--{$aMsg['RecipientNickName']}--> <a href=\"{$site['url']}{$aMsg['RecipientNickName']}\">{$aMsg['RecipientNickName']}</a>"; $aReplace['Date'] = "<!--{$aMsg['timestamp']}--> {$aMsg['Date']}"; $aReplace['Subject'] = "<!--{$sSubject}--> <a href=\"{$site['url']}messages_outbox.php?message={$aMsg['ID']}\">{$sSubject}</a>"; $sInsertRow = $tmplRow; foreach ($aReplace as $key => $val) { $sInsertRow = str_replace("{{$key}}", $val, $sInsertRow); } $sInsertRows .= $sInsertRow; $tr_class = $tr_class == 'odd' ? 'even' : 'odd'; } $ret = str_replace("{InsertRows /}", $sInsertRows, $ret); return $ret; }
/** * Parse system keys. * * @param string $sKey key * @return string value associated with the key. */ function parseSystemKey($sKey, $mixedKeyWrapperHtml = null) { global $site; global $_page; global $oFunctions; global $oTemplConfig; global $logged; $aKeyWrappers = $this->_getKeyWrappers($mixedKeyWrapperHtml); $sRet = ''; switch ($sKey) { case 'page_charset': $sRet = 'UTF-8'; break; case 'page_keywords': if (!empty($GLOBALS[$this->_sPrefix . 'PageKeywords']) && is_array($GLOBALS[$this->_sPrefix . 'PageKeywords'])) { $sRet = '<meta name="keywords" content="' . bx_html_attribute(implode(',', $GLOBALS[$this->_sPrefix . 'PageKeywords'])) . '" />'; } break; case 'page_description': if (!empty($GLOBALS[$this->_sPrefix . 'PageDescription']) && is_string($GLOBALS[$this->_sPrefix . 'PageDescription'])) { $sRet = '<meta name="description" content="' . bx_html_attribute($GLOBALS[$this->_sPrefix . 'PageDescription']) . '" />'; } break; case 'page_header': if (!empty($GLOBALS[$this->_sPrefix . 'PageTitle'])) { $sRet = $GLOBALS[$this->_sPrefix . 'PageTitle']; } else { if (isset($_page['header'])) { $sRet = $_page['header']; } } //$sRet = process_line_output($sRet); break; case 'page_header_text': if (!empty($GLOBALS[$this->_sPrefix . 'PageMainBoxTitle'])) { $sRet = $GLOBALS[$this->_sPrefix . 'PageMainBoxTitle']; } else { if (isset($_page['header_text'])) { $sRet = $_page['header_text']; } } //$sRet = process_line_output($sRet); break; case 'main_div_width': if (!empty($GLOBALS[$this->_sPrefix . 'PageWidth'])) { $sRet = process_line_output($GLOBALS[$this->_sPrefix . 'PageWidth']); } break; case 'main_logo': $sRet = $GLOBALS['oFunctions']->genSiteLogo(); break; case 'main_splash': $sRet = $GLOBALS['oFunctions']->genSiteSplash(); break; case 'top_menu': $sRet = $GLOBALS['oTopMenu']->getCode(); break; case 'top_menu_breadcrumb': $sRet = !empty($GLOBALS['oTopMenu']->sBreadCrumb) ? $GLOBALS['oTopMenu']->sBreadCrumb : $GLOBALS['oTopMenu']->genBreadcrumb(); break; case 'extra_top_menu': $iProfileId = getLoggedId(); if ($iProfileId && getParam('ext_nav_menu_enabled')) { bx_import('BxTemplMemberMenu'); $oMemberMenu = new BxTemplMemberMenu(); $sRet = $oMemberMenu->genMemberMenu($iProfileId); } break; case 'bottom_links': $sRet = $oFunctions->genSiteBottomMenu(); break; case 'switch_skin_block': $sRet = getParam("enable_template") ? templates_select_txt() : ''; break; case 'dol_images': $sRet = $this->_processJsImages(); break; case 'dol_lang': $sRet = $this->_processJsTranslations(); break; case 'dol_options': $sRet = $this->_processJsOptions(); break; case 'bottom_text': $sRet = _t('_bottom_text', date('Y')); break; case 'copyright': $sRet = _t('_copyright', date('Y')) . getVersionComment(); break; case 'flush_header': //TODO: add some variable to disable it if needed //flush(); break; case 'extra_js': $sRet = empty($_page['extra_js']) ? '' : $_page['extra_js']; break; case 'is_profile_page': $sRet = defined('BX_PROFILE_PAGE') ? 'true' : 'false'; break; default: $sRet = ($sTemplAdd = $oFunctions->TemplPageAddComponent($sKey)) !== false ? $sTemplAdd : $aKeyWrappers['left'] . $sKey . $aKeyWrappers['right']; } $sRet = BxDolTemplate::processInjection($_page['name_index'], $sKey, $sRet); return $sRet; }
function getPostFeatureBlock() { $iMemberID = (int) $this->aViewingPostInfo['OwnerID']; $aOwnerInfo = getProfileInfo($iMemberID); $aUser = array('Permalink' => $aOwnerInfo['NickName'], 'Link' => $iMemberID); $sFeaturedSect = ''; $vFeaturedPosts = $this->_oDb->getFeaturedPosts($iMemberID); if (mysql_num_rows($vFeaturedPosts)) { $sFeatured = ''; while ($aFeaturedPost = mysql_fetch_assoc($vFeaturedPosts)) { $iPostID = (int) $aFeaturedPost['PostID']; $aPost = array('Permalink' => $aFeaturedPost['PostUri'], 'Link' => $iPostID); $sPostLink = $this->genBlogLink('show_member_post', $aUser, '', $aPost); $sFeaturedPostTitle = process_line_output($aFeaturedPost['PostCaption']); $sFeatured .= <<<EOF <div class="cls_result_row bx-def-margin-sec-top-auto"> <div class="cls_categ_name"> <i class="sys-icon star-o"></i> <a href="{$sPostLink}" title="{$sFeaturedPostTitle}">{$sFeaturedPostTitle}</a> </div> </div> EOF; } return <<<EOF <div class="bx-def-bc-padding"> {$sFeatured} </div> EOF; } }
/** * Parse system keys. * * @param string $sKey key * @return string value associated with the key. */ function parseSystemKey($sKey, $mixedKeyWrapperHtml = null) { global $logged; $aKeyWrappers = $this->_getKeyWrappers($mixedKeyWrapperHtml); $sRet = ''; switch ($sKey) { case 'version': $sRet = $GLOBALS['site']['ver']; break; case 'current_version': $sRet = $GLOBALS['site']['ver'] . '.' . $GLOBALS['site']['build']; break; case 'page_charset': $sRet = 'UTF-8'; break; case 'page_keywords': if (!empty($GLOBALS[$this->_sPrefix . 'PageKeywords']) && is_array($GLOBALS[$this->_sPrefix . 'PageKeywords'])) { $sRet = '<meta name="keywords" content="' . process_line_output(implode(',', $GLOBALS[$this->_sPrefix . 'PageKeywords'])) . '" />'; } break; case 'page_description': if (!empty($GLOBALS[$this->_sPrefix . 'PageDescription']) && is_string($GLOBALS[$this->_sPrefix . 'PageDescription'])) { $sRet = '<meta name="description" content="' . process_line_output($GLOBALS[$this->_sPrefix . 'PageDescription']) . '" />'; } break; case 'page_header': if (!empty($GLOBALS[$this->_sPrefix . 'PageTitle'])) { $sRet = $GLOBALS[$this->_sPrefix . 'PageTitle']; } else { if (isset($GLOBALS['_page']['header'])) { $sRet = $GLOBALS['_page']['header']; } } $sRet = process_line_output($sRet); break; case 'page_header_text': if (!empty($GLOBALS[$this->_sPrefix . 'PageMainBoxTitle'])) { $sRet = process_line_output($GLOBALS[$this->_sPrefix . 'PageMainBoxTitle']); } else { if (isset($GLOBALS['_page']['header_text'])) { $sRet = $GLOBALS['_page']['header_text']; } } $sRet = process_line_output($sRet); break; case 'main_div_width': if (!empty($GLOBALS[$this->_sPrefix . 'PageWidth'])) { $sRet = process_line_output($GLOBALS[$this->_sPrefix . 'PageWidth']); } break; case 'top_menu': $sRet = BxDolAdminMenu::getTopMenu(); break; case 'main_menu': $sRet = BxDolAdminMenu::getMainMenu(); break; case 'dol_images': $sRet = $this->_processJsImages(); break; case 'dol_lang': $sRet = $this->_processJsTranslations(); break; case 'dol_options': $sRet = $this->_processJsOptions(); break; case 'promo_code': if (defined('BX_PROMO_CODE')) { $sRet = BX_PROMO_CODE; } else { $sRet = ' '; } break; case 'copyright': $sRet = _t('_copyright', date('Y')) . getVersionComment(); break; } $sRet = BxDolTemplate::processInjection($GLOBALS['_page']['name_index'], $sKey, $sRet); return $sRet; }
$iCurPage = (int) bx_get('page'); if ($iCurPage < 1) { $iCurPage = 1; } $sLimitFrom = ($iCurPage - 1) * $iPerPage; $aSqlQuery = "LIMIT {$sLimitFrom}, {$iPerPage}"; ///////////////eof pagination///////////////////// $aManage = array('medID', 'medProfId', 'medTitle', 'medUri', 'medDate', 'medViews', 'medExt', 'Approved'); if ($iTotalNum > 0) { $sMemberRSSSQL = "SELECT * FROM `bx_crss_main` {$aSqlQuery}"; $vMemberRSS = db_res($sMemberRSSSQL); while ($aRSSInfo = mysql_fetch_assoc($vMemberRSS)) { $iRssID = (int) $aRSSInfo['ID']; $sRssUrl = process_line_output($aRSSInfo['RSSUrl']); $sRssDesc = process_line_output($aRSSInfo['Description']); $sRssStatus = _t('_crss_status_' . process_line_output($aRSSInfo['Status'])); $sRssUrlJS = addslashes(htmlspecialchars($sRssUrl)); $sStatusColor = $aRSSInfo['Status'] == 'active' ? 'green' : 'red'; $sRSSs .= <<<EOF <div class="bx-def-margin-sec-top-auto" style="position:relative; padding-left:30px;"> <div class="bx_sys_unit_checkbox bx-def-round-corners"> <input id="ch{$iRssID}" type="checkbox" value="{$iRssID}" name="crsss[]" /> </div> <div class="bx-def-font-h3" > {$sRssUrl} </div> <div> <span style="color:{$sStatusColor};">{$sRssStatus}</span> <span class="sys-bullet"></span> {$sRssDesc} </div> </div> EOF;
function _getIconsList() { for ($i = 0; $i < $this->aMediaConfig['max']['photo']; $i++) { $sIconSrc = $this->sMediaDir . 'icon_' . $this->aMedia[$i]['med_file']; if (extFileExists($sIconSrc)) { $iPhotoRatingSum = 0 < $this->aMedia[$i]['med_rating_sum'] ? $this->aMedia[$i]['med_rating_sum'] : 0; $iPhotoRatingCount = 0 < $this->aMedia[$i]['med_rating_count'] ? $this->aMedia[$i]['med_rating_count'] : 0; $iPhotoRating = $this->getRating($iPhotoRatingSum, $iPhotoRatingCount); $sIconUrl = $this->sMediaUrl . 'icon_' . $this->aMedia[$i]['med_file']; //function changePhoto( sFile, imgDiv, sTitle, titleDiv, iRate, rateDiv) $atrib = ' \'' . $this->aMedia[$i]['med_file'] . '\', ' . $this->aMedia[$i]['med_id'] . ', \'' . process_line_output(addslashes($this->aMedia[$i]['med_title'])) . '\', ' . $iPhotoRating . ', ' . $iPhotoRatingSum . ', ' . $iPhotoRatingCount . ' '; $ret .= '<img src="' . getTemplateIcon('spacer.gif') . '" style="width:' . $this->aMediaConfig['size']['iconWidth'] . 'px; height:' . $this->aMediaConfig['size']['iconHeight'] . 'px; background-image:url(' . $sIconUrl . '); cursor:pointer;" alt="" class="icons" onmouseover="this.className=\'iconsHover\'" onmouseout="this.className=\'icons\'" onclick="return changePhoto(' . $atrib . ');" />'; } else { $sIconUrl = getTemplateIcon($this->sSexIcon); $ret .= '<img src="' . getTemplateIcon('spacer.gif') . '" style="width:' . $this->aMediaConfig['size']['iconWidth'] . 'px; height:' . $this->aMediaConfig['size']['iconHeight'] . 'px; background-image:url(' . $sIconUrl . ');" alt="" class="icons" />'; } } return $ret; }
echo $p_arr[id]; ?> "><?php echo $p_arr['id']; ?> </td> <td align="center"><?php echo process_line_output($p_arr['name']); ?> </td> <td align="center"><?php echo process_line_output($p_arr['email']); ?> </td> <td align="center"><?php echo process_line_output($p_arr['status']); ?> </td> <td align="center"><input type="checkbox" name="<?php echo $p_arr[id]; ?> "></td> </tr> <?php } } ?> </table> <!-- Check all/Uncheck all controls --> <center>
/** * Function will generate site's search; * * @return : Html presentation data; */ function genSiteSearch($sText = '') { if (empty($sText)) { $sText = process_line_output(_t('_Search...')); } return $GLOBALS['oSysTemplate']->parseHtmlByName('search_header.html', array('text' => $sText)); }
function getNickName() { $oProfileQuery = new BxDolProfileQuery(); return process_line_output($oProfileQuery->getNickName($this->_iProfileID)); }
/** * 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); }
/** * Print Stories */ function MemberPrintStories() { global $member; global $ADMIN; $php_date_format = getParam('php_date_format'); if ($ADMIN) { $res = db_res("SELECT `ID`, UNIX_TIMESTAMP( `Date` ) AS `Date`, `Sender`, `Header`, `Text`, `active` FROM `Stories` ORDER BY `Date` DESC"); } else { $res = db_res("SELECT `ID`, UNIX_TIMESTAMP( `Date` ) AS `Date`, `Sender`, `Header`, `Text`, `active` FROM `Stories` WHERE `Sender` = {$member['ID']} ORDER BY `Date` DESC"); } if ($ADMIN && !mysql_num_rows($res)) { return MsgBox(_t('_No stories available')); } ob_start(); ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?> "> <table class="stories_list"> <tr> <th><?php echo _t('_Select'); ?> </th> <th><?php echo _t('_Status'); ?> </th> <th><?php echo _t('_Date'); ?> </th> <th><?php echo _t('_Title'); ?> </th> </tr> <?php $story_line_class = 'odd'; while ($story_arr = mysql_fetch_array($res)) { $story_status = _t($story_arr['active'] ? '_active_story' : '_not_active_story'); $story_status_class = $story_arr['active'] ? 'status_active' : 'status_inactive'; $story_header = process_line_output($story_arr['Header']); ?> <tr class="line_<?php echo $story_line_class; ?> "> <td> <input type="checkbox" name="select_story[]" value="<?php echo $story_arr['ID']; ?> " /> </td> <td class="<?php echo $story_status_class; ?> "> <?php echo $story_status; ?> </td> <td><?php echo date($php_date_format, $story_arr['Date']); ?> </td> <td> <b><a href="story_view.php?ID=<?php echo $story_arr['ID']; ?> "><?php echo $story_header; ?> </a></b> (<a href="story.php?edit_id=<?php echo $story_arr['ID']; ?> &sender=<?php echo $story_arr['Sender']; ?> "><?php echo _t('_Edit'); ?> </a>) </td> </tr> <?php $story_line_class = $story_line_class == 'odd' ? 'even' : 'odd'; } ?> <tr> <td colspan="4"> <?php if ($ADMIN) { ?> <input type="submit" name="do_activate" value="Make active" /> <input type="submit" name="do_deactivate" value="Make inactive" /> <?php } ?> <input type="submit" name="do_delete" value="<?php echo _t('_Delete'); ?> " onclick="return confirm( '<?php echo _t('_Are you sure'); ?> ?' );" /> </td> </tr> </table> </form> <!-- <a href="story.php?action=delete&delete_id=<?php echo $story_arr['ID']; ?> &sender=<?php echo $story_arr['Sender']; ?> "><?php echo _t('_Delete'); ?> </a> --> <?php return ob_get_clean(); }
function getArticleEditForm($iArticleID = '') { $sEditArticleC = _t('_Edit Article'); $sArticlesC = _t('_Articles'); $sArticleC = _t('_Article'); $sArticleTitleC = _t('_Article Title'); $sSelectCategoryC = _t('_Select Category'); $sPrintAsC = _t('_Print As'); $rCatories = $this->getArticlesCategoriesList(true); if ((int) $iArticleID) { $articleQuery = "\r\n\t\t\t\tSELECT `Articles`.`ArticlesID`, `Articles`.`CategoryID`, `Articles`.`Date`,\r\n\t\t\t\t\t\t`Articles`.`Title`, `Articles`.`Text`, `Articles`.`ArticleFlag`, `ArticlesCategory`.`CategoryName`\r\n\t\t\t\tFROM `Articles`\r\n\t\t\t\tINNER JOIN `ArticlesCategory` ON `ArticlesCategory`.`CategoryID` = `Articles`.`CategoryID`\r\n\t\t\t\tWHERE `Articles`.`ArticlesID` = '{$iArticleID}';\r\n\t\t\t"; $aArticle = db_arr($articleQuery); } $sCategoryNameAd = ''; if ($iArticleID && strlen($aArticle['CategoryName'])) { $sCategoryNameAd = <<<EOF <span>></span> <span><a href="{$this->sUrl}articles.php?catID={$aArticle['CategoryID']}&action=viewcategory">{$aArticle['CategoryName']}</a></span> <span>></span> <span>{$sEditArticleC}</span> EOF; } $sRetCateg = ''; while ($aCategory = mysql_fetch_assoc($rCatories)) { if ($aArticle['CategoryID'] == $aCategory['CategoryID']) { $sSelectedCategory = ' selected="selected"'; } else { $sSelectedCategory = ''; } $sRetCateg .= '<option value="' . $aCategory['CategoryID'] . '"' . $sSelectedCategory . '>' . process_line_output(strmaxtextlen($aCategory['CategoryName'], 50)) . '</option>' . "\n"; } $sArticleActions = ''; if ((int) $iArticleID) { $sArticleActions .= '<input type="hidden" name="edit_article" value="true" />' . "\n"; $sArticleActions .= '<input type="hidden" name="articleID" value="' . $iArticleID . '" />' . "\n"; } else { $sArticleActions .= '<input type="hidden" name="add_article" value="true" />' . "\n"; } $sTitle = process_line_output($aArticle['Title']); $textSelected = $aArticle['ArticleFlag'] == 'Text' ? ' selected="selected"' : ''; $htmlSelected = $aArticle['ArticleFlag'] == 'HTML' ? ' selected="selected"' : ''; $ret = <<<EOF <div class="navigationLinks"> \t<span><a href="{$this->sUrl}articles.php">{$sArticlesC}</a></span> \t{$sCategoryNameAd} </div> <script type="text/javascript"> function checkForm() { \tvar el; \tvar hasErr = false; \tvar fild = ""; \tel = document.getElementById("articleTitle"); \tif( el.value.length < 3 ) { \t\tel.style.backgroundColor = "pink"; \t\thasErr = true; \t\tfild += " Article Title"; \t} else { \t\tel.style.backgroundColor = "#fff"; \t} \tel = document.getElementById("articleBody"); \tif( el.value.length < 3 ) { \t\tif (typeof tinyMCE != 'undefined') {//here Tiny \t\t\tif( tinyMCE.selectedElement.innerHTML.length < 3 ) { \t\t\t\tel.style.backgroundColor = "pink"; \t\t\t\thasErr = true; \t\t\t\tfild += " Article text"; \t\t\t} else { \t\t\t\tel.style.backgroundColor = "#fff"; \t\t\t} \t\t} \t} else { \t\tel.style.backgroundColor = "#fff"; \t} \tel = document.getElementById("categoryID"); \tif( el.value.length < 1 ) { \t\tel.style.backgroundColor = "pink"; \t\thasErr = true; \t\tfild += " Category "; \t} else { \t\tel.style.backgroundColor = "#fff"; \t} \tel = document.getElementById("flag"); \tif( el.value.length < 1 ) { \t\tel.style.backgroundColor = "pink"; \t\thasErr = true; \t\tfild += " Text type "; \t} else { \t\tel.style.backgroundColor = "#fff"; \t} \tif (hasErr) { \t\talert( "Please fill next fields first!" + fild ) \t\treturn false; \t} else { \t\treturn true; \t} } </script> <div class="articlesFormBlock"> \t<form method="post" action="{$this->sUrl}articles.php" onsubmit="return checkForm();"> \t\t<div>{$sArticleTitleC}</div> \t\t<div> \t\t\t<input type="text" name="title" id="articleTitle" class="catCaption" value="{$sTitle}" /> \t\t</div> \t\t<div>{$sArticleC}</div> \t\t<div style="margin-bottom:7px;"> \t\t\t<textarea name="article" id="articleBody" class="classfiedsTextArea articl">{$aArticle['Text']}</textarea> \t\t</div> \t\t<div style="margin-bottom:7px;"> \t\t\t<select name="categoryID" id="categoryID"> \t\t\t\t<option value="">{$sSelectCategoryC}</option> \t\t\t\t{$sRetCateg} \t\t\t</select> \t\t</div> \t\t<div style="margin-bottom:7px;"> \t\t\t<input type="hidden" name="flag" value="HTML" /> \t\t\t<!-- <select name="flag" id="flag"> \t\t\t\t<option value="">{$sPrintAsC}</option> \t\t\t\t<option value="Text"{$textSelected}>Text</option> \t\t\t\t<option value="HTML"{$htmlSelected}>HTML</option> \t\t\t</select> --> \t\t</div> \t\t<div> \t\t\t<input type="submit" value="Submit"> \t\t\t{$sArticleActions} \t\t</div> \t</form> </div> EOF; return $ret; }
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 displaySearchUnit($aResSQL) { $iVisitorID = getLoggedId(); $oMain = $this->getBlogsMain(); $iPostID = (int) $aResSQL['id']; $sBlogsImagesUrl = BX_BLOGS_IMAGES_URL; $bPossibleToView = $oMain->oPrivacy->check('view', $iPostID, $oMain->_iVisitorID); if (!$bPossibleToView) { if ($this->sMobileWrapper) { return $this->_wrapMobileUnit($oMain->_oTemplate->parseHtmlByTemplateName('browse_unit_private_mobile', array()), $iPostID, $oMain); } else { return $oMain->_oTemplate->parseHtmlByName('browse_unit_private.html', array('extra_css_class' => '')); } } $sCategories = $aResSQL['Categories']; $aCategories = $oMain->getTagLinks($aResSQL['Categories'], 'category', CATEGORIES_DIVIDER); $sStyle = ''; $sFriendStyle = ''; $sPostVote = ''; $sPostMode = ''; $sVotePostRating = $this->oRate->getJustVotingElement(0, 0, $aResSQL['Rate']); $aProfileInfo = getProfileInfo($aResSQL['ownerId']); $sAuthorTitle = process_line_output(getNickName($aProfileInfo['ID'])); $sAuthorUsername = getUsername($aProfileInfo['ID']); $sAuthorLink = getProfileLink($aProfileInfo['ID']); $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' => $sAuthorUsername)); $sCatName = process_line_output($sCatValue); $aAllCategoriesLinks[] = '<a href="' . $sCatLink . '">' . $sCatName . '</a>'; } $aAllCategoriesLinkHrefs = implode(", ", $aAllCategoriesLinks); $sAllCategoriesLinks = <<<EOF <span class="margined"> <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="unit_title bx-def-font-h2" href="{$sPostLink}">{$sPostCaption}</a>{$sAdminStatus} EOF; if ($this->iPostViewType == 3 || $this->sMobileWrapper) { $sFriendStyle = "2"; $sPostMode = '_post'; $sPostCaptionHref = '<div class="unit_title bx-def-font-h2">' . $sPostCaption . '</div>'; } $sDateTime = defineTimeInterval($aResSQL['date']); //$oCmtsView = new BxTemplCmtsView ('blogposts', (int)$iPostID); $iCommentsCnt = (int) $aResSQL['CommentsCount']; $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"> <span>{$sTagsHrefs}</span> </span> EOF; $sPostText = $aResSQL['bodyText']; $bOwner = $iVisitorID == $aResSQL['ownerId'] ? true : false; $sOwnerThumb = $sPostPicture = $sPreviewPicture = ''; if ($aResSQL['PostPhoto'] && $this->iPostViewType == 3) { $oMain->_oTemplate->addJs('plugins/fancybox/|jquery.fancybox.js'); $oMain->_oTemplate->addCss('plugins/fancybox/|jquery.fancybox.css'); $sPostPicture = $oMain->_oTemplate->parseHtmlByName('picture_preview.html', array('img_url_big' => $sBlogsImagesUrl . 'orig_' . $aResSQL['PostPhoto'], 'img_url_small' => $sBlogsImagesUrl . 'big_' . $aResSQL['PostPhoto'])); } if ($aResSQL['PostPhoto'] && ($this->iPostViewType == 1 || $this->iPostViewType == 4 || $this->iPostViewType == 5)) { $sStyle = 'padding-right:' . ($this->iThumbSize + 10) . 'px; min-height:' . $this->iThumbSize . 'px;'; $sPreviewPicture = '<div class="unit_img"><img class="bx-def-shadow bx-def-round-corners" src="' . $sBlogsImagesUrl . 'big_' . $aResSQL['PostPhoto'] . '" /></div>'; } if ($this->iPostViewType == 4) { $sOwnerThumb = $GLOBALS['oFunctions']->getMemberIcon($aResSQL['ownerId'], 'left'); } if ($this->iPostViewType == 4 || $this->iPostViewType == 1 || $this->iPostViewType == 5) { $iBlogLimitChars = (int) getParam('max_blog_preview'); $sPostText = trim(strip_tags($sPostText)); if (mb_strlen($sPostText) > $iBlogLimitChars) { $sPostText = mb_substr($sPostText, 0, $iBlogLimitChars); $sLinkMore = $this->sMobileWrapper ? '' : ' <a title="' . htmlspecialchars_adv(_t('_Read more')) . '" href="' . $sPostLink . '">…</a>'; } $sPostText = htmlspecialchars_adv($sPostText) . $sLinkMore; } $aUnitReplace = array('checkbox' => $sAdminCheck, 'post_caption' => $sPostCaptionHref, 'author_title' => $sAuthorTitle, 'author_username' => $sAuthorUsername, 'author_link' => $sAuthorLink, 'post_date' => $sDateTime, 'all_categories' => $sAllCategoriesLinks, 'comments_count' => $iCommentsCnt, 'post_tags' => $sTags, 'friend_style' => $sFriendStyle, 'post_uthumb' => $sOwnerThumb, 'post_picture2' => $sPostPicture, 'preview_picture' => $sPreviewPicture, 'post_description' => $sPostText, 'post_vote' => $sVotePostRating, 'post_mode' => $sPostMode, 'style' => $sStyle, 'bx_if:full' => array('condition' => $this->iPostViewType != 5, 'content' => array('author_title' => $sAuthorTitle, 'author_username' => $sAuthorUsername, 'author_link' => $sAuthorLink, 'post_date' => $sDateTime))); if ($this->sMobileWrapper) { return $this->_wrapMobileUnit($oMain->_oTemplate->parseHtmlByTemplateName('blogpost_unit_mobile', $aUnitReplace), $iPostID, $oMain); } else { return $oMain->_oTemplate->parseHtmlByTemplateName('blogpost_unit', $aUnitReplace); } }