Advertisement:

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

Aficionado

  • Guest
Let the poster select Ad Duration Time
« on: December 08, 2016, 05:05:54 pm »
Hi !

Is there a way to let all poster to choose the Ad Duration time (maybe from a preconfigured array of time) ?

Sometimes it is needed to post an ad with (for example) a short TTL and not the preconfigured of the category.

Thanks

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: Let the poster select Ad Duration Time
« Reply #1 on: December 08, 2016, 05:11:58 pm »
Nice thought, should not be too much effort to implement as a plugin. Will think about it.

Aficionado

  • Guest
Re: Let the poster select Ad Duration Time
« Reply #2 on: December 08, 2016, 05:32:19 pm »
Nice thought, should not be too much effort to implement as a plugin. Will think about it.

Nice to see that at least there are some people that really understand what is really missing from Osclass.

Not many do so.



_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4689
Re: Let the poster select Ad Duration Time
« Reply #3 on: December 08, 2016, 11:30:03 pm »
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>

Aficionado

  • Guest
Re: Let the poster select Ad Duration Time
« Reply #4 on: December 08, 2016, 11:47:54 pm »
Well, if so, then some Themes are based on Bender (OsclassWizards). But even Bender doesn't have that included.

 :(

Aficionado

  • Guest
Re: Let the poster select Ad Duration Time
« Reply #5 on: December 08, 2016, 11:53:26 pm »

My mistake. Works ok. Just i had to select a category first.

Thanks. Pitty theme developers don't use that.

 :D
« Last Edit: December 08, 2016, 11:59:17 pm by Aficionado »

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: Let the poster select Ad Duration Time
« Reply #6 on: December 09, 2016, 12:57:40 am »
Damn... i've just finished the plugin version and uploaded to the market  ;D ;D ;D


maybe someone have a use for it xD

Aficionado

  • Guest
Re: Let the poster select Ad Duration Time
« Reply #7 on: December 09, 2016, 01:40:23 am »
Liath: a plugin is needed since the duration values are hardcoded and so must be edited in each update.


Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: Let the poster select Ad Duration Time
« Reply #8 on: December 09, 2016, 02:00:43 am »

Ok... if someone need it, i hope its all ok with it and will published soon. But now i think about a good point from _CONEJO

It checks against the category's expiration limit too.

This isn't implemented for now in this plugin... should the category settings limit the plugin settings or vice versa?

Aficionado

  • Guest
Re: Let the poster select Ad Duration Time
« Reply #9 on: December 09, 2016, 02:38:16 am »


It checks against the category's expiration limit too.

This isn't implemented for now in this plugin... should the category settings limit the plugin settings or vice versa?

Yes that would be nice.

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4689
Re: Let the poster select Ad Duration Time
« Reply #10 on: December 09, 2016, 02:49:07 am »
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?

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: Let the poster select Ad Duration Time
« Reply #11 on: December 09, 2016, 05:15:58 am »
with the liath's plugin, you need to modify your theme with each update, why not use the proper hooks to do it?
there is an option to add automatically the selectbox to the item form, it can be used or, if someone want to add it in his template on specific position, he can use the function to implement, so changes after updates not really needed, only if you implement it by yourself


Yes that would be nice.
i will check this

Aficionado

  • Guest
Re: Let the poster select Ad Duration Time
« Reply #12 on: December 19, 2016, 10:16:44 am »
@Liath is the plugin available at Market, i can't find it ?

Thanks

theinvisible

  • Sr. Member
  • ****
  • Posts: 311
Re: Let the poster select Ad Duration Time
« Reply #13 on: December 23, 2016, 07:18:10 am »
Hi !

Is there a way to let all poster to choose the Ad Duration time (maybe from a preconfigured array of time) ?

Sometimes it is needed to post an ad with (for example) a short TTL and not the preconfigured of the category.

Thanks

Idea is good.  :D

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: Let the poster select Ad Duration Time
« Reply #14 on: December 23, 2016, 07:48:22 pm »
@Liath is the plugin available at Market, i can't find it ?

Thanks


sorry, there was a little error and i dont fixed it for now, will reupload it today