Osclass forums
Support forums => General help => 3.6.x => Topic started 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
-
Nice thought, should not be too much effort to implement as a plugin. Will think about it.
-
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.
-
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
<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>
-
Well, if so, then some Themes are based on Bender (OsclassWizards). But even Bender doesn't have that included.
:(
-
My mistake. Works ok. Just i had to select a category first.
Thanks. Pitty theme developers don't use that.
:D
-
Damn... i've just finished the plugin version and uploaded to the market ;D ;D ;D
maybe someone have a use for it xD
-
Liath: a plugin is needed since the duration values are hardcoded and so must be edited in each update.
-
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?
-
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.
-
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?
-
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
-
@Liath is the plugin available at Market, i can't find it ?
Thanks
-
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 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
-
Still i can't find it anywhere.
-
should be available soon
-
Hi Liath.
Still no news.
-
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.
-
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.
-
If you want, you can test it by your own, maybe it is in due of my configuration.... i dont know :-\
-
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 ?
-
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 ....)
-
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 :)
-
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.
-
i thought so, then I have to rework something on this
edited previous post
-
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, the NO CHANGE appears to new ads also. Could that be fixed, i really like this plugin.
-
after finishing the spam & protection completely, i want to finish this plugin... i need to change something more
-
after finishing the spam & protection completely, i want to finish this plugin... i need to change something more
Great !!!
-
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
-
yes, there are not all durations calculated correctly... this is why i need to work on this plugin
-
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 .....
:-[
-
yes, it isn't too much work, but at first i want to finish the antispam plugin
-
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?
-
I was right about what?
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?
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.
-
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
<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
-
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.
:'( :'( :'(
-
i'll check it and send it to you
-
mail is sended
-
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.
-
Maybe someone could adopt this plugin and finish it.