Advertisement:

Author Topic: Let the poster select Ad Duration Time  (Read 6837 times)

Aficionado

  • Guest
Re: Let the poster select Ad Duration Time
« Reply #30 on: September 04, 2017, 02:10:17 am »
It seems to be a major flow in this plugin.

1. Using your plugin i selected a TWO (2) days duration. Using the RENEW plugin of Cartagena i see that the ad is expiring in 364 days and 23 hours and 59 minutes. And that is wrong.

2. Disabling your plugin and creating a category with 2 days duration, i see in the RENEW plugin that the ad is expiring in 23 hours 59 minutes and 59 seconds. And that is Correct.

 :o

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: Let the poster select Ad Duration Time
« Reply #31 on: September 04, 2017, 02:12:46 am »
yes, there are not all durations calculated correctly... this is why i need to work on this plugin

Aficionado

  • Guest
Re: Let the poster select Ad Duration Time
« Reply #32 on: September 04, 2017, 02:15:17 am »
yes, there are not all durations calculated correctly... this is why i need to work on this plugin

So Daniel (_Conejo) was right after all about it .....

 :-[

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: Let the poster select Ad Duration Time
« Reply #33 on: September 04, 2017, 02:34:14 am »
yes, it isn't too much work, but at first i want to finish the antispam plugin

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4689
Re: Let the poster select Ad Duration Time
« Reply #34 on: September 04, 2017, 11:31:53 am »
yes, there are not all durations calculated correctly... this is why i need to work on this plugin

So Daniel (_Conejo) was right after all about it .....

 :-[

I was right about what?

Aficionado

  • Guest
Re: Let the poster select Ad Duration Time
« Reply #35 on: September 04, 2017, 02:48:41 pm »


I was right about what?


Quote
after looking at the code,the date seems to not be checked against the category limit. the select/dropdown is, but not when inserting the data, we should fix thator an user may set a non expired listing.

with the liath's plugin, you need to modify your theme with each update, why not use the proper hooks to do it?

Quote
After reviewing the plugin, they found an issue that the ad duration was set to unlimited in some cases, i didnt found the error for now and didnt uploaded it again.

Aficionado

  • Guest
Re: Let the poster select Ad Duration Time
« Reply #36 on: September 07, 2017, 12:37:38 am »
No need for a plugin, it's already in the core, the theme needs to include it :
https://github.com/osclass/Osclass/blob/master/oc-includes/osclass/ItemActions.php#L1184
and
https://github.com/osclass/Osclass/blob/master/oc-includes/osclass/frm/Item.form.class.php#L333-L391


Just add it to your theme's form from ItemForm or maybe create it manually (to add jQuery's datepicker for example). It works with datetime values (yyyy-mm-dd hh:mm:ss) or with integer (X days). It checks against the category's expiration limit too.


For bender, you could add the following to item-post.php

Code: [Select]
                        <div class="control-group">
                            <label class="control-label" for="description[<?php echo osc_current_user_locale(); ?>]"><?php _e('Expiration''bender'); ?></label>
                            <div class="controls">
                                <?php ItemForm::expiration_select(); ?>
                            </div>
                        </div>

_CONEJO that works great (with OsclasWizards classic theme) when posting an ad, but not when editing. When editing the div shows with the form selector empty.

Any help on this ?

Thanks

Aficionado

  • Guest
Re: Let the poster select Ad Duration Time
« Reply #37 on: September 09, 2017, 05:31:18 pm »
Apparently the 1 day defaults to the category expiration and in my case it was 365.


Found my error and fixed it. I didnt checked for right variable on new ads posts, so durations was only saved if you have edited an ad  ::)

Liath could i have that version via email (you have my email) ?

Using the code for Bender doesn't seem to work right for me (in edit ad) and i need that, so your plugin could rescue me.

 :'( :'( :'(
« Last Edit: September 09, 2017, 10:47:37 pm by Aficionado »

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: Let the poster select Ad Duration Time
« Reply #38 on: September 09, 2017, 10:30:33 pm »
i'll check it and send it to you

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: Let the poster select Ad Duration Time
« Reply #39 on: September 10, 2017, 02:37:21 am »
mail is sended

Aficionado

  • Guest
Re: Let the poster select Ad Duration Time
« Reply #40 on: September 10, 2017, 04:43:09 am »
mail is sended

Got it and as i already wrote you, the only thing needed is to check the category limit and NOT show values greater.

It seems it already checks for cat limits when computing/saving.


Aficionado

  • Guest
Re: Let the poster select Ad Duration Time
« Reply #41 on: September 26, 2018, 09:18:15 am »
Maybe someone could adopt this plugin and finish it.