Support Forums

Renewal question

This is a discussion on Renewal question within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Hi, I noticed when I upgrade an ad, the renewal option has no limit. So we can renew without limit. ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 05-06-2009, 04:27 PM   #1
Customer
 
hel68c's Avatar
 
Join Date: Jun 2008
Location: Canada, Quebec
Posts: 289
Rep Power: 22
hel68c is just really nice hel68c is just really nice
Default Renewal question

Hi,

I noticed when I upgrade an ad, the renewal option has no limit. So we can renew without limit.

To correct this problem , I would like to display the renewal option only inside 7 days .

I downloaded the date_diff Smarty function (it calculates the number of days between 2 dates).

{date_diff date1=$oDate date2=$smarty.now interval="days"}

I can't manage how to compare the result of date_diff

I tried :
Quote:
{if date_diff date1=$oDate date2=$smarty.now interval="days" <=$renewalDays}
display option renewal
{/if}
I receive a Smarty error

Do you know how I can compare with this function or maybe you find something else that can help me.
__________________
Serge
HobbyClassified.com
V4.08 Developper, Module installed (CIV Scam Filter, Maffo Location System, Maffo News,Youtube, Seller Store)

Last edited by hel68c; 05-06-2009 at 04:33 PM.
hel68c is offline   Reply With Quote
Old 05-06-2009, 05:44 PM   #2
curmudgeon
 
Join Date: Mar 2006
Posts: 5,413
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

get rid of the plugin.

I think you are making this a lot more complicated than it needs to be...

{if $entry.expiration|strtotime <= "+7 day"|strtotime}
renew link here
{/if}
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 05-07-2009, 07:53 AM   #3
Customer
 
hel68c's Avatar
 
Join Date: Jun 2008
Location: Canada, Quebec
Posts: 289
Rep Power: 22
hel68c is just really nice hel68c is just really nice
Default

indeed this method is less complicated and more efficient.

Thanks you Lhotch
__________________
Serge
HobbyClassified.com
V4.08 Developper, Module installed (CIV Scam Filter, Maffo Location System, Maffo News,Youtube, Seller Store)
hel68c is offline   Reply With Quote
Old 05-16-2009, 09:40 AM   #4
Customer
 
Join Date: Mar 2008
Location: ireland
Posts: 105
Rep Power: 17
markstanden is on a distinguished road
Default

Hi,

I have the same problem, users are renewing more then once.

Which file(s) did you edit with the above code?

Thanks for any help

Mark
markstanden is offline   Reply With Quote
Old 11-01-2009, 04:38 PM   #5
Junior Member
 
Join Date: Sep 2009
Posts: 11
Rep Power: 9
s2kpunisher is on a distinguished road
Default

I would also like to know what page this can be edited. I'm using v4.1.6 with fluid style templates.

Thanks in advance!
s2kpunisher is offline   Reply With Quote
Old 11-01-2009, 08:52 PM   #6
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 135
Eric Barnes is just really nice Eric Barnes is just really nice
Default

I believe this would be in userbrowselistings.tpl
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 11-02-2009, 02:54 AM   #7
Junior Member
 
Join Date: Sep 2009
Posts: 11
Rep Power: 9
s2kpunisher is on a distinguished road
Default

Quote:
Originally Posted by Lhotch
get rid of the plugin.

I think you are making this a lot more complicated than it needs to be...

{if $entry.expiration|strtotime <= "+7 day"|strtotime}
renew link here
{/if}
PHP Code:
<tr>
        <
th>{$smarty.const.LANG_TITLE}</th>
        <
th>{$smarty.const.LANG_LISTING_ACTIVE}</th>
        <
th>{$smarty.const.LANG_LISTING_EXPIRATION}</th>
        <
th>{$smarty.const.LANG_LISTING_MODIFY}</th>
        <
th>{$smarty.const.LANG_LISTING_DELETE}</th>
    </
tr>
    {if 
$results}
        {foreach 
from=$results item="entry"}
        <
tr>
             <
td class="{cycle values="row1,row2" advance=false}">{$entry.title}</td>
             <
td class="{cycle values="row1,row2" advance=false}">
              {if 
$entry.expirationTime $smarty.now}
                 {
$smarty.const.LANG_EXPIRED}
             {elseif 
$entry.display == "Y"}
                 {
$smarty.const.LANG_YES}
             {elseif 
$entry.oStatus == 3}
                 
Pending Payment
             
{else}
                 {
$smarty.const.LANG_NO}
             {/if}
             </
td>
             <
td class="{cycle values="row1,row2" advance=false}">
                 {
$entry.expiration|date_format:$dateformat}
                 
                 {if 
$entry.oStatus == || $entry.oStatus==4}
                 &
nbsp;
                 {elseif 
$entry.renew}
                     <
br /><a href="userrenew.php?action=renew&listingid={$entry.id}&orderid={$entry.orderID}">{$smarty.const.LANG_LISTING_CLICK_TO_RENEW}</a>
                 {else}
                     <
br /><a href="userrenew.php?action=renew&listingid={$entry.id}&orderid={$entry.orderID}">{$smarty.const.LANG_LISTING_UPGRADE}</a>
                 {/if}
             </
td>
             {if 
$entry.oStatus==|| $entry.oStatus==4}
             <
td class="{cycle values="row1,row2" advance=false}"><input type="button" value="{$smarty.const.LANG_MAKE_PAYMENT}" onClick="MM_goToURL('parent','usercheckout.php?step=6&listingid={$entry.id}&productid={$entry.oProductID}');return document.MM_returnValue" /></td>
             {else}
             <
td class="{cycle values="row1,row2" advance=false}"><input type="button" value="{$smarty.const.LANG_LISTING_MODIFY}" onClick="MM_goToURL('parent','usermodifylisting.php?view={$entry.id}');return document.MM_returnValue" /></td>
             {/if}
             <
td class="{cycle values="row1,row2" advance=true}"><input type="button" value="{$smarty.const.LANG_LISTING_DELETE}" onClick="delrec('{$entry.id}')" /></td>
        </
tr
I'm still learning all this PHP programming (I'm pretty much still a beginner). Where exactly does the code you posted go Lhotch, my setup looks a little more elaborate I think you could say.
s2kpunisher is offline   Reply With Quote
Old 11-02-2009, 08:18 AM   #8
curmudgeon
 
Join Date: Mar 2006
Posts: 5,413
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

None of that is php programming, its smarty and html.

As I showed in my quote, the smarty code goes around the link to renew the ad.

Code:
{if $entry.expiration|strtotime <= "+7 day"|strtotime}
<br /><a href="userrenew.php?action=renew&listingid={$entry.id}&orderid={$entry.orderID}">{$smarty.const.LANG_LISTING_CLICK_TO_RENEW}</a> 
{/if}
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Renewal Bug? bbncu Technical Support 4 04-21-2009 11:41 AM
Renewal question hel68c Technical Support 29 04-08-2009 09:35 AM


All times are GMT -4. The time now is 08:20 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0