本文整理汇总了PHP中draw_important_message函数的典型用法代码示例。如果您正苦于以下问题:PHP draw_important_message函数的具体用法?PHP draw_important_message怎么用?PHP draw_important_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了draw_important_message函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepare_input
$params['tag_keywords'] = prepare_input($_POST['tag_keywords']);
}
if (isset($_POST['tag_description'])) {
$params['tag_description'] = prepare_input($_POST['tag_description']);
}
if (isset($_POST['page_title'])) {
$params['page_title'] = prepare_input($_POST['page_title']);
}
if (isset($_POST['page_text'])) {
$params['page_text'] = prepare_input($_POST['page_text'], false, 'low');
}
if (isset($_POST['menu_link'])) {
$params['menu_link'] = prepare_input($_POST['menu_link']);
}
$params['menu_id'] = isset($_POST['menu_id']) ? prepare_input($_POST['menu_id']) : '0';
$params['page_key'] = create_seo_url(prepare_input($_POST['page_title']));
$params['language_id'] = isset($_POST['language_id']) ? prepare_input($_POST['language_id']) : '';
$params['finish_publishing'] = isset($_POST['finish_publishing']) && check_date($_POST['finish_publishing']) ? prepare_input($_POST['finish_publishing']) : '0000-00-00';
if ($objPage->PageCreate($params, $copy_to_other_langs)) {
$msg = draw_success_message(_PAGE_CREATED, false);
$objSession->SetMessage('notice', $msg);
header('location: index.php?admin=pages' . (Application::Get('type') != '' ? '&type=' . Application::Get('type') : '') . '&mg_language_id=' . $params['language_id']);
exit;
} else {
$msg = draw_important_message($objPage->error, false);
}
}
if ($msg == '') {
$msg = draw_message(_ALERT_REQUIRED_FILEDS, false);
}
}
示例2: defined
/**
* @project ApPHP Business Directory
* @copyright (c) 2011 ApPHP
* @author ApPHP <info@apphp.com>
* @license http://www.gnu.org/licenses/
*/
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
$curr_page_id = Application::Get('system_page') == '' ? Application::Get('page_id') : Application::Get('system_page');
$field_name = Application::Get('system_page') == '' ? 'id' : 'system_page';
$mg_language_id = isset($_REQUEST['mg_language_id']) ? prepare_input($_REQUEST['mg_language_id']) : Application::Get('lang');
$new_page_id = Pages::GetPageId($curr_page_id, $mg_language_id, $field_name);
$field_from = Application::Get('system_page') == '' ? 'pid=' . $curr_page_id : 'system_page=' . $curr_page_id;
$field_to = Application::Get('system_page') == '' ? 'pid=' . $new_page_id : 'system_page=' . $new_page_id;
$seo_field_from = Application::Get('system_page') == '' ? '/' . $curr_page_id . '/' : '/' . $curr_page_id . '.';
$seo_field_to = Application::Get('system_page') == '' ? '/' . $new_page_id . '/' : '/' . $new_page_id . '.';
if (!empty($new_page_id) && $curr_page_id != $new_page_id) {
$url = get_page_url(false);
if ($objSettings->GetParameter('seo_urls') == '1') {
$url = str_replace($seo_field_from, $seo_field_to, $url);
} else {
$url = str_replace($field_from, $field_to, $url);
}
header('location: ' . $url);
exit;
} else {
if (empty($new_page_id)) {
$objSession->SetMessage('notice', draw_important_message(_PAGE_UNKNOWN, false));
}
}
示例3: draw_title_bar
<?php
/**
* @project ApPHP Business Directory
* @copyright (c) 2012 ApPHP
* @author ApPHP <info@apphp.com>
* @license http://www.gnu.org/licenses/
*/
// draw title bar
draw_title_bar(_PAGES);
draw_content_start();
draw_important_message(_PAGE_NOT_EXISTS);
draw_content_end();
示例4: array
} else {
if ($submition_type == 'site_info') {
$params_ranks = array();
$params_ranks['alexa_rank'] = number_format((double) $objSettings->CheckAlexaRank($http_host));
$params_ranks['google_rank'] = (int) $objSettings->CheckGoogleRank($http_host);
if ($objSettings->UpdateFields($params_ranks) == true) {
$msg = draw_success_message(_CHANGES_WERE_SAVED, false);
} else {
$msg = draw_important_message($objSettings->error, false);
}
} else {
if ($submition_type == 'cron_settings') {
if ($objSettings->UpdateFields($params_cron) == true) {
$msg = draw_success_message(_CHANGES_WERE_SAVED, false);
} else {
$msg = draw_important_message($objSettings->error, false);
}
}
}
}
}
}
}
}
}
}
}
$template = $objSettings->GetTemplate();
if (strtolower(SITE_MODE) != 'demo' && $submition_type == 'general' || $submition_type == 'visual_settings' || $submition_type == 'meta_tags') {
$objSiteDescription->LoadData();
RSSFeed::UpdateFeeds();
示例5: draw_important_message
exit;
} else {
//echo mysql_error();
$msg = draw_important_message(_TRY_LATER, false);
}
}
}
}
}
}
}
}
}
}
} else {
$msg = draw_important_message(str_replace('_COUNT_', $maximum_inquiries, _MAXIMUM_ALLOWED_INQUIRIES_PER_SESSION), false);
}
} else {
if ($act == 'location_reload') {
// currently do nothing
} else {
if ($act == 'inquiry_sent') {
$msg = draw_success_message(_INQUIRY_SENT_SUCCESS_MSG, false);
}
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
示例6: defined
* @license http://www.gnu.org/licenses/
*/
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
$task = isset($_POST['task']) ? prepare_input($_POST['task']) : '';
$keyword = isset($_POST['keyword']) ? strip_tags(prepare_input($_POST['keyword'])) : '';
if ($keyword == _SEARCH_KEYWORDS . '...') {
$keyword = '';
}
$p = isset($_POST['p']) ? (int) $_POST['p'] : '';
$objSearch = new Search();
$search_result = '';
$title_bar = _LOOK_IN . ':
<select class="look_in" name="search_in" onchange="javascript:document.getElementById(\'search_in\').value=this.value;appQuickSearch();">
<option value="listings" ' . (Application::Get('search_in') == 'listings' ? 'selected="selected"' : '') . '>' . _LISTINGS . '</option>
<option value="pages" ' . (Application::Get('search_in') == 'pages' ? 'selected="selected"' : '') . '>' . _PAGES . '</option>
<option value="news" ' . (Application::Get('search_in') == 'news' ? 'selected="selected"' : '') . '>' . _NEWS . '</option>
</select>';
// Check if there is a page
if ($keyword != '') {
draw_title_bar(_SEARCH_RESULT_FOR . ': ' . $keyword . '', $title_bar);
if ($task == 'quick_search') {
$search_result = $objSearch->SearchBy($keyword, $p, Application::Get('search_in'));
}
$objSearch->DrawPopularSearches();
$objSearch->DrawSearchResult($search_result, $p, $keyword);
} else {
draw_title_bar(_SEARCH_RESULT_FOR . ': ' . $keyword);
draw_important_message(_NO_RECORDS_FOUND);
}
示例7: Pages
if ($objLogin->IsLoggedInAsAdmin()) {
$objPage = new Pages(Application::Get('page_id'), false, $mg_language_id);
} else {
$objPage = new Pages(Application::Get('system_page') != '' ? Application::Get('system_page') : Application::Get('page_id'), true, $mg_language_id);
}
$button_text = '';
// check if there is a page
if ($objSession->IsMessage('notice')) {
draw_title_bar(_PAGE);
echo $objSession->GetMessage('notice');
} else {
if ($objPage->CheckAccessRights($objLogin->IsLoggedIn())) {
// check if there is a page
if ($objPage->GetId() != '') {
if ($objLogin->IsLoggedInAsAdmin() && Application::Get('preview') != 'yes') {
$button_text = prepare_permanent_link('index.php?admin=pages' . (Application::Get('type') == 'system' ? '&type=system' : '') . '&mg_language_id=' . $mg_language_id, _BUTTON_BACK);
}
$objPage->DrawTitle($button_text);
if (Modules::IsModuleInstalled('adsense') && (ModulesSettings::Get('adsense', 'adsense_code_activation') == 'All' || ModulesSettings::Get('adsense', 'adsense_code_activation') == 'Horizontal')) {
//echo '<div class="adsense-horizontal">'.Adsense::GetHorizontalBanerCode().'</div>';
}
$objPage->DrawText();
} else {
draw_title_bar(_PAGES);
draw_important_message(_PAGE_UNKNOWN);
}
} else {
draw_title_bar(_PAGE);
draw_important_message(_MUST_BE_LOGGED);
}
}
示例8: DrawVocabulary
/**
* Draws vocabulary
* @param $key
*/
public function DrawVocabulary($key)
{
$align_left = Application::Get('lang_dir') == 'ltr' ? 'left' : 'right';
$align_right = Application::Get('lang_dir') == 'ltr' ? 'right' : 'left';
$this->GetVocabulary($this->whereClause);
echo '<a name="top"></a>';
echo '<table width="100%" align="center" border="0" cellspacing="0" cellpadding="2" class="main_text">
<tr>
<td>' . _FILTER_BY . ': ';
echo prepare_permanent_link('index.php?admin=vocabulary' . $this->langIdByUrl, _ALL) . ' - ';
for ($i = 65; $i < 91; $i++) {
if ($this->filterBy == chr($i)) {
$chr_i = '<b><u>' . chr($i) . '</u></b>';
} else {
$chr_i = chr($i);
}
echo prepare_permanent_link('index.php?admin=vocabulary&filter_by=' . chr($i) . $this->langIdByUrl, $chr_i) . ' ';
}
echo ' - ';
for ($i = 1; $i <= 5; $i++) {
if ($this->filterBy == $i) {
$chr_i = '<b><u>' . $i . '</u></b>';
} else {
$chr_i = $i;
}
echo prepare_permanent_link('index.php?admin=vocabulary&filter_by=' . $i . $this->langIdByUrl, $chr_i) . ' ';
}
echo '</td>
<td width="7%" align="center" nowrap="nowrap">
' . _TOTAL . ': ' . count($this->keys) . '
</td>
</tr>';
echo '<tr align="center"><td colspan="2">' . draw_line('line_no_margin', IMAGE_DIRECTORY, false) . '</td></tr>';
echo '</table>';
if (!empty($this->keys)) {
echo '<table width="100%" align="center" border="0" cellspacing="0" cellpadding="3" class="main_text">';
echo '<tr>
<th width="1%">#</th>
<th width="25%" align="' . $align_left . '">' . _KEY . '</th>
<th width="65%" align="' . $align_left . '">' . _VALUE . '</th>
<th width="9%"></th>';
for ($i = 0; $i < $this->vocabularySize; $i++) {
// Prepare key_text for displaying
$decoded_text = strip_tags(decode_text($this->keys[$i]['key_text']));
if (strlen($decoded_text) > 90) {
$key_text = '<span style="cursor:help;" title="' . $decoded_text . '">' . substr_by_word($decoded_text, 95, true) . '</span>';
} else {
$key_text = $decoded_text;
}
// Display vocabulary row
if ($this->keys[$i]['key_value'] == $this->currentKey) {
echo '<tr>';
echo '<td align="' . $align_right . '" class="voc_row_edit_' . $align_left . '" nowrap="nowrap">' . ($i + 1) . '.</td>';
echo '<td align="' . $align_left . '" class="voc_row_edit_middle" nowrap="nowrap">' . $this->keys[$i]['key_value'] . '</td>';
echo '<td align="' . $align_left . '" class="voc_row_edit_middle">' . $key_text . '</td>
<td align="center" class="voc_row_edit_' . $align_right . '">' . prepare_permanent_link('index.php?admin=vocabulary&key=' . $this->keys[$i]['id'] . '&act=edit' . $this->filterByUrl . $this->langIdByUrl, '[ ' . _EDIT_WORD . ' ]') . '</td>
</tr>';
} else {
if ($this->keys[$i]['id'] == (int) $key) {
echo '<tr>';
echo '<td align="' . $align_right . '" class="voc_row_update_' . $align_left . '" nowrap="nowrap">' . ($i + 1) . '.</td>';
echo '<td align="' . $align_left . '" class="voc_row_update_middle" nowrap="nowrap">' . $this->keys[$i]['key_value'] . '</td>';
echo '<td align="' . $align_left . '" class="voc_row_update_middle">' . $key_text . '</td>
<td align="center" class="voc_row_update_' . $align_right . '">' . prepare_permanent_link('index.php?admin=vocabulary&key=' . $this->keys[$i]['id'] . '&act=edit' . $this->filterByUrl . $this->langIdByUrl, '[ ' . _EDIT_WORD . ' ]') . '</td>
</tr>';
} else {
echo '<tr ' . highlight(0) . ' onmouseover="oldColor=this.style.backgroundColor;this.style.backgroundColor=\'#ededed\';" onmouseout="this.style.backgroundColor=oldColor">';
echo '<td align="' . $align_right . '" nowrap="nowrap">' . ($i + 1) . '.</td>';
echo '<td align="' . $align_left . '" nowrap="nowrap">' . $this->keys[$i]['key_value'] . '</td>';
echo '<td align="' . $align_left . '">' . $key_text . '</td>
<td align="center">' . prepare_permanent_link('index.php?admin=vocabulary&key=' . $this->keys[$i]['id'] . '&act=edit' . $this->filterByUrl . $this->langIdByUrl, '[ ' . _EDIT_WORD . ' ]') . '</td>
</tr>';
}
}
}
echo '<tr><td colspan="4" nowrap="nowrap" height="10px"></td></tr>';
if ($this->vocabularySize > 15) {
echo '<tr valign="bottom"><td colspan="3"></td><td align="center">' . prepare_permanent_link('index.php?admin=vocabulary' . $this->filterByUrl . $this->langIdByUrl . '#top', _TOP . ' ^') . '</td></tr>';
}
echo '</table>';
} else {
draw_important_message(_VOC_NOT_FOUND);
}
}
示例9: draw_success_message
if ($action == 'add') {
$mode = 'view';
} else {
if ($action == 'create') {
$mode = 'view';
} else {
if ($action == 'edit') {
$mode = 'edit';
} else {
if ($action == 'update') {
if ($objModules->UpdateRecord($rid)) {
$mst_text = $objModules->error != '' ? $objModules->error : _UPDATING_OPERATION_COMPLETED;
$msg = draw_success_message($mst_text, false);
$mode = 'view';
} else {
$msg = draw_important_message($objModules->error, false);
$mode = 'edit';
}
} else {
if ($action == 'delete') {
$mode = 'view';
} else {
if ($action == 'details') {
$mode = 'view';
} else {
if ($action == 'cancel_add') {
$mode = 'view';
} else {
if ($action == 'cancel_edit') {
$mode = 'view';
}
示例10: send_email
} else {
if ($reg_confirmation == 'by admin') {
$email_template = 'new_account_created_confirm_by_admin';
} else {
$email_template = 'new_account_created';
}
}
send_email($email, $objSettings->GetParameter('admin_email'), $email_template, array('{FIRST NAME}' => $first_name, '{LAST NAME}' => $last_name, '{USER NAME}' => $user_name, '{USER PASSWORD}' => $user_password1, '{WEB SITE}' => $_SERVER['SERVER_NAME'], '{REGISTRATION CODE}' => $registration_code, '{BASE URL}' => APPHP_BASE, '{YEAR}' => date('Y')));
if ($admin_alert_new_registration == 'yes') {
send_email($objSettings->GetParameter('admin_email'), $objSettings->GetParameter('admin_email'), 'new_account_created_notify_admin', array('{FIRST NAME}' => $first_name, '{LAST NAME}' => $last_name, '{USER NAME}' => $user_name, '{USER EMAIL}' => $email, '{WEB SITE}' => $_SERVER['SERVER_NAME'], '{BASE URL}' => APPHP_BASE, '{YEAR}' => date('Y')));
}
////////////////////////////////////////////////////////////
if ($reg_confirmation == 'by email') {
$msg = draw_success_message(_ACCOUNT_CREATED_CONF_BY_EMAIL_MSG, false);
$msg .= '<br />' . draw_message(_ACCOUT_CREATED_CONF_LINK, false);
} else {
if ($reg_confirmation == 'by admin') {
$msg = draw_success_message(_ACCOUNT_CREATED_CONF_BY_ADMIN_MSG, false);
$msg .= '<br />' . draw_message(_ACCOUT_CREATED_CONF_LINK, false);
} else {
$msg = draw_success_message(_ACCOUNT_CREATED_NON_CONFIRM_MSG, false);
$msg .= '<br />' . draw_message(_ACCOUNT_CREATED_NON_CONFIRM_LINK, false);
}
}
$account_created = true;
} else {
$msg = draw_important_message(_CREATING_ACCOUNT_ERROR, false);
}
}
}
}
示例11: DrawRegistrationForm
/**
* Draws registration form
* @param $news_id
* @param $event_title
* @param $draw
*/
public function DrawRegistrationForm($news_id = '0', $event_title = '', $draw = true)
{
if (!$news_id) {
return '';
}
global $objSettings, $objLogin;
$lang = Application::Get('lang');
$focus_element = 'first_name';
// post fields
$task = isset($_POST['task']) ? prepare_input($_POST['task']) : '';
$event_id = isset($_POST['event_id']) ? (int) $_POST['event_id'] : '0';
$first_name = isset($_POST['first_name']) ? prepare_input($_POST['first_name']) : '';
$last_name = isset($_POST['last_name']) ? prepare_input($_POST['last_name']) : '';
$email = isset($_POST['email']) ? prepare_input($_POST['email']) : '';
$phone = isset($_POST['phone']) ? prepare_input($_POST['phone']) : '';
$message = isset($_POST['message']) ? substr(prepare_input($_POST['message']), 0, 2048) : '';
$captcha_code = isset($_POST['captcha_code']) ? prepare_input($_POST['captcha_code']) : '';
$admin_email = $objSettings->GetParameter('admin_email');
$msg = '';
if ($task == 'register_to_event') {
include_once 'modules/captcha/securimage.php';
$objImg = new Securimage();
if ($first_name == '') {
$msg = draw_important_message(_FIRST_NAME_EMPTY_ALERT, false);
$focus_element = 'first_name';
} else {
if ($last_name == '') {
$msg = draw_important_message(_LAST_NAME_EMPTY_ALERT, false);
$focus_element = 'last_name';
} else {
if ($email == '') {
$msg = draw_important_message(_EMAIL_EMPTY_ALERT, false);
$focus_element = 'email';
} else {
if ($email != '' && !check_email_address($email)) {
$msg = draw_important_message(_EMAIL_VALID_ALERT, false);
$focus_element = 'email';
} else {
if ($phone == '') {
$msg = draw_important_message(str_replace('_FIELD_', _PHONE, _FIELD_CANNOT_BE_EMPTY), false);
$focus_element = 'phone';
} else {
if (!$objImg->check($captcha_code)) {
$msg = draw_important_message(_WRONG_CODE_ALERT, false);
$focus_element = 'captcha_code';
} else {
$sql = 'SELECT * FROM ' . TABLE_EVENTS_REGISTERED . ' WHERE event_id = \'' . (int) $event_id . '\' AND email = \'' . $email . '\'';
if (database_query($sql, ROWS_ONLY, FIRST_ROW_ONLY) > 0) {
$msg = draw_important_message(_EVENT_USER_ALREADY_REGISTERED, false);
}
}
}
}
}
}
}
// deny all operations in demo version
if (strtolower(SITE_MODE) == 'demo') {
$msg = draw_important_message(_OPERATION_BLOCKED, false);
}
if ($msg == '') {
if ($objLogin->IpAddressBlocked(get_current_ip())) {
$msg = draw_important_message(_IP_ADDRESS_BLOCKED, false);
} else {
if ($objLogin->EmailBlocked($email)) {
$msg = draw_important_message(_EMAIL_BLOCKED, false);
} else {
$sql = 'INSERT INTO ' . TABLE_EVENTS_REGISTERED . ' (id, event_id, first_name, last_name, email, phone, message, date_registered)
VALUES (NULL, ' . (int) $event_id . ', \'' . encode_text($first_name) . '\', \'' . encode_text($last_name) . '\', \'' . encode_text($email) . '\', \'' . encode_text($phone) . '\', \'' . encode_text($message) . '\', \'' . @date('Y-m-d H:i:s') . '\')';
if (database_void_query($sql)) {
$msg = draw_success_message(_EVENT_REGISTRATION_COMPLETED, false);
////////////////////////////////////////////////////////////
send_email($email, $admin_email, 'events_new_registration', array('{FIRST NAME}' => $first_name, '{LAST NAME}' => $last_name, '{EVENT}' => '<b>' . $event_title . '</b>'), '', $admin_email, 'Events - new user was registered (admin copy)');
////////////////////////////////////////////////////////////
$first_name = $last_name = $email = $phone = $message = '';
} else {
///echo mysql_error();
$msg = draw_important_message(_TRY_LATER, false);
}
}
}
}
}
$output = '
' . ($msg != '' ? $msg : '') . '<br />
<fieldset style="border:1px solid #cccccc;padding-left:10px;margin:0px 12px 12px 12px;">
<legend><b>' . _REGISTRATION_FORM . '</b></legend>
<form method="post" name="frmEventRegistration" id="frmEventRegistration">
' . draw_hidden_field('task', 'register_to_event', false) . '
' . draw_hidden_field('event_id', $news_id, false) . '
' . draw_token_field(false);
$output .= '
<table cellspacing="1" cellpadding="2" border="0" width="100%">
<tbody>
//.........这里部分代码省略.........
示例12: DrawText
/**
* Draw page text
*/
public function DrawText()
{
global $objLogin;
$objGallery = new GalleryAlbums();
$objContactUs = ContactUs::Instance();
$replace_needles = 1;
$module_page = false;
if (!count($this->page)) {
return false;
}
// dont show this page if it was expired
if (!$objLogin->IsLoggedInAsAdmin() && $this->page['finish_publishing'] != '0000-00-00' && date('Y-m-d') > $this->page['finish_publishing']) {
draw_important_message(_PAGE_EXPIRED);
return false;
}
if ($this->page['content_type'] == 'article' && isset($this->page['page_text'])) {
$page_text = decode_text($this->page['page_text'], false);
echo '<div class="pages_contents">';
if (preg_match('/{module:gallery}/i', $page_text)) {
$module_page = true;
$page_text = @preg_replace('/{module:gallery}/i', $objGallery->DrawGallery(false), $page_text, 1);
}
if (preg_match_all('/{module:album=(.*?)}/i', $page_text, $matches)) {
$module_page = true;
if (is_array($matches[1])) {
foreach ($matches[1] as $key => $val) {
if (strtolower($val) != 'code') {
$val = @preg_replace('/[^A-Za-z0-9:]/i', '', $val);
$page_text = @preg_replace('/{module:album=' . $val . '}/i', $objGallery->DrawAlbum($val, false), $page_text, 1);
}
}
}
}
if (self::$PROJECT == 'MedicalAppointment') {
if (preg_match('/{module:about_us}/i', $page_text)) {
$module_page = true;
$page_text = @preg_replace('/{module:about_us}/i', Clinic::DrawAboutUs(false), $page_text, 1);
}
}
if (self::$PROJECT == 'HotelSite') {
if (preg_match('/{module:about_us}/i', $page_text)) {
$module_page = true;
$page_text = @preg_replace('/{module:about_us}/i', Hotels::DrawAboutUs(false), $page_text, 1);
}
if (preg_match('/{module:rooms}/i', $page_text)) {
$module_page = true;
$page_text = @preg_replace('/{module:rooms}/i', Rooms::DrawRoomsInfo(false), $page_text, 1);
}
if (preg_match('/{module:testimonials}/i', $page_text)) {
$module_page = true;
$page_text = @preg_replace('/{module:testimonials}/i', Testimonials::DrawTestimonails(false), $page_text, 1);
}
}
if (preg_match('/{module:contact_us}/i', $page_text)) {
$module_page = true;
$page_text = @preg_replace('/{module:contact_us}/i', $objContactUs->DrawContactUsForm(false), $page_text, 1);
}
if (preg_match('/{module:faq}/i', $page_text)) {
$module_page = true;
$page_text = @preg_replace('/{module:faq}/i', FaqCategories::DrawFaqList(false), $page_text, 1);
}
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
$page_text = stripslashes($page_text);
}
if ($this->page['is_home']) {
if (self::$PROJECT == 'HotelSite') {
Campaigns::DrawCampaignBanner('standard');
Campaigns::DrawCampaignBanner('global');
}
}
//echo $page_text;
//echo "<hr>";
// draw all needed blocks for Home page
if ($this->page['is_home']) {
if (self::$PROJECT == 'BusinessDirectory') {
if (ModulesSettings::Get('listings', 'show_categories_home_block') == 'yes') {
Categories::DrawHomePageBlock();
}
} else {
if (self::$PROJECT == 'ShoppingCart') {
if (ModulesSettings::Get('products_catalog', 'is_active') == 'yes') {
Campaigns::DrawCampaignBanner();
if (ModulesSettings::Get('products_catalog', 'show_featured_block') == 'home page') {
Products::DrawFeaturedBlock('home');
}
if (ModulesSettings::Get('products_catalog', 'show_new_products_block') == 'home page') {
Products::DrawNewProductsBlock();
}
Categories::DrawHomePageBlock();
}
}
}
}
// draw comments form
if (!$this->page['is_home'] && !$module_page) {
if (Modules::IsModuleInstalled('comments')) {
if (ModulesSettings::Get('comments', 'comments_allow') == 'yes' && $this->page['comments_allowed']) {
//.........这里部分代码省略.........
示例13: defined
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
$objNews = News::Instance();
$news = $objNews->GetNews(Application::Get('news_id'));
// Draw title bar
if ($objSession->IsMessage('notice')) {
draw_title_bar(_NEWS);
echo $objSession->GetMessage('notice');
} else {
if ($news[1] == 1) {
$news_type = isset($news[0]['type']) ? $news[0]['type'] : 'news';
$header_text = isset($news[0]['header_text']) ? str_replace("\\'", "'", $news[0]['header_text']) : '';
$body_text = isset($news[0]['body_text']) ? str_replace("\\'", "'", $news[0]['body_text']) : '';
$date_created = isset($news[0]['mod_date_created']) ? $news[0]['mod_date_created'] : '';
if ($news_type == 'events') {
draw_title_bar(prepare_breadcrumbs(array(_EVENTS => '', $header_text => '')));
} else {
draw_title_bar(prepare_breadcrumbs(array(_NEWS => '', $header_text => '')));
}
echo '<div class="center_box_heading_news">' . $header_text . '</div>';
echo '<div class="center_box_contents_news">' . $body_text . '</div>';
echo '<div class="center_box_bottom_news"><i><b>' . _POSTED_ON . ':</b> ' . $date_created . '</i></div>';
if ($news_type == 'events') {
$objNews->DrawRegistrationForm(Application::Get('news_id'), $header_text);
}
} else {
draw_title_bar(_NEWS);
draw_important_message(_WRONG_PARAMETER_PASSED);
}
}
示例14: DrawSearchResult
/**
* Draws search result
* @param $search_result - search result
* @param $page
* @param $keyword
* @param $type
*/
public function DrawSearchResult($search_result, $page = 1, $keyword = '', $type = 'quick')
{
$total_pages = (int) ($this->totalSearchRecords / $this->pageSize);
if (!is_numeric($total_pages) || (int) $total_pages <= 0) {
$total_pages = 1;
}
if ($search_result != '' && $search_result[1] > 0) {
echo '<div class="pages_contents">';
for ($i = 0; $i < $search_result[1]; $i++) {
if ($search_result[0][$i]['content_type'] == 'article') {
echo $i + 1 . '. ' . prepare_permanent_link('index.php?' . $search_result[0][$i]['url'], decode_text($search_result[0][$i]['title'])) . '<br />';
if (isset($search_result[0][$i]['image_file_thumb'])) {
echo '<img src="images/listings/' . $search_result[0][$i]['image_file_thumb'] . '" style="width:42px;height:42px;margin:4px;" align="' . Application::Get('defined_left') . '" alt="" />';
}
$page_text = $search_result[0][$i]['text'];
$page_text = str_replace(array('\\r', '\\n'), '', $page_text);
$page_text = preg_replace('/{module:(.*?)}/i', '', $page_text);
$page_text = strip_tags($page_text);
$page_text = decode_text($page_text);
if (!empty($keyword)) {
$page_text = $this->HighLight($page_text, array($keyword));
}
echo substr_by_word($page_text, 512) . '...<br />';
} else {
echo $i + 1 . '. <a href="' . $search_result[0][$i]['link_url'] . '">' . decode_text($search_result[0][$i]['title']) . '</a> <img src="images/external_link.gif" alt="" /><br />';
}
echo '<br />';
draw_line();
echo '<br />';
}
echo '<b>' . _PAGES . ':</b> ';
for ($i = 1; $i <= $total_pages; $i++) {
echo '<a class="paging_link" href="javascript:void(0);" onclick="javascript:appPerformSearch(' . $i . ', \'' . ($type == 'advanced' ? 'frmAdvSearch' : 'frmQuickSearch') . '\');">' . ($i == $page ? '<b>[' . $i . ']</b>' : $i) . '</a> ';
}
echo '</div>';
} else {
draw_important_message(_NO_RECORDS_FOUND);
}
}
示例15: DrawListing
//.........这里部分代码省略.........
$output .= '<div class="wide_block">' . $nl;
if ($bpf_rating_button) {
$output .= '<div class="ratings_stars" id="rt_listing_' . $this->GetField('id') . '"></div>' . $nl;
}
if ($bpf_business_name) {
$output .= '<h2>' . $this->GetField('business_name') . '</h2><br />' . $nl;
}
$output .= '<ul class="l_items">' . $nl;
if ($bpf_address && $this->GetField('business_address') != '') {
$output .= '<li><span class="l_item">' . _ADDRESS . ':</span> <span class="l_description">' . $this->GetField('business_address') . '</span></li>' . $nl;
}
if ($bpf_phone && $this->GetField('business_phone') != '') {
$output .= '<li><span class="l_item">' . _PHONE . ':</span> <span class="l_description">' . $this->GetField('business_phone') . '</span></li>' . $nl;
}
if ($bpf_phone && $this->GetField('business_fax') != '') {
$output .= '<li><span class="l_item">' . _FAX . ':</span> <span class="l_description">' . $this->GetField('business_fax') . '</span></li>' . $nl;
}
if ($this->GetField('website_url') != '') {
$output .= '<li><span class="l_item">' . _WEB_SITE . ':</span> <span class="l_description"><a href="' . $this->GetField('website_url') . '" target="_blank">' . $this->GetField('website_url') . '</a> <img src="images/external_link.gif" alt="" /></span></li>' . $nl;
}
if ($this->GetField('business_email') != '') {
$output .= '<li><span class="l_item">' . _EMAIL_ADDRESS . ':</span> <span class="l_description"><a href="mailto:' . $this->GetField('business_email') . '" target="_blank">' . $this->GetField('business_email') . '</a></span></li>' . $nl;
}
if ($bpf_video_link && $this->GetField('video_url') != '') {
$output .= '<li><span class="l_item">' . _VIDEO . ':</span> <span class="l_description"><a href="' . $this->GetField('video_url') . '" target="_blank">' . $this->GetField('video_url') . '</a> <img src="images/external_link.gif" alt="" /></span></li>' . $nl;
}
$output .= '<li><span class="l_item">' . _LOCATION . ':</span> <span class="l_description">' . $this->GetField('listing_location') . '</span></li>' . $nl;
$output .= '<li><span class="l_item">' . _SUB_LOCATION . ':</span> <span class="l_description">' . $this->GetField('listing_sub_location') . '</span></li>' . $nl;
if ($this->GetField('date_published') != '0000-00-00 00:00:00') {
$output .= '<li><span class="l_item">' . _PUBLISHED . ':</span> <span class="l_description">' . format_datetime($this->GetField('date_published'), get_datetime_format(false), _UNKNOWN) . '</span></li>' . $nl;
}
if ($bpf_business_description) {
$output .= '<li><span class="l_item">' . _DESCRIPTION . ':</span> <br>' . $this->GetField('business_description') . '</li>' . $nl;
}
$added_categories = ListingsCategories::GetCategoriesForListing($this->GetField('id'));
$arr_added_categories = array();
$output .= '<li><span class="l_item">' . _CATEGORIES . ':</span><br>';
$categories = '';
foreach ($added_categories[0] as $key => $val) {
$categories .= !empty($categories) ? ', ' : '';
$categories .= prepare_link('category', 'cid', $val['category_id'], '', $val['name'], '', '');
}
$output .= $categories;
$output .= '</li>';
$output .= '</ul>';
$output .= '</div>';
$output .= '<div class="narrow_block">';
$output .= '<div class="listing_images_wrapper">';
if ($bpf_logo) {
$image_file = $this->GetField('image_file') != '' ? $this->GetField('image_file') : '';
$image_file_thumb = $this->GetField('image_file_thumb') != '' ? $this->GetField('image_file_thumb') : 'no_image.png';
if (!empty($image_file)) {
$output .= '<a href="images/listings/' . $image_file . '" rel="lyteshow' . $this->GetField('id') . '">';
}
$output .= '<img class="listing_image' . ($image_file == '' ? ' no_hover' : '') . '" src="images/listings/' . $image_file_thumb . '" alt="" />';
if (!empty($image_file)) {
$output .= '</a>';
}
$output .= '<br />';
}
$additional_images = array();
for ($i = 1; $i <= $bpf_images_count; $i++) {
$additional_image = $this->GetField('image_' . $i) != '' ? $this->GetField('image_' . $i) : '';
$additional_image_thumb = $this->GetField('image_' . $i . '_thumb') != '' ? $this->GetField('image_' . $i . '_thumb') : '';
if ($additional_image != '') {
$output .= '<a href="images/listings/' . $additional_image . '" rel="lyteshow' . $this->GetField('id') . '">';
$output .= '<img class="listing_icon" src="images/listings/' . $additional_image_thumb . '" alt="" />';
$output .= '</a>';
}
}
$output .= '</div>';
$map_code = $this->GetField('map_code', false);
if ($bpf_map && $map_code != '') {
$map_code = preg_replace('/width="(.*?)"/', 'width="240px"', $map_code);
$map_code = preg_replace('/height="(.*?)"/', 'height="200px"', $map_code);
$output .= '<div class="map">' . $map_code . '</div><br /><br />';
}
if (Modules::IsModuleInstalled('inquiries') == 'yes' && $bpf_inquiry_button) {
$output .= '<form name="frmDirectInquiry" action="index.php?page=inquiry_form" method="post">';
$output .= draw_token_field(false);
$output .= draw_hidden_field('listing_id', $this->listing_info[0]['id'], false);
$output .= draw_hidden_field('visitor_locations', $this->listing_info[0]['listing_location_id'], false);
$output .= draw_hidden_field('visitor_sub_locations', $this->listing_info[0]['listing_sub_location_id'], false);
$output .= draw_hidden_field('business_name', $this->GetField('business_name'), false);
$output .= draw_hidden_field('inquiry_type', '1', false);
$output .= '<center><input type="submit" class="form_button" value="' . _SUBMIT_INQUIRY . '"></center>';
$output .= '</form><br /><br />';
}
$output .= '</div>';
$output .= '<div style="clear:both;"></div>';
$output .= '</div>';
} else {
$output .= draw_important_message(_NO_LISTINGS_TO_DISPLAY, false);
}
if ($draw) {
echo $output;
} else {
return $output;
}
}