PDA

View Full Version : Need ideas on way to streamline my videos


durdon
04-30-2008, 01:23 PM
Hey Guys,
I have created a module that has html templete that links to my video's that I am hosting myself, either quicktime or flash(I have done both) so that the video's are embed in the module. When you goto my page I have this module in the center at the top, so I have an embed video box that is the first thing members see. It is working great and my members love it.

My question is I am trying to figure out a way to streamline the process. Currently for every video I have to copy the old template, create a new one, change the 2 url values inside the new template, then go into the module have it point to the new template, plus I want to archive my old video's so I am creating a new page from the old template so that my members can view my old video's which is also time consuming.

It works, it just time consuming. Anyone have any ideas on how I can streamline my process.

Thanks in advance,

durdon

stitch
04-30-2008, 02:28 PM
One way is to tie your template into a php that will randomly select a file within a predetermined directory and fetch.

Our Sponsors
 

durdon
04-30-2008, 03:15 PM
Stitch,
Bare with me here, so you are saying to tie it to a php file, have that php pull the data files out of that directory, so then all I would have to do is simply replace the data files in that directory every time I wanted to change the video on my front page?

That would cut down a couple of steps and keep me from having to create a ton of new templates and to mess with my module everyday.

I thought about doing that but then how do I manage my video's after i pull them off the front page? Other than creating an individual page for each one, I am not sure how to manage them, and my problem is if I have to create a page for each one then I am going to need have a template for each one correct?

Sorry, VB and VBadvance are both very new to me, so I am probably looking like a moron here, but I just trying to figure this out. I really appreciate the feedback.

Thanks,

durdon

stitch
04-30-2008, 03:39 PM
Durdon,

The way I mention is that your template / module will randomly will grab a file from that directory and play it. You don't have to worry about template or managing files. All you need to do is adding more files into that directory

If you want to manually manage your media file then put only one file in that directory. The php file should handle the rest.

Our Sponsors
 

stitch
04-30-2008, 03:46 PM
Here is a sample code that I use for random clock mod that I have it here


<?php
//directory here (relative to script)
$path = 'c:/vbb/clocks';
$urlswf='http://localhost/vbb/clocks';

$i = 0;
$swfDir = opendir ($path);
while ( $file = readdir( $swfDir ) )
{
//checks that file is an image
$file_type = strrchr( $file, "." );
$is_clock = eregi( "swf",$file_type );

if ( $file != '.' && $file != '..' && $is_clock )
{ $clocks[$i++] = $file; }
}
closedir ($swfDir);

srand( (double) microtime()*1000000 );
$clock_name = $urlswf . '/' . $clocks[rand( 0,sizeof( $clocks ) -1 )];
//ends script if no swf found
if ( $i == 0 )
die();

//okie spit out the whole thang
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_reverseclock') . '";');

?>