Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: Runtime - in Minutes/Seconds?

  1. #11
    Join Date
    Jun 2007
    Posts
    21

    Default

    NP

    I think there were a couple more files where it should be changed.
    I've forgotten which ones though!

  2. #12
    Join Date
    May 2007
    Posts
    686

    Default Re: Runtime - in Minutes/Seconds?

    Every few videos, one will upload with a "0" runtime, even when it's several minutes long.
    If the runtime shows zero there a good chances your connection to the server was cut and only half of that file would be converted to .flv.

  3. #13
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default

    Thank you for this hack, works great...but still need to know how to get it to show Minutes:Seconds on the "WATCH" link (which takes you to URL: http://yourdomain.com/recent).

    Anyone?
    If it's not fun, stop doing it!

  4. #14
    Join Date
    Jun 2007
    Posts
    21

    Default

    Quote Originally Posted by grynmoors
    Thank you for this hack, works great...but still need to know how to get it to show Minutes:Seconds on the "WATCH" link (which takes you to URL: http://yourdomain.com/recent).

    Anyone?
    Go to video.tpl - there are two occurances, one for "Detailed View" and one for "Basic View".
    Replace both.:)


    Look for:
    Code:
    Runtime: {$answers[i].duration|string_format:"%.2f"}
    Replace with:
    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
    Regards, HE

  5. #15
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default

    Ohhhh worked great, you're an absolute doll. Thanks!!!!

    Another one I discovered to use this on is user_videos.tpl

    I used Dreamweaver's "find" for the syntax and changed instances of it that it found, which were mostly in files with the word "video" as part of the name.

    add_video.tpl
    fvideos.tpl
    gvideos.tpl
    my_video.tpl
    user_videos.tpl
    video.tpl
    view_video.tpl
    search.tlp

    There's one other instance of the runtime showing up funny and that is in the view_video.tpl where it says:

    Code:
    Runtime: {$vinfo[0].duration|string_format:"%.2f"}
    which is inside the "video details" box. I'm not sure how to change that to get it to show the minutes/seconds...I'll try using the same code above and see what happens...will let you know!

    Yeah, it worked.... just change that with this (note: I use a colon in place of the m - s thingie):

    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}:{$seconds}
    If it's not fun, stop doing it!

  6. #16
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default

    I just noticed a small problem with this...if the time is 3:03, it displays as 3:3 (dropping the zero).

    How do I get it to show the zero?
    If it's not fun, stop doing it!

  7. #17
    Join Date
    Jun 2007
    Location
    USA
    Posts
    123

    Default

    Who reads runtimes in seconds anyway?


    Admin, can you please make the next update with all of these corrections?

    I want the minutes and seconds runtime.. Not only seconds, if that is what it is?

    I'm just affraid that I'm going to go and make all of these changes only to have a new release come out and negate all of the corrections I have made.

    Thanks

  8. #18
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default

    I posted about this in the "Feature Requests". I've changed several templates and every time an update comes out I have to remember to include this code. WinMerge helps tho. Get it.
    If it's not fun, stop doing it!

  9. #19
    Join Date
    May 2007
    Posts
    394

    Default

    Here are all the templates that carry this code:
    Code:
    Runtime: {$answers[i].duration|string_format:"%.2f"} |
    add_favour.tpl
    add_video.tpl
    ffavour.tpl
    fvideos.tpl
    gvideos.tpl
    index.tpl
    my_video.tpl
    playlist.tpl
    search.tpl
    tag.tpl
    user_favorites.tpl
    user_videos.tpl


    Just for looks, I used a different last line in my replace code than that which started this thread:

    Code:
    Runtime: {$minutes} minutes {$seconds} seconds
    which produces

    Runtime: 5 minutes 22 seconds

  10. #20
    Join Date
    May 2007
    Posts
    394

    Default Freakin' beautiful

    THANK YOU all who posted to this thread! Each one worked :)

    this script just KEEPS GETTING BETTER!

    8)

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Runtime in s Fix to MM:SS
    By nikhom in forum Fixed Bugs
    Replies: 1
    Last Post: 12-23-2007, 06:54 AM
  2. Time in MINUTES AND SECONDS
    By grynmoors in forum Feature Requests
    Replies: 2
    Last Post: 11-09-2007, 12:16 AM
  3. Video duration in minutes and seconds
    By starapple in forum Fixed Bugs
    Replies: 2
    Last Post: 07-31-2007, 01:02 PM
  4. Feature Request: Show runtime in Minutes:Seconds
    By grynmoors in forum Feature Requests
    Replies: 1
    Last Post: 07-07-2007, 09:40 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •