Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: Add a truly random video to any page...

  1. #11
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: Add a truly random video to any page...

    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.
    If it's not fun, stop doing it!

  2. #12
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: Add a truly random video to any page...

    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.
    If it's not fun, stop doing it!

  3. #13
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: Add a truly random video to any page...

    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.
    If it's not fun, stop doing it!

  4. #14
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: Add a truly random video to any page...

    ah ok so it should be like this then?

    Code:
    "SELECT VID FROM video WHERE type = 'public' AND approve = '1' AND active= '1'"
    Cos that's what I poked in there and so far it didn't seem to hurt anything.
    If it's not fun, stop doing it!

  5. #15
    Join Date
    Mar 2008
    Location
    Canada Eh?
    Posts
    37

    Default Re: Add a truly random video to any page...

    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.
    http://www.asiancumtube.com Send Traffic, Make $$$
    Check the webmasters link at the bottom of the site

  6. #16
    Join Date
    Mar 2008
    Posts
    2

    Default Re: Add a truly random video to any page...

    Owsome code guys!

    Id like to play my own video ONLY on the first page. Is it possible?

    Almira

  7. #17
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: Add a truly random video to any page...

    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)

    Code:
    <?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>";
    
            ?>
    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.com
    If it's not fun, stop doing it!

  8. #18
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: Add a truly random video to any page...

    Well, whatta ya know... it worked! putting {$baseurl} instead of http://YOURDOMAIN.COM worked! Sweet, nothing to configure anymore!
    If it's not fun, stop doing it!

  9. #19

    Default

    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?

  10. #20

    Default

    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

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Feature Request: Random Video
    By grynmoors in forum Feature Requests
    Replies: 0
    Last Post: 07-16-2008, 10:50 PM
  2. make other page with new video like in index page
    By cmedia in forum Template Modifications
    Replies: 4
    Last Post: 05-29-2008, 10:23 PM
  3. Random Video Image
    By KnoPPerS in forum Template Modifications
    Replies: 1
    Last Post: 05-01-2008, 01:58 PM
  4. Carousel Random Viewer - OUT NOW!!
    By galnet in forum Template Modifications
    Replies: 23
    Last Post: 11-29-2007, 02:06 AM
  5. Activate Random Featured Videos
    By ofir in forum General Discussions
    Replies: 6
    Last Post: 06-13-2007, 06:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •