我正在处理其他人的 php 代码,但用户/菜单语言有问题。这是本网站横幅广告的动态价目表页面的代码。根据选择的菜单语言,用户可以看到每种菜单语言不同的横幅广告价格。
每当用户访问此页面时,活动横幅广告的价格应该是用户菜单语言的价格。现在它固定在俄语上,我不知道如何动态地使其或至少将其更改/修复为英语。
请看一下,如果您能找到解决方案,请告诉我。谢谢!
<?php
class reklama_content
{
private $db;
private $cms;
private $valid;
private $data;
private $tools;
public function __construct()
{
$reg = Registry::getInstance();
$this->db = $reg->get('db');
$this->cms = $reg->get('cms');
$this->valid = $reg->get('Validate');
$this->data = $reg->get('methodData');
$this->tools = $reg->get('tools');
}
public function get_reklama_content()
{
$lang = language::getLang();
if ($_GET['ryb'])
$ryb = $_GET['ryb'];
else
$ryb = 'banners';
if ($ryb == 'banners')
$ret = $this->getBanner($lang);
elseif ($ryb == 'classifieds')
$ret = $this->getClassifieds($lang);
return $ret;
}
public function getClassifieds($lang)
{
$contetn = $this->db->selectArray($this->db->Select('*', 'block', "`name` = 'classifieds_content'"));
$ret = $contetn['content_' . $lang];
return $ret;
}
public function getBanner($lang)
{
$header = array();
$top = array();
$center = array();
$bottom = array();
$banners = $this->db->selectAssoc($this->db->Select('*', 'banners', false, 'page_id', false, true));
$contetn_top = $this->db->selectArray($this->db->Select('*', 'block', "`name` = 'reklams_baner_top'"));
$contetn_bottom = $this->db->selectArray($this->db->Select('*', 'block', "`name` = 'reklams_baner_bottom'"));
foreach ($banners as $x => $y) {
if ($y['position'] == 'header')
$header[$x] = $y;
elseif ($y['position'] == 'top')
$top[$x] = $y; elseif ($y['position'] == 'center')
$center[$x] = $y; elseif ($y['position'] == 'bottom')
$bottom[$x] = $y;
}
$ret = $contetn_top['content_' . $lang];
$langs = ($this->tools->getAllLang(true));
$ret .= '
<hr style="width: 100%; margin: 40px 0;" />
<div class="rek_banner_conteiner header_conteiner">
<span class="ban_title">' . l::top_banner1() . '</span>
<img src="styles/them_01/img/banner_468x60.jpg" class="header_example" />
<div class="lang_menu">' . l::menu_language1() . '<br />';
$ret .= '<span id="eng_header" >' . l::english() . '</span>';
$ret .= '<span id="de_header" >' . l::german() . '</span>';
$ret .= '<span id="rus_header" >' . l::russian() . '</span>';
$ret .= '<span id="tr_header" >' . l::turkish() . '</span>';
$ret .= '</div>';
foreach ($langs as $z => $g) {
$ret .= '
<div id="' . $g['name'] . '_header_box" class="hide">
<table>
<tr class="order_table_title">
<td class="order_table_position">' . l::location() . '</td>
<td class="order_table_size">' . l::size1() . '</td>
<td class="order_table_date">' . l::fee_per_month() . '</td>
</tr>
';
foreach ($header as $z => $f) {
$page = $this->db->selectArray($this->db->Select('title_' . $lang, 'pages', "`id` = '" . $f['page_id'] . "'"));
$ret .= '<tr>
<td>' . $page['title_' . $lang] . '</td>
<td>' . $f['size'] . '</td>
';
if ($f['price' . '_header_' . $g['name']])
$ret .= '<td>$ ' . $f['price' . '_header_' . $g['name']] . '</td>';
else
$ret .= '<td></td>';
$ret .= '
</tr>';
}
$ret .= '
</table>
</div>
';
}
$ret .= '</div>';
$ret .= $contetn_bottom['content_' . $lang];
return $ret;
}
}
?>