function serviceGetQuoteUnit() { $oQuoteUnit = $this->_oDb->getRandomQuote(); $sUnitText = process_text_output($oQuoteUnit['Text']); $sUnitAuthor = process_line_output($oQuoteUnit['Author']); $aVariables = array('unit_text' => $sUnitText, 'author' => $sUnitAuthor); $this->_oTemplate->addCss('unit.css'); return array($this->_oTemplate->parseHtmlByTemplateName('unit', $aVariables), array(), array(), false); }
/** * 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; }
/** * 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; }
/** * 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(); }
/** * 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 displaySearchUnit($aApplInfo) { global $oFunctions; $iAppID = (int) $aApplInfo['id']; $iOwnerID = (int) $aApplInfo['ownerId']; $sOwnerName = getNickname($iOwnerID); $sOwnerLink = getProfileLink($iOwnerID); $sAppUrl = process_text_output($aApplInfo['url']); $sAppDate = defineTimeInterval($aApplInfo['date']); $sAppTitle = process_text_output($aApplInfo['title']); $sStatusColor = $aApplInfo['status'] == 'active' ? '#00CC00' : '#CC0000'; $aUnitReplace = array(); $aUnitReplace['status_color'] = $sStatusColor; $aUnitReplace['appl_id'] = $iAppID; $aUnitReplace['appl_url'] = $sAppUrl; $aUnitReplace['appl_title'] = $sAppTitle; $aUnitReplace['owner_url'] = $sOwnerLink; $aUnitReplace['owner_name'] = $sOwnerName; $aUnitReplace['appl_date'] = $sAppDate; return $this->oOsiTemplate->parseHtmlByTemplateName('unit_application', $aUnitReplace); }
</tr> <tr class=table> <td valign=top align="left"> HTML e-mail body </td> <td align="left"><textarea cols="55" rows="10" name="body_html" style="text-align: justify;"><?php echo htmlspecialchars($body_html); ?> </textarea></td> </tr> <?php if (strlen($body_html)) { ?> <tr class="table"> <td valign="top" align="left" width="120"> Text e-mail body </td> <td width="390" align="justify" style="border: 1px solid #666666"><?php echo process_text_output($body_text); ?> </td> </tr> <?php } ?> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan=2 align=center> <?php if ($_POST['msgs_id']) { ?> <input class="text" type="submit" style="width: 120px" name="add_message" value="Add message">
* * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. * http://creativecommons.org/licenses/by/3.0/ * * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the Creative Commons Attribution 3.0 License for more details. * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, * see license.txt file; if not, write to marketing@boonex.com ***************************************************************************/ require_once 'inc/header.inc.php'; require_once BX_DIRECTORY_PATH_INC . 'design.inc.php'; require_once BX_DIRECTORY_PATH_INC . 'profiles.inc.php'; require_once BX_DIRECTORY_PATH_INC . 'utils.inc.php'; // --------------- page variables $_page['name_index'] = 21; $_page['css_name'] = 'news_view.css'; $logged['member'] = member_auth(0, false); $_page['header'] = _t("_COMPOSE_NEWS_VIEW_H"); $_page['header_text'] = _t("_COMPOSE_NEWS_VIEW_H1"); // --------------- page components $_ni = $_page['name_index']; $query = "\n\tSELECT\n\t\t`Header`,\n\t\t`Snippet`,\n\t\t`Text`,\n\t\tDATE_FORMAT(`Date`, '{$date_format}' ) AS 'Date'\n\tFROM `News`\n\tWHERE `ID`=" . (int) $_GET['ID']; $news_arr = db_arr($query); $_page_cont[$_ni]['news_date'] = $news_arr['Date']; $_page_cont[$_ni]['news_header'] = process_line_output($news_arr['Header']); $_page_cont[$_ni]['news_text'] = process_text_withlinks_output($news_arr['Text']); $_page_cont[$_ni]['news_snippet'] = process_text_output($news_arr['Snippet']); // --------------- [END] page components PageCode(); // --------------- page components functions
function GetLinkList() { global $site; $link_query = "SELECT `ID`, `Title`, `URL`, `Description` FROM `Links`"; $link_res = db_res($link_query); $link_count = db_arr("SELECT COUNT(ID) FROM `Links`"); $link_count = $link_count['0']; $links_onpage = 10; $ret = ''; $ret .= '<div class="linkAdd">'; $ret .= '<a href="' . $site['url_admin'] . 'links.php?action=add">'; $ret .= 'Add New Link'; $ret .= '</a>'; $ret .= '</div>'; $j = 1; while ($link_arr = mysql_fetch_assoc($link_res)) { if ($j % 2 == 0) { $add = 'style="background-color:#E6E6E6;"'; } else { $add = ''; } $ret .= '<div class="link_block" ' . $add . '>'; $ret .= '<div class="link_title">'; $ret .= '<a href="' . $link_arr['URL'] . '">'; $ret .= process_line_output($link_arr['Title']); $ret .= '</a>'; $ret .= '</div>'; $ret .= '<div>'; $ret .= process_text_output($link_arr['Description']); $ret .= '</div>'; $ret .= '<div style="text-align:right;">'; $ret .= '<a href="' . $site['url_admin'] . 'links.php?linkID=' . $link_arr['ID'] . '&action=edit">'; $ret .= 'Edit'; $ret .= '</a>'; $ret .= ' || '; $ret .= '<a href="' . $site['url_admin'] . 'links.php?linkID=' . $link_arr['ID'] . '&action=delete">'; $ret .= 'Delete'; $ret .= '</a>'; $ret .= '</div>'; $ret .= '</div>'; $j++; } return $ret; }
/** * contr panel "latest news" */ function PageCompNews() { global $site; global $news_resl; global $oTemplConfig; // news //$news_limit_chars = getParam("max_news_preview"); $news_res = db_res("SELECT `ID` AS `newsID`, `Header`, `Snippet` FROM `News` ORDER BY `Date` DESC LIMIT " . $oTemplConfig->iMaxNewsOnMemberPanel . ""); $news_count = db_arr("SELECT COUNT(`ID`) FROM `News`"); $ret = ''; // $i = 1; while ($news_arr = mysql_fetch_assoc($news_res)) { /* News snippets delimiter if( ($i%2) == 0 ) { $style_add = ''; } else { $style_add = 'style="border-bottom:2px solid #e4e4e4; margin-bottom:5px;"'; } News snippets delimiter */ //if ( strlen($news_arr['Text']) == $news_limit_chars ) $news_arr['Text'] .= "..."; $ret .= '<div class="news_head">'; //$ret .= '<img src="' . $site['icons'] . 'news.gif" alt="" />'; $ret .= '<a href="' . $site['url'] . 'news_view.php?ID=' . $news_arr['newsID'] . '">'; $ret .= process_line_output($news_arr['Header']); $ret .= '</a>'; $ret .= '</div>'; $ret .= '<div class="news_text" ' . $style_add . '>'; $ret .= process_text_output($news_arr['Snippet']); $ret .= '</div>'; // $i ++; } if ($news_count['0'] > $max_news_on_cp) { $ret .= '<div style="position:relative; text-align:center; line-height:20px;"><a href="' . $site['url'] . 'news.php">' . _t("_Read news in archive") . '</a></div>'; } return $ret; }
/** * returns HTML code for one search row */ function PrintSearhResult($p_arr, $templ_search, $iNumber = 1, $bCouple = false, $aCoupleInfo = '') { global $site; global $pa_icon_preload; global $aPreValues; global $logged; global $tmpl; global $dir; global $max_thumb_width; global $max_thumb_height; global $anon_mode; global $enable_zodiac; global $enable_friendlist; global $pic_num; global $oTemplConfig; global $NickName; $member['ID'] = (int) $_COOKIE['memberID']; $free_mode = getParam("free_mode") == "on" ? 1 : 0; $bEnableRay = getParam('enable_ray') == 'on'; $gl_thumb_width = $max_thumb_width; $gl_thumb_height = $max_thumb_height; // get user online status $user_is_online = get_user_online_status($p_arr[ID]); $templ = $templ_search; // ------------ template variables -------------- $thumbnail = get_member_thumbnail($p_arr['ID'], 'none', true); // online/offline status $launch_ray_im = ""; //--- Ray IM integration ---// if ($user_is_online) { $check_res = checkAction($member['ID'], ACTION_ID_USE_RAY_IM); if ($bEnableRay && $check_res[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED && $member['ID'] != $p_arr['ID'] && !empty($member['ID'])) { $iSndId = (int) $member['ID']; $sSndPassword = getPassword($member['ID']); $iRspId = (int) $p_arr['ID']; $launch_ray_im = "<a href=\"javascript:void(0);\" onClick=\"javascript: openRayWidget( 'im', 'user', '" . $iSndId . "', '" . $sSndPassword . "', '" . $iRspId . "' ); return false;\">" . _t("_IM now", $p_arr['NickName']) . "</a>"; } } //--- Ray IM integration ---// // Template customizations // profile Nick/Age/Sex etc. $nick = '<a href="' . getProfileLink($p_arr['ID']) . '">' . $p_arr['NickName'] . '</a>'; $age_str = $p_arr['DateOfBirth'] != "0000-00-00" ? _t("_y/o", age($p_arr['DateOfBirth'])) . ' ' : ""; $age_only = $p_arr['DateOfBirth'] != "0000-00-00" ? age($p_arr['DateOfBirth']) : ""; $y_o_sex = $age_str . _t("_" . $p_arr['Sex']); $city = _t("_City") . ": " . process_line_output($p_arr['City']); $country = _t("_Country") . ": " . _t($aPreValues['Country'][$p_arr['Country']]['LKey']) . ' <img src="' . ($site['flags'] . strtolower($p_arr['Country'])) . '.gif" alt="flag" />'; $sFlag = $p_arr['Country'] != '' ? ' <img src="' . ($site['flags'] . strtolower($p_arr['Country'])) . '.gif" alt="flag" />' : ''; $city_con = process_line_output($p_arr['City']) . ", " . _t($aPreValues['Country'][$p_arr['Country']]['LKey']) . $sFlag; $occupation = process_line_output($p_arr['Occupation']); $children = $p_arr['Children'] ? $p_arr['Children'] . " " . _t("_children") : ""; $id = _t("_ID") . ": " . $p_arr['ID']; // description $i_am = _t("_I am"); $i_am_desc = process_smiles(strip_tags(process_text_output($p_arr['DescriptionMe']), '<img>')) . "..."; $you_are = _t("_You are"); $you_are_desc = process_smiles(process_text_output($p_arr['DescriptionYou'])) . "... <a href=\"" . getProfileLink($p_arr['ID']) . "\">" . _t("_more") . "</a>"; /* echo '<hr>'; print_r( $p_arr ); echo '<hr>'; */ $sCity = $p_arr['City']; //echo $sCity . '<hr>'; //--- Ray IM integration start ---// $ai_im = ''; $al_im = ''; $chechActionRes = checkAction($member['ID'], ACTION_ID_USE_RAY_IM); if ($bEnableRay && $chechActionRes[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED && $member['ID'] != $p_arr['ID'] && !empty($member['ID'])) { $iSndId = (int) $member['ID']; $sSndPassword = getPassword($member['ID']); $iRspId = (int) $p_arr['ID']; if ($user_is_online) { $file_icon = $dir['root'] . "templates/tmpl_" . $tmpl . "/images/icons/action_im_small.gif"; if (file_exists($file_icon)) { $ai_im .= "<img alt=\"" . _t("_IM now") . "\" class=\"links_image\" name=i06{$p_arr['ID']} src=\"{$site['url']}templates/tmpl_{$tmpl}/images/icons/action_im_small.gif\" />"; } $al_im .= '<a href="javascript:void(0);" onClick="javascript: openRayWidget( \'im\', \'user\', \'' . $iSndId . '\', \'' . $sSndPassword . '\', \'' . $iRspId . '\' ); return false;">'; $al_im = '<span class="links_span">' . $ai_im . $al_im . ucwords(_t("_IM now", $p_arr['NickName'])) . '</a></span>'; } } //--- Ray IM integration end ---// /* Standard IM commented out else if ( $enable_im ) { if ( $user_is_online ) { $al_im = "<a href=\"javascript:void(0);\" OnClick=\"javascript: launchAddToIM({$p_arr['ID']}); return false;\""; } else { $al_im = "<a href='javascript: void(0);' OnClick=\"javascript: alert('". _t("_Sorry, user is OFFLINE") ."'); return false;\""; } if ( $pa_icon_preload ) $al_im .= "onMouseOut =\"javascript: i06$p_arr[ID].src='$site[images]pa_im.gif';\""; $al_im .= ">"; $file_icon = $dir['root'] ."templates/tmpl_".$tmpl."/images/pa_im.gif"; if ( file_exists( $file_icon ) ) $ai_im .= $al_im ."<img name=i06$p_arr[ID] src=\"". $site['images']. "pa_im.gif\" border=0></a>"; $al_im .= _t("_chat now") ."</a>"; } Standard IM commented out */ /* View Profile commented out $ai_viewprof = "<img alt=\""._t("_View Profile")."\" name=i00$p_arr[ID] src=\"$site[images]pa_profile.gif\" border=0>"; $al_viewprof = "<a href=\"$p_arr[NickName]\""; if ( $pa_icon_preload ) { $al_viewprof.="onMouseOver=\"javascript:i00$p_arr[ID].src='$site[images]pa_profile2.gif';\""; $al_viewprof.="onMouseOut =\"javascript:i00$p_arr[ID].src='$site[images]pa_profile.gif';\""; } $al_viewprof .= ">"; $ai_viewprof = $al_viewprof.$ai_viewprof."</a>"; $al_viewprof .= _t("_View Profile")."</a>"; View Profile commented out */ //--- Greeting start ---// $chechActionRes = checkAction($member['ID'], ACTION_ID_SEND_VKISS); if ($chechActionRes[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED && $member['ID'] != $p_arr['ID']) { $ai_kiss = "<img alt=\"" . _t("_Greet") . "\" class=\"links_image\" name=i01{$p_arr['ID']} src=\"" . $site['url'] . "templates/tmpl_" . $tmpl . "/images/icons/action_greet_small.gif\" />"; $al_kiss = '<a target=_blank href="greet.php?sendto=' . $p_arr[ID] . '"'; if ($pa_icon_preload) { $al_kiss .= "onMouseOver=\"javascript: i01{$p_arr['ID']}.src='{$site['images']}pa_kiss2.gif';\""; $al_kiss .= "onMouseOut =\"javascript: i01{$p_arr['ID']}.src='{$site['images']}pa_kiss.gif';\""; } $al_kiss .= ">"; $al_kiss = "<span class=\"links_span\">" . $ai_kiss . $al_kiss . _t("_Greet") . "</a></span>"; } else { $al_kiss = ''; } //--- Greeting end ---// //--- Contact start ---// $chechActionRes = checkAction($member['ID'], ACTION_ID_SEND_MESSAGE); if ($chechActionRes[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED && $member['ID'] != $p_arr['ID']) { $ai_sendmsg = "<img alt=\"" . _t("_SEND_MESSAGE") . "\" name=i02{$p_arr['ID']} src=\"{$site['url']}templates/tmpl_{$tmpl}/images/icons/action_send_small.gif\" class=\"links_image\" />"; $al_sendmsg = "<a href=\"compose.php?ID={$p_arr['ID']}\""; if ($pa_icon_preload) { $al_sendmsg .= "onMouseOver=\"javascript: i02{$p_arr['ID']}.src='{$site['images']}pa_send2.gif';\""; $al_sendmsg .= "onMouseOut =\"javascript: i02{$p_arr['ID']}.src='{$site['images']}pa_send.gif';\""; } $al_sendmsg .= ">"; $al_sendmsg = "<span class=\"links_span\">" . $ai_sendmsg . $al_sendmsg . _t("_Contact") . "</a></span>"; } else { $al_sendmsg = ''; } //--- Contact end ---// if ($logged['member']) { $ai_hot = "<img alt=\"" . _t("_hot member") . "\" name=i03{$p_arr['ID']} src=\"{$site['images']}pa_hot.gif\" border=0>"; $al_hot = "<a href=\"javascript:void(0);\" onClick=\"javascript:window.open( 'list_pop.php?action=hot&ID=" . $p_arr['ID'] . "', '', 'width=280,height=200,menubar=no,status=no,resizable=no,scrollbars=yes,toolbar=no, location=no' );\""; if ($pa_icon_preload) { $al_hot .= "onMouseOver=\"javascript: i03{$p_arr['ID']}.src='{$site['images']}pa_hot2.gif';\""; $al_hot .= "onMouseOut =\"javascript: i03{$p_arr['ID']}.src='{$site['images']}pa_hot.gif';\""; } $al_hot .= ">"; $ai_hot = $al_hot . $ai_hot . "</a>"; $al_hot .= _t("_hot member") . "</a>"; $ai_friend = "<img alt=\"" . _t("_friend member") . "\" name=i03{$p_arr['ID']} src=\"{$site['images']}pa_friend.gif\" border=0>"; $al_friend = "<a href=\"javascript:void(0);\" onClick=\"javascript:window.open( 'list_pop.php?action=friend&ID=" . $p_arr['ID'] . "', '', 'width=280,height=200,menubar=no,status=no,resizable=no,scrollbars=yes,toolbar=no, location=no' );\""; if ($pa_icon_preload) { $al_friend .= "onMouseOver=\"javascript: i03{$p_arr['ID']}.src='{$site['images']}pa_friend2.gif';\""; $al_friend .= "onMouseOut =\"javascript: i03{$p_arr['ID']}.src='{$site['images']}pa_friend.gif';\""; } $al_friend .= ">"; $ai_friend = $al_friend . $ai_friend . "</a>"; $al_friend .= _t("_friend member") . "</a>"; $ai_block = "<img alt=\"" . _t("_block member") . "\" name=i04{$p_arr['ID']} src=\"{$site['images']}pa_block.gif\" border=0>"; $al_block = "<a href=\"javascript:void(0);\" onClick=\"javascript:window.open( 'list_pop.php?action=block&ID=" . $p_arr['ID'] . "', '', 'width=280,height=200,menubar=no,status=no,resizable=no,scrollbars=yes,toolbar=no, location=no' );\""; if ($pa_icon_preload) { $al_block .= "onMouseOver=\"javascript: i04{$p_arr['ID']}.src='{$site['images']}pa_block2.gif';\""; $al_block .= "onMouseOut =\"javascript: i04{$p_arr['ID']}.src='{$site['images']}pa_block.gif';\""; } $al_block .= ">"; $ai_block = $al_block . $ai_block . "</a>"; $al_block .= _t("_block member") . "</a>"; } //--- Fave Start ---// if ($logged['member'] && $member['ID'] != $p_arr['ID']) { $ai_fave = "<img alt=\"" . _t("_Fave") . "\" class=\"links_image\" name=i03{$p_arr['ID']} src=\"{$site['url']}templates/tmpl_{$tmpl}/images/icons/action_fave_small.gif\" />"; $al_fave = "<a href=\"javascript:void(0);\" onclick=\"window.open( 'list_pop.php?action=hot&ID={$profileID}', '', 'width={$oTemplConfig->popUpWindowWidth},height={$oTemplConfig->popUpWindowHeight},menubar=no,status=no,resizable=no,scrollbars=yes,toolbar=no,location=no' );\">"; $al_fave = '<span class="links_span">' . $ai_fave . $al_fave . _t("_Fave") . "</a></span>"; } else { $al_fave = ''; } //--- Fave End ---// $more = '<a href="' . getProfileLink($p_arr['ID']) . '" target="_blank">'; $more .= '<img src="' . $site['icons'] . 'desc_more.gif" alt="' . _t('_more') . '" />'; $more .= '</a>'; $enable_more_photos = 'on' == getParam("more_photos_on_searchrow") ? 1 : 0; if ($enable_more_photos) { $more_photos = ''; for ($i = 1; $i <= $pic_num; ++$i) { if ($p_arr['Pic_' . $i . '_addon'] > 0) { $photo_counter++; } } if (0 < $photo_counter && ($logged['admin'] || $check_res[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED)) { $more_photos = '<a href="javascript:void(0);" onClick="javascript: get_gallery(' . $p_arr['ID'] . ');" class="search_more_photo">'; $more_photos .= $photo_counter . ' ' . _t("_More Photos"); $more_photos .= '</a>'; } else { $more_photos = ''; } } // ------------ [end] template variables -------------- if ($aCoupleInfo) { // profile Nick/Age/Sex etc. $nick2 = '<a href="' . getProfileLink($aCoupleInfo['ID']) . '">' . $aCoupleInfo['NickName'] . '</a>'; $age_str2 = $aCoupleInfo['DateOfBirth'] != "0000-00-00" ? _t("_y/o", age($aCoupleInfo['DateOfBirth'])) . ' ' : ""; $age_only2 = $aCoupleInfo['DateOfBirth'] != "0000-00-00" ? age($aCoupleInfo['DateOfBirth']) : ""; $y_o_sex2 = $age_str2 . _t("_" . $aCoupleInfo['Sex']); $city2 = _t("_City") . ": " . process_line_output($aCoupleInfo['City']); $country2 = _t("_Country") . ": " . _t($aPreValues['Country'][$aCoupleInfo['Country']]['LKey']) . ' <img src="' . ($site['flags'] . strtolower($aCoupleInfo['Country'])) . '.gif" alt="flag" />'; $city_con2 = process_line_output($aCoupleInfo['City']) . ", " . _t($aPreValues['Country'][$aCoupleInfo['Country']]['LKey']) . ' <img src="' . ($site['flags'] . strtolower($aCoupleInfo['Country'])) . '.gif" alt="flag" />'; $occupation2 = process_line_output($aCoupleInfo['Occupation']); $children2 = $aCoupleInfo['Children'] ? $aCoupleInfo['Children'] . " " . _t("_children") : ""; $id2 = _t("_ID") . ": " . $aCoupleInfo['ID']; // description $i_am2 = _t("_I am"); $i_am_desc2 = process_smiles(strip_tags(process_text_output($aCoupleInfo['DescriptionMe']), '<img>')) . "..."; $you_are2 = _t("_You are"); $you_are_desc2 = process_smiles(process_text_output($aCoupleInfo['DescriptionYou'])) . "... <a href=\"" . getProfileLink($aCoupleInfo['ID']) . "\">" . _t("_more") . "</a>"; $sCity2 = $aCoupleInfo['City']; $templ = str_replace("__add_style_c1__", 'float:left;width:31%;margin-right:10px;', $templ); $templ = str_replace("__add_style_c2__", 'float:left;width:31%;display:block;', $templ); $templ = str_replace("__nick2__", $nick2, $templ); $templ = str_replace("__age_sex2__", $y_o_sex2, $templ); $templ = str_replace("__city_con2__", $city_con2, $templ); $templ = str_replace("__i_am_desc2__", $i_am_desc2, $templ); if ($logged['member'] && $member['ID'] != $aCoupleInfo['ID'] && getParam('enable_match')) { $templ = str_replace("__match2__", getProfileMatch($member['ID'], $aCoupleInfo['ID']), $templ); } else { $templ = str_replace("__match2__", '', $templ); } } else { $templ = str_replace("__add_style_c1__", '', $templ); $templ = str_replace("__add_style_c2__", 'display:none;', $templ); $templ = str_replace("__match2__", '', $templ); } // replace template variables $templ = str_replace("__row_title__", process_line_output($p_arr[Headline]), $templ); $templ = str_replace("__n__", $iNumber, $templ); if (isset($p_arr['Couple']) && $p_arr['Couple'] > 0) { $iMaxThumbWidth = getParam('max_thumb_width'); $iNewWidth = 2 * ($iMaxThumbWidth + 10 + 2); $templ = str_replace("__ext_st__", 'style="width:' . $iNewWidth . 'px;"', $templ); } else { $iMaxThumbWidth = getParam('max_thumb_width'); $iNewWidth = 1 * ($iMaxThumbWidth + 12); $templ = str_replace("__ext_st__", 'style="width:' . $iNewWidth . 'px;"', $templ); } //$templ = str_replace ( "__ext_st__", '', $templ ); $templ = str_replace("__thumbnail__", $thumbnail, $templ); $templ = str_replace("__launch_ray_im__", $launch_ray_im, $templ); // match progress bar if ($logged['member'] && $member['ID'] != $p_arr['ID'] && getParam('enable_match')) { $templ = str_replace("__match__", getProfileMatch($member['ID'], $p_arr['ID']), $templ); } else { $templ = str_replace("__match__", '', $templ); } $templ = str_replace("__nick__", $nick, $templ); $templ = str_replace("__age_sex__", $y_o_sex, $templ); $templ = str_replace("__city__", $city, $templ); $templ = str_replace("__just_city__", $sCity, $templ); $templ = str_replace("__just_age__", $age_only, $templ); $templ = str_replace("__city_con__", $city_con, $templ); $templ = str_replace("__country__", $country, $templ); $templ = str_replace("__occupation__", $occupation, $templ); $templ = str_replace("__children__", $children, $templ); $templ = str_replace("__id__", $id, $templ); if ($enable_zodiac) { $templ = str_replace("__zodiac_sign__", getProfileZodiac($p_arr['DateOfBirth']), $templ); } else { $templ = str_replace("__zodiac_sign__", "", $templ); } $templ = str_replace("__i_am__", $i_am, $templ); $templ = str_replace("__i_am_desc__", $i_am_desc, $templ); $templ = str_replace("__you_are__", $you_are, $templ); $templ = str_replace("__you_are_desc__", $you_are_desc, $templ); $templ = str_replace("__ai_im__", $ai_im, $templ); $templ = str_replace("__al_im__", $al_im, $templ); $templ = str_replace("__ai_viewprof__", $ai_viewprof, $templ); $templ = str_replace("__al_viewprof__", $al_viewprof, $templ); $templ = str_replace("__ai_kiss__", $ai_kiss, $templ); $templ = str_replace("__al_kiss__", $al_kiss, $templ); $templ = str_replace("__ai_sendmsg__", $ai_sendmsg, $templ); $templ = str_replace("__al_sendmsg__", $al_sendmsg, $templ); $templ = str_replace("__ai_fave__", $ai_fave, $templ); $templ = str_replace("__al_fave__", $al_fave, $templ); $templ = str_replace("__ai_hot__", $ai_hot, $templ); $templ = str_replace("__al_hot__", $al_hot, $templ); $templ = str_replace("__ai_block__", $ai_block, $templ); $templ = str_replace("__al_block__", $al_block, $templ); $templ = str_replace("__from__", _t("_from"), $templ); $templ = str_replace("__more__", $more, $templ); $templ = str_replace("__more_photos__", $more_photos, $templ); $templ = str_replace("__images__", $site['images'], $templ); if (function_exists('colors_select')) { $templ = str_replace("__designBoxColor__", colors_select(), $templ); } return $templ; }
function displaySearchUnit($aResSQL) { global $oFunctions; $sFromC = _t('_Added by'); $oMain = $this->getAdsMain(); $iAdID = (int) $aResSQL['id']; $bPossibleToView = $oMain->oPrivacy->check('view', $iAdID, $oMain->_iVisitorID); if (!$bPossibleToView) { return $oMain->_oTemplate->parseHtmlByName('browse_unit_private.html', array('extra_css_class' => '')); } $iOwnerID = (int) $aResSQL['ownerId']; $sOwnerName = getNickname($iOwnerID); $sOwnerLink = getProfileLink($iOwnerID); $sTimeAgo = defineTimeInterval($aResSQL['date']); $sVotePostRating = ''; if (!is_null($this->oRate) && $this->oRate->isEnabled()) { $sVotePostRating = $this->oRate->getJustVotingElement(0, 0, $aResSQL['Rate']); } $iCatID = (int) $aResSQL['categoryId']; $iSubCatID = (int) $aResSQL['subcategoryId']; $sAdTitle = process_text_output($aResSQL['title']); $sEntryUri = process_text_output($aResSQL['uri']); $sAdUrl = $this->genUrlX($iAdID, $sEntryUri); $sCustomVal1 = process_text_output($aResSQL['CustomFieldValue1']); $sCustomVal2 = process_text_output($aResSQL['CustomFieldValue2']); $sCustomName1 = process_text_output($aResSQL['CustomFieldName1']); $sCustomName2 = process_text_output($aResSQL['CustomFieldName2']); $sUnit1 = process_text_output($aResSQL['Unit1']); $sUnit2 = process_text_output($aResSQL['Unit2']); $sCustomStyle1 = $sCustomStyle2 = ''; $sCustomStyle1 = $sCustomVal1 != '' ? '' : 'display:none;'; $sCustomStyle2 = $sCustomVal2 != '' ? '' : 'display:none;'; $sCategUri = process_text_output($aResSQL['categoryUri']); $sSubCategUri = process_text_output($aResSQL['subcategoryUri']); $sCategName = process_text_output($aResSQL['categoryName']); $sSubCategName = process_text_output($aResSQL['subcategoryName']); $sCEntryUri = htmlspecialchars($aResSQL['categoryUri']); $sSEntryUri = htmlspecialchars($aResSQL['subcategoryUri']); $oMain = $this->getAdsMain(); $sCategUrl = $oMain->_oConfig->bUseFriendlyLinks ? BX_DOL_URL_ROOT . 'ads/cat/' . $sCEntryUri : "{$oMain->_oConfig->sCurrBrowsedFile}?bClassifiedID={$iCatID}"; $sSubCategUrl = $oMain->_oConfig->bUseFriendlyLinks ? BX_DOL_URL_ROOT . 'ads/subcat/' . $sSEntryUri : "{$oMain->_oConfig->sCurrBrowsedFile}?bSubClassifiedID={$iSubCatID}"; $sAdCover = $oMain->getAdCover($aResSQL['media']); $sAdBigCover = $oMain->getAdCover($aResSQL['media'], 'big_thumb'); $sAdminCheck = ''; if ($this->bShowCheckboxes) { $sAdminCheck = <<<EOF <div class="browseCheckbox"> <input id="ad{$iAdID}" type="checkbox" name="ads[]" value="{$iAdID}" /> </div> EOF; $sPostStatus = '<div class="ads_From">' . _t('_Status') . ': ' . process_line_output($aResSQL['Status']) . '</div>'; } $aUnitReplace = array('ad_cover_img' => $sAdCover, 'ad_link' => $sAdUrl, 'rating' => $sVotePostRating, 'ad_title' => $sAdTitle, 'ad_status' => $sPostStatus, 'ad_date' => mb_strtolower($sTimeAgo), 'from_label' => mb_strtolower($sFromC), 'ad_owner_link' => $sOwnerLink, 'ad_owner_name' => $sOwnerName, 'cats' => $oMain->_oTemplate->parseHtmlByTemplateName('category', array('cat_link' => $sCategUrl, 'sub_cat_link' => $sSubCategUrl, 'cat_name' => $sCategName, 'sub_cat_name' => $sSubCategName)), 'admin_check' => $sAdminCheck, 'ad_big_cover_img' => $sAdBigCover, 'bx_if:using_c1' => array('condition' => $sCustomName1 && $sCustomVal1, 'content' => array('cust_style1' => $sCustomStyle1, 'custom_name1' => $sCustomName1, 'custom1' => $sCustomVal1, 'unit' => $sUnit1)), 'bx_if:using_c2' => array('condition' => $sCustomName2 && $sCustomVal2, 'content' => array('cust_style2' => $sCustomStyle2, 'custom_name2' => $sCustomName2, 'custom2' => $sCustomVal2, 'unit2' => $sUnit2)), 'bx_if:expired' => array('condition' => time() - $aResSQL['date'] > 24 * 60 * 60 * $aResSQL['LifeTime'], 'content' => array(1 => 1))); return $oMain->_oTemplate->parseHtmlByTemplateName($this->sSelectedUnit, $aUnitReplace); }
function showBlockDescriptions($sCaption) { if (strlen($this->_aProfile['DescriptionMe'])) { $text = '<div class="discr">' . '<div class="rss_item_header">' . process_text_output($this->_aProfile['Headline']) . '</div>' . process_smiles(process_text_output($this->_aProfile['DescriptionMe'])) . '</div>'; echo DesignBoxContent(_t($sCaption), $text, 1); } if (strlen($this->_aProfile['DescriptionYou'])) { $text = '<div class="discr">' . process_smiles(process_text_output($this->_aProfile['DescriptionYou'])) . '</div>'; echo DesignBoxContent(_t('_Ideal match description'), $text, 1); } }
/** * print list of the table date */ function PrintData() { global $fields_types; global $fields_titles; global $fields_sizes; global $fields_align; global $class_titles; global $class_data; global $class_error; global $table_width; global $use_table; global $allow_delete; global $allow_edit; $query = "SELECT * FROM {$use_table}"; $res = db_res($query); if (!mysql_num_rows($res)) { echo "<div align=center class=\"err\">No data available</div>"; return; } echo "<table cellspacing=2 cellpadding=1 class=\"text\" width=\"{$table_width}\" align=\"center\">\n\n"; // print titles echo "<tr class=\"{$class_titles}\">\n"; if ($allow_delete) { echo "<form name=\"rows_form\" method=\"POST\" action=\"quotes.php\">"; echo "<td> </td>\n"; } foreach ($fields_titles as $k => $v) { echo "\t<td width=\"{$fields_sizes[$k]}\" align=\"{$fields_align[$k]}\">{$v}</td>\n"; } if ($allow_edit) { echo "<td> </td>\n"; } echo "</tr>\n\n"; // print data while ($row = mysql_fetch_array($res)) { if ($row[get_index_fieldname()] == $_GET['index_field'] || $row[get_index_fieldname()] == $_POST['index_field']) { echo "<tr class=\"{$class_error}\">\n"; } else { echo "<tr class=\"{$class_data}\">\n"; } // checkboxes if ($allow_delete) { echo "<td align=center><input type=checkbox name=\"" . $row[get_index_fieldname()] . "\"></td>\n"; } // data foreach ($fields_sizes as $k => $v) { echo "\t<td width=\"{$v}\" align=\"{$fields_align[$k]}\">" . process_text_output($row[$k]) . "</td>\n"; } // edit button if ($allow_edit) { echo "<td align=center><a href=\"?action=edit&index_field=" . $row[get_index_fieldname()] . "\">Edit</a></td>\n"; } echo "</tr>\n\n"; } echo "</table>\n\n"; if ($allow_delete) { echo get_checkbox_menu() . "</form>"; } ContentBlockFoot(); }
function getArticlesCategoryEditForm($iCategoryID = '') { global $site; $sArticlesC = _t('_Articles'); $sCategoryCaptionC = _t('_Category Caption'); $sCategoryDescriptionC = _t('_category_description'); $ret = ''; if ((int) $iCategoryID) { $sEditCategoryQuery = "\r\n\t\t\t\tSELECT `CategoryID`, `CategoryName`, `CategoryDescription`\r\n\t\t\t\tFROM `ArticlesCategory`\r\n\t\t\t\tWHERE `CategoryID` = '{$iCategoryID}'\r\n\t\t\t\tLIMIT 1;\r\n\t\t\t"; $aCategory = db_arr($sEditCategoryQuery); } $ret .= <<<EOF <div class="navigationLinks"> \t<span><a href="articles.php">{$sArticlesC}</a></span> </div> EOF; $ret .= <<<EOF <script type="text/javascript"> function checkForm() { \tvar el; \tvar hasErr = false; \tvar fild = ""; \tel = document.getElementById("caption"); \tif( el.value.length < 3 ) { \t\tel.style.backgroundColor = "pink"; \t\thasErr = true; \t\tfild += " Category Title "; \t} else { \t\tel.style.backgroundColor = "#fff"; \t} \tel = document.getElementById("description"); \tif( el.value.length < 3 ) { \t\tel.style.backgroundColor = "pink"; \t\thasErr = true; \t\tfild += " Category Description"; \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> EOF; $sFormInputs = ''; if ((int) $iCategoryID) { $sFormInputs .= '<input type="hidden" name="edit_category" value="true" />' . "\n"; $sFormInputs .= '<input type="hidden" name="categoryID" value="' . $iCategoryID . '" />' . "\n"; } else { $sFormInputs .= '<input type="hidden" name="add_category" value="true" />' . "\n"; } $sCategoryName = process_line_output($aCategory['CategoryName']); $sCategoryDescription = process_text_output($aCategory['CategoryDescription']); $ret .= <<<EOF <div class="articlesFormBlock"> \t<form method="post" action="{$this->sUrl}articles.php" onsubmit="return checkForm();"> \t\t<div>{$sCategoryCaptionC}</div> \t\t<div> \t\t\t<input type="text" name="caption" id="caption" class="catCaption" value="{$sCategoryName}" /> \t\t</div> \t\t<div>{$sCategoryDescriptionC}</div> \t\t<div> \t\t\t<textarea name="description" id="description" class="catDesc">{$sCategoryDescription}</textarea> \t\t</div> \t\t<div> \t\t\t<input type="submit" value="Submit"> \t\t\t{$sFormInputs} \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 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); }