How to convert this block script?

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   How to convert this block script?
gamefowlworld
CZ Super Newbie
gamefowlworld has been a member for over 19 year's 19 Year Member
Gender: Male
Website:
Status: Offline
Joined: Jun 17, 2005
0.00 posts per day
Posts: 35
Points: 1,392
   
I came across a block script for nuke that puts a media player on my homepage as a block but here is the problem. My wmv's etc are in a folder in my root called gamefowlworld.com/uploads

Is there anyone here that can look at this and see what can be written in to make this pull from there instead of from mysql?
Here is the code.



<?php

/************************************************************************/
/* */
/* Video Player for Direct Upload Nuke 1.0 */
/* Copyright (c) 2005 by Anthony Stewart [ Register or login to view links on this board. ] */
/* [ Register or login to view links on this board. ] */
/* */
/************************************************************************/

if (eregi("block-Modules.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.html");
die();
}
//$content.="<strong>Select file</strong><br>";

$content.="<form action=\"$PHP_SELF#vid\" name=\"videos\" method=\"post\">
<a name=\"vid\">
<select name=\"videos\" size=\"1\">";

$get_videos=mysql_query("SELECT * FROM nuke_downloads_downloads WHERE title LIKE '%.wmv%' OR title LIKE '%.wma%' OR title LIKE '%.avi%' OR title LIKE '%.wav%' OR title LIKE '%.mpg%' OR title LIKE '%.mpg%' OR title LIKE '%.mp3%' OR title LIKE '%.midi%' OR title LIKE '%.aiff%' OR title LIKE '%.au%' OR title LIKE '%.mov%' ORDER BY title ASC");
while($video_array=mysql_fetch_array($get_videos)) {
$content.="<option value=\"$video_array[title]\">$video_array[title]</option>";
}

$content.="
</select>
<select name=\"player\" size=\"1\">
<option value=\"w\">Windows Media Player</option>
<option value=\"q\">Quicktime Player</option>
</select>
<input type=\"Submit\" name=\"Submit\" value=\"Play this video\" /><p>";

$get_info = mysql_fetch_array(mysql_query("SELECT * FROM nuke_downloads_downloads WHERE title LIKE '%$_REQUEST[videos]%'"));

$content.="<table border=\"0\">
<tr>
<td colspan=\"2\"><strong>Now playing:</strong></td>
</tr>
<tr>
<td>File name:</td><td><strong>$get_info[title]</strong></td>
</tr>
<tr>
<td>Submitted by:</td><td><strong>$get_info[submitter]</strong></td>
</tr>
<tr>
<td>Description:</td><td><strong>$get_info[description]</strong></td>
</tr>
</table>
";
if(isset($_REQUEST[Submit])){ $play_now = "true"; } else { $play_now="false"; }
if($_REQUEST[player]=="w" || (!isset($_REQUEST[player]))) {
$content.="<div align=\"center\">
<p><OBJECT ID=\"mediaPlayer\" maxwidth=320 CLASSID=\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" CODEBASE=\"http://activex.microsoft.com/activex/ controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701\" STANDBY=\"Loading Microsoft Windows Media Player components...\" TYPE=\"application/x-oleobject\">
<PARAM NAME=\"fileName\" VALUE=\"uploads/".$_REQUEST[videos]."\">
<PARAM NAME=\"animationatStart\" VALUE=\"true\">
<PARAM NAME=\"transparentatStart\" VALUE=\"true\">
<PARAM NAME=\"autoStart\" VALUE=\"$play_now\">
<PARAM NAME=\"showControls\" VALUE=\"true\">
</OBJECT></p>
</div>";
} else {
$content.="<div align=\"center\">
<p><object classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" maxwidth=\"320\" standby=\"Data is loading...\" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\">
<param name=\"src\" value=\"uploads/".$_REQUEST[videos]."\">
<param name=\"autoplay\" value=\"$play_now\">
<param name=\"controller\" value=\"true\">
<embed src=\"uploads/".$_REQUEST[videos]."\" maxwidth=\"320\" scale=\"1\" autoplay=\"$play_now\" controller=\"true\" type=\"video/quicktime\" pluginspage=\"http://www.apple.com/quicktime/download/\">
</embed>
</object><p>";
}
$content.="To upload your own videos click <a href=\"downloads-AddDownload.html\"><strong>here</strong></a>.<p>";
$content.="Your video or audio file must be less than 1MB in size and in one of the following formats: .wmv, .wma, .avi, .wav, .mp3, .midi, .aiff, .au., or QuickTime's .mov";
$content.="<center><a href=\"http://www.parentalskills.org\" target=\"_new\">&copy; [ Register or login to view links on this board. ] ";
?>


Thanks to anyone that can rewrite this for me.



Back to top Reply with quote
#2   re: How to convert this block script?
gamefowlworld
CZ Super Newbie
gamefowlworld has been a member for over 19 year's 19 Year Member
Gender: Male
Website:
Status: Offline
Joined: Jun 17, 2005
0.00 posts per day
Posts: 35
Points: 1,392
   
Can anyone understand what I am asking here? Please help.



Back to top Reply with quote
#3   
tribaljohn
CZ Newbie
tribaljohn has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Jan 29, 2005
0.00 posts per day
Posts: 6
Points: 902
   
look up nuke tools and do a proper one, just paste your code in the box, once you find nuke tools, click the create code, select all, copy, paste into a new text document, save as...



Back to top Reply with quote
#4   re: How to convert this block script?
gamefowlworld
CZ Super Newbie
gamefowlworld has been a member for over 19 year's 19 Year Member
Gender: Male
Website:
Status: Offline
Joined: Jun 17, 2005
0.00 posts per day
Posts: 35
Points: 1,392
   
I think you missed my whole question.

I'm not having a problem getting the block to come up on my site. I need for the block to pull directly from a folder in my root instead of through the downloads msql files.

But anyway here is the script using nuke tools block creator


<?php
#### Generated by Block Creator by Disipal Site (www.disipal.net) ###
if (eregi("block-Block_Creator.php",$PHP_SELF)) {
Header("Location: index.html");
die();
}
$content = "<?php";
$content .= "/************************************************************************/";
$content .= "* */";
$content .= "* Video Player for Direct Upload Nuke 1.0 */";
$content .= "* Copyright (c) 2005 by Anthony Stewart [ Register or login to view links on this board. ] */";
$content .= "* [ Register or login to view links on this board. ] */";
$content .= "* */";
$content .= "************************************************************************/";
$content .= "if (eregi(\"block-Modules.php\", $_SERVER['PHP_SELF'])) {";
$content .= " Header(\"Location: index.html\");";
$content .= " die();";
$content .= "";
$content .= "/$content.=\"<strong>Select file</strong><br>\";";
$content .= "$content.=\"<form action=\\\"$PHP_SELF#vid\\\" name=\\\"videos\\\" method=\\\"post\\\">";
$content .= "a name=\\\"vid\\\">";
$content .= "select name=\\\"videos\\\" size=\\\"1\\\">\";";
$content .= "$get_videos=mysql_query(\"SELECT * FROM nuke_downloads_downloads WHERE title LIKE '%.wmv%' OR title LIKE '%.wma%' OR title LIKE '%.avi%' OR title LIKE '%.wav%' OR title LIKE '%.mpg%' OR title LIKE '%.mpg%' OR title LIKE '%.mp3%' OR title LIKE '%.midi%' OR title LIKE '%.aiff%' OR title LIKE '%.au%' OR title LIKE '%.mov%' ORDER BY title ASC\");";
$content .= "hile($video_array=mysql_fetch_array($get_videos)) {";
$content .= "content.=\"<option value=\\\"$video_array[title]\\\">$video_array[title]</option>\";";
$content .= "";
$content .= "$content.=\"";
$content .= "/select>";
$content .= "select name=\\\"player\\\" size=\\\"1\\\">";
$content .= "option value=\\\"w\\\">Windows Media Player</option>";
$content .= "option value=\\\"q\\\">Quicktime Player</option>";
$content .= "/select>";
$content .= "input type=\\\"Submit\\\" name=\\\"Submit\\\" value=\\\"Play this video\\\" /><p>\";";
$content .= "$get_info = mysql_fetch_array(mysql_query(\"SELECT * FROM nuke_downloads_downloads WHERE title LIKE '%$_REQUEST[videos]%'\"));";
$content .= "$content.=\"<table border=\\\"0\\\">";
$content .= " <tr>";
$content .= " <td colspan=\\\"2\\\"><strong>Now playing:</strong></td>";
$content .= " </tr>";
$content .= " <tr>";
$content .= " <td>File name:</td><td><strong>$get_info[title]</strong></td>";
$content .= " </tr>";
$content .= " <tr>";
$content .= " <td>Submitted by:</td><td><strong>$get_info[submitter]</strong></td>";
$content .= " </tr>";
$content .= " <tr>";
$content .= " <td>Description:</td><td><strong>$get_info[description]</strong></td>";
$content .= " </tr>";
$content .= " </table>";
$content .= " \";";
$content .= "f(isset($_REQUEST[Submit])){ $play_now = \"true\"; } else { $play_now=\"false\"; }";
$content .= "f($_REQUEST[player]==\"w\" || (!isset($_REQUEST[player]))) {";
$content .= "content.=\"<div align=\\\"center\\\">";
$content .= " <p><OBJECT ID=\\\"mediaPlayer\\\" maxwidth=320 CLASSID=\\\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\\\" CODEBASE=\\\"http://activex.microsoft.com/activex/ controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701\\\" STANDBY=\\\"Loading Microsoft Windows Media Player components...\\\" TYPE=\\\"application/x-oleobject\\\">";
$content .= "PARAM NAME=\\\"fileName\\\" VALUE=\\\"uploads/\".$_REQUEST[videos].\"\\\">";
$content .= "PARAM NAME=\\\"animationatStart\\\" VALUE=\\\"true\\\">";
$content .= "PARAM NAME=\\\"transparentatStart\\\" VALUE=\\\"true\\\">";
$content .= "PARAM NAME=\\\"autoStart\\\" VALUE=\\\"$play_now\\\">";
$content .= "PARAM NAME=\\\"showControls\\\" VALUE=\\\"true\\\">";
$content .= "/OBJECT></p>";
$content .= "/div>\";";
$content .= " else {";
$content .= "content.=\"<div align=\\\"center\\\">";
$content .= "p><object classid=\\\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\\\" maxwidth=\\\"320\\\" standby=\\\"Data is loading...\\\" codebase=\\\"http://www.apple.com/qtactivex/qtplugin.cab\\\">";
$content .= "param name=\\\"src\\\" value=\\\"uploads/\".$_REQUEST[videos].\"\\\">";
$content .= "param name=\\\"autoplay\\\" value=\\\"$play_now\\\">";
$content .= "param name=\\\"controller\\\" value=\\\"true\\\">";
$content .= "embed src=\\\"uploads/\".$_REQUEST[videos].\"\\\" maxwidth=\\\"320\\\" scale=\\\"1\\\" autoplay=\\\"$play_now\\\" controller=\\\"true\\\" type=\\\"video/quicktime\\\" pluginspage=\\\"http://www.apple.com/quicktime/download/\\\">";
$content .= "/embed>";
$content .= "/object><p>\";";
$content .= "";
$content .= "content.=\"To upload your own videos click <a href=\\\"downloads-AddDownload.html\\\"><strong>here</strong></a>.<p>\";";
$content .= "content.=\"Your video or audio file must be less than 1MB in size and in one of the following formats: .wmv, .wma, .avi, .wav, .mp3, .midi, .aiff, .au., or QuickTime's .mov\";";
$content .= "content.=\"<center><a href=\\\"http://www.parentalskills.org\\\" target=\\\"_new\\\">&copy; [ Register or login to view links on this board. ] ";";
$content .= ">";
?>[quote]



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum