Go Back   BuyScripts Forums > vShare YouTube Clone > Template Modifications

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-08-2007, 05:12 PM
Member
 
Join Date: May 2007
Posts: 30
Default Runtime - in Minutes/Seconds?

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.
Reply With Quote
  #2 (permalink)  
Old 05-08-2007, 06:09 PM
Administrator
 
Join Date: Apr 2007
Posts: 2,122
Default

To show duration in minutes and seconds, edit /tmplates/index.tpl

FIND

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 |
We will look into the duration problem, this may be due to ffmpeg-php is not able to get duration from video format you are uploading.
__________________
vShare Youtube Clone
Reply With Quote
  #3 (permalink)  
Old 05-09-2007, 07:46 AM
Member
 
Join Date: May 2007
Posts: 30
Default

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.
Reply With Quote
  #4 (permalink)  
Old 05-23-2007, 10:29 AM
Senior Member
 
Join Date: May 2007
Posts: 101
Default

Agreed, runtime in minutes and seconds would be the most logical.
Reply With Quote
  #5 (permalink)  
Old 06-12-2007, 12:29 AM
Member
 
Join Date: Jun 2007
Posts: 42
Default

I concour!
Reply With Quote
  #6 (permalink)  
Old 06-14-2007, 07:29 PM
Senior Member
 
Join Date: May 2007
Posts: 594
Default

i changed it in all the templates but it only works on index.tpl.....admin can we have it working on all pages?
Reply With Quote
  #7 (permalink)  
Old 06-15-2007, 03:00 PM
Senior Member
 
Join Date: May 2007
Posts: 131
Default

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"} |
The rest work ok.
__________________
Look, it's not steep till you need to stop ok !
Reply With Quote
  #8 (permalink)  
Old 06-16-2007, 07:01 PM
Junior Member
 
Join Date: Jun 2007
Posts: 24
Default

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
I added the hyphen between minutes/seconds also, whatever ........
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
There are two changes in channel-detail.tpl

Look for:
Code:
Runtime: {$recadd[j].duration|string_format:"%.2f"}
Replace with:
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"}
Replace with:
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
Regards, HE
Reply With Quote
  #9 (permalink)  
Old 06-17-2007, 12:26 PM
Senior Member
 
Join Date: May 2007
Posts: 131
Default

Nice one!
Cheers HE
__________________
Look, it's not steep till you need to stop ok !
Reply With Quote
  #10 (permalink)  
Old 06-17-2007, 01:32 PM
Senior Member
 
Join Date: Jun 2007
Posts: 210
Default

Quote:
Originally Posted by Philthy
Nice one!
Cheers HE
Same here cheers!
__________________
------------------------------------
Make an arse of yourself:
http://www.youtwatonline.com
------------------------------------
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT. The time now is 02:09 PM.


Powered by vBulletin. Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO