Index: branches/5.1.x/core/units/visits/visits_config.php =================================================================== diff -u -N -r13159 -r13581 --- branches/5.1.x/core/units/visits/visits_config.php (.../visits_config.php) (revision 13159) +++ branches/5.1.x/core/units/visits/visits_config.php (.../visits_config.php) (revision 13581) @@ -1,6 +1,6 @@ Array ( '' => Array ( - 'UserName' => 'IF( ISNULL(u.Login), IF (%1$s.PortalUserId = -1, \'root\', IF (%1$s.PortalUserId = -2, \'Guest\', \'n/a\')), u.Login)', + 'UserName' => 'IF( ISNULL(u.Login), IF (%1$s.PortalUserId = ' . USER_ROOT . ', \'root\', IF (%1$s.PortalUserId = ' . USER_GUEST . ', \'Guest\', \'n/a\')), u.Login)', ), 'incommerce' => Array ( - 'UserName' => 'IF( ISNULL(u.Login), IF (%1$s.PortalUserId = -1, \'root\', IF (%1$s.PortalUserId = -2, \'Guest\', \'n/a\')), u.Login)', + 'UserName' => 'IF( ISNULL(u.Login), IF (%1$s.PortalUserId = ' . USER_ROOT . ', \'root\', IF (%1$s.PortalUserId = ' . USER_GUEST . ', \'Guest\', \'n/a\')), u.Login)', 'AffiliateUser' => 'IF( LENGTH(au.Login),au.Login,\'!la_None!\')', 'AffiliatePortalUserId' => 'af.PortalUserId', 'OrderTotalAmount' => 'IF(ord.Status = 4, ord.SubTotal+ord.ShippingCost+ord.VAT, 0)', @@ -134,7 +134,7 @@ 'Referer' => Array ('type' => 'string','not_null' => '1','default' => ''), 'IPAddress' => Array ('type' => 'string','not_null' => '1','default' => ''), 'AffiliateId' => Array ('type' => 'int','formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (0 => 'lu_None'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Affiliates af LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = af.PortalUserId WHERE `%s` = \'%s\'','left_key_field' => 'AffiliateId','left_title_field' => 'Login','not_null'=>1,'default'=>0), - 'PortalUserId' => Array ('type' => 'int','not_null' => '1','default' => -2), + 'PortalUserId' => Array ('type' => 'int','not_null' => '1','default' => USER_GUEST), ), 'VirtualFields' => Array (