...

View Full Version : dynamic asx file with php code (PAID)



gamesport
02-13-2006, 06:14 PM
On the microsofts site (http://www.microsoft.com/windows/windowsmedia/howto/articles/ad.aspx#ad_topic5), they show an example of a dynamic asx file done using asp code.

I was hoping someone would have come up with a php version of it, i searched high and low, and i came up with just a snippet from another coding forum:


Here is a snippet that call an dynamic .asx file:
movie.asx?cat=hardcore&movie=072_twisted&scene=01&size=small

Here is a snippet of the dynamic movie.asx file:

foreach( $myScenes[0]->media as $media )
{
if( preg_match( "/\.wmv$/", $media ) )
{
echo "<entry>\n";
echo "<ref href=\"$media\" />\n";
echo "</entry>\n\n";
}
}



i hope someone can help me with the full code for $20 or want to negotiate the price, please drop me an email at gamesport at hotmail (also my msn messenger address)

Here is the asp version btw

<%@ Language="JScript" %>
<%
// Note that setting the Request.ContentType property to
// "video/x-ms-asf" lets you create dynamic
// metafiles that do not contain HTTP header data.
Response.ContentType = "video/x-ms-asf";
%>
<% // Set the BASE_PATH variable to point to your
// server running Windows Media Services.
var BASE_PATH = "mms://MyMediaServer/";
//Force content to always refresh.
Response.Expires = 0;
//Create the opening ASX tag.
Response.Write (AsxHeader());
//Create an ad.
Response.Write (AdEntry());
//Create an XML entry for content.
Response.Write (AsxEntry());
//Write the ASX footer.
Response.Write (AsxFooter());
// This function returns an opening <ASX> tag.
function AsxHeader ()
{
return "<ASX Version=\"3\">" + "\n" + "<TITLE> Demo Dynamic ASX File
From Active Server Pages </TITLE>" + "\n";
}
// This function returns an ad based on user request.
function AdEntry()
{
if (Request("AdPref") == 0)
{
return " <ENTRY>" + "\n" + "\t" + "<REF HREF=\"" + BASE_PATH +
"AdInsertion/BackpackingAd.wmv\" />" + "\n" +
" </ENTRY>" + "\n";
}
else
{
return " <ENTRY>" + "\n" + "\t" + "<REF HREF=\"" + BASE_PATH +
"AdInsertion/TravelAd.wmv\" />" + "\n" +
" </ENTRY>" + "\n";
}
}
// This function returns an XML entry for a specific piece of content.
// With actual code, this function does a database lookup.
function AsxEntry ()
{
var AsxEntry, Abstract;
AsxEntry = " <ENTRY>" + "\n" + "\t" +
"<TITLE> Upcoming Movie Releases in 2004 </TITLE>" + "\n";
AsxEntry += "\t" + "<REF HREF=\"" + BASE_PATH +
"Content/UpcomingReleases2004.asf \"/>" + "\n";
AsxEntry += "\t" + "<ABSTRACT>" + "\n";
Abstract = " Check out the latest movies to hit the big screen in 2004!";
AsxEntry += Abstract + "\n"; AsxEntry += "\t" +"</ABSTRACT>" + "\n";
AsxEntry += "\t" + "<COPYRIGHT> Copyright 2004,
Southridge Video -- All Rights Reserved </COPYRIGHT>" + "\n";
AsxEntry += " </ENTRY>" + "\n";
return AsxEntry;
}
// This function returns a closing </ASX> tag.
function AsxFooter ()
{
return "</ASX>";
}
%>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum