I certainly will! I'll probably get around to it tomorrow. It's 2 AM here and I'm about to go hit the sack.
Printable View
I certainly will! I'll probably get around to it tomorrow. It's 2 AM here and I'm about to go hit the sack.
The Random Video for public only is showing videos that are marked by admin as INACTIVE. For example, I had a video up as a test....I made it inactive so that nobody would really know it's there...it showed up in the random video.
Can you tell me what was the typo part so that I can just change the typo (as I have made a slight change in the code in the OP and don't want to have to re-do everything, especially where the database name and the domain name is and all that). Thanks.
ah ok so it should be like this then?
Cos that's what I poked in there and so far it didn't seem to hurt anything.Code:"SELECT VID FROM video WHERE type = 'public' AND approve = '1' AND active= '1'"
Very slick code, and it may prove handy.
However.... It doesn't take into account the server ID,
so any videos stored on other servers don't work.
Owsome code guys!
Id like to play my own video ONLY on the first page. Is it possible?
Almira
I found that this works and you don't have to enter the database/user name information (you will still have to enter the domain name tho)
I'm working on finding a way so that we don't have to add in the domain information...like somehow putting {$baseurl} in there instead if that's possible. I currently have it working at my test site: http://vshare-mods.comCode:<?php
include("include/config.php");
$sql = mysql_query("SELECT VID FROM video WHERE type = 'public' AND approve = '1' AND active= '1'") or die (mysql_error());
while($row = mysql_fetch_array($sql)){
$row_array[] = $row['VID'];
}
$random_row = $row_array[rand(0, count($row_array) - 1)];
$sql2 = mysql_query("SELECT flvdoname FROM video WHERE VID = '$random_row'") or die (mysql_error());
$row = mysql_fetch_object($sql2);
$flv = $row->flvdoname;
?>
<?
echo "<div style=\"PADDING-RIGHT: 10px; PADDING-LEFT: 10px; padding-bottom: 2px; PADDING-TOP: 10px\">\n";
echo "<script type=\"text/javascript\" src=\"http://YOURDOMAIN.COM/player/swfobject.js\"></script>\n";
echo "<p id=\"vshare_player\"><a href=\"http://www.macromedia.com/go/getflashplayer\">Get Flash</a> to see this player.</p>\n";
echo "<script type=\"text/javascript\" src=\"http://YOURDOMAIN.COM/player/swfobject.js\"></script>\n";
echo "<script type=\"text/javascript\">\n";
echo "var so = new SWFObject(\"http://YOURDOMAIN.COM/player/player.swf\",\"vshare_player\",\"300\",\"275\",\"8\");\n";
echo "so.addParam(\"allowfullscreen\",\"true\");\n";
echo "so.addVariable(\"file\",\"http://YOURDOMAIN.COM/flvideo/", urlencode($flv), "\");\n";
echo "so.addVariable(\"image\",\"http://YOURDOMAIN.COM/thumb/", urlencode($random_row), ".jpg\");\n";
echo "so.addVariable(\"logo\",\"http://YOURDOMAIN.COM/templates/images/watermark.gif\");\n";
echo "so.addVariable(\"link\",\"http://YOURDOMAIN.COM\");\n";
echo "so.addVariable(\"linktarget\",\"_blank\");\n";
echo "so.addVariable(\"width\",\"300\");\n";
echo "so.addVariable(\"height\",\"275\");\n";
echo "so.addVariable(\"bufferlength\", \"5\");\n";
echo "so.addVariable(\"overstretch\", \"true\");\n";
echo "so.addVariable(\"autostart\", \"false\");\n";
echo "so.write('vshare_player');\n";
echo "</script>";
echo "</div>";
?>
Well, whatta ya know... it worked! putting {$baseurl} instead of http://YOURDOMAIN.COM worked! Sweet, nothing to configure anymore!
Is there a way to modify this code to instead of picking a random video, but the latest video, with the last few like in this attachment?
Does this random video method still work for 2.8.1? If it does, can anyone tell me exactly which files do we have to add or edit. Any input is appreciated.
Thanks