Osclass forums

Support forums => General help => 3.6.x => Topic started by: Aficionado on December 08, 2016, 05:05:54 pm

Title: Let the poster select Ad Duration Time
Post by: Aficionado 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
Title: Re: Let the poster select Ad Duration Time
Post by: Liath 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.
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado 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.


Title: Re: Let the poster select Ad Duration Time
Post by: _CONEJO 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>
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado 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.

 :(
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado 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
Title: Re: Let the poster select Ad Duration Time
Post by: Liath 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
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado 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.

Title: Re: Let the poster select Ad Duration Time
Post by: Liath 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?
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado 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.
Title: Re: Let the poster select Ad Duration Time
Post by: _CONEJO 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?
Title: Re: Let the poster select Ad Duration Time
Post by: Liath 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
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado on December 19, 2016, 10:16:44 am
@Liath is the plugin available at Market, i can't find it ?

Thanks
Title: Re: Let the poster select Ad Duration Time
Post by: theinvisible 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
Title: Re: Let the poster select Ad Duration Time
Post by: Liath 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
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado on January 05, 2017, 03:09:03 pm
Still i can't find it anywhere.
Title: Re: Let the poster select Ad Duration Time
Post by: Liath on January 05, 2017, 05:57:03 pm
should be available soon
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado on January 23, 2017, 12:03:48 pm
Hi Liath.

Still no news.
Title: Re: Let the poster select Ad Duration Time
Post by: Liath on January 23, 2017, 06:09:04 pm
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.



Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado on January 23, 2017, 06:25:56 pm
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.

Pitty.
Title: Re: Let the poster select Ad Duration Time
Post by: Liath on January 23, 2017, 06:32:20 pm
If you want, you can test it by your own, maybe it is in due of my configuration.... i dont know  :-\
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado on January 23, 2017, 07:40:06 pm
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.


How can we replicate this ? I tested/posted 30+ ads with various durations in various categories and didn't foudn that.

Any hint on this ?
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado on January 23, 2017, 07:41:34 pm
If you want, you can test it by your own, maybe it is in due of my configuration.... i dont know  :-\

I did.

1. The No Change as a first option what does it mean ? Obscure to the poster ...

2. One Day duration doesn't work, defaults to 365. Not important since 1 day ad doesn't really exist.

I will check more and come back.

 ;)

(ps: do you mind if i -try to- mirror your Osclass part of your site ? in English ....)
Title: Re: Let the poster select Ad Duration Time
Post by: Liath on January 23, 2017, 07:46:18 pm
1. The No Change as a first option what does it mean ? Obscure to the poster ...
it should be only available in edit ads not in publish...


2. One Day duration doesn't work, defaults to 365. Not important since 1 day ad doesn't really exist.
maybe someone want to publish a short time offer  ;D


I will check more and come back.
thank you :)

(ps: do you mind if i -try to- mirror your Osclass part of your site ? in English ....)
no, do what you think you want to do :)
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado on January 23, 2017, 07:50:15 pm
If you want, you can test it by your own, maybe it is in due of my configuration.... i dont know  :-\

2. One Day duration doesn't work, defaults to 365. Not important since 1 day ad doesn't really exist.

Apparently the 1 day defaults to the category expiration and in my case it was 365.
Title: Re: Let the poster select Ad Duration Time
Post by: Liath on January 23, 2017, 07:52:18 pm
i thought so, then I have to rework something on this


edited previous post
Title: Re: Let the poster select Ad Duration Time
Post by: Liath on January 23, 2017, 08:35:33 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  ::)



Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado on August 19, 2017, 12:59:20 am
Liath, the NO CHANGE appears to new ads also. Could that be fixed, i really like this plugin.
Title: Re: Let the poster select Ad Duration Time
Post by: Liath on August 19, 2017, 01:03:44 am
after finishing the spam & protection completely, i want to finish this plugin... i need to change something more
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado on August 19, 2017, 01:08:33 am
after finishing the spam & protection completely, i want to finish this plugin... i need to change something more

Great !!!
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado 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
Title: Re: Let the poster select Ad Duration Time
Post by: Liath 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
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado 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 .....

 :-[
Title: Re: Let the poster select Ad Duration Time
Post by: Liath 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
Title: Re: Let the poster select Ad Duration Time
Post by: _CONEJO 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?
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado 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.
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado 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
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado 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.

 :'( :'( :'(
Title: Re: Let the poster select Ad Duration Time
Post by: Liath on September 09, 2017, 10:30:33 pm
i'll check it and send it to you
Title: Re: Let the poster select Ad Duration Time
Post by: Liath on September 10, 2017, 02:37:21 am
mail is sended
Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado 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.

Title: Re: Let the poster select Ad Duration Time
Post by: Aficionado on September 26, 2018, 09:18:15 am
Maybe someone could adopt this plugin and finish it.