本文整理汇总了PHP中Application::Get方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::Get方法的具体用法?PHP Application::Get怎么用?PHP Application::Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application::Get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_chart_changer
/**
* Get chart changer
* @param $tabid
* @param $chart_type
* @param $year
* @param $page
**/
function get_chart_changer($tabid, $chart_type, $year, $page = 'statistics')
{
$output = '<form action="' . APPHP_BASE . 'index.php?admin=' . $page . '" name="frmStatistics" method="post">
' . draw_hidden_field('tabid', $tabid, false) . '
' . draw_token_field(false) . '
<table width="98%" align="center" style="background-color:#efefef;border:1px solid #ddd;">
<tr>
<td valign="middle">
' . _TYPE . ': <select name="chart_type">
<option value="barchart" ' . ($chart_type == 'barchart' ? ' selected="selected"' : '') . '>Barchart</option>
<option value="columnchart" ' . ($chart_type == 'columnchart' ? ' selected="selected"' : '') . '>ColumnChart</option>
<option value="piechart" ' . ($chart_type == 'piechart' ? ' selected="selected"' : '') . '>PieChart</option>
<option value="areachart" ' . ($chart_type == 'areachart' ? ' selected="selected"' : '') . '>AreaChart</option>
</select>
' . _YEAR . ': <select name="year">';
for ($y = date('Y') - 5; $y < date('Y') + 5; $y++) {
$output .= '<option value="' . $y . '" ' . ($year == $y ? ' selected="selected"' : '') . '>' . $y . '</option>';
}
$output .= '</select> ';
$output .= '</td>
<td valign="middle" align="' . Application::Get('defined_right') . '">
<input type="button" class="form_button" onclick="frmStatistics_Submit();" value="' . _SUBMIT . '" />
</td>
</tr>
</table>
</form>';
return $output;
}
示例2: _Write
public function _Write($key, $data)
{
global $user;
$userId = empty($user->Id) ? 0 : $user->Id;
$app = Application::Get();
if (!$this->_save || empty($data) && empty($_COOKIE[$this->_name]) && $userId > 0) {
return TRUE;
}
return db_get()->Call('system_session_write', $key, $userId, $app->RemoteIP, 1, $data);
}
示例3: rewrite_reverse
/**
* Do a reverse rewrite of a link
*
* @access public
* @param string $url
* @return string $reverse_rewrite
*/
public static function rewrite_reverse($url)
{
$application = Application::Get();
$url = Util::rewrite_reverse_routes($url);
if (isset($application->config->base_uri) and $application->config->base_uri !== null) {
$url = trim($application->config->base_uri, '/') . '/' . trim($url, '/');
}
// We don't support relative URIs at all
if (strpos($url, '/') !== 0) {
$url = '/' . $url;
}
return $url;
}
示例4: 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);
}
示例5: GetLevelsInfo
/**
* Returns levels info
*/
public function GetLevelsInfo($category_id, $target = 'category')
{
$lang = Application::Get('lang');
$output = array('first' => array('id' => '', 'name' => '', 'link' => ''), 'second' => array('id' => '', 'name' => '', 'link' => ''), 'third' => array('id' => '', 'name' => '', 'link' => ''));
$sql = 'SELECT
c.id,
c.parent_id,
cd.name
FROM ' . TABLE_CATEGORIES . ' c
LEFT OUTER JOIN ' . TABLE_CATEGORIES_DESCRIPTION . ' cd ON c.id = cd.category_id
WHERE
c.id = _CID_ AND
cd.language_id = \'' . $lang . '\'';
$sql_1 = str_replace('_CID_', (int) $category_id, $sql);
$result = database_query($sql_1, DATA_AND_ROWS, FIRST_ROW_ONLY);
if ($result[1] > 0) {
$output['first']['id'] = $result[0]['id'];
$output['first']['name'] = $result[0]['name'];
$output['first']['link'] = prepare_link($target, 'cid', $result[0]['id'], '', $result[0]['name'], '', '', true);
$sql_2 = str_replace('_CID_', $result[0]['parent_id'], $sql);
$result_2 = database_query($sql_2, DATA_AND_ROWS, FIRST_ROW_ONLY);
if ($result_2[1] > 0) {
$output['second']['id'] = $result_2[0]['id'];
$output['second']['name'] = $result_2[0]['name'];
$output['second']['link'] = prepare_link($target, 'cid', $result_2[0]['id'], '', $result_2[0]['name'], '', '', true);
$sql_3 = str_replace('_CID_', $result_2[0]['parent_id'], $sql);
$result_3 = database_query($sql_3, DATA_AND_ROWS, FIRST_ROW_ONLY);
if ($result_3[1] > 0) {
$output['third']['id'] = $result_3[0]['id'];
$output['third']['name'] = $result_3[0]['name'];
$output['third']['link'] = prepare_link($target, 'cid', $result_3[0]['id'], '', $result_3[0]['name'], '', '', true);
}
}
}
return $output;
}
示例6: GetAllTemplates
/**
* Returns all email templates
* @param @where_clause
*/
private function GetAllTemplates($where_clause = '')
{
$sql = 'SELECT
language_id,
template_code,
template_name,
template_subject,
template_content,
is_system_template
FROM ' . $this->tableName . '
WHERE language_id = \'' . Application::Get('lang') . '\' ' . ($where_clause != '' ? ' AND ' . $where_clause : '') . '
ORDER BY is_system_template ASC';
$result = database_query($sql, DATA_AND_ROWS, ALL_ROWS);
return $result;
}
示例7: GetCurrenciesDDL
/**
* Returns currencies dropdown list
* @param $allow_seo_links
*/
public static function GetCurrenciesDDL($allow_seo_links = true)
{
global $objSettings;
$sel_currency = Application::Get('currency_code');
$currency = Application::Get('currency');
$output = '';
$sql = 'SELECT id, name, symbol, code, rate, decimals, primary_order
FROM ' . TABLE_CURRENCIES . '
WHERE is_active = 1';
if ($result = database_query($sql, DATA_AND_ROWS, ALL_ROWS)) {
if ($result[1] > 1) {
$base_url = APPHP_BASE;
$url = get_page_url();
// prevent wrong re-loading for some problematic cases
if (self::$PROJECT == 'HotelSite') {
$url = str_replace(array('page=booking_payment'), 'page=booking_checkout', $url);
$url = str_replace(array('page=check_availability'), 'page=index', $url);
} else {
if (self::$PROJECT == 'ShoppingCart') {
$url = str_replace(array('&act=add', '&act=remove'), '', $url);
$url = str_replace(array('page=order_proccess'), 'page=checkout', $url);
$url = str_replace(array('page=search'), 'page=index', $url);
}
}
// trim last character if ? or &
$url = trim($url, '?&');
if ($objSettings->GetParameter('seo_urls') == '1' && $allow_seo_links) {
// remove lang parameters
$url = str_replace('/' . Application::Get('lang') . '/', '/', $url);
if (preg_match('/\\/' . Application::Get('currency_code') . '\\//i', $url)) {
$url = str_replace('/' . Application::Get('currency_code') . '/', '/__CUR__/', $url);
} else {
$url = str_replace($base_url, $base_url . '__CUR__/', $url);
}
} else {
if (preg_match('/currency=' . Application::Get('currency_code') . '/i', $url)) {
$url = str_replace('currency=' . Application::Get('currency_code'), 'currency=__CUR__', $url);
} else {
$url = $url . (preg_match('/\\?/', $url) ? '&' : '?') . 'currency=__CUR__';
}
}
$output .= '<select onchange="javascript:appSetNewCurrency(\'' . $url . '\',this.value)" name="currency" class="currency_select">';
for ($i = 0; $i < $result[1]; $i++) {
$output .= '<option value="' . $result[0][$i]['code'] . '" ' . ($sel_currency == $result[0][$i]['code'] ? ' selected="selected"' : '') . '>' . $result[0][$i]['name'] . '</option>';
}
$output .= '</select>';
}
}
return $output;
}
示例8: DrawFaqList
/**
* Draws FAQ list
* @param $draw
*/
public static function DrawFaqList($draw = true)
{
$output = '';
$page_url = get_page_url();
if (Modules::IsModuleInstalled('faq')) {
if (ModulesSettings::Get('faq', 'is_active') == 'yes') {
$sql = 'SELECT
fc.id as category_id,
fc.name as category_name,
fci.id as item_id,
fci.faq_question,
fci.faq_answer,
fci.priority_order
FROM ' . TABLE_FAQ_CATEGORY_ITEMS . ' fci
INNER JOIN ' . TABLE_FAQ_CATEGORIES . ' fc ON fci.category_id = fc.id
WHERE
fc.is_active = 1 AND
fci.is_active = 1
ORDER BY
fc.priority_order ASC,
fci.priority_order ASC ';
$result = database_query($sql, DATA_AND_ROWS, ALL_ROWS);
$count = 1;
$current_category = '';
$output .= '<a name="up"></a>';
$output .= '<div class="faq_questions">';
for ($i = 0; $i < $result[1]; $i++) {
if ($current_category == '') {
$current_category = $result[0][$i]['category_name'];
$output .= ($i > 0 ? '<br>' : '') . '<h3>' . $current_category . '</h3>';
} else {
if ($current_category != $result[0][$i]['category_name']) {
$current_category = $result[0][$i]['category_name'];
$output .= ($i > 0 ? '<br>' : '') . '<h3>' . $current_category . '</h3>';
}
}
$output .= '<span> • </span><a href="' . $page_url . '#faq_' . $result[0][$i]['category_id'] . '_' . $result[0][$i]['item_id'] . '">' . str_replace('\\', '', $result[0][$i]['faq_question']) . '</a><br>';
}
$output .= '</div>';
$current_category = '';
$draw_hr = true;
$count = 1;
for ($i = 0; $i < $result[1]; $i++) {
if ($current_category == '') {
$current_category = $result[0][$i]['category_name'];
$draw_hr = false;
$output .= '<br />' . draw_sub_title_bar($current_category, false);
} else {
if ($current_category != $result[0][$i]['category_name']) {
$current_category = $result[0][$i]['category_name'];
$draw_hr = false;
$output .= '<br />' . draw_sub_title_bar($current_category, false);
} else {
$draw_hr = true;
}
}
$output .= '<table width="100%" border="0" cellpadding="1" cellspacing="2">
' . ($draw_hr ? '<tr align="left" valign="top"><td colspan="2"><hr size="1" style="color:#cccccc" noshade></td></tr>' : '') . '
<tr>
<td><a name="faq_' . $result[0][$i]['category_id'] . '_' . $result[0][$i]['item_id'] . '"></a><strong>' . str_replace('\\', '', $result[0][$i]['faq_question']) . '</strong></td>
</tr>
<tr>
<td>' . str_replace('\\', '', $result[0][$i]['faq_answer']) . '</td>
</tr>
<tr><td colspan="2" align="' . Application::Get('defined_right') . '"><a href="' . $page_url . '#up">top ^</a></td></tr>
</table>';
}
}
}
if ($draw) {
echo $output;
} else {
return $output;
}
}
示例9: __construct
function __construct($login_type = '')
{
parent::__construct();
global $objSettings;
$this->params = array();
if (isset($_POST['first_name'])) {
$this->params['first_name'] = prepare_input($_POST['first_name']);
}
if (isset($_POST['last_name'])) {
$this->params['last_name'] = prepare_input($_POST['last_name']);
}
if (isset($_POST['user_name'])) {
$this->params['user_name'] = prepare_input($_POST['user_name']);
}
if (isset($_POST['password'])) {
$this->params['password'] = prepare_input($_POST['password']);
}
if (isset($_POST['email'])) {
$this->params['email'] = prepare_input($_POST['email']);
}
if (isset($_POST['preferred_language'])) {
$this->params['preferred_language'] = prepare_input($_POST['preferred_language']);
}
if (isset($_POST['account_type'])) {
$this->params['account_type'] = prepare_input($_POST['account_type']);
}
if (isset($_POST['date_created'])) {
$this->params['date_created'] = prepare_input($_POST['date_created']);
}
if (isset($_POST['is_active'])) {
$this->params['is_active'] = (int) $_POST['is_active'];
} else {
$this->params['is_active'] = '0';
}
if (self::$PROJECT == 'HotelSite') {
if (isset($_POST['hotels'])) {
$this->params['hotels'] = prepare_input($_POST['hotels']);
}
}
$this->primaryKey = 'id';
$this->tableName = TABLE_ACCOUNTS;
$this->dataSet = array();
$this->error = '';
$this->formActionURL = 'index.php?admin=admins_management';
$this->actions = array('add' => true, 'edit' => true, 'details' => true, 'delete' => true);
$this->actionIcons = true;
$this->allowRefresh = true;
$this->allowLanguages = false;
if ($login_type == 'owner') {
$this->WHERE_CLAUSE = 'WHERE (' . TABLE_ACCOUNTS . '.account_type = \'mainadmin\' || ' . TABLE_ACCOUNTS . '.account_type = \'admin\' || ' . TABLE_ACCOUNTS . '.account_type = \'hotelowner\')';
} else {
if ($login_type == 'mainadmin') {
$this->WHERE_CLAUSE = 'WHERE (' . TABLE_ACCOUNTS . '.account_type = \'admin\' || ' . TABLE_ACCOUNTS . '.account_type = \'hotelowner\')';
} else {
if ($login_type == 'admin') {
$this->WHERE_CLAUSE = 'WHERE ' . TABLE_ACCOUNTS . '.account_type = \'admin\'';
} else {
if ($login_type == 'hotelowner') {
$this->WHERE_CLAUSE = 'WHERE ' . TABLE_ACCOUNTS . '.account_type = \'hotelowner\'';
}
}
}
}
$this->ORDER_CLAUSE = 'ORDER BY id ASC';
$this->isAlterColorsAllowed = true;
$this->isPagingAllowed = true;
$this->pageSize = 20;
$this->isSortingAllowed = true;
$this->isFilteringAllowed = true;
// define filtering fields
$this->arrFilteringFields = array(_FIRST_NAME => array('table' => $this->tableName, 'field' => 'first_name', 'type' => 'text', 'sign' => 'like%', 'width' => '80px'), _LAST_NAME => array('table' => $this->tableName, 'field' => 'last_name', 'type' => 'text', 'sign' => 'like%', 'width' => '80px'), _ACTIVE => array('table' => $this->tableName, 'field' => 'is_active', 'type' => 'dropdownlist', 'source' => array('0' => _NO, '1' => _YES), 'sign' => '=', 'width' => '85px'));
// prepare languages array
$total_languages = Languages::GetAllActive();
$arr_languages = array();
foreach ($total_languages[0] as $key => $val) {
$arr_languages[$val['abbreviation']] = $val['lang_name'];
}
$arr_account_types = array('admin' => _ADMIN, 'mainadmin' => _MAIN_ADMIN);
if (self::$PROJECT == 'HotelSite') {
$arr_account_types['hotelowner'] = _HOTEL_OWNER;
}
$arr_is_active = array('0' => '<span class=no>' . _NO . '</span>', '1' => '<span class=yes>' . _YES . '</span>');
$datetime_format = get_datetime_format();
if (self::$PROJECT == 'HotelSite') {
$total_hotels = Hotels::GetAllActive();
$arr_hotels = array();
foreach ($total_hotels[0] as $key => $val) {
$this->arrCompanies[$val['id']] = $val['name'];
}
$this->additionalFields = ', hotels';
$this->accountTypeOnChange = 'onchange="javascript:AccountType_OnChange(this.value)"';
}
if ($objSettings->GetParameter('date_format') == 'mm/dd/yyyy') {
$this->sqlFieldDatetimeFormat = '%b %d, %Y %H:%i';
} else {
$this->sqlFieldDatetimeFormat = '%d %b, %Y %H:%i';
}
$this->SetLocale(Application::Get('lc_time_name'));
//----------------------------------------------------------------------
// VIEW MODE
//.........这里部分代码省略.........
示例10: DrawArticleComments
/**
* Draws article comments
* @param $article_id
* @param $draw
*/
public function DrawArticleComments($article_id = '', $draw = true)
{
if (!$article_id) {
return '';
}
global $objLogin;
$delete_pending_time = ModulesSettings::Get('comments', 'delete_pending_time');
$user_type = ModulesSettings::Get('comments', 'user_type');
$comment_length = ModulesSettings::Get('comments', 'comment_length');
$image_verification = ModulesSettings::Get('comments', 'image_verification_allow');
$comments_on_page = ModulesSettings::Get('comments', 'page_size');
$is_published = ModulesSettings::Get('comments', 'pre_moderation_allow') == 'yes' ? '0' : '1';
if ($image_verification == 'yes') {
include_once 'modules/captcha/securimage.php';
$objImg = new Securimage();
}
//echo '<pre>';
//print_r($_SERVER);
//echo '</pre>';
$task = isset($_POST['task']) ? prepare_input($_POST['task']) : '';
$comment_id = isset($_POST['comment_id']) ? (int) $_POST['comment_id'] : '';
$init_state = 'closed';
$user_id = isset($_POST['user_id']) ? (int) $_POST['user_id'] : '';
$user_name = isset($_POST['comment_user_name']) ? prepare_input($_POST['comment_user_name']) : '';
$user_email = isset($_POST['comment_user_email']) ? prepare_input($_POST['comment_user_email']) : '';
$comment_text = isset($_POST['comment_text']) ? prepare_input($_POST['comment_text']) : '';
$captcha_code = isset($_POST['captcha_code']) ? prepare_input($_POST['captcha_code']) : '';
$msg = '';
$task_completed = false;
$focus_field = '';
$current_page = isset($_GET['p']) ? abs((int) $_GET['p']) : '1';
if ($task == 'publish_comment') {
$init_state = 'opened';
if ($user_name == '') {
$msg = draw_important_message(_USERNAME_EMPTY_ALERT, false);
$focus_field = 'comment_user_name';
} else {
if (!check_email_address($user_email) && !$objLogin->IsLoggedInAs($this->user_type_name)) {
$msg = draw_important_message(_EMAIL_IS_WRONG, false);
$focus_field = 'comment_user_email';
} else {
if ($comment_text == '') {
$msg = draw_important_message(_MESSAGE_EMPTY_ALERT, false);
$focus_field = 'comment_text';
} else {
if ($comment_text != '' && strlen($comment_text) > $comment_length) {
$msg = draw_important_message(str_replace('_LENGTH_', $comment_length, _COMMENT_LENGTH_ALERT), false);
$focus_field = 'comment_text';
} else {
if ($image_verification == 'yes' && !$objImg->check($captcha_code)) {
$msg = draw_important_message(_WRONG_CODE_ALERT, false);
$focus_field = 'captcha_code';
} else {
// Block operation in demo mode
if (strtolower(SITE_MODE) == 'demo') {
$msg = draw_important_message(_OPERATION_BLOCKED, false);
} else {
if ($objLogin->IpAddressBlocked(get_current_ip())) {
$msg = draw_important_message(_IP_ADDRESS_BLOCKED, false);
} else {
if ($objLogin->EmailBlocked($user_email)) {
$msg = draw_important_message(_EMAIL_BLOCKED, false);
} else {
$sql = 'INSERT INTO ' . TABLE_COMMENTS . '(
id,
article_id,
user_id,
user_name,
user_email,
comment_text,
date_created,
date_published,
is_published
)VALUES(
NULL,
' . (int) $article_id . ',
' . (int) $user_id . ',
\'' . encode_text($user_name) . '\',
\'' . encode_text($user_email) . '\',
\'' . encode_text(strip_tags($comment_text, '<b><i><u><br>')) . '\',
\'' . date('Y-m-d H:i:s') . '\',
\'' . ($is_published == '1' ? date('Y-m-d H:i:s') : '0000-00-00 00:00:00') . '\',
\'' . $is_published . '\'
)';
if (database_void_query($sql)) {
if ($is_published == '1') {
$msg = draw_success_message(_COMMENT_POSTED_SUCCESS, false);
} else {
$msg = draw_success_message(_COMMENT_SUBMITTED_SUCCESS, false);
}
$task_completed = true;
} else {
$msg = draw_important_message(_TRY_LATER, false);
}
}
//.........这里部分代码省略.........
示例11: DrawBannersTop
/**
* Draw top banners code
* @param $banner_image
* @param $show_always
* @param $draw
*/
public static function DrawBannersTop(&$banner_image, $show_always = true, $draw = true)
{
global $objLogin;
$default_banner_image = '';
$nl = "\n";
if (Modules::IsModuleInstalled('banners')) {
$is_banners_active = ModulesSettings::Get('banners', 'is_active');
$rotate_delay = ModulesSettings::Get('banners', 'rotate_delay');
$rotation_type = ModulesSettings::Get('banners', 'rotation_type');
$caption_html = ModulesSettings::Get('banners', 'slideshow_caption_html');
if ($is_banners_active == 'yes') {
$objBanners = new Banners();
if ($rotation_type == 'slide show') {
$arrBanners = $objBanners->GetBannersArray();
if ($show_always || !$show_always && Application::Get('page') == 'home' && !$objLogin->IsLoggedIn()) {
$output = '<script src="' . APPHP_BASE . 'modules/cslide/jquery.cross-slide.min.js" type="text/javascript"></script>' . $nl;
$output .= '<script type="text/javascript">' . $nl;
$output .= 'jQuery(function() {
jQuery(\'#slideshow\').crossSlide({
sleep: ' . $rotate_delay . ', fade: 2,variant: true
}, [
';
$ind = '0';
foreach ($arrBanners as $key => $val) {
if ($ind == '0') {
$default_banner_image = 'images/banners/' . $val['image_file'];
} else {
$output .= ',';
}
$output .= '{ src: \'images/banners/' . $val['image_file'] . '\', alt: \'' . encode_text($val['image_text']) . ($val['link_url'] != '' ? '##' . $val['link_url'] : '') . '\', to:\'up\' }';
$ind++;
}
$output .= '], function(idx, img, idxOut, imgOut) {
var img_alt_split = img.alt.split(\'##\');
var caption_width = jQuery(\'div#slideshow\').width() - 20;
if(idxOut == undefined){
/* starting single image phase, put up caption */
if(img.alt != \'\'){
jQuery(\'div.slideshow-caption\').click(function(){ if(img_alt_split[1] != undefined && img_alt_split[1] != \'\') appGoToPage(img_alt_split[1]); });
jQuery(\'div.slideshow-caption\').' . ($caption_html == 'yes' ? 'html' : 'text') . '(img_alt_split[0]).animate({ opacity: .7 })
jQuery(\'div.slideshow-caption\').fadeIn();
if(caption_width != null) jQuery(\'div.slideshow-caption\').width(caption_width);
}
}else{
// starting cross-fade phase, take out caption
jQuery(\'div.slideshow-caption\').click(function() { });
jQuery(\'div.slideshow-caption\').fadeOut();
}}) });';
$output .= '</script>' . $nl;
if ($ind == 1) {
$banner_image = '<div class="banners-box-random" id="slideshow">' . $objBanners->GetRandomBanner() . '</div>';
} else {
if ($draw) {
echo $output;
} else {
return $output;
}
$banner_image = '<div class="banners-box-slideshow" id="slideshow"></div><div class="slideshow-caption"></div>';
}
}
} else {
if ($show_always || !$show_always && Application::Get('page') == 'home' && !$objLogin->IsLoggedIn()) {
$banner_image = '<div class="banners-box-random" id="slideshow">' . $objBanners->GetRandomBanner() . '</div>';
}
}
}
}
}
示例12: 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);
}
}
示例13: DrawRecentBlock
/**
* Draw recent listings side block with listings links
* @param $draw
*/
public static function DrawRecentBlock($draw = true)
{
global $objLogin;
$show_expired_listings = ModulesSettings::Get('listings', 'show_expired_listings');
$output = draw_block_top(_RECENT_LISTINGS, '', 'maximized', false);
$listings_name_length = ModulesSettings::Get('listings', 'listings_name_length');
$max_listings = 5;
$where_condition = ' 1=1 ' . (!$objLogin->IsLoggedIn() ? ' AND access_level="public"' : '');
$where_condition .= $show_expired_listings != 'yes' ? ' AND ((finish_publishing = \'0000-00-00 00:00:00\') OR (finish_publishing > \'' . date("Y-m-d H:i:s") . '\'))' : '';
$result = self::GetAllListings($where_condition, 'date_published DESC', $max_listings + 1);
if ($result[1] > 0) {
$output .= '<ul>';
for ($i = 0; $i < $result[1] && $i < $max_listings; $i++) {
$output .= '<li>' . prepare_link('listing', 'lid', $result[0][$i]['id'], $result[0][$i]['business_name'], substr_by_word($result[0][$i]['business_name'], $listings_name_length, true, Application::Get('lang')), '', $result[0][$i]['business_name']) . '</li>';
}
if ($result[1] > $max_listings) {
$output .= '<li>' . prepare_link('listings', 'type', 'recent', 'all', _MORE . ' »', '', _MORE) . '</li>';
}
$output .= '</ul>';
} else {
$output .= _NO_LISTINGS_TO_DISPLAY;
}
$output .= draw_block_bottom(false);
if ($draw) {
echo $output;
} else {
return $output;
}
}
示例14: DrawMenu
/**
* Draws menus
* @param $menu_position
* @param $draw
*/
public static function DrawMenu($menu_position = 'left', $draw = true)
{
global $objSettings, $objLogin;
$output = '';
if ($menu_position == 'left') {
$objLogin->DrawLoginLinks();
}
// Get all menus which have items (links to pages)
$menus = self::GetMenus($menu_position);
$menus_count = $menus[1];
$objNews = News::Instance();
$show_news_block = ModulesSettings::Get('news', 'show_news_block');
$show_subscribe_block = ModulesSettings::Get('news', 'show_newsletter_subscribe_block');
if (Modules::IsModuleInstalled('news') && ($show_news_block == 'right side' || $show_subscribe_block == 'right side')) {
$menus_count++;
}
$show_inquiries_block = ModulesSettings::Get('inquiries', 'show_inquiries_block');
if (Modules::IsModuleInstalled('inquiries') && $show_inquiries_block == 'right side') {
$menus_count++;
}
if (ModulesSettings::Get('listings', 'show_categories_side_block') == $menu_position . ' side') {
$output .= Categories::DrawSideBlock(false);
$menus_count++;
}
if (ModulesSettings::Get('listings', 'show_featured_block') == $menu_position . ' side') {
$output .= Listings::DrawFeaturedBlock(false);
$menus_count++;
}
if (ModulesSettings::Get('listings', 'show_recent_block') == $menu_position . ' side') {
$output .= Listings::DrawRecentBlock(false);
$menus_count++;
}
if (ModulesSettings::Get('listings', 'show_directory_statistics') == $menu_position . ' side') {
$menus_count++;
}
if ($menus_count > 0) {
$output .= '<div id="column-' . $menu_position . '-wrapper">';
}
// Display all menu titles (names) according to their order
for ($menu_ind = 0; $menu_ind < $menus[1]; $menu_ind++) {
// Start draw new menu
$output .= draw_block_top($menus[0][$menu_ind]['menu_name'], '', 'maximazed', false);
$menu_links = self::GetMenuLinks($menus[0][$menu_ind]['id'], Application::Get('lang'), $menu_position);
if ($menu_links[1] > 0) {
$output .= '<ul>';
}
for ($menu_link_ind = 0; $menu_link_ind < $menu_links[1]; $menu_link_ind++) {
$class = Application::Get('page_id') == $menu_links[0][$menu_link_ind]['id'] ? ' active' : '';
if ($menu_links[0][$menu_link_ind]['content_type'] == 'link') {
$output .= '<li>' . prepare_permanent_link($menu_links[0][$menu_link_ind]['link_url'], $menu_links[0][$menu_link_ind]['menu_link'], $menu_links[0][$menu_link_ind]['link_target'], 'main_menu_link' . $class) . '</li>';
} else {
// draw current menu link
$output .= '<li>' . prepare_link('pages', 'pid', $menu_links[0][$menu_link_ind]['id'], $menu_links[0][$menu_link_ind]['page_key'], $menu_links[0][$menu_link_ind]['menu_link'], 'main_menu_link' . $class) . '</li>';
}
}
if ($menu_links[1] > 0) {
$output .= '</ul>';
}
$output .= draw_block_bottom(false);
}
if ($menu_position == 'left') {
if (!$objLogin->IsLoggedIn() || Application::Get('preview') == 'yes') {
if (Modules::IsModuleInstalled('customers') && ModulesSettings::Get('customers', 'allow_login') == 'yes') {
if (Application::Get('customer') != 'login') {
$output .= Customers::DrawLoginFormBlock(false);
}
}
}
if (Modules::IsModuleInstalled('news')) {
if ($show_news_block == 'left side') {
$output .= $objNews->DrawNewsBlock(false);
}
if ($show_subscribe_block == 'left side') {
$output .= $objNews->DrawSubscribeBlock(false);
}
}
if (Modules::IsModuleInstalled('inquiries')) {
if ($show_inquiries_block == 'left side') {
$output .= Inquiries::DrawLastInquiriesBlock(false);
}
}
}
if ($menu_position == 'right') {
if (Modules::IsModuleInstalled('inquiries')) {
if ($show_inquiries_block == 'right side') {
$output .= Inquiries::DrawLastInquiriesBlock(false);
}
}
if (Modules::IsModuleInstalled('news')) {
if ($show_news_block == 'right side') {
$output .= $objNews->DrawNewsBlock(false);
}
if ($show_subscribe_block == 'right side') {
$output .= $objNews->DrawSubscribeBlock(false);
}
//.........这里部分代码省略.........
示例15: btnSubmitPD_OnClick
</tr>
<tr>
<td colspan="3" align="center">
<br /><br />
<input type="submit" class="form_button" name="btnSubmitPD" id="btnSubmitPD" value="<?php
echo _SUBMIT;
?>
" onclick="return btnSubmitPD_OnClick()">
</td>
</tr>
<tr><td colspan="2"> </td></tr>
<tr>
<td colspan="3" align="<?php
echo Application::Get('defined_left');
?>
">
<p><?php
echo _CREATE_ACCOUNT_NOTE;
?>
</p>
</td>
</tr>
</table>
</form>
</div>
<script type="text/javascript">
appSetFocus('<?php