*

A.M

  • ***
  • 34 posts
Republish without expiration!
« on: May 09, 2023, 12:22:51 PM »
Hello there...

i know my idea looks a litle bit strange but yes, this is what i think about, to Republish without expiration!

for example if 60days comeover!, to make the button appear and able to Republishing it!

hope can find solution for this

thanks
« Last Edit: May 09, 2023, 12:40:21 PM by A.M »
iloveOsclass

*

MB Themes

Re: Republish without expiration!
« Reply #1 on: May 09, 2023, 07:04:13 PM »
There are plugins to achieve this (backoffice manager, osclass pay, core?)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

A.M

  • ***
  • 34 posts
Re: Republish without expiration!
« Reply #2 on: May 10, 2023, 12:26:58 PM »
There are plugins to achieve this (backoffice manager, osclass pay, core?)

i already have backoffice manager, but i can't find exact what im looking for!

yes i found: Allow users to republish listing anytime, not only when listing is about expire. (6)

this is good, but i can't put also time limit, 60days for example, and after that the button display:block!

you can't just let the users Republish anytime like what they want!, that's not ok, they must have specific time for this also,

i hope you understand me!



« Last Edit: May 10, 2023, 12:38:59 PM by A.M »
iloveOsclass

*

MB Themes

Re: Republish without expiration!
« Reply #3 on: May 11, 2023, 09:01:24 PM »
Well you might wrap that button into condition based on item publish date.
Like if its 50 days from publish, show button
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

A.M

  • ***
  • 34 posts
Re: Republish without expiration!
« Reply #4 on: May 11, 2023, 11:38:57 PM »
Well you might wrap that button into condition based on item publish date.
Like if its 50 days from publish, show button

how to code this?  :(
iloveOsclass

*

MB Themes

Re: Republish without expiration!
« Reply #5 on: May 12, 2023, 10:36:06 AM »
Something like this (many codes on google):
Code: [Select]
<?php
function dateDiff($date1$date2)
{
    
$date1_ts strtotime($date1);
    
$date2_ts strtotime($date2);
    
$diff $date2_ts $date1_ts;
    return 
abs(round($diff 86400));
}

if(
dateDiff(osc_item_pub_date(), date('Y-m-d H:i:s')) > 50) {
  ... 
show my button ...
}
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

A.M

  • ***
  • 34 posts
Re: Republish without expiration!
« Reply #6 on: May 12, 2023, 07:03:03 PM »
Something like this (many codes on google):
Code: [Select]
<?php
function dateDiff($date1$date2)
{
    
$date1_ts strtotime($date1);
    
$date2_ts strtotime($date2);
    
$diff $date2_ts $date1_ts;
    return 
abs(round($diff 86400));
}

if(
dateDiff(osc_item_pub_date(), date('Y-m-d H:i:s')) > 50) {
  ... 
show my button ...
}

yeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeees i did it by your help and ChapGPT,

the code you gaved it to me wasn't work at the begining try, but after i asked ChatGPT AI his help, it got worked perfect :D

-----------------------------------------------------------------------------------------------------------------------------------------

So we can say First this is the code:

Code: [Select]
<?php 
$item_pub_date 
osc_item_pub_date(); // Get the publication date of the item
$current_date date('Y-m-d H:i:s'); // Get the current date and time

// Calculate the difference in days between the publication date and the current date
$date_diff round((strtotime($current_date) - strtotime($item_pub_date)) / (60 60 24));

// Only display the "Republish" button if 30 or more days have passed since the publication date
if ($date_diff >= 30 && function_exists('republish_link_raw') && republish_link_raw(osc_item_id())) { ?>

    <a class="republish" href="<?php echo republish_link_raw(osc_item_id()); ?>" rel="nofollow"><?php _e('Republish''epsilon'); ?></a>
    <span class="delim">/</span>
<?php ?>

replace it with that code in user-item.php:

Code: [Select]
<?php if(function_exists('republish_link_raw') && republish_link_raw(osc_item_id())) { ?>
                    <a class="republish" href="<?php echo republish_link_raw(osc_item_id()); ?>" rel="nofollow"><?php _e('Republish''epsilon'); ?></a>
                    <span class="delim">/</span>
                  <?php ?>

2- you need to use Backoffice Manager Pro Plugin and active:

Allow users to republish listing anytime, not only when listing is about expire. (6)

Done

Thank you Buddy for your Help ;D


iloveOsclass

*

MB Themes

Re: Republish without expiration!
« Reply #7 on: May 15, 2023, 03:00:40 PM »
Cool ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots