Actually, when you set, for example, 5 for 'Limit use of listing package' it means that user can use this package 5 times
and after the last added listing it will show 'Used Up'
Actually, when you set, for example, 5 for 'Limit use of listing package' it means that user can use this package 5 times
and after the last added listing it will show 'Used Up'
Hello Rudi,
But the system is displaying a message that a hack has been detected.
In addition the "Plan Usage Stats" is displaying several records, that is, all repeated, is as Autocy reported above.
screen-2.jpg
If I limit to 5, the system will allow 6 or 7 times.
It is a pity... because I tested version 4.5.2 here on my computer and there is no such error.
Thank you
Last edited by Ed; March 29, 2018 at 06:55 PM.
Hello Rudi,
The error is now occurring in reverse.
1 - I added a free plan, name: (Free)
2 - Set a usage limit in 5 (Five)
See the illustrative image below:
screen-1.jpg
3 - I entered the system as a Dealer, even with a limit of 5 (Five), I was able to use the 10 (Ten) times plan, and in addition there was a serious error in the "Plan Usage Stats".
See the illustrative image below:
screen-2.jpg
Thank You !
Last edited by Ed; March 29, 2018 at 06:55 PM.
it works correctly up to 2 limited plan uses...
and Upgrade/renew listing plan works ok! it updates the balance correctly without adding a new entry in plan using database
Last edited by autocy; March 29, 2018 at 02:24 PM.
Hello Autocy,
I am waiting for a return of a ticket that I opened...
Thank you for your attention!
Last edited by Ed; March 30, 2018 at 01:05 PM.
i've found the problem:
under the new class file addlisting.php (~line 1283)flynax never inserted code for updating plan using:
// Limited listing mode
elseif ($plan_info['Type'] == 'listing' && $plan_info['Limit'] > 0 ) {
$usage_key = $plan_info['Using'] ? 'Using' : 'Limit';
$plan_usage_insert = array(
'Account_ID' => $account_info['ID'],
'Plan_ID' => $plan_info['ID'],
'Listings_remains' => $plan_info[$usage_key] - 1,
'Type' => 'limited',
'Date' => 'NOW()',
'IP' => $reefless->getClientIpAddress()
);
$rlDb->insert($plan_usage_insert, 'listing_packages');
}
i have added/changed code:
// Limited listing mode
if ($plan_info['Type'] == 'listing' && $plan_info['Limit'] > 0)
{
if ($plan_info['Using'] == '') {
$usage_key = $plan_info['Using'] ? 'Using' : 'Limit';
$plan_usage_insert = array(
'Account_ID' => $account_info['ID'],
'Plan_ID' => $plan_info['ID'],
'Listings_remains' => $plan_info[$usage_key] - 1,
'Type' => 'limited',
'Date' => 'NOW()',
'IP' => $reefless->getClientIpAddress()
);
$rlDb->insert($plan_usage_insert, 'listing_packages');
}
else
{
$plan_using_update = array(
'fields' => array(
'Account_ID' => $account_info['ID'],
'Plan_ID' => $plan_info['ID'],
'Listings_remains' => $plan_info['Using']-1,
'Type' => 'limited',
'Date' => 'NOW()',
'IP' => $reefless->getClientIpAddress()
),
'where' => array(
'ID' => $plan_info['Plan_using_ID']
)
);
$rlDb->update($plan_using_update, 'listing_packages');
}
}
Rudi confirm please if code ok!
now works fine from my site!
Last edited by autocy; March 29, 2018 at 06:21 PM.
Hello Guys, is this a script wide issue as i have not created my plans yet and will the Flynax team be providing the correct fix? Thanks
Hello everyone,
I've reviewed the code and unfortunately, there are a lot of things to do to
this feature practically doesn't work and requires full review and update
it will be fixed in the next update, so please be patient
Sorry for the inconveniences!
Rudi this is the code from upgrade listing controler which is working fine:
// limited listing mode
elseif ($plan_info['Type'] == 'listing' && $plan_info['Limit'] > 0 )
{
/* update/insert limited plan using entry */
if ( empty($plan_info['Using']) )
{
$plan_using_insert = array(
'Account_ID' => $account_info['ID'],
'Plan_ID' => $plan_info['ID'],
'Listings_remains' => $plan_info['Limit']-1,
'Type' => 'limited',
'Date' => 'NOW()',
'IP' => $reefless->getClientIpAddress()
);
$GLOBALS['rlActions'] -> insertOne($plan_using_insert, 'listing_packages');
}
else
{
$plan_using_update = array(
'fields' => array(
'Account_ID' => $account_info['ID'],
'Plan_ID' => $plan_info['ID'],
'Listings_remains' => $plan_info['Using']-1,
'Type' => 'limited',
'Date' => 'NOW()',
'IP' => $reefless->getClientIpAddress()
),
'where' => array(
'ID' => $plan_info['Plan_using_ID']
)
);
$GLOBALS['rlActions'] -> updateOne($plan_using_update, 'listing_packages');
}