Skip to content

Instantly share code, notes, and snippets.

View alpharder's full-sized avatar
:shipit:

Alex Bolshakov alpharder

:shipit:
View GitHub Profile
diff --git a/app/Tygh/Mailer.php b/app/Tygh/Mailer.php
index 7d8bdd2..eeb4ace 100644
--- a/app/Tygh/Mailer.php
+++ b/app/Tygh/Mailer.php
@@ -261,4 +261,9 @@ class Mailer extends \PHPMailer
return array_unique($result);
}
+
+ public static function ValidateAddress($email, $method = 'auto')
diff --git a/design/themes/basic/templates/views/profiles/components/profiles_account.tpl b/design/themes/basic/templates/views/profiles/components/profiles_account.tpl
index 64a3053..732653e 100644
--- a/design/themes/basic/templates/views/profiles/components/profiles_account.tpl
+++ b/design/themes/basic/templates/views/profiles/components/profiles_account.tpl
@@ -4,12 +4,10 @@
{hook name="profiles:account_info"}
-{if $nothing_extra || $runtime.checkout}
- <div class="control-group">
diff --git a/app/Tygh/SmartyEngine/Core.php b/app/Tygh/SmartyEngine/Core.php
index b3eee69..34ac367 100644
--- a/app/Tygh/SmartyEngine/Core.php
+++ b/app/Tygh/SmartyEngine/Core.php
@@ -26,8 +26,6 @@ class Core extends \Smarty
public $default_resource_type = 'tygh';
public $merge_compiled_includes = false;
public $escape_html = true;
- public $_dir_perms = 0777;
- public $_file_perms = 0666;
diff --git a/admin.php b/admin.php
index 2d7210c..864e97f 100644
--- a/admin.php
+++ b/admin.php
@@ -20,6 +20,7 @@ if (version_compare($php_value, '5.3.0') == -1) {
define('AREA', 'A');
define('ACCOUNT_TYPE', 'admin');
+define('ENTRY_SCRIPT', __FILE__);
diff --git a/app/functions/fn.common.php b/app/functions/fn.common.php
index 4bf36ce..7ccd1fb 100644
--- a/app/functions/fn.common.php
+++ b/app/functions/fn.common.php
@@ -5877,7 +5877,7 @@ function fn_live_editor_prepare_callback_args($schema, $vars)
* @param $operator
* @param $right_operand
*
- * @return bool Comparison result
+ * @return bool|null Boolean comparison result or null if unknown operator given
diff --git a/app/controllers/frontend/products.php b/app/controllers/frontend/products.php
index faa4dae..44a038e 100644
--- a/app/controllers/frontend/products.php
+++ b/app/controllers/frontend/products.php
@@ -182,6 +182,9 @@ if ($mode == 'search') {
// Set recently viewed products history
fn_add_product_to_recently_viewed($_REQUEST['product_id']);
+ // Increase product popularity
+ fn_set_product_popularity($_REQUEST['product_id']);
diff --git a/app/functions/fn.cart.php b/app/functions/fn.cart.php
index 1e96c84..efa7eed 100644
--- a/app/functions/fn.cart.php
+++ b/app/functions/fn.cart.php
@@ -809,11 +810,19 @@ function fn_update_order(&$cart, $order_id = 0)
$order['promotion_ids'] = fn_create_set(array_keys($cart['promotions']));
}
- $old_order = db_get_row("SELECT company_id, payment_id, status FROM ?:orders WHERE order_id = ?i", $order_id);
+ $old_order = db_get_row(
diff --git a/app/addons/watermarks/func.php b/app/addons/watermarks/func.php
index 1793ce5..b11b633 100644
--- a/app/addons/watermarks/func.php
+++ b/app/addons/watermarks/func.php
@@ -445,7 +445,7 @@ function fn_watermark_create(
try {
$image = $imagine->open($original_abs_path);
- $image->usePalette(new \Imagine\Image\Palette\RGB());
+// $image->usePalette(new \Imagine\Image\Palette\RGB());
diff --git a/init.php b/init.php
index 2772327..0472c9f 100644
--- a/init.php
+++ b/init.php
@@ -21,7 +21,7 @@ use Tygh\Registry;
$this_dir = dirname(__FILE__);
$classLoader = require($this_dir . '/app/lib/vendor/autoload.php');
$classLoader->add('Tygh', $this_dir . '/app');
-class_alias('\Tygh\Tygh', 'Tygh', true);
+class_alias('\Tygh\Tygh', 'Tygh');
diff --git a/app/functions/fn.images.php b/app/functions/fn.images.php
index 02892d2..44072fa 100644
--- a/app/functions/fn.images.php
+++ b/app/functions/fn.images.php
@@ -649,6 +649,8 @@ function fn_resize_image($src, $new_width = 0, $new_height = 0, $bg_color = '#ff
$thumbnail = $canvas;
}
+ unset($image);
+