NP
I think there were a couple more files where it should be changed.
I've forgotten which ones though!
NP
I think there were a couple more files where it should be changed.
I've forgotten which ones though!
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.Every few videos, one will upload with a "0" runtime, even when it's several minutes long.
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!
Go to video.tpl - there are two occurances, one for "Detailed View" and one for "Basic View".Originally Posted by grynmoors
Replace both.:)
Look for:
Replace with:Code:Runtime: {$answers[i].duration|string_format:"%.2f"}
Regards, HECode:{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
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:
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!Code:Runtime: {$vinfo[0].duration|string_format:"%.2f"}
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!
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!
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
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!
Here are all the templates that carry this code:
add_favour.tplCode:Runtime: {$answers[i].duration|string_format:"%.2f"} |
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:
which producesCode:Runtime: {$minutes} minutes {$seconds} seconds
Runtime: 5 minutes 22 seconds
THANK YOU all who posted to this thread! Each one worked :)
this script just KEEPS GETTING BETTER!
8)
Bookmarks