Hi @bexhu
Later, I want to sum the time on each new row. I planned to make it with php but it seems php is deprecated on pods.
This is indeed more complex and cannot be done with Pods templates (PHP should never be used inside Pods templates!!).
The best way to do this is to create your own PHP templates in your theme or plugin. You could assign those to a shortcode.
You can use the WordPress core functions to create these layouts.
See functions like get_post_meta and add_shortcode.
I tried to convert int to h:m:s format, using {@audio_duration,gmdate(H:i:s)} without success.
You’ll also need functions to convert a number to a time length.
Something I quickly found online: https://www.hashbangcode.com/article/converting-and-decimal-time-php
Good luck!
Cheers, Jory
Thread Starter
bexhu
(@bexhu)
You can use the WordPress core functions to create these layouts.
See functions like get_post_meta and add_shortcode.
Thank You, Jory
You’ll also need functions to convert a number to a time length.
Something I quickly found online: https://www.hashbangcode.com/article/converting-and-decimal-time-php
I’ll check
btw, want to share how I solved
function duration($secDuration){
$seconds = intval($secDuration%60);
$totalMinutes = intval($secDuration/60);
$minutes = $totalMinutes%60;
$hours = intval($totalMinutes/60);
$timerFormat = "$hours:$minutes:$seconds";
return $timerFormat;
}
On Pods {@duration,timerFormat}
Cheers, Bexhu 🙂