![]() |
|
|||
|
Can we get RUNTIME in minutes and seconds?
And when I see "Runtime: 232.73", what exactly does that mean? Is that 232.73 seconds? Right now, I'm also getting strange behavior from the "Runtime" feature... Every few videos, one will upload with a "0" runtime, even when it's several minutes long. |
|
|||
|
To show duration in minutes and seconds, edit /tmplates/index.tpl
FIND Code:
Runtime: {$answers[i].duration|string_format:"%.2f"} |
Code:
{assign var=viddur value=$answers[i].duration}
{math equation="$viddur/60" format="%0.0f" assign=minutes}
{math equation="$viddur - ($minutes * 60)" format="%0.0f" assign=seconds}
{if $seconds < 0}
{math equation="$minutes - 1" assign=minutes}
{math equation="$seconds + 60" assign=seconds}
{/if}
Runtime: {$minutes}m{$seconds}s |
|
|
|||
|
Thanks for that, but it looks like the runtime has to be manually changed in several templates, which I'm not real sure how to do.
It would be awesome if you could select between the two runtime formats through the admin panel. |
|
|||
|
I changed it where necessary, but the code on line 186 of video.tpl is slightly different, and doesn't work when you replace it with:
Code:
Runtime: {$answers[i].duration|string_format:"%.2f"} |
__________________
Look, it's not steep till you need to stop ok ! |
|
|||
|
The changes I made in version: 2.1 Release: 20070530
as follows. I suggest you BACKUP YOUR FILES. The easiest way is to rename your current file right on the server before you upload your hacked file. ie: view-video.orig.tpl view-video.tpl Code:
{assign var=viddur value=$vinfo[0].duration}
{math equation="$viddur/60" format="%0.0f" assign=minutes}
{math equation="$viddur - ($minutes * 60)" format="%0.0f" assign=seconds}
{if $seconds < 0}
{math equation="$minutes - 1" assign=minutes}
{math equation="$seconds + 60" assign=seconds}
{/if}
Runtime: {$minutes}m-{$seconds}s
REF: http://www.tubebucket.com/ index.tpl Code:
{assign var=viddur value=$answers[i].duration}
{math equation="$viddur/60" format="%0.0f" assign=minutes}
{math equation="$viddur - ($minutes * 60)" format="%0.0f" assign=seconds}
{if $seconds < 0}
{math equation="$minutes - 1" assign=minutes}
{math equation="$seconds + 60" assign=seconds}
{/if}
Runtime: {$minutes}m - {$seconds}s
Look for: Code:
Runtime: {$recadd[j].duration|string_format:"%.2f"}
Code:
{assign var=viddur value=$recadd[j].duration}
{math equation="$viddur/60" format="%0.0f" assign=minutes}
{math equation="$viddur - ($minutes * 60)" format="%0.0f" assign=seconds}
{if $seconds < 0}
{math equation="$minutes - 1" assign=minutes}
{math equation="$seconds + 60" assign=seconds}
{/if}
Runtime: {$minutes}m-{$seconds}s
Look for: Code:
Runtime: {$mostview[k].duration|string_format:"%.2f"}
Code:
{assign var=viddur value=$mostview[k].duration}
{math equation="$viddur/60" format="%0.0f" assign=minutes}
{math equation="$viddur - ($minutes * 60)" format="%0.0f" assign=seconds}
{if $seconds < 0}
{math equation="$minutes - 1" assign=minutes}
{math equation="$seconds + 60" assign=seconds}
{/if}
Runtime: {$minutes}m-{$seconds}s
|
|
|||
|
Quote:
__________________
------------------------------------ Make an arse of yourself: http://www.youtwatonline.com ------------------------------------ |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Runtime in s Fix to MM:SS | nikhom | Fixed Bugs | 1 | 12-23-2007 05:54 AM |
| Time in MINUTES AND SECONDS | grynmoors | Feature Requests | 2 | 11-08-2007 11:16 PM |
| Video duration in minutes and seconds | starapple | Fixed Bugs | 2 | 07-31-2007 01:02 PM |
| Feature Request: Show runtime in Minutes:Seconds | grynmoors | Feature Requests | 1 | 07-07-2007 09:40 AM |