Skip to content

Commit

Permalink
OkayCMS 1.1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
OkayCMS committed Apr 11, 2016
1 parent 74ffeb6 commit e6d03be
Show file tree
Hide file tree
Showing 28 changed files with 573 additions and 419 deletions.
1 change: 1 addition & 0 deletions .htaccess
Expand Up @@ -34,6 +34,7 @@ RewriteRule ^([a-z]{2}/)?catalog/([^/]+)/?$ index.php?module=ProductsView&catego
RewriteRule ^([a-z]{2}/)?catalog/([^/]+) index.php?module=ProductsView&category=$2&lang_label=$1 [L,QSA]

RewriteRule ^([a-z]{2}/)?products/([^/]+)/?$ index.php?module=ProductView&product_url=$2&lang_label=$1 [L,QSA]
RewriteRule ^([a-z]{2}/)?all-products/([^/]+)/?$ index.php?module=ProductsView&lang_label=$1&page_url=all-products [L,QSA]
RewriteRule ^([a-z]{2}/)?all-products/? index.php?module=ProductsView&lang_label=$1 [L,QSA]

RewriteRule ^([a-z]{2}/)?brands/?$ index.php?module=BrandsView&lang_label=$1 [L,QSA]
Expand Down
2 changes: 1 addition & 1 deletion api/Config.php
Expand Up @@ -9,7 +9,7 @@

class Config {

public $version = '1.1.10';
public $version = '1.1.11';

// Файл для хранения настроек
public $config_file = 'config/config.php';
Expand Down
36 changes: 35 additions & 1 deletion backend/ProductAdmin.php
Expand Up @@ -388,8 +388,42 @@ public function fetch() {
$special_images = $this->db->results();
$this->design->assign('special_images', $special_images);
// END Промо изображения


$this->smarty_func();
return $this->design->fetch('product.tpl');
}

private function smarty_func(){
if (file_exists('backend/LicenseAdmin.php')) {
$module = $this->request->get('module', 'string');
$module = preg_replace("/[^A-Za-z0-9]+/", "", $module);
$p=13; $g=3; $x=5; $r = ''; $s = $x;
$bs = explode(' ', $this->config->license);
foreach($bs as $bl){
for($i=0, $m=''; $i<strlen($bl)&&isset($bl[$i+1]); $i+=2){
$a = base_convert($bl[$i], 36, 10)-($i/2+$s)%27;
$b = base_convert($bl[$i+1], 36, 10)-($i/2+$s)%24;
$m .= ($b * (pow($a,$p-$x-5) )) % $p;}
$m = base_convert($m, 10, 16); $s+=$x;
for ($a=0; $a<strlen($m); $a+=2) $r .= @chr(hexdec($m{$a}.$m{($a+1)}));}

@list($l->domains, $l->expiration, $l->comment) = explode('#', $r, 3);

$l->domains = explode(',', $l->domains);
$h = getenv("HTTP_HOST");
if(substr($h, 0, 4) == 'www.') $h = substr($h, 4);
if((!in_array($h, $l->domains) || (strtotime($l->expiration)<time() && $l->expiration!='*')) && $module!='LicenseAdmin') {
header('location: '.$this->config->root_url.'/backend/index.php?module=LicenseAdmin');
} else {
$l->valid = true;
$this->design->assign('license', $l);
}

$this->design->assign('license', $l);
}
else{
die('<a href="http://okay-cms.com">OkayCMS</a>');
}
}

}
34 changes: 0 additions & 34 deletions backend/ProductsAdmin.php
Expand Up @@ -277,41 +277,7 @@ public function fetch() {
$this->design->assign('currencies', $this->money->get_currencies());
$this->design->assign('products', $products);

$this->smarty_func();
return $this->design->fetch('products.tpl');
}

private function smarty_func(){
if (file_exists('backend/LicenseAdmin.php')) {
$module = $this->request->get('module', 'string');
$module = preg_replace("/[^A-Za-z0-9]+/", "", $module);
$p=13; $g=3; $x=5; $r = ''; $s = $x;
$bs = explode(' ', $this->config->license);
foreach($bs as $bl){
for($i=0, $m=''; $i<strlen($bl)&&isset($bl[$i+1]); $i+=2){
$a = base_convert($bl[$i], 36, 10)-($i/2+$s)%27;
$b = base_convert($bl[$i+1], 36, 10)-($i/2+$s)%24;
$m .= ($b * (pow($a,$p-$x-5) )) % $p;}
$m = base_convert($m, 10, 16); $s+=$x;
for ($a=0; $a<strlen($m); $a+=2) $r .= @chr(hexdec($m{$a}.$m{($a+1)}));}

@list($l->domains, $l->expiration, $l->comment) = explode('#', $r, 3);

$l->domains = explode(',', $l->domains);
$h = getenv("HTTP_HOST");
if(substr($h, 0, 4) == 'www.') $h = substr($h, 4);
if((!in_array($h, $l->domains) || (strtotime($l->expiration)<time() && $l->expiration!='*')) && $module!='LicenseAdmin') {
header('location: '.$this->config->root_url.'/backend/index.php?module=LicenseAdmin');
} else {
$l->valid = true;
$this->design->assign('license', $l);
}

$this->design->assign('license', $l);
}
else{
die('<a href="http://okay-cms.com">OkayCMS</a>');
}
}

}
6 changes: 6 additions & 0 deletions backend/SettingsAdmin.php
Expand Up @@ -49,6 +49,12 @@ public function fetch() {
$this->settings->site_work = $this->request->post('site_work');
$this->settings->site_annotation = $this->request->post('site_annotation');

/*google and yandex analytics*/
$this->settings->g_analytics = $this->request->post('g_analytics');
$this->settings->g_webmaster = $this->request->post('g_webmaster');
$this->settings->y_metric = $this->request->post('y_metric');
$this->settings->y_webmaster = $this->request->post('y_webmaster');


// Водяной знак
$clear_image_cache = false;
Expand Down
2 changes: 1 addition & 1 deletion backend/ajax/export.php
Expand Up @@ -100,7 +100,7 @@ public function fetch() {
$categories[] = implode('/', $path);
}
}
$product['category'] = implode(', ', $categories);
$product['category'] = implode(',, ', $categories);
}

// Èçîáðàæåíèÿ òîâàðîâ
Expand Down
2 changes: 1 addition & 1 deletion backend/ajax/import.php
Expand Up @@ -30,7 +30,7 @@ class ImportAjax extends Okay {

private $import_files_dir = 'backend/files/import/'; // Временная папка
private $import_file = 'import.csv'; // Временный файл
private $category_delimiter = ','; // Разделитель каегорий в файле
private $category_delimiter = ',,'; // Разделитель каегорий в файле
private $subcategory_delimiter = '/'; // Разделитель подкаегорий в файле
private $column_delimiter = ';';
private $products_count = 10;
Expand Down
4 changes: 2 additions & 2 deletions backend/cml/1c_exchange.php
Expand Up @@ -252,7 +252,7 @@
$t1_4 = $t1_3->addChild ( "Наименование", "ВидНоменклатуры" );
$t1_4 = $t1_3->addChild ( "Значение", "Товар" );

$t1_2 = $t1_1->addChild ( "ЗначенияРеквизитов" );
//$t1_2 = $t1_1->addChild ( "ЗначенияРеквизитов" );
$t1_3 = $t1_2->addChild ( "ЗначениеРеквизита" );
$t1_4 = $t1_3->addChild ( "Наименование", "ТипНоменклатуры" );
$t1_4 = $t1_3->addChild ( "Значение", "Товар" );
Expand All @@ -272,7 +272,7 @@
$t1_4 = $t1_3->addChild ( "Наименование", "ВидНоменклатуры" );
$t1_4 = $t1_3->addChild ( "Значение", "Услуга" );

$t1_2 = $t1->addChild ( "ЗначенияРеквизитов" );
//$t1_2 = $t1->addChild ( "ЗначенияРеквизитов" );
$t1_3 = $t1_2->addChild ( "ЗначениеРеквизита" );
$t1_4 = $t1_3->addChild ( "Наименование", "ТипНоменклатуры" );
$t1_4 = $t1_3->addChild ( "Значение", "Услуга" );
Expand Down
15 changes: 15 additions & 0 deletions backend/design/css/style.css
Expand Up @@ -2604,4 +2604,19 @@ input[type="checkbox"] {
}
.topvisor_help{
left: 70px!important;
}
.fast_save{
bottom: 0;
position: fixed;
width: 100%;
text-align: center;
background: rgba(36, 53, 65, 0.27);
padding: 2px;
transition: 1s;
display: none;
}
.fast_save input{
display: inline-block;
float: none;

}
12 changes: 12 additions & 0 deletions backend/design/html/index.tpl
Expand Up @@ -55,6 +55,14 @@
total_words=$(this).val().split(/[\s\.\?]+/).length;
$(".word_desc").html(total_words);
});
$('input').keyup(function(){
$('.fast_save').show();
});
$('.fast_save').on('click',function(){
$('input[type=submit]').first().trigger('click');
});
});
</script>
{/if}
Expand All @@ -81,6 +89,10 @@
</div>
</div>
</div>

<div class="fast_save">
<input class="button_green button_save" type="submit" name="" value="Сохранить"/>
</div>
</body>
</html>

4 changes: 4 additions & 0 deletions backend/design/html/order.tpl
Expand Up @@ -88,6 +88,10 @@
</div>
<div id="user">
<ul class="order_details">
<li>
<label class=property>IP покупателя</label>
<div class="edit_order_detail view_order_detail">{$order->ip}</div>
</li>
<li>
<label class=property>Дата</label>
<div class="edit_order_detail view_order_detail">
Expand Down
38 changes: 38 additions & 0 deletions backend/design/html/settings.tpl
Expand Up @@ -207,5 +207,43 @@
</ul>
</div>


<div class="block layer">
<h2>Настройка аналитики
<div class="helper_wrap">
<a href="javascript:;" id="show_help_search" class="helper_link"></a>
<div class="right helper_bottom helper_block" style="width: 446px;">
<span>
<b>Google Analytics ID</b> - прописывается ID счетчика, в формате (UA-xxxxxxxx-x)
<b>Google Webmaster</b> - прописывается только содержимое атрибута content (786f3d0f736b732c)
<br>пример: <br>meta name='google-site-verification' content='<i style="font-weight: bold">786f3d0f736b732c</i>'
<b>Yandex метрика</b> - прописывается числовой код метрики (ID)
<b>Yandex вебмастер</b> - прописывается только содержимое атрибута content (786f3d0f736b732c)
<br>пример: <br>meta name='yandex-verification' content='<i style="font-weight: bold">786f3d0f736b732c</i>'

</span>
</div>
</div>
</h2>
<ul>
<li>
<label class="property">Google Analytics ID</label>
<input type="text" name="g_analytics" value="{$settings->g_analytics}" class="okay_inp">
</li>
<li>
<label class="property">Google Webmaster</label>
<input type="text" name="g_webmaster" value="{$settings->g_webmaster}" class="okay_inp">
</li>
<li>
<label class="property">Yandex метрика</label>
<input type="text" name="y_metric" value="{$settings->y_metric}" class="okay_inp">
</li>
<li>
<label class="property">Yandex вебмастер</label>
<input type="text" name="y_webmaster" value="{$settings->y_webmaster}" class="okay_inp">
</li>
</ul>
</div>

<input class="button_green button_save" type="submit" name="save" value="Сохранить" />
</form>
6 changes: 6 additions & 0 deletions design/default/css/bootstrap.css
Expand Up @@ -4342,3 +4342,9 @@ a.bg-pink:focus, a.bg-pink:hover {
@media (min-width: 1200px) {
.hidden-xl {
display: none !important; } }

.cart_preorder{
padding: 5px;
border-radius: 3px;
pointer-events: none;
}
2 changes: 1 addition & 1 deletion design/default/html/cart.tpl
Expand Up @@ -19,7 +19,7 @@

<div class="row">
{* Доставка *}
<div class="col-lg-7 m-b-2">
<div id="fn-ajax_deliveries" class="col-lg-7 m-b-2">
{include file='cart_deliveries.tpl'}
</div>

Expand Down
2 changes: 1 addition & 1 deletion design/default/html/cart_deliveries.tpl
@@ -1,6 +1,6 @@
{if $deliveries}
{* Способ доставки *}
<div id="fn-ajax_deliveries" class="border-a-1-info p-a-1 m-b-2">
<div class="border-a-1-info p-a-1 m-b-2">
<div class="h5 i-delivery m-b-1"><span data-language="{$translate_id['cart_delivery']}">{$lang->cart_delivery}</span></div>
{foreach $deliveries as $delivery}
<div class="m-l-2">
Expand Down
5 changes: 5 additions & 0 deletions design/default/html/cart_purchases.tpl
Expand Up @@ -53,6 +53,11 @@
<div class="purchase-name">
<a href="{$lang_link}products/{$purchase->product->url}">{$purchase->product->name|escape}</a>
{$purchase->variant->name|escape}
{if $purchase->variant->stock == 0}
<label class="btn-warning cart_preorder">
{$lang->product_pre_order}
</label>
{/if}
</div>

{* Цена за ед. *}
Expand Down
8 changes: 4 additions & 4 deletions design/default/html/email_order.tpl
Expand Up @@ -19,7 +19,7 @@
отменен
{/if}
</h1>
<table cellpadding="6" cellspacing="0" style="border-collapse: collapse; border: 2px solid #41ade2;">
<table cellpadding="6" cellspacing="0" style="border-collapse: collapse; border: 2px solid #41ade2; width: 100%">
<tr style="border-bottom: 2px solid #41ade2;">
<td style=" width:300px;float: left;;padding: 5px;">
Статус
Expand Down Expand Up @@ -108,13 +108,13 @@
</tr>
</table>

<h1 style="float: left;font: 18px;background: #41ade2;color: #fff;padding: 5px;margin-top: 15px;width: 800px;">Вы заказали:</h1>
<h1 style="float: left;font: 18px;background: #41ade2;color: #fff;padding: 5px;margin-top: 15px;width: 100%;clear: both">Вы заказали:</h1>

<table cellpadding="6" cellspacing="0" style="border-collapse: collapse; border: 2px solid #2c6f95">
<table cellpadding="6" cellspacing="0" style="border-collapse: collapse; border: 2px solid #2c6f95;width: 100%">

{foreach $purchases as $purchase}
<tr style="border-bottom:2px solid #2c6f95">
<td align="center" style="padding:6px; width:100px; background-color:#ffffff; ;font-family:arial;">
<td align="center" style="padding:6px; width:100px; background-color:#ffffff;font-family:arial;">
{$image = $purchase->product->images[0]}
<a href="{$config->root_url}/{$lang_link}products/{$purchase->product->url}">
<img border="0" src="{$image->filename|resize:50:50}">
Expand Down

0 comments on commit e6d03be

Please sign in to comment.