`network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`network_api_index` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0,
+`sort` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
UNIQUE `provider_type_key` (`network_id`,`network_type_id`,`network_api_index`),
+INDEX (`sort`),
PRIMARY KEY (`network_api_id`)
) TYPE={?_TABLE_TYPE?} COMMENT='Translation of API responses, generic data, DO NOT ALTER!'");
ON
`network_api_index`=`network_translation_id`
ORDER BY
- `network_api_id` ASC', __FUNCTION__, __LINE__);
+ `sort` ASC', __FUNCTION__, __LINE__);
// Do we have entries?
if (SQL_NUMROWS($result) > 0) {
// Add id
setPostRequestParameter('network_id', bigintval(getRequestParameter('network')));
+ // Add sorting
+ setPostRequestParameter('sort', countSumTotalData(
+ postRequestParameter('network_id'),
+ 'network_api_translation',
+ 'network_api_id',
+ 'network_id',
+ true,
+ sprintf(" AND `network_type_id`=%s", bigintval(postRequestParameter('network_type_id')))
+ ));
+
// Add the whole request to database
SQL_QUERY('INSERT INTO
`{?_MYSQL_PREFIX?}_network_api_translation`