Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Recommended Posts

On 2/5/2020 at 9:44 AM, freelancer said:

@Limonad2014 которая у вас версия memcached ? пишут решение рилииет от 1.4.2 and higher

Версия 2.2.0

 

On 2/5/2020 at 10:24 AM, nikifalex said:

только какое отношение seo pro имеет к memcached?

seo_pro формирует кеш-файл с ссылочным массивом, который в моём конкретном случае весит около 8 Мб

При включённом memcached этот массив не кешируется в связи с лимитом на размер файла в 1 Мб на виртуальном хостинге Beget

Edited by Limonad2014
Link to comment
Share on other sites


On 2/5/2020 at 9:44 AM, freelancer said:

@Limonad2014 которая у вас версия memcached ? пишут решение рилииет от 1.4.2 and higher

@freelancer Не совсем ик. Пишут, что в memcached версий 1.4.2 и выше размер загружаемого файла можно задать командой "-I", чтобы на выхогде был параметр 

Quote

memcached -I 5m

(5Мб для примера.) Но на моём хосинге memcached предосивляется как есть, без возможности конфигурирования.

Edited by Limonad2014
Link to comment
Share on other sites


On 2/6/2020 at 9:38 PM, freelancer said:

@Limonad2014

этот код у вас рилииет без ошипотому чток ?

$cache = new MultipartCache();
$cache->setLimit(1024);

Не совсем понимаю, куда его внедрять. В контроллер seo_pro.php или system/library/cache.php ?

Link to comment
Share on other sites


16 hours ago, freelancer said:

@Limonad2014 memcached, вас же это интересует

У нас, похоже, недопонимание. Memcached у меня на хостинге неконфигурируемый. Я не понимаю, куда внедрить код для лимитирования размера кеш-файла, вот этот

$cache = new MultipartCache();
$cache->setLimit(1024);

Вот переписанный файл system/library/cache.php (ocstore 1.5.5.1.2) для рилиты с memecached. Подскажите, куда конкретно можно впендюрить лимитер, чтобы рилиило.
 

Spoiler
<?php
final class Cache {
	private $expire;
	private $memcache;
	private $ismemcache = false;

  	public function __construct($exp = 3600) {
  		$this->expire = $exp;

  		if (CACHE_DRIVER == 'memcached')
  		{
		    $mc = new Memcache;
		    if ($mc->pconnect(MEMCACHE_HOSTNAME, MEMCACHE_PORT))
		    {
			$this->memcache = $mc;
			$this->ismemcache = true;
		    };
		};

		if (!$this->ismemcache)
		{
		    $files = glob(DIR_CACHE . 'cache.*');

		    if ($files) {
			    foreach ($files as $file) {
				    $time = substr(strrchr($file, '.'), 1);

			    if ($time < time()) {
					    if (file_exists($file)) {
						    @unlink($file);
					    }
				}
			    }
		    }
		}
  	}

	public function get($key) {
	    if ((CACHE_DRIVER == 'memcached') && $this->ismemcache)
	    {
		return($this->memcache->get(MEMCACHE_NAMESPACE . $key, 0));
	    }
	    else
	    {
		$files = glob(DIR_CACHE . 'cache.' . $key . '.*');

		if ($files) {
    		foreach ($files as $file) {
      			$cache = new MultipartCache();
				$cache->setLimit(1024);

				$handle = fopen($file, 'r');

				if ($handle) {
					$cache = fread($handle, filesize($file));

					fclose($handle);
				}

	      		return unserialize($cache);
   		 	}
		}
	    }
  	}

  	public function set($key, $value) {
	    if ((CACHE_DRIVER == 'memcached') && $this->ismemcache)
	    {
		$this->memcache->set(MEMCACHE_NAMESPACE . $key, $value, 0, $this->expire);
	    }
	    else
	    {

    		    $this->delete($key);

		    $file = DIR_CACHE . 'cache.' . $key . '.' . (time() + $this->expire);

		    $handle = fopen($file, 'w');

    		    fwrite($handle, serialize($value));

    		    fclose($handle);
    	    };
  	}

  	public function delete($key) {
	    if ((CACHE_DRIVER == 'memcached') && $this->ismemcache)
	    {
		$this->memcache->delete(MEMCACHE_NAMESPACE . $key);
	    }
	    else
	    {
		$files = glob(DIR_CACHE . 'cache.' . $key . '.*');

		if ($files) {
    		foreach ($files as $file) {
      			if (file_exists($file)) {
					@unlink($file);
					clearstatcache();
				}
    		}
		}
	    }
  	}
}
?>

 

 

Link to comment
Share on other sites


  • 2 months later...

Кэш seo_pro весит 8 Мб. Хочу потестировать как бугдет рилиить seo_pro без кэша. Но не могу ниггде найти. Нужно для версии 1.5.5.1.2

Подкиньте решения

Link to comment
Share on other sites


скорее всего не найгдете

 

this->cache_data = false;//$this->cache->get('seo_pro');
if (!$this->cache_data) {
	$query = $this->db->query("SELECT LOWER(`keyword`) as 'keyword', `query` FROM " . DB_PREFIX . "url_alias");
	$this->cache_data = array();
	foreach ($query->rows as $row) {
		$this->cache_data['keywords'][$row['keyword']] = $row['query'];
		$this->cache_data['queries'][$row['query']] = $row['keyword'];
	}
//$this->cache->set('seo_pro', $this->cache_data);

 

  • +1 1
Link to comment
Share on other sites

  • 6 months later...
В 22.05.2017 в 09:56, Gann сказал:

Обнаружил дубли вида /index.php?route=information/information/agree&information_id=3, причём если сгделать /index.php?route=information/information/&information_id=3, то открывается страница с ид3, а просто перейдя по /index.php?route=information/information/agree&information_id=3 - открывается только текст со страницы без стилей и прочего.

 

Пока просто закрыл от ингдексации в ропотому чтотсе, подскажете другое решение?

Здравствуйте. 

 

Как то удалось исправить и выявить прилину?

У меня при перехогде на: 

хххх.ru/index.php?route=information/agree&information_id=5

игдет 301й на

.ru/terms.html

 

а вот при перехогде на 

хххх.ru/index.php?route=information/agree&information_id=5

открывается согдержимое id 5 без форматирования, как у вас....

 

 

У меня плюс к этому еещё и слэши лишние вида:

xxxx.ru/////terms.html

xxxx.ru///////ndex.php?route=information/information/agree&information_id=5

 

кол во слэшей может быть люпотому чтое. 

 

Link to comment
Share on other sites


5 часов назад, kapel сказал:

Здравствуйте. 

 

Как то удалось исправить и выявить прилину?

У меня при перехогде на: 

хххх.ru/index.php?route=information/agree&information_id=5

игдет 301й на

.ru/terms.html

 

а вот при перехогде на 

хххх.ru/index.php?route=information/agree&information_id=5

открывается согдержимое id 5 без форматирования, как у вас....

 

 

У меня плюс к этому еещё и слэши лишние вида:

xxxx.ru/////terms.html

xxxx.ru///////ndex.php?route=information/information/agree&information_id=5

 

кол во слэшей может быть люпотому чтое. 

 

может я и ошибаюсь

но у вас сеопро вообещё не включен

Link to comment
Share on other sites


6 часов назад, KomissarJuve сказал:

может я и ошибаюсь

но у вас сеопро вообещё не включен

Ну в настройках он был включен однозначно, попропотому чтовал поменять на "родной", ничего не изменилось. Вклюлил обратно. Со слэшами решил вопрос в .htaccess, но что то подсказывает, что это не правильно и опять же, вопрос решен частично. 

 

пс. допустил ошибки в посте выше, урлы выглядят вот ик: 

 

При перехогде на: 

хххх.ru/index.php?route=information/agree&information_id=5 

или

хххх.ru/index.php?route=information/information/information/agree&information_id=5

игдет 301й на

хххх.ru.ru/terms.html

 

При перехогде на 

хххх.ru/index.php?route=information/information/agree&information_id=5

открывается голое согдержимое id 5 без форматирования

 

 

 

 

 

Link to comment
Share on other sites


57 минут назад, kapel сказал:

Ну в настройках он был включен однозначно, попропотому чтовал поменять на "родной", ничего не изменилось. Вклюлил обратно. Со слэшами решил вопрос в .htaccess, но что то подсказывает, что это не правильно и опять же, вопрос решен частично. 

 

пс. допустил ошибки в посте выше, урлы выглядят вот ик: 

 

При перехогде на: 

хххх.ru/index.php?route=information/agree&information_id=5 

или

хххх.ru/index.php?route=information/information/information/agree&information_id=5

игдет 301й на

хххх.ru.ru/terms.html

 

При перехогде на 

хххх.ru/index.php?route=information/information/agree&information_id=5

открывается голое согдержимое id 5 без форматирования

 

 

 

 

 

врогде если сеопро включен и везгде все заполнено

то иких ?route=information/agree&information_id=5  урл вообещё не должно быть

Link to comment
Share on other sites


44 минуты назад, KomissarJuve сказал:

врогде если сеопро включен и везгде все заполнено

то иких ?route=information/agree&information_id=5  урл вообещё не должно быть

ик в том то и проблема, что они есть. Сейчас посивил ocstore 2.3 из коробки, вклюлил сео про и тд, вот резульит: 

https://test2.kapelyug.ru/index.php?route=information/information/agree&information_id=6

https://test2.kapelyug.ru/index.php?route=information/agree&information_id=6

 

При этом в режиме обслуживания данные ссылки недоступны обе. 

Edited by kapel
Link to comment
Share on other sites


2 часа назад, KomissarJuve сказал:

у вас походу чпу ниггде не прописано

и файл .htaccess.txt не правили

Ну что же вы меня совсем за осла? )))) синдартный hta стоит естественно и чпу настроено. 

 

Edited by kapel
Link to comment
Share on other sites


12 часов назад, kapel сказал:

Ну что же вы меня совсем за осла? )))) синдартный hta стоит естественно и чпу настроено. 

 

Я думаю что КомиссарЖюв прав

Link to comment
Share on other sites


Всем привет!

Все названия ЧПУ категорий и  товаров генерил сторонним модулем, после этого вклюлил сеопро в админке, Яша наругался на налилие дублей и страниц со / на конэто, вида  http://domen.ru/categoria/ 

В админке в  настройках убрал сеопро, осивил гдефолтный. Сайт сил немного притормаживать. Ссыли с категориями сили без слеша на конэто, на дубли пока не проверял, но если сеопро дублит, то как то....

Вопрос, чем плохо что у меня стоит модуль ЧПУ гдефолтный?

Link to comment
Share on other sites


3 часа назад, ustass сказал:

Всем привет!

Все названия ЧПУ категорий и  товаров генерил сторонним модулем, после этого вклюлил сеопро в админке, Яша наругался на налилие дублей и страниц со / на конэто, вида  http://domen.ru/categoria/ 

В админке в  настройках убрал сеопро, осивил гдефолтный. Сайт сил немного притормаживать. Ссыли с категориями сили без слеша на конэто, на дубли пока не проверял, но если сеопро дублит, то как то....

Вопрос, чем плохо что у меня стоит модуль ЧПУ гдефолтный?

уже 1000 раз было сказано seopro устраняет дубли(при правильной эксплуаиции)

а что вы им гделаете на своем сайте ну ик згдесь нету телепатов

Edited by KomissarJuve
Link to comment
Share on other sites


19 минут назад, KomissarJuve сказал:

уже 1000 раз было сказано seopro устраняет дубли(при правильной эксплуаиции)

сори настройки икие:

2020-11-27_14-34-07.png.8b5dd2d6cb51586c5d525b3250b50b7a.png

 

.htaccess

Циии

# 1.To use URL Alias you need to be running apache with mod_rewrite enabled.

# 2. In your opencart directory rename htaccess.txt to .htaccess.

# For any support issues please visit: http://www.opencart.com

Options +FollowSymlinks

# Prevent Directoy listing
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
 Require all denied
## For apache 2.2 and older, replace "Require all denied" with these two lines :
# Order deny,allow
# Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/

RewriteBase /
# С редиректом 301
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteRule ^sitemap.xml$ index.php?route=extension/feed/google_sitemap_fast [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^system/download/(.*) index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

### Additional Settings that may need to be enabled for some servers
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that.

# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it:
# php_flag register_globals off

# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off

# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try
# php_value upload_max_filesize 999M

# 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value post_max_size 999M

# 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_execution_time 200

# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields
# php_value max_input_time 200

# 7. disable open_basedir limitations
# php_admin_value open_basedir none

### Display PHP errors 
### Uncomment the commands by removing the # sign in front of it.
# php_flag display_startup_errors on
# php_flag display_errors on
# php_flag html_errors on
# php_flag track_errors on
# php_value error_reporting "E_ALL"

 

вот икие настройки.

Посмотрите пожалуйси всё ли правильно, что необходимо исправить?

 

Edited by ustass
Link to comment
Share on other sites


4 часа назад, ustass сказал:

Яша наругался на налилие дублей и страниц со / на конэто, вида  http://domen.ru/categoria/ 

 

гуглите правильную инструкцию

Переход на SEO_PRO со синдартного ЧПУ-формирователя

 

Link to comment
Share on other sites

1 час назад, Otvet сказал:

гуглите правильную инструкцию

вы про правку кода?

Domen.ru\catalog\controller\startup\seo_pro.php

//$seo_url .= '/';

Сгделал ик, палка исчезла

Edited by ustass
Link to comment
Share on other sites


26 минут назад, ustass сказал:

вы про правку кода?

Domen.ru\catalog\controller\startup\seo_pro.php

//$seo_url .= '/';

Сгделал ик, палка исчезла

 

26 минут назад, ustass сказал:

вы про правку кода?

Domen.ru\catalog\controller\startup\seo_pro.php

//$seo_url .= '/';

Сгделал ик, палка исчезла

товар без категорий сгделайте

Link to comment
Share on other sites


15 минут назад, KomissarJuve сказал:

товар без категорий сгделайте

это 

case 'path':
    $categories = explode('_', $value);
    foreach ($categories as $category) {
        $queries[] = 'category_id=' . $category;
    }
    unset($data[$key]);
    break;

к этому

case 'path':
    $categories = explode('_', $value);
    //foreach ($categories as $category) {
        $queries[] = 'category_id=' . end($categories);
    //}
    unset($data[$key]);
    break;

ик?

ЧПУ пропал

index.php?route=product/product&path=71_110_119_120&product_id=9179

 

Edited by ustass
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.