@@ -368,7 +368,7 @@ public static function getTotalPostOfChildParent( $all_child = array() ) {
368
368
}
369
369
370
370
public static function getAllChildCategory ( $ id_smart_blog_category , $ current ) {
371
- $ sql = 'select id_smart_blog_category from ` ' . _DB_PREFIX_ . 'smart_blog_category` where id_smart_blog_category = ' . $ id_smart_blog_category ;
371
+ $ sql = 'select id_smart_blog_category from ` ' . _DB_PREFIX_ . 'smart_blog_category` where id_smart_blog_category = ' . ( int ) $ id_smart_blog_category ;
372
372
373
373
if ( ! $ result = Db::getInstance ()->executeS ( $ sql ) ) {
374
374
return false ;
@@ -388,7 +388,7 @@ public static function getAllChildCategory( $id_smart_blog_category, $current )
388
388
}
389
389
390
390
public static function haveChildCategory ( $ id_smart_blog_category ) {
391
- $ sql = 'select count(id_smart_blog_category) as count from ` ' . _DB_PREFIX_ . 'smart_blog_category` where id_parent = ' . $ id_smart_blog_category ;
391
+ $ sql = 'select count(id_smart_blog_category) as count from ` ' . _DB_PREFIX_ . 'smart_blog_category` where id_parent = ' . ( int ) $ id_smart_blog_category ;
392
392
393
393
if ( ! $ result = Db::getInstance ()->executeS ( $ sql ) ) {
394
394
return false ;
@@ -500,7 +500,7 @@ public static function getRootCategory( $id_lang = null ) {
500
500
public static function getNameCategory ( $ id ) {
501
501
$ id_lang = (int ) Context::getContext ()->language ->id ;
502
502
$ sql = 'SELECT * FROM ' . _DB_PREFIX_ . 'smart_blog_category_lang pl, ' . _DB_PREFIX_ . 'smart_blog_category p
503
- WHERE pl.id_smart_blog_category=p.id_smart_blog_category AND p.id_smart_blog_category= ' . $ id . ' AND pl.id_lang = ' . $ id_lang ;
503
+ WHERE pl.id_smart_blog_category=p.id_smart_blog_category AND p.id_smart_blog_category= ' . ( int ) $ id . ' AND pl.id_lang = ' . ( int ) $ id_lang ;
504
504
if ( ! $ result = Db::getInstance ()->executeS ( $ sql ) ) {
505
505
return false ;
506
506
}
@@ -629,7 +629,7 @@ public static function getCategory( $active = 1, $id_lang = null ) {
629
629
}
630
630
631
631
public static function getPostByCategory ( $ id_smart_blog_category ) {
632
- $ sql = 'select count(id_smart_blog_post) as count from ` ' . _DB_PREFIX_ . 'smart_blog_post_category` where id_smart_blog_category = ' . $ id_smart_blog_category ;
632
+ $ sql = 'select count(id_smart_blog_post) as count from ` ' . _DB_PREFIX_ . 'smart_blog_post_category` where id_smart_blog_category = ' . ( int ) $ id_smart_blog_category ;
633
633
634
634
if ( ! $ result = Db::getInstance ()->executeS ( $ sql ) ) {
635
635
return false ;
@@ -728,7 +728,7 @@ public static function getAllCategoriesName( $root_category = null, $id_lang = f
728
728
729
729
public static function getCatName ( $ id ) {
730
730
$ id_lang = (int ) Context::getContext ()->language ->id ;
731
- $ sql = 'SELECT pl.name FROM ' . _DB_PREFIX_ . 'smart_blog_category_lang pl join ' . _DB_PREFIX_ . 'smart_blog_post_category as p3 on pl.id_smart_blog_category=p3.id_smart_blog_category WHERE pl.id_smart_blog_category= ' . $ id . ' AND pl.id_lang = ' . $ id_lang ;
731
+ $ sql = 'SELECT pl.name FROM ' . _DB_PREFIX_ . 'smart_blog_category_lang pl join ' . _DB_PREFIX_ . 'smart_blog_post_category as p3 on pl.id_smart_blog_category=p3.id_smart_blog_category WHERE pl.id_smart_blog_category= ' . ( int ) $ id . ' AND pl.id_lang = ' . ( int ) $ id_lang ;
732
732
733
733
if ( ! $ result = Db::getInstance ()->executeS ( $ sql ) ) {
734
734
return false ;
@@ -738,7 +738,7 @@ public static function getCatName( $id ) {
738
738
739
739
public static function getCatLinkRewrite ( $ id ) {
740
740
$ id_lang = (int ) Context::getContext ()->language ->id ;
741
- $ sql = 'SELECT pl.link_rewrite FROM ' . _DB_PREFIX_ . 'smart_blog_category_lang pl join ' . _DB_PREFIX_ . 'smart_blog_post_category as p3 on pl.id_smart_blog_category=p3.id_smart_blog_category WHERE pl.id_smart_blog_category= ' . $ id . ' AND pl.id_lang = ' . $ id_lang ;
741
+ $ sql = 'SELECT pl.link_rewrite FROM ' . _DB_PREFIX_ . 'smart_blog_category_lang pl join ' . _DB_PREFIX_ . 'smart_blog_post_category as p3 on pl.id_smart_blog_category=p3.id_smart_blog_category WHERE pl.id_smart_blog_category= ' . ( int ) $ id . ' AND pl.id_lang = ' . ( int ) $ id_lang ;
742
742
if ( ! $ result = Db::getInstance ()->executeS ( $ sql ) ) {
743
743
return false ;
744
744
}
@@ -768,7 +768,7 @@ public static function getNestedCategories( $root_category = null, $id_lang = fa
768
768
FROM ` ' . _DB_PREFIX_ . 'smart_blog_category` c
769
769
' . ( $ use_shop_restriction ? Shop::addSqlAssociation ( 'smart_blog_category ' , 'c ' ) : '' ) . '
770
770
LEFT JOIN ` ' . _DB_PREFIX_ . 'smart_blog_category_lang` cl ON c.`id_smart_blog_category` = cl.`id_smart_blog_category`
771
- WHERE 1 ' . $ sql_filter . ' ' . ( $ id_lang ? 'AND cl.`id_lang` = ' . (int ) $ id_lang : '' ) . '
771
+ WHERE 1 ' . $ sql_filter . ' ' . ( ( int ) $ id_lang ? 'AND cl.`id_lang` = ' . (int ) $ id_lang : '' ) . '
772
772
' . ( $ active ? ' AND c.`active` = 1 ' : '' ) . '
773
773
' . ( $ sql_limit != '' ? $ sql_limit : '' )
774
774
);
@@ -811,8 +811,8 @@ public static function updateAssocCat( $id_post ) {
811
811
if ( is_array ( $ cats ) ) {
812
812
foreach ( $ cats as $ cat ) {
813
813
$ insert [] = array (
814
- 'id_smart_blog_category ' => $ cat ,
815
- 'id_smart_blog_post ' => $ id_post ,
814
+ 'id_smart_blog_category ' => ( int ) $ cat ,
815
+ 'id_smart_blog_post ' => ( int ) $ id_post ,
816
816
);
817
817
}
818
818
0 commit comments