Jump to content

Gyakutsuki

♥Ambassador
  • Content count

    727
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by Gyakutsuki

  1. You can use moneris hosting, I don't think you will have this problem.
  2. Gyakutsuki

    Mailchimp newsletter Everywhere add on

    @Demitry Happy you like, you can share what you made with the spam bot-trap, some people can be interested.
  3. Gyakutsuki

    Mailchimp newsletter Everywhere add on

    @dimitri Thank you for your fix, I recreated a package and will be available soon.
  4. Gyakutsuki

    Mailchimp newsletter Everywhere add on

    I will look when I have the time and if the BS works with php 7.1. It was not the case when this contribution was wroten
  5. Gyakutsuki

    Mailchimp newsletter Everywhere add on

    @Demitry You must install now the plugin, there is some interesting can help you in your learning. I don"t use VS Code, but it's built on that. Take time to understand the tool.
  6. Gyakutsuki

    Mailchimp newsletter Everywhere add on

    @Demitry @raiwa Hello, Since the 2.02 just the Api has been updated. Nothing has changed in the integration and function. Demitry, it's better for you to change your code editor, I recommend you Phpstorm or code.visualstudio.com if you want something very good. Dreamweaver is old age now. Yesterday, I just updated the api. ?: is an operator
  7. 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 } ?> */
  8. Gyakutsuki

    Stripe App?

    If you want to test app paypal, you can download there : https://github.com/haraldpdl/oscom2_app_paypal 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.
  9. Hello Harald,
    Is it possible to add on the forum a link in the header for the contribution (https://apps.oscommerce.com). because in this moment, eveytime we must search this page.
    Tk

  10. Gyakutsuki

    [CONTRIBUTION] Sloppy Words Cleaner

    Do you know this ? https://github.com/cocur/slugify it's not the same result ? (not sur tell me)
  11. Gyakutsuki

    17 Years Young!

    Nice, Thank you Harald, Happy birthday for the community.
  12. Gyakutsuki

    Mailchimp newsletter Everywhere add on

    I uploaded a new version Api updated included a timeout and subscribe.php I tested and works for me. http://addons.oscommerce.com/info/9289 Could you test also on your website. Thank you.
  13. Gyakutsuki

    Mailchimp newsletter Everywhere add on

    I tested the latest and 2.02; it seems does'nt work for me. Also, I noted a difference if the site is in SSL or Not. SSL certificate seems important to send the information What is you consol resonse ? looking the consol response than I have : type"http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/" title"Invalid Resource" status 400 detail"The resource submitted could not be validated. For field-specific details, see the 'errors' array." instance"" errors [2]0 Object field""message"Required fields were not provided: email_address" 1Object field"email_address" message"Schema describes string, NULL found instead" {"type":"http:\/\/developer.mailchimp.com\/documentation\/mailchimp\/guides\/error-glossary\/","title":"Invalid Resource","status":400,"detail":"The resource submitted could not be validated. For field-specific details, see the 'errors' array.","instance":"","errors":[{"field":"","message":"Required fields were not provided: email_address"},{"field":"email_address","message":"Schema describes string, NULL found instead"}]}
  14. Gyakutsuki

    Dashboards

    I think your indicators could be developped also on other page like products / customers / orders. Hooks could be interesting in this case;
  15. Gyakutsuki

    Happy Holidays!

    Happy Christmas Everyone and Hope you all have a great year in 2017. Congratualtion for the team, very nice work.
  16. Gyakutsuki

    Happy Holidays!

    :)
  17. Gyakutsuki

    osCommerce Online Merchant v2.4.0 Joli Beta

    @@harald I suppose it's a limit of github, in this case it's impossible to follow the development. Is not possible to create in this case another project and include only 2.4 ? Is possible to download the dev ?
  18. Gyakutsuki

    Mailchimp newsletter Everywhere add on

    I am looking also, the status is always at 200 same if there is an error, must be 400.
  19. Gyakutsuki

    Mailchimp newsletter Everywhere add on

    if there is an ajax specialist on the forum it can answer you. But I think there is a specific pb. The message appear only when you click on the button and diseappear after the page is refresh. Also if you click too many time with the email address, mailchimp block the email. Don't use the debug tool in production because it's possible to see all your informations mailchimp.
  20. Gyakutsuki

    Mailchimp newsletter Everywhere add on

    The system use an ajax and you will have a message after clic on the button. No page refresh with this integration.
  21. Gyakutsuki

    Mailchimp newsletter Everywhere add on

    · Integrated the js into the header tag module for easier language localization. · Changed hardcoded messages to language constants · Added language definitions for messages · Added spanish and German translations · Moved “firstname” before “last name” following osc standards Tk raiwa to your sugestions.
  22. Gyakutsuki

    Mailchimp newsletter Everywhere add on

    Yes you have right. I am too fast maybe too speed good lesson. 2.3 does nt work on my server and don t take for a manual installation. Code from scrash just by editor no good to see result and error. It will be my last addon on 2.3 Sorry guy.
  23. Gyakutsuki

    Mailchimp newsletter Everywhere add on

    @ecommunlimited I understand your frustration, but it's a development with some test and update. Also, I understand your knowledge are basic, but some people are like you since Oscommerce exist and some people acquire knowledge because Osc is simple to understand and work to understand. C'est en forgeant que l'on devient forgeron :) That's why the community is make to share and help. The latest must be the good ( I hope) :).
×