Latest News: (loading..)


  • Content count

  • Joined

  • Last visited

  • Days Won


Gyakutsuki last won the day on November 29 2016

Gyakutsuki had the most liked content!

About Gyakutsuki

Profile Information

  • Real Name
    Loic Richard
  • Gender
  • Location
  • Skype

Recent Profile Visitors

40,048 profile views
  1. Price Competitive Intelligence : Only for 2.4 Osc :)

    1. Dan Cole

      Dan Cole

      Don't leave us hanging...tell us more.

    2. Gyakutsuki
  2. There my class to do that, work perfect (for me :) ). <?php /** * * @license GNU Public License V2.0 * @version $Id: */ namespace ClicShopping\Apps\Catalog\Products\Classes\ClicShoppingAdmin; class ImageResample { protected $image; protected $image_type; protected $filename; protected $height; protected $width; protected $size; protected $scale; protected $x; protected $y; public function __construct($filename = null){ if(!empty($filename)){ $this->load($filename); } } public function load($filename) { $image_info = getimagesize($filename); $this->image_type = $image_info[2]; if( $this->image_type == IMAGETYPE_JPEG ) { $this->image = imagecreatefromjpeg($filename); } elseif( $this->image_type == IMAGETYPE_GIF ) { $this->image = imagecreatefromgif($filename); } elseif( $this->image_type == IMAGETYPE_PNG ) { $this->image = imagecreatefrompng($filename); } else { throw new Exception("The file you're trying to open is not supported"); } } public function save($filename, $image_type=IMAGETYPE_PNG, $compression=100, $permissions=null) { if( $image_type == IMAGETYPE_JPEG ) { imagejpeg($this->image,$filename,$compression); } elseif( $image_type == IMAGETYPE_GIF ) { imagegif($this->image,$filename); } elseif( $image_type == IMAGETYPE_PNG ) { imagepng($this->image,$filename); } if( $permissions != null) { chmod($filename,$permissions); } } public function output($image_type=IMAGETYPE_JPEG, $quality = 80) { if( $image_type == IMAGETYPE_JPEG ) { header("Content-type: image/jpeg"); imagejpeg($this->image, null, $quality); } elseif( $image_type == IMAGETYPE_GIF ) { header("Content-type: image/gif"); imagegif($this->image); } elseif( $image_type == IMAGETYPE_PNG ) { header("Content-type: image/png"); imagepng($this->image); } } public function getWidth() { return imagesx($this->image); } public function getHeight() { return imagesy($this->image); } public function resizeToHeight($height) { $ratio = $height / $this->getHeight(); $width = $this->getWidth() * $ratio; $this->resize($width,$height); } public function resizeToWidth($width) { $ratio = $width / $this->getWidth(); $height = $this->getHeight() * $ratio; $this->resize($width,$height); } public function square($size){ $new_image = imagecreatetruecolor($size, $size); if($this->getWidth() > $this->getHeight()){ $this->resizeToHeight($size); imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0)); imagealphablending($new_image, false); imagesavealpha($new_image, true); imagecopy($new_image, $this->image, 0, 0, ($this->getWidth() - $size) / 2, 0, $size, $size); } else { $this->resizeToWidth($size); imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0)); imagealphablending($new_image, false); imagesavealpha($new_image, true); imagecopy($new_image, $this->image, 0, 0, 0, ($this->getHeight() - $size) / 2, $size, $size); } $this->image = $new_image; } public function scale($scale) { $width = $this->getWidth() * $scale/100; $height = $this->getHeight() * $scale/100; $this->resize($width,$height); } public function resize($width,$height) { $new_image = imagecreatetruecolor($width, $height); imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0)); imagealphablending($new_image, false); imagesavealpha($new_image, true); imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight()); $this->image = $new_image; } public function cut($x, $y, $width, $height){ $new_image = imagecreatetruecolor($width, $height); imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0)); imagealphablending($new_image, false); imagesavealpha($new_image, true); imagecopy($new_image, $this->image, 0, 0, $x, $y, $width, $height); $this->image = $new_image; } public function maxarea($width, $height = null){ $height = $height ? $height : $width; if($this->getWidth() > $width){ $this->resizeToWidth($width); } if($this->getHeight() > $height){ $this->resizeToheight($height); } } public function cutFromCenter($width, $height){ if($width < $this->getWidth() && $width > $height){ $this->resizeToWidth($width); } if($height < $this->getHeight() && $width < $height){ $this->resizeToHeight($height); } $x = ($this->getWidth() / 2) - ($width / 2); $y = ($this->getHeight() / 2) - ($height / 2); return $this->cut($x, $y, $width, $height); } public function maxareafill($width, $height, $red = 0, $green = 0, $blue = 0){ $this->maxarea($width, $height); $new_image = imagecreatetruecolor($width, $height); $color_fill = imagecolorallocate($new_image, $red, $green, $blue); imagefill($new_image, 0, 0, $color_fill); imagecopyresampled($new_image, $this->image, floor(($width - $this->getWidth())/2), floor(($height-$this->getHeight())/2), 0, 0, $this->getWidth(), $this->getHeight(), $this->getWidth(), $this->getHeight()); $this->image = $new_image; } } /* usage The first example below will load a file named picture.jpg resize it to 250 pixels wide and 400 pixels high and resave it as picture2.jpg $image = new SimpleImage(); $image->load('picture.jpg'); $image->resize(250,400); $image->save('picture2.jpg'); If you want to resize to a specifed width but keep the dimensions ratio the same then the script can work out the required height for you, just use the resizeToWidth function. $image = new SimpleImage(); $image->load('picture.jpg'); $image->resizeToWidth(250); $image->save('picture2.jpg'); You may wish to scale an image to a specified percentage like the following which will resize the image to 50% of its original width and height $image = new SimpleImage(); $image->load('picture.jpg'); $image->scale(50); $image->save('picture2.jpg'); You can of course do more than one thing at once. The following example will create two new images with heights of 200 pixels and 500 pixels $image = new SimpleImage(); $image->load('picture.jpg'); $image->resizeToHeight(500); $image->save('picture2.jpg'); $image->resizeToHeight(200); $image->save('picture3.jpg'); The output function lets you output the image straight to the browser without having to save the file. Its useful for on the fly thumbnail generation <?php if( isset($_POST['submit']) ) { include('SimpleImage.php'); $image = new SimpleImage(); $image->load($_FILES['uploaded_image']['tmp_name']); $image->resizeToWidth(150); $image->output(); } else { ?> <form action="upload.php" method="post" enctype="multipart/form-data"> <input type="file" name="uploaded_image" /> <input type="submit" name="submit" value="Upload" /> </form> <?php } ?> */
  3. I don't agree with that, 2.4 is very nice and allow to make that you can not make with 2.3.x. I don't understand why there are so many resistance with that and some tools change their core (drupal, joomla, prestashop ...) at a moment for a good benefit for everybody. All programmers say is a pain to maintain the 2.x and if we must have new programmers inside the community and not just like "3 or 4" in this moment, it will be better for everybody. Why you don't like the disruptive ? This forum is not for just a little developper has been make many contributions and does'nt want to adapt the contribution for the new core or does'nt want to evoluate. Stay like that, lost knowledge, learn and lost innovation and technology. Sorry if don't like this sentence Everytime, I have a customer, everytime, I don't know how the contributions are integrated, how and coded inside osc, and eveytime the customer must paid more just for that, just for analyse and for integration because there is some many problem can appear .... Like the last time when there is an evolution on 2.2 to 2.3 with including new template approach, all people create new contribution. That's the evolution. That's sit. Every new tools need time to take this place in ecosystem. HPDL stop the first time the new 2.4 and create another 2.4 just because little does'nt agree with that. At the moment it's time to change and to evoluate. Don't afraid. evoluate like programmer evoluate like shop owner. evoluate for community to finish with that, attitude of the community don't help HPDL to continue. Says opinion ok, says the problem ok, with respect but when I saw all is writen, I can be agree with that. Be positive. that's the good way.
  4. When you look some website test and propose some correction. Whith your experience what is the best approach with osc to create a best htaccess. I tried to make a summary; Opinon and correction will be welcome. speed optimization security optimization cache .. Options +FollowSymlinks <IfModule mod_rewrite.c> RewriteEngine On #blocking Libwww-perl access RewriteCond %{HTTP_USER_AGENT} libwww-perl.* RewriteRule .* – [F,L] FileETag INode MTime Size ## URL Canonicalization RewriteCond %{HTTP_HOST} !^$ [NC] RewriteRule ^(.*)$$1 [L,R=301] # RewriteRule \.(gif|jpg|png|js|css)$ - [F] ### FILTRE CONTRE XSS, base64_encode SALETE , DEFINIR VARIABLE PHP GLOBALS VIA URL, MODIFIER VARIABLE _REQUEST VIA URL RewriteCond %{REQUEST_METHOD} (GET|POST) [NC] RewriteCond %{QUERY_STRING} ^(.*)(%3C|<)/?script(.*)$ [NC,OR] RewriteCond %{QUERY_STRING} ^(.*)(%3D|=)?javascript(%3A|:)(.*)$ [NC,OR] RewriteCond %{QUERY_STRING} ^(.*)document\.location\.href(.*)$ [OR] RewriteCond %{QUERY_STRING} ^(.*)base64_encode(.*)$ [OR] RewriteCond %{QUERY_STRING} ^(.*)GLOBALS(=|[|%[0-9A-Z]{0,2})(.*)$ [OR] RewriteCond %{QUERY_STRING} ^(.*)_REQUEST(=|[|%[0-9A-Z]{0,2})(.*)$ RewriteRule (.*) - [F] </IfModule> # Compress all output labeled with one of the following MIME-types # (for Apache versions below 2.3.7, you don't need to enable `mod_filter` # and can remove the `<IfModule mod_filter.c>` and `</IfModule>` lines # as `AddOutputFilterByType` is still in the core directives). <IfModule mod_deflate.c> <IfModule mod_filter.c> AddOutputFilterByType DEFLATE application/atom+xml \ application/javascript \ application/json \ application/rss+xml \ application/ \ application/x-font-ttf \ application/x-web-app-manifest+json \ application/x-javascript \ application/xhtml+xml \ application/xml \ font/opentype \ image/svg+xml \ image/x-icon \ text/css \ text/html \ text/plain \ text/x-component \ text/xml </IfModule> </IfModule> <IfModule mod_headers.c> # Unset Server Signature header ServerSignature Off # Unset Server Technology header Header unset X-Powered-By Header set Content-Security-Policy "script-src 'self'" Header always set X-FRAME-OPTIONS "DENY" Header always set X-XSS-Protection "1; mode=block" Header always set X-Content-Type-Options "nosniff" Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains" Header unset ETag Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure <FilesMatch "\.(js|css|xml|gz|html)$"> Header append Vary: Accept-Encoding </FilesMatch> <filesMatch ".(css|jpg|jpeg|png|gif|js|ico)$"> Header set Cache-Control "max-age=25200, public" </filesMatch> </IfModule> <IfModule mod_expires.c> ExpiresActive on ExpiresDefault "access plus 2 days" # CSS # ExpiresByType text/css "access plus 2592000 seconds" # Data interchange ExpiresByType application/json "access plus 0 seconds" ExpiresByType application/xml "access plus 0 seconds" ExpiresByType text/xml "access plus 0 seconds" # Favicon (cannot be renamed!) and cursor images ExpiresByType image/x-icon "access plus 2592000 seconds" # HTML components (HTCs) ExpiresByType text/x-component "access plus 2592000 seconds" # HTML ExpiresByType text/html "access plus 0 seconds" # JavaScript ExpiresByType application/javascript "access plus 1 month" ExpiresByType text/x-javascript "access plus 1 month" # Manifest files ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds" ExpiresByType text/cache-manifest "access plus 0 seconds" # Media ExpiresByType audio/ogg "access plus 1 month" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" ExpiresByType image/jpg "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType video/mp4 "access plus 1 month" ExpiresByType video/ogg "access plus 1 month" ExpiresByType video/webm "access plus 1 month" ExpiresByType application/x-shockwave-flash "access plus 1 month" # Web feeds ExpiresByType application/atom+xml "access plus 2592000 seconds" ExpiresByType application/rss+xml "access plus 2592000 seconds" # Web fonts ExpiresByType image/svg+xml "access plus 1 month" </IfModule>
  5. It will interesting to know exactly the @Burt request (origin of the situation). It easy to create a post and after sent something to Harald but what exactly? Sincerely I don't like the turn of this and some bad reaction of some people.
  6. I saw this article, what do you think ?
  7. Success, 100% full integration IceCat To Oscommerce with options. Available for 2.4 is out

    1. wHiTeHaT


      Right now try to get the specs into db.

      So can use them as a filter :)

    2. Gyakutsuki


      I don't what exactly what do you want to say but I included all that I can. Currently just the massive importation it does'nt make. but for a product, there is nothing to do, just to include the price and stock. That's all.

    3. wHiTeHaT


      I added you to skype, so we can talk about it if you like.

  8. Just a question are you sur is Osc an not your forum ?
  9. @LeeFoster look this the module is on marketplace for odoo8 must be adapted for odoo11
  10. Odoo is an ERP write in Python / postgresql, and you install lot of module accounting, crm, e-commerce ....
  11. Also, which version do you use? You can ask a commercial request for that. Or if you have some knowledge, you can download your site and compare with the original version to see the difference and examine the code.
  12. look there, maybe it help to find an a first answer't+connect+to+MySQL+server+on+''+(111)+in&oq=PHP+Warning%3A+mysqli_connect()%3A+(HY000%2F2003)%3A+Can't+connect+to+MySQL+server+on+''+(111)+in&gs_l=psy-ab.3...604.604.0.1421.
  13. Some solutions have proposed been there (each)
  14. If you want to test app paypal, you can download there : Also, you must adapt the code because some elements in paypal has changed. I think (not sure), the next update will be integrated stripe inside paypal app.
  15. How to make a boostrap modal with external element in 2.4