Hello, thank you @dev101
for those who want translation, here is the change in the code
For standard ad:
<?php
$pubdate = osc_item_field("dt_pub_date");
$pubdateformat = strtotime($pubdate);
$now = time();
$diff = $now - $pubdateformat;
$diffhours = floor($diff/3600);
$diffminutes = floor($diff/60);
$zero = 0;
$oneminute = 1;
$sixtyminutes = 60;
$onehour = 1;
$oneday = 24;
$twodays = 48;
$threedays = 72;
$fourdays = 96;
$fivedays = 120;
$sixdays = 144;
$sevendays = 168;
$eightdays = 192;
$ninedays = 216;
$tendays = 240;
$elevendays = 264;
$twelvedays = 288;
$thirteendays = 312;
$fourteendays = 336;
$fifteendays = 360;
//$sixteendays = 384;
//$seventeendays = 408;
if ($diffminutes == $zero) {_e(' just posted!', 'YourThemeName') ;}
else if ($diffminutes == $oneminute) {_e(' 1 minute ago', 'YourThemeName') ;}
else if ($diffminutes > $oneminute && $diffminutes < $sixtyminutes) {echo $diffminutes;_e(' minutes ago', 'YourThemeName') ;}
else if ($diffhours == $onehour) {_e(' 1 hour ago', 'YourThemeName') ;}
else if ($diffhours > $onehour && $diffhours < $oneday) {echo $diffhours;_e(' hours ago', 'YourThemeName') ;}
else if ($diffhours >= $oneday && $diffhours < $twodays) {_e(' 1 day ago', 'YourThemeName') ;}
else if ($diffhours >= $twodays && $diffhours < $threedays) {_e(' 2 days ago', 'YourThemeName') ;}
else if ($diffhours >= $threedays && $diffhours < $fourdays) {_e(' 3 days ago', 'YourThemeName') ;}
else if ($diffhours >= $fourdays && $diffhours < $fivedays) {_e(' 4 days ago', 'YourThemeName') ;}
else if ($diffhours >= $fivedays && $diffhours < $sixdays) {_e(' 5 days ago', 'YourThemeName') ;}
else if ($diffhours >= $sixdays && $diffhours < $sevendays) {_e(' 6 days ago', 'YourThemeName') ;}
else if ($diffhours >= $sevendays && $diffhours < $eightdays) {_e(' 1 week ago', 'YourThemeName') ;}
else if ($diffhours >= $eightdays && $diffhours < $ninedays) {_e(' 8 days ago', 'YourThemeName') ;}
else if ($diffhours >= $ninedays && $diffhours < $tendays) {_e(' 9 days ago', 'YourThemeName') ;}
else if ($diffhours >= $tendays && $diffhours < $elevendays) {_e(' 10 days ago', 'YourThemeName') ;}
else if ($diffhours >= $elevendays && $diffhours < $twelvedays) {_e(' 11 days ago', 'YourThemeName') ;}
else if ($diffhours >= $twelvedays && $diffhours < $thirteendays) {_e(' 12 days ago', 'YourThemeName') ;}
else if ($diffhours >= $thirteendays && $diffhours < $fourteendays) {_e(' 13 days ago', 'YourThemeName') ;}
else if ($diffhours >= $fourteendays && $diffhours < $fifteendays) {_e(' 2 weeks ago', 'YourThemeName') ;}
//else if ($diffhours >= $fifteendays && $diffhours < $sixteendays) {_e(' 15 days ago', 'YourThemeName') ;}
//else if ($diffhours >= $sixteendays && $diffhours < $seventeendays) {_e(' 16 days ago', 'YourThemeName') ;}
else if ($diffhours > $fifteendays) {echo osc_format_date(osc_item_pub_date());}
?>
For Premium ad:
<?php
$pubdate = osc_premium_field("dt_pub_date");
$pubdateformat = strtotime($pubdate);
$now = time();
$diff = $now - $pubdateformat;
$diffhours = floor($diff/3600);
$diffminutes = floor($diff/60);
$zero = 0;
$oneminute = 1;
$sixtyminutes = 60;
$onehour = 1;
$oneday = 24;
$twodays = 48;
$threedays = 72;
$fourdays = 96;
$fivedays = 120;
$sixdays = 144;
$sevendays = 168;
$eightdays = 192;
$ninedays = 216;
$tendays = 240;
$elevendays = 264;
$twelvedays = 288;
$thirteendays = 312;
$fourteendays = 336;
$fifteendays = 360;
//$sixteendays = 384;
//$seventeendays = 408;
if ($diffminutes == $zero) {_e(' just posted!', 'YourThemeName') ;}
else if ($diffminutes == $oneminute) {_e(' 1 minute ago', 'YourThemeName') ;}
else if ($diffminutes > $oneminute && $diffminutes < $sixtyminutes) {echo $diffminutes;_e(' minutes ago', 'YourThemeName') ;}
else if ($diffhours == $onehour) {_e(' 1 hour ago', 'YourThemeName') ;}
else if ($diffhours > $onehour && $diffhours < $oneday) {echo $diffhours;_e(' hours ago', 'YourThemeName') ;}
else if ($diffhours >= $oneday && $diffhours < $twodays) {_e(' 1 day ago', 'YourThemeName') ;}
else if ($diffhours >= $twodays && $diffhours < $threedays) {_e(' 2 days ago', 'YourThemeName') ;}
else if ($diffhours >= $threedays && $diffhours < $fourdays) {_e(' 3 days ago', 'YourThemeName') ;}
else if ($diffhours >= $fourdays && $diffhours < $fivedays) {_e(' 4 days ago', 'YourThemeName') ;}
else if ($diffhours >= $fivedays && $diffhours < $sixdays) {_e(' 5 days ago', 'YourThemeName') ;}
else if ($diffhours >= $sixdays && $diffhours < $sevendays) {_e(' 6 days ago', 'YourThemeName') ;}
else if ($diffhours >= $sevendays && $diffhours < $eightdays) {_e(' 1 week ago', 'YourThemeName') ;}
else if ($diffhours >= $eightdays && $diffhours < $ninedays) {_e(' 8 days ago', 'YourThemeName') ;}
else if ($diffhours >= $ninedays && $diffhours < $tendays) {_e(' 9 days ago', 'YourThemeName') ;}
else if ($diffhours >= $tendays && $diffhours < $elevendays) {_e(' 10 days ago', 'YourThemeName') ;}
else if ($diffhours >= $elevendays && $diffhours < $twelvedays) {_e(' 11 days ago', 'YourThemeName') ;}
else if ($diffhours >= $twelvedays && $diffhours < $thirteendays) {_e(' 12 days ago', 'YourThemeName') ;}
else if ($diffhours >= $thirteendays && $diffhours < $fourteendays) {_e(' 13 days ago', 'YourThemeName') ;}
else if ($diffhours >= $fourteendays && $diffhours < $fifteendays) {_e(' 2 weeks ago', 'YourThemeName') ;}
//else if ($diffhours >= $fifteendays && $diffhours < $sixteendays) {_e(' 15 days ago', 'YourThemeName') ;}
//else if ($diffhours >= $sixteendays && $diffhours < $seventeendays) {_e(' 16 days ago', 'YourThemeName') ;}
else if ($diffhours > $fifteendays) {echo osc_format_date(osc_premium_pub_date());}
?>
I use a path for two files without functions (optional): <?php osc_current_web_theme_path('NameOfYourFileStandardAd.php') ; ?>
<?php osc_current_web_theme_path('NameOfYourFilePremiumAd.php') ; ?>
Regards