PDA

View Full Version : CRITICAL FLAW: Renew upgrade feature doesn't work as it should



Wei Hong
October 15, 2013, 05:15 PM
ok, so I have been doing alot of searching on this forum, submit ticket, online support. And they said there is nothing wrong with it.
I have gone through with flynax support countless time, it's have some bugs here and there. There is no perfect software.
I know Flynax is a good software and for that matter of fact, I just got my second license last week. And probably 3rd one soon. Since I planed to stick with it for a long time, I need to give in my thought to make it even better.

Many of you who skim through this will not get the point and will ignore it just like me. So I will carefully explained it here.
So we all know that Flynax has this feature button called: "Renew/upgrade listing plan". Its the third button from the left with a dollar sign in it
703

This is where the flaw is and many of us probably didn't even know it exist.
This button doesn't work as it advertised: "renew/upgrade." It work as "extend/change" Look at these screenshot:
704705

Look at the "Active still" date, some may find this funny, yea, I click renew/upgrade multiple times and know my listing can live until August 23 2015 with a 30-day plan while original posting date is Sept 23 2013, that is around 2 year long for a 30days plan.

The renew/upgrade feature extend the live of the listing, but it doesn't renew your listing.

Let me give you a simple example
Say you paid 2 dollar to post a listing to sell a house for $500k in July 2013 using a 3-month plan. After 2 months, you still haven't sold the house. So you lower the price to $400k and decided to "renew/upgrade" your listing, thinking to make your listing fresh, new, and it would bump to the top so many people can see it. You are wrong.

It would only extend your listing live, it does not "renew" your listing by any mean. Now this doesn't make any sense to me.
You pay money to "renew" your listing, but it is still a 2 months old listing. Check my screenshot, after many "renew/upgrade" using 30-day plan just 15 minutes ago, I have it active till August 23 2015, while it is still show as Sept 23 2013, a one month old listings

So when people check the categories, they only see the new post, while yours listing is buried to some 10-20 pages, even though you are still actively selling your house and just reduced your price. Even if people reached the bottom of the list and found your listing. What would they think it they see the old date.

Would you pay to renew your listing, knowing it still an old old listing after all.

I consider this is a critical flaw, and flynax dev should change this to 4.1 and in the upcoming version.


Make the renew/upgrade feature renew the posting date, and add the listing live after that date.
For example, using this screenshot.
705
When I choose renew/upgrade with the very same 30-day plan, it should change the post date from 09.23.2013 to today which is 10.15.2013, and the "Active still" from 08.23.2015 to 30 days after today, which is 11.14.2013.



Please read and give me your thought. I probably need to "renew" this thread, bump it to the top every now and then so Flynax Dev can see it.

Chris Brown
October 15, 2013, 08:00 PM
I think over the last few weeks a few have come on the forum and mentioned this but classed it and complained that its a bug. Flynax have probably wrote the script as it is.

You have done the right thing here and gave a detailed description for a positive change. For people to review and postsuggestions.

I agree with the issue, i dont see it as critical but see it as a good change/improvement that flynax should consider for future versions of the script.

For me personally i would like to see the date updated when listing is renewed.

Wei Hong
October 15, 2013, 09:26 PM
Hi Chris,
Thanks for the comment.
Would you agree that its awkward for the renew/upgrade feature to extend the live of the listing, in my case i have extend it for another 2 years using 30-day plan, instead of renew the listing: refreshing the post date. Would you rather go through all of the process to repost the very same listing again instead of renewing it. Just so that it could be at the top again.

Steffen Buschkemper
October 16, 2013, 12:56 AM
Hi Chris,

I can not agree with you there.
For me is this a bug and it will always be, because renew = renew and it does not renew.

But since we come here upon deaf ears...

//Steffen

Pete Young
October 16, 2013, 01:20 AM
This is nothing new, I raised this issue a while back as a fault and some did not see it as that, although I agree with you it should do as you state. For that reason I had my site modified to do exactly what your talking about, this mod some say should be how it should work, but rather than worry about who says what I just paid to have it work how I wanted to, from memory viktor done this for me, I will try and find and link the thread here for you.


http://www.flynax.com/forum/showthread.php?1233-Renew-Upgrade-Listing-Plan

Wei Hong
October 16, 2013, 02:43 AM
Hi Pete.
I didn't see your post earlier because it wasn't renewed and buried deep down in this forum. Wish I saw it earlier. I will correct this by renew this thread more often then.

So you have to pay to get flynax to fix this bug? Like Steffen has stated, renew = renew. Flynax should accept this as a bug and fix it.
Otherwise, I will have no choice but to pay to have it fixed. Because this is a basic, core feature, all information software even this vbulletin flynax forum has it, to renew posting. I'm posting this post to renew this thread so you and many other can read it.

I'm waiting for words from developers. Let me know if you want my money to fix this bug. I have spent over $1000 for flynax license. I'm also contacting flynax for custom modification of rating and comment. But to be honest, I don't think this bug worth paying for, because it's a bug. It make no sense at all.

New customers or those who havent aware of this problem should read this thread and think about it.

John
October 16, 2013, 03:47 AM
Hi Guys,
I see you have fierce discussion here, let me take a part in it...
So main question is: why the listing posting date remains the same after renew?
I can explain why, firstly: the Renew/Update option relates to the listing plan and not the listing itself,
you can easily check it by putting the mouse cursor on the icon.
Secondly: The listing date remains the same because the seller sells the same house
and nothing changed there. Visitors who already saw this house will not check it again because they
don't want it.

I just explain you our concept but if you want to change the logic just apply the following changes
or contact our support and they will do changes for free fro you:
1. Open the file: /includes/classes/rlListings.class.php
2. Find the code (line ~2775):


$update = array(
'fields' => array(
'Pay_date' => $upgrade_date,
'Plan_ID' => $plan_id,
'Cron_notified' => '0'
),
'where' => array(
'ID' => $listing_id
)
);

3. Replace with the cod:


$update = array(
'fields' => array(
'Pay_date' => $upgrade_date,
'Date' => 'NOW()',
'Plan_ID' => $plan_id,
'Cron_notified' => '0'
),
'where' => array(
'ID' => $listing_id
)
);

4. You should find the same code statement a bit bellow, right after code line:

case 'package':
do the same changes there.
5. Open the file: /includes/controllers/upgrade_listing.inc.php
6. Find the code (line~ 366):


$update = array(
'fields' => array(
'Plan_ID' => $plan_info['ID'],
'Pay_date' => $upgrade_date,
'Featured_ID' => $update_featured_id,
'Featured_date' => $upgrade_featured_date,
'Last_type' => $listing_mode
),
'where' => array(
'ID' => $listing_id
)
);

7. Replace with the code:


$update = array(
'fields' => array(
'Plan_ID' => $plan_info['ID'],
'Pay_date' => $upgrade_date,
'Date' => 'NOW()',
'Featured_ID' => $update_featured_id,
'Featured_date' => $upgrade_featured_date,
'Last_type' => $listing_mode
),
'where' => array(
'ID' => $listing_id
)
);


John

Wei Hong
October 16, 2013, 04:16 AM
Hi Guys,
I see you have fierce discussion here, let me take a part in it...
So main question is: why the listing posting date remains the same after renew?
I can explain why, firstly: the Renew/Update option relates to the listing plan and not the listing itself,
you can easily check it by putting the mouse cursor on the icon.
Secondly: The listing date remains the same because the seller sells the same house
and nothing changed there. Visitors who already saw this house will not check it again because they
don't want it.
John

Hi John,
I wish every flynax supporter would have the same behavior as you. To read and put effort to correct. We are here trying to make your script better. Regarding your concept, in my opinion. Firstly, if the renew/update option relates to the listing plan only, but not the listing itself, then its all ready ruined the basic concept of that very listing plan. As I mentioned in my screenshot in the 1st post. This renew/update option extend the live of the listing to 2 years or even more years using a 30-day listing plan. How does that sound to customers? The listing plan is not renewed, it is added on top of every each of the time customer use the renew option. If it is renewed, then it will go back to our very first problem that we are discussing, the listing posting date. If the plan is renewed, it should be renewed as a new listing plan with the very same duration, in my case, 30 days, not to add them all up.

Secondly, I also mentioned in my example in this thread 1st post. The seller couldn't sell the house after 2 months, so he reduced the price from 500k to 400k. There is change there, even if there is not. When renew the listing plan, the listing should bump to top to show other people that this very seller is still actively selling this house, not some guys who post and ignore. And it also encourage this seller to pay to renew/update plan.

Think about this, for the very same scenario, if you can't sell the house in two months, and you want to catch people attention again by reducing price, add more furniture, offer extra financing, what will you do? You can edit all of those info of course, and renew the very same listing, bump it to the top so people can see it.

Or would you post a new listing to sell the very same house, just to bump it to the top, so people can see it, and to prove that you are still actively selling this very same house.

Thank you for taking the time reading this thread and working with us. I will try to apply your suggestion and give you my feedback.

Morgan Bohman
October 16, 2013, 05:08 AM
As I see it, if you would like to renew your listing, then it would be on top again but, as Sweden's largest classified site does it: a strike through line in the old price or an arrow pointing down, indicated that something has changed - text, images or whatever, to make the listing sell again.

//Morgan

John
October 17, 2013, 03:25 AM
Hi Wei Hong,
ok I got you, we will take into account your suggestion working on new version of the software, thanks!

John

Wei Hong
October 17, 2013, 05:27 AM
Hi John,
The code work great.
Just one more question. How do I change the "Upgrade date" to the date of pay_date plus the listing plan period. For example:
If I renew the listing plan that has 10 day period on October 1, 2013, then the listing will "active till" October 11, 2013.

I try to change this part:


$upgrade_date = 'IF(UNIX_TIMESTAMP(NOW()) > UNIX_TIMESTAMP(DATE_ADD(`Pay_date`, INTERVAL '. $plan_info['Listing_period'] .' DAY)) OR UNIX_TIMESTAMP(`Pay_date`) = 0, NOW(), DATE_ADD(`Pay_date`, INTERVAL '. $plan_info['Listing_period'] .' DAY))';




$upgrade_date = 'IF(UNIX_TIMESTAMP(NOW()) > UNIX_TIMESTAMP(DATE_ADD(`Pay_date`, INTERVAL '. $plan_info['Listing_period'] .' DAY)) OR UNIX_TIMESTAMP(`Pay_date`) = 0, NOW(), DATE_ADD(NOW(), INTERVAL '. $plan_info['Listing_period'] .' DAY))';


But for some reasons, the "active till" date didn't show as October 11, 2013, but October 21, 2013, which is exactly double the period of that 10 days listing. I have tried with other plans and various periods, still showing double the listing period.

Petrache Nicolae
October 17, 2013, 07:01 AM
Wei Hong, you manage to do what many of us didn.t succeed. You manage to make Flynax see this as a issue (i totaly agree with it) and provide us a solution.

in my country we have a website called mercador.ro wich has a great feature. a user makes a listing and that listing, unless you delete it, is active for 30 days. after 30 days, you receive an email with 2 buttons (one is for renew, one is for cancel). if you do not, than it is gone in a few days. if you click from email on renew button, than the listing is renewed in website and moved to the first position in the listings.

in other words, by confirming via renew, any seller gets a better position each month, in adition of confirming that the listing is active. YOU MOTIVATE SELLERS by this aproach. if you list an item wich doesn.t sell for 9 months, how would it be to have your add at the end of (hopefully for us) a very long list of ads? not so great for the seller.

So John, please help us all the way to have this working perfect as Wei Hong mentioned in his last reply. thanks

Petrache Nicolae
October 26, 2013, 10:06 PM
Hi Wei Hong,
ok I got you, we will take into account your suggestion working on new version of the software, thanks!

John

hello John. Can you please reply to Wei Hong question regarding "Just one more question. How do I change the "Upgrade date" to the date of pay_date plus the listing plan period. For example:
If I renew the listing plan that has 10 day period on October 1, 2013, then the listing will "active till" October 11, 2013."

we all wait for a reply. thanks

Pete Young
October 27, 2013, 12:01 AM
I seem to get a lot of pm's regards the updates that Viktor done for me, the cost was $30 from memory and it covered if I am correct the fix shown above, it also covered from memory the date options and fixed those up as in regards the post above.

Not sure why the upgrade could not be just added as a module so that way if people wanted this they could just add in the same way would add banners as an example. As many have said this is how many top classified sites work and puzzling why flynax did not have it working ?

The good thing is now it seems peer pressure has made them see it is a option more than one or two people want.

Wei Hong
October 27, 2013, 01:19 AM
Yes, Pete was generous enough to share with me the file that Viktor modified regarding this matter, and as far as I can tell, it's the same fix that John have instruct here. I'm also still waiting for John reply, been trying to PM him as well.

John
October 28, 2013, 05:16 AM
Hello Wei Hong,

Hi John,
The code work great.
Just one more question. How do I change the "Upgrade date" to the date of pay_date plus the listing plan period. For example:
If I renew the listing plan that has 10 day period on October 1, 2013, then the listing will "active till" October 11, 2013.

I try to change this part:


$upgrade_date = 'IF(UNIX_TIMESTAMP(NOW()) > UNIX_TIMESTAMP(DATE_ADD(`Pay_date`, INTERVAL '. $plan_info['Listing_period'] .' DAY)) OR UNIX_TIMESTAMP(`Pay_date`) = 0, NOW(), DATE_ADD(`Pay_date`, INTERVAL '. $plan_info['Listing_period'] .' DAY))';




$upgrade_date = 'IF(UNIX_TIMESTAMP(NOW()) > UNIX_TIMESTAMP(DATE_ADD(`Pay_date`, INTERVAL '. $plan_info['Listing_period'] .' DAY)) OR UNIX_TIMESTAMP(`Pay_date`) = 0, NOW(), DATE_ADD(NOW(), INTERVAL '. $plan_info['Listing_period'] .' DAY))';


But for some reasons, the "active till" date didn't show as October 11, 2013, but October 21, 2013, which is exactly double the period of that 10 days listing. I have tried with other plans and various periods, still showing double the listing period.
Actually the system already works as you want, the plan date adds to the pay date now.
What is the problem?

John

Wei Hong
November 1, 2013, 07:33 AM
The problem is exactly what i described. About stacking up listing period. About using 10-day period to extend a listing to unlimited time. For instance: 10 years or more.
I want it to add the period to the upgrade date, not stacking up. I did explain this issue with screenshot in my 1st post.

Petrache Nicolae
December 6, 2013, 05:17 PM
Hello Wei Hong,

Actually the system already works as you want, the plan date adds to the pay date now.
What is the problem?

John

Hello John. The code works fine but is it posible to renew automatic all the listings after the amount of time specified in plan? without user action to renew it. thanks

Petrache Nicolae
December 17, 2013, 01:59 PM
Hello Wei Hong,

Actually the system already works as you want, the plan date adds to the pay date now.
What is the problem?

John

hello John. 2 issues please

1.is it posible to renew automatic all the listings after the amount of time specified in plan? without user action to renew it?
2.can we hide the renew button if the plan is active? that button should be available when those 30 days expire. i can click each day for a new renew and the listing will go to the top of the listings each day? this is wrong... a user can keep his listing on top if he click every hour becouse the script allows it.

Peter Jonsson
December 17, 2013, 02:45 PM
Tried this and it puts the listing on the top (current day) but it stacks the days. after 3 (60days)upgrade clicks on the listing and now my listing are active until 2014-06-10 when it should only be active until 2014-01-17

Petrache Nicolae
December 17, 2013, 03:01 PM
exactly. i can keep it in first position each hour (or minute) and in adition i get the period extended with another 30 days for each renew i make. this is so wrong..............

this is a major part of the script wich is broken, countles threads on this subject and just in this John was kind to present a solution wich is a step forword

in other threads, i have sean just request for money so, team Flynax, a full working solution exactly how much does it cost? a working solution like we should had from the begining. thanks

Wei Hong
December 18, 2013, 07:13 AM
Like I said. That is the only problem left that need to be fixed.

Mike
December 18, 2013, 08:32 AM
If i understood you right, issue is that during "renew process" it adds "period" to date each time you update your listings?

Renew is supposed to renew listing plan (listing period) and not just for date updating. In other words Renew here is not to renew listing date but to renew its plan period (listing live period).

To remove period extending in renew function, try to make changes in the same place as John mentioned.


1. Open the file: /includes/classes/rlListings.class.php
2. Find the code (line ~2775):


$update = array(
'fields' => array(
'Pay_date' => $upgrade_date,
'Plan_ID' => $plan_id,
'Cron_notified' => '0'
),
'where' => array(
'ID' => $listing_id
)
);


3. Replace with the code:


$update = array(
'fields' => array(
/* 'Pay_date' => $upgrade_date,*/
'Date' => 'NOW()',
'Plan_ID' => $plan_id,
'Cron_notified' => '0'
),
'where' => array(
'ID' => $listing_id
)
);




but my opinion on the subject that it should be not changed like this.

Renew plan function(what we changing) is for different purposes and it works as it should.

For those who need Renew listing its better to add another button which will just renew listing date and will have no relation to listing plans and upgrade,
If you want i can post instructions here it seems pretty simple.
Only problem with that way if you want to charge users for this, in this case easier to make above mentioned change, but still think its not right solution )

Wei Hong
December 18, 2013, 10:15 PM
Hi Mike,
Thanks for the reply. I think you are slightly misunderstood. This is about stacking up problem
We all agree that renew should add the listing period on top of the renew date. For example: We renew a listing that used a 10-day period plan on 12/01/2013, then the expire date should be 12/11/2013. Afterward on the following date which is 12/02/2012, we renew it again with the same listing and same plan, the expire date should be 12/12/2013, but it doesn't. It stack up the date, so the expire date is 12/21/2013 while it should be 12/12/2013. And if you keep doing this, it stack up everytime you hit the renew button. So if you hit renew again on the same date 12/02/2013, the expire date would be 12/22/2013, hit renew again and it will goes up 10days from 12/22/2013.
Hope I explained clear enough. This is basically the same issue that i have explained in my 1st post, but I guess it is too complicated to understand

Peter Jonsson
December 19, 2013, 03:41 AM
Hi Mike,
Thanks for the reply. I think you are slightly misunderstood. This is about stacking up problem
We all agree that renew should add the listing period on top of the renew date. For example: We renew a listing that used a 10-day period plan on 12/01/2013, then the expire date should be 12/11/2013. Afterward on the following date which is 12/02/2012, we renew it again with the same listing and same plan, the expire date should be 12/12/2013, but it doesn't. It stack up the date, so the expire date is 12/21/2013 while it should be 12/12/2013. And if you keep doing this, it stack up everytime you hit the renew button. So if you hit renew again on the same date 12/02/2013, the expire date would be 12/22/2013, hit renew again and it will goes up 10days from 12/22/2013.
Hope I explained clear enough. This is basically the same issue that i have explained in my 1st post, but I guess it is too complicated to understand






1. Open the file: /includes/classes/rlListings.class.php
2. Find the code (line ~2775):


$update = array(
'fields' => array(
'Pay_date' => $upgrade_date,
'Plan_ID' => $plan_id,
'Cron_notified' => '0'
),
'where' => array(
'ID' => $listing_id
)
);


3. Replace with the code:


$update = array(
'fields' => array(
/* 'Pay_date' => $upgrade_date,*/
'Date' => 'NOW()',
'Plan_ID' => $plan_id,
'Cron_notified' => '0'
),
'where' => array(
'ID' => $listing_id
)
);


This code made it work

Wei Hong
December 19, 2013, 04:58 AM
This code made it work

Nice to hear that. I will try it out when I have time.

Petrache Nicolae
December 19, 2013, 05:52 AM
For those who need Renew listing its better to add another button which will just renew listing date and will have no relation to listing plans and upgrade,
If you want i can post instructions here it seems pretty simple.
Only problem with that way if you want to charge users for this, in this case easier to make above mentioned change, but still think its not right solution )


Hello. Please provide your solution so we can check it and maybee will work better. This is the most important feature for us and for the users and flynax script shoulded had this feature from the begining.

if you want to see it perform great, test it in www.mercador.ro

make a listing without creating an account, after 30 days you get a html email with a button to renew the listing and you click on that and you are logged in directly (as opposed to flynax in wich you have a link, click on it and than you have to log in, than select the plan and so on....again steps over steps..great :wub:) and the listing is renewed directly without any other clicks and is moved as first listing in the linstings list. this provides rotation of the ads in the same time as confirming that the listing is still viable.
This is the basic feature that we as owners and our clients needs. It is exactly what so many script offer for quite some time.

And regarding the present solution i already mentioned that i can click on renew listing at each hour and i get the listing renew and keept as first each hour (instead of 30 days becouse that is the time of the plan) + the fact that it stacks up the date. for each click, the date grows. do some maths...if i click and renew each hour, i keep the listing on top each hour and the expire date has 30 days x 24 hours x 30 days and so on...will be live for eternity like this.

bottom line...the renew should pop up only when the 30 days (in my case) expired and should be used just 1 time.

Wei Hong
December 19, 2013, 08:56 PM
What script is this site using?
www.mercador.ro

Petrache Nicolae
December 20, 2013, 06:10 AM
i don't know what script is beeing used

Chris Brown
December 20, 2013, 02:02 PM
I have been keeping tabs on this thread as i want when a listing is renewed the date posted changes so like said its bumped to the top.

Do the changes earlier in this thread work?

I then see there is discussion of stacking up listing time.

I thought i would test this, so i created a test listing and renewed it straight away. Then i renewed it again and again all within 2 minutes. now the listing is now active till April 11th.

Is this the problem you guys mean?

I can see this being an issue for free listings as it can be taken advantage of, but if they are paid listings shouldnt it work like that. As if they do it 2 times they will have paid 2 times.

I think a better solution is for the renew button to be hidden until its time/the email is sent out to renew. Configure it to show up when the email is sent to the user
Which is in admin/configurations/cron-job/Send an expiration notice in advance.


Any thoughts?

Mike
December 25, 2013, 03:29 AM
As i told here is alternative solution, its Renew Listing Date button this function is stand alone from the upgrade process and can be used if you dont charge your users for renewing listings


1. templates/yourtemplate/tpl/blocks/my_listing.tpl



{if !$listing.Featured_expire && $listing.Status == 'active' && $available_plans}
<a title="{$lang.make_featured}" class="nav_icon text_button" href="{$rlBase}{if $config.mod_rewrite}{$pages.upgrade_listing}/featured.html?id={$listing.ID}{else}?page={$pages. upgrade_listing}&amp;id={$listing.ID}&amp;featured{/if}">
{$lang.make_featured}
</a>
{/if}
<!--add this code, its for renew button-->
<a title="{$lang.renew}" class="nav_icon text_button" href="javascript:void(0)" onclick="xajax_renewListing({$listing.ID});">
<span class="left">&nbsp;</span><span class="center">{$lang.renew}</span><span class="right">&nbsp;</span>
</a>



2. includes/controllers/my_listings.inc.php



/* register ajax methods */
$rlXajax -> registerFunction( array( 'deleteListing', $rlListings, 'ajaxDeleteListing' ) );
$rlXajax -> registerFunction( array( 'renewListing', $rlListings, 'ajaxRenewListing' ) );//add this line



3. includes/classes/rlListings.class.php

add this function



function ajaxRenewListing( $id = false )
{
global $_response;

if ( !$id )
return;

$id = (int)$id;
if ( defined( 'IS_LOGIN' ) )
{
$sql ="UPDATE `".RL_DBPREFIX."listings` SET `Date` = NOW() WHERE `ID` =".$id;
$this -> query($sql);

$_response -> script("printMessage('notice', '{$lang['notice_listing_renewed']}')");
}

return $_response;
}



4. login to admin panel, go to languages page and add frontend phrase with key notice_listing_renewed and text Listing renewed



Its possible to improve function to limit it to one renew per hour or something like this, if you interested lets clarify how would be better, i will add it

Wei Hong
December 28, 2013, 05:50 AM
As i told here is alternative solution, its Renew Listing Date button this function is stand alone from the upgrade process and can be used if you dont charge your users for renewing listings


1. templates/yourtemplate/tpl/blocks/my_listing.tpl



{if !$listing.Featured_expire && $listing.Status == 'active' && $available_plans}
<a title="{$lang.make_featured}" class="nav_icon text_button" href="{$rlBase}{if $config.mod_rewrite}{$pages.upgrade_listing}/featured.html?id={$listing.ID}{else}?page={$pages. upgrade_listing}&id={$listing.ID}&featured{/if}">
{$lang.make_featured}
</a>
{/if}
<!--add this code, its for renew button-->
<a title="{$lang.renew}" class="nav_icon text_button" href="javascript:void(0)" onclick="xajax_renewListing({$listing.ID});">
<span class="left">*</span><span class="center">{$lang.renew}</span><span class="right">*</span>
</a>



2. includes/controllers/my_listings.inc.php



/* register ajax methods */
$rlXajax -> registerFunction( array( 'deleteListing', $rlListings, 'ajaxDeleteListing' ) );
$rlXajax -> registerFunction( array( 'renewListing', $rlListings, 'ajaxRenewListing' ) );//add this line



3. includes/classes/rlListings.class.php

add this function



function ajaxRenewListing( $id = false )
{
global $_response;

if ( !$id )
return;

$id = (int)$id;
if ( defined( 'IS_LOGIN' ) )
{
$sql ="UPDATE `".RL_DBPREFIX."listings` SET `Date` = 'NOW()' WHERE `ID` =".$id;
$this -> query($sql);

$_response -> script("printMessage('notice', '{$lang['notice_listing_renewed']}')");
}

return $_response;
}



4. login to admin panel, go to languages page and add frontend phrase with key notice_listing_renewed and text Listing renewed



Its possible to improve function to limit it to one renew per hour or something like this, if you interested lets clarify how would be better, i will add it

Wow, this is excellent. And the idea of limiting it to one renew per hour is also a great idea. Please do guide us. Thank you very much, Mike. Excellent job

Morgan Bohman
December 30, 2013, 08:42 AM
@Mike,
Hm this won't work for me as the text button is not visible. I have only a button for Uppgrade Listing?

Ok have the button now but nothing happens when clicking and when refreshing the listing still expired and the date is set to 1-11-30. Seems like the $sql ="UPDATE `".RL_DBPREFIX."listings` SET `Date` = 'NOW()' WHERE `ID` =".$id; set the date to 1-11-30 anyone in for help?

OK sorted it out ---> 'NOW()' have to be NOW() in the line above. But still the response line is something wrong with.
//Morgan

Morgan Bohman
December 31, 2013, 09:01 AM
Apart from the response message, this works great, but Mike, can you check if we could have the renew function inside admin panel also?

//Morgan

Mike
January 6, 2014, 11:41 AM
Hi Morgan,

Yes thanks, my mistake with 'NOW()', i have corrected it in instruction.
Ok here is for admin panel.


1.admin/tpl/listings.tpl



<script type="text/javascript">//<![CDATA[
var mass_actions = [
[lang['ext_activate'], 'activate'],
[lang['ext_suspend'], 'approve'],
{if 'delete'|in_array:$aRights.listings}[lang['ext_delete'], 'delete'],{/if}
[lang['ext_move'], 'move'],
[lang['ext_make_featured'], 'featured'],
[lang['ext_annul_featured'], 'annul_featured'], //also dont add comma here
[lang['ext_renew'], 'renew'] //add this line
];



2. includes/classes/admin/rlListings.class.php be carefull, dont mix with rlListings in classes directory

find function ajaxMassActions and modify as shown below



function ajaxMassActions( $ids = false, $action = false )
{
global $_response, $rlSmarty, $config, $lang, $pages, $rlListingTypes;

if ( !$ids || !$action )
return $_response;

$GLOBALS['rlHook'] -> load('apPhpListingsMassActions', $ids, $action); //> 4.1.0

$ids = explode('|', $ids);
$this -> loadClass('Mail');

/* inform listing owner about status changing */
$mail_tpl = $GLOBALS['rlMail'] -> getEmailTemplate( $action == 'activate' ? 'listing_activated' : 'listing_deactivated' );
$this -> loadClass('Categories');
$this -> loadClass('Account');

$this -> loadClass('Notice');
if ( in_array($action, array('activate', 'approve')) )
{
...
}
elseif ( $action == 'delete' )
{
...
}
/*you have to add this condition*/
elseif( $action == 'renew' )
{
$sql ="UPDATE `".RL_DBPREFIX."listings` SET `Date` = 'NOW()' WHERE FIND_IN_SET(`ID`, '".$ids."')";
$this -> query($sql);
$_response -> script("printMessage('notice', '{$lang['notice_listing_renewed']}')");
}

Morgan Bohman
January 6, 2014, 12:44 PM
Thanks Mike, any clue why the response is not showing up? Checked the lang_key but only in swedish maybe needed in english too?
//Morgan

Morgan Bohman
January 6, 2014, 02:26 PM
Ok hope you meant admin/tpl/controllers/listings.tpl? The other one is hard to find exact right place to put in the code, can you show me specific? Anyway, I can not get this to work.

//Morgan

Drazen Corak
January 6, 2014, 04:34 PM
lang_key - must be User Interface not Common etc.. :)

Hi all, thanks on code for this function (Renew Listing Date button) but it is not full and not work corect for me - the ads in listing.tpl list dont go on top of ads only in listing box new ads. This is good function for special box with renew ads.
regards..

Mike
January 8, 2014, 09:56 AM
Thanks Mike, any clue why the response is not showing up? Checked the lang_key but only in swedish maybe needed in english too?
//Morgan

yes its admin/tpl/controllers/listings.tpl

i forgot to say that you have to add 'ext_renew' lang phrase with module 'ext' and text Renew

Mike
January 8, 2014, 09:57 AM
lang_key - must be User Interface not Common etc.. :)

Hi all, thanks on code for this function (Renew Listing Date button) but it is not full and not work corect for me - the ads in listing.tpl list dont go on top of ads only in listing box new ads. This is good function for special box with renew ads.
regards..

That means your listings order is not Date by default and seems customized

Petrache Nicolae
January 9, 2014, 10:13 AM
As i told here is alternative solution, its Renew Listing Date button this function is stand alone from the upgrade process and can be used if you dont charge your users for renewing listings
Its possible to improve function to limit it to one renew per hour or something like this, if you interested lets clarify how would be better, i will add it

hello Mike. can you provide some details about this? exactly how should be used.

my case is 1 type of plan wich allows 1 free ad with unlimited use.

should i make this plan valid for 31 days and after that the ad expires and the user can click on renew button and the ad is renewed with 31 days and moved in the top of the ads list?
or
should i make the plan valid for 9999 days and after 100 days (for instance) the user clicks on renew button and the ad is is renewed with 31 days and moved in the top of the ads list?

what about the "Upgrade listing plan" button? if we have just 1 single plan, why this is not hidden by the script? users will get confused about this. a fix for this bug please?

the first part of the thread dealed with this "Upgrade listing plan" button wich worked ok, the ad was renewed with another 31 days and moved as first but had 2 issues - it can be used at every minute and by each every minute use the date would stack up.

Drazen Corak
January 9, 2014, 05:16 PM
That means your listings order is not Date by default and seems customized

Hi Mike F. thanks for the reply, can you tell me where I can check the listing order date in which file?

Morgan Bohman
January 12, 2014, 08:42 AM
@Mike, the message for the user after renewing the listing doesn't work for me. Have the key's in user and ext module and the sql update is OK, the listing adds up on first place but message doesn't pop up.

//Morgan

Mike
January 16, 2014, 11:17 AM
Hi Mike F. thanks for the reply, can you tell me where I can check the listing order date in which file?

It's includes/classes/rlListings.class.php function getListings

i have looked into it and it seems default order is not date.. strange.

Ok, to fix issue open above mentioned function and find code


$sql .= "ORDER BY `Featured` DESC ";
if ( $custom_order )
{
$sql .= ", `{$custom_order}` ". strtoupper($order_type) . " ";
}
elseif ( $order )
{
switch ($sorting[$order]['Type']){
case 'price':
case 'unit':
case 'mixed':
$sql .= ", ROUND(`T1`.`{$order}`) " . strtoupper($order_type) . " ";
break;

case 'select':
if ( $sorting[$order]['Key'] == 'Category_ID' )
{
$sql .= ", `T3`.`Key` " . strtoupper($order_type) . " ";
}
else
{
$sql .= ", `T1`.`{$order}` " . strtoupper($order_type) . " ";
}
break;

default:
$sql .= ", `T1`.`{$order}` " . strtoupper($order_type) . " ";
break;
}
}

$sql .= ", `ID` DESC ";


and change last line with

$sql .= ", `T1`.`Date` DESC ";

I think it will fix your problem.

Mike
January 16, 2014, 11:20 AM
@Mike, the message for the user after renewing the listing doesn't work for me. Have the key's in user and ext module and the sql update is OK, the listing adds up on first place but message doesn't pop up.

//Morgan

try to replace {$lang['notice_listing_renewed']}

with just text



$_response -> script("printMessage('notice', 'listing renewed')");


if it worked problem is in lang module, try to change then to common instead of ex, maybe i was wrong with module..
if no luck please pm me details i will check

Wei Hong
January 19, 2014, 09:00 PM
Hi Mike
You have been very helpful with this particular idea. But could you please help guide us how to limit the Renew Listing Date button / or even upgrade plan button to a specific time like: 1 hour, 2 hours, or 1 day, 2 days?

Drazen Corak
January 20, 2014, 08:21 AM
Thanks Mike F. now it work. Jes I did not have date in that line. Thank you.

Mike
January 20, 2014, 10:30 AM
Please clarify,

Limit to use the button one time per hour for each listing, in other words you may renew all your listings one time per hour
Or one time per hour no matter for what listing, you will need to choose what listing to renew

Wei Hong
January 20, 2014, 06:00 PM
Hi Mike,
Thank you for your throughout thought.
I think this is the best bet
" Limit to use the button one time per hour for each listing, in other words you may renew all your listings one time per hour"

Petrache Nicolae
January 20, 2014, 06:02 PM
both solution would be apreciated becouse some may want the first case and others the second. thanks Mike

Wei Hong
February 21, 2014, 05:57 PM
Hi guys,
I come back to this thread because I reinstalled a clean 4.2 and John's code is no longer work.
The 4.2 is default as renew the posting date when we change the plan. But it doesn't make the listing to top. Renewed listings has a new posting dates and will remain buried in 4.2
Please look at the screeenshot.
John code was working in 4.1 though. And now 4.3 is released.

816

Is there any fix for this?

Petrache Nicolae
February 21, 2014, 06:38 PM
any buyer of this script is requesting a solution to this, since this is how the rest of the scripts works and flynax decided to keep the head under the ground ignoring this crucial feature. i gues we all expected a miracle regarding this in 4.3 but we were hopeing in vain.

Wei Hong
February 21, 2014, 07:23 PM
Did you have a chance to try 4.3 ? I really hope this will work out. I spent too much time and money for flynax already.

Petrache Nicolae
February 21, 2014, 07:38 PM
yes, i have made the upgrade to 4.3 but beside this, no changes. i wait for the reponsive template and after that i can finish my website by adding my changes and most likely, pay flynax to do what they shoulded done by default with this issue.

Wei Hong
February 21, 2014, 07:57 PM
Great idea, I was planning to up to 4.3 but I guess I will wait for the responsive template as well as John has confirmed that it will be released by the end of this week.
Just 1 question Petrache. Does 4.3 have the same issue about listing not moving to top after renewing but have a renew posting date?

Petrache Nicolae
February 21, 2014, 08:15 PM
just tested...on renew, the listing goes up as it should, the time period ads up as it should but this can be used endless wich is not ok.
my bigest issue right now is that the cron is not ok (even if i use the same setting as in 4.1/4.2 and now, in general, i do not get the emails that notify me that in x days the listing will expire.

Wei Hong
February 21, 2014, 10:55 PM
Humh, that is odd. Look at my screenshot. Upon renew, listing stay buried. Not going up. And I didn't mess anything here. I only have flynax supporter fixed some bug here and there. I just one of them conflicted.

Liridon Sokoli
October 4, 2018, 08:56 AM
Hi Guys,
I see you have fierce discussion here, let me take a part in it...
So main question is: why the listing posting date remains the same after renew?
I can explain why, firstly: the Renew/Update option relates to the listing plan and not the listing itself,
you can easily check it by putting the mouse cursor on the icon.
Secondly: The listing date remains the same because the seller sells the same house
and nothing changed there. Visitors who already saw this house will not check it again because they
don't want it.

I just explain you our concept but if you want to change the logic just apply the following changes
or contact our support and they will do changes for free fro you:
1. Open the file: /includes/classes/rlListings.class.php
2. Find the code (line ~2775):


$update = array(
'fields' => array(
'Pay_date' => $upgrade_date,
'Plan_ID' => $plan_id,
'Cron_notified' => '0'
),
'where' => array(
'ID' => $listing_id
)
);

3. Replace with the cod:


$update = array(
'fields' => array(
'Pay_date' => $upgrade_date,
'Date' => 'NOW()',
'Plan_ID' => $plan_id,
'Cron_notified' => '0'
),
'where' => array(
'ID' => $listing_id
)
);

4. You should find the same code statement a bit bellow, right after code line:

case 'package':
do the same changes there.
5. Open the file: /includes/controllers/upgrade_listing.inc.php
6. Find the code (line~ 366):


$update = array(
'fields' => array(
'Plan_ID' => $plan_info['ID'],
'Pay_date' => $upgrade_date,
'Featured_ID' => $update_featured_id,
'Featured_date' => $upgrade_featured_date,
'Last_type' => $listing_mode
),
'where' => array(
'ID' => $listing_id
)
);

7. Replace with the code:


$update = array(
'fields' => array(
'Plan_ID' => $plan_info['ID'],
'Pay_date' => $upgrade_date,
'Date' => 'NOW()',
'Featured_ID' => $update_featured_id,
'Featured_date' => $upgrade_featured_date,
'Last_type' => $listing_mode
),
'where' => array(
'ID' => $listing_id
)
);


John



Renew / Upgrade Package only when we click this button to have the expiration date from that package, not to add plus date but remain from posting to expiration date.

I'm not telling you to hide anything,

Added Sep 28, 2018
Active till Nov 29, 2018

Added Sep 28, 2018
Active till Dec 30, 2018


Added Sep 28, 2018
Active till Jan 30, 2019

I want this to be posting like this at first only 31 days term not for 4 months more,
after each Renew / Upgrade Package

from the day of posting for 31 days, not more than


Added: Sep 28, 2018
Active: till Oct 29, 2018

if I do the date

Added: Sep 20, 2018
Active: till Oct 21, 2018

only the time limit is set.


look video : https://youtu.be/FDbMS5LB8i0

Rudi
October 4, 2018, 09:15 AM
Hello,

You already have a ticket regarding your issue and suggested two possible ways to solve it
please, follow one of them or keep discussion in the ticket