Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

shalan

Users
  
  • Posts

    273
  • Joined

  • Last visited

Everything posted by shalan

  1. Делайте бакап таблицы, очищайте таблицу, меняйте структуру, восстанавливайте данные из бакапа. 26000 символов должно входить в поле TEXT даже при двухбайтной кодировке. Как считали количество символов?
  2. про phpMyAdmin слышали? находите таблицу oc_information_description и меняете тип поля description
  3. $arr['addr_name'] = trim($order_info['shipping_lastname'].' '.$order_info['shipping_firstname']) . ' ' . $field_value;
  4. тут удаляется разделитель / $directory = rtrim(DIR_IMAGE . 'data/' . str_replace('../', '', $this->request->post['directory']), '/'); тогда добавляем его в проверке while(file_exists($directory . '/'. $filename . $cnt . $fileextention))
  5. перенесите $directory = rtrim(DIR_IMAGE . 'data/' . str_replace('../', '', $this->request->post['directory']), '/'); выше чем $file = $filename;
  6. ...опять надо догадываться переменная $directory инициализируется ниже чем используется
  7. текущая директория видимо задается строкой $directory = rtrim(DIR_IMAGE . 'data/' . str_replace('../', '', $this->request->post['directory']), '/'); т..е. вместо DIR_IMAGE используем $directory
  8. после { while(file_exists('image/' . $filename . $cnt . $fileextention)) $cnt ++; $file = $filename . $cnt . $fileextention; } добавить $filename = $file;
  9. Это пример, Вставлять в том месте, где формируется имя файла. DIR_FREEDOWNLOAD заменить на каталог изображений
  10. видимо должно быть так $object = 'order'; $query = $this->db->query('SELECT * FROM `' . DB_PREFIX . $object . '_simple_fields` WHERE `'.$object.'_id` = \'' . $objectId . '\' LIMIT 1'); $field_value = $query->row['otchreg']; в $field_value будет значение нужного вам поля
  11. код для добавления номера к названию файла $file = $filename; $cnt = 1; $fileextention = substr(strrchr($file, '.'), 0); $filename = substr($file, 0, strrpos($file, '.')); if(file_exists(DIR_FREEDOWNLOAD . $file)) { while(file_exists(DIR_FREEDOWNLOAD . $filename . $cnt . $fileextention)) $cnt ++; $file = $filename . $cnt . $fileextention; }
  12. Указать размер нельзя. Можно только проверить размер картинки после загрузки на сервер. Если размер не устраивает, картинку не сохраняем, пользователю возвращаем ошибку "неподходящий размер картинки".
  13. уже советовали, выведите тип файла в сообщение об ошибке // Allowed file extension types $allowed = array(); $extension_allowed = preg_replace('~\r?\n~', "\n", $this->config->get('config_file_ext_allowed')); $filetypes = explode("\n", $extension_allowed); foreach ($filetypes as $filetype) { $allowed[] = trim($filetype); } if (!in_array(strtolower(substr(strrchr($filename, '.'), 1)), $allowed)) { $json['error'] = $this->language->get('error_filetype') . strtolower(substr(strrchr($filename, '.'), 1)); } // Allowed file mime types $allowed = array(); $mime_allowed = preg_replace('~\r?\n~', "\n", $this->config->get('config_file_mime_allowed')); $filetypes = explode("\n", $mime_allowed); foreach ($filetypes as $filetype) { $allowed[] = trim($filetype); } if (!in_array($this->request->files['file']['type'], $allowed)) { $json['error'] = $this->language->get('error_filetype') . $this->request->files['file']['type'] ; } файл /admin/controller/catalog/download.php
  14. В таблицу oc_manufacturer добавляем поле statuses, как писал chukcha В админке, в модели товара для методов add, edit, delete добавляем код $res = $this->db->query("SELECT count(*) AS cnt FROM oc_product p WHERE p.status=1 AND p.manufacturer_id=" . (int)$data['manufacturer_id]); $this->db->query("UPDATE oc_manufacturer m SET m.statuses = '" . (int)$res->row['cnt'] . "' WHERE m.manufacturer_id=" . (int)$data['manufacturer_id]); В фронтенде, в модели производителя, метод getManufacturers добавляем условие AND m.stautses > 0
  15. Любой модуль выводится в составе схемы. Cоздайте новую схему и добавьте туда свой модуль
×
×
  • 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.