Advertisement
cuonic

Design Video Viewer

Jun 16th, 2011
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.67 KB | None | 0 0
  1. <?php
  2.  
  3. if($_GET['id'])
  4. {
  5.     // Connect to the MySQL Server, and select the database the video data is stored in. This is the DATABASE name and NOT the TABLE name :)
  6.     mysql_connect("localhost", "username", "password");
  7.     mysql_select_db("database-name");
  8.  
  9.     // Assign the ID provided in the URL a variable inside the script
  10.     $id = $_GET['id'];
  11.  
  12.     // This ID is a number, so if the ID isn't a number, tell them off
  13.     if(!is_numeric($id)) { $msg[] =  "Video ID is invalid !"; }
  14.     else
  15.     {
  16.         // Query the MySQL Server for that id (title, description, url = Field Names / videos = Table Name)
  17.         $query = mysql_query("SELECT title, description, url FROM videos WHERE id='$id'");
  18.  
  19.         // Does that ID exist in the Database ? Get the result count from the previous query
  20.         if(mysql_num_rows($query) == 0) { $msg[] = "Video ID doesn't exist"; }
  21.         else
  22.         {
  23.             // Ok, the video ID exists, now lets fetch the related data
  24.             list($title, $description, $url) = mysql_fetch_row($query);
  25.  
  26.             // Now The video title is stored in the variable $title, the description is stored in $description and the Video URL is stored in $url
  27.             // You can then echo these out later in the script, like in your flash video player script
  28.             // Thats it :D
  29.         }
  30.     }
  31. }
  32. else
  33. {
  34.     $msg[] = "No Video ID provided !";
  35. }
  36.  
  37. ?>
  38. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  39.  
  40. <html xmlns="http://www.w3.org/1999/xhtml" >
  41.     <head>
  42.         <title>Xenano - Videos</title>
  43.         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  44.         <meta http-equiv="content-language" content="en" />  
  45.         <link rel="stylesheet" type="text/css" href="css/global.css" />
  46.         <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
  47.     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  48.  
  49. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb" dir="ltr" >
  50.   <link href="/templates/yoo_planet/favicon.ico" rel="shortcut icon" type="image/x-icon" />
  51.   <link rel="stylesheet" href="http://xenano.net/plugins/system/yoo_effects/lightbox/shadowbox.css" type="text/css" />
  52.   <link rel="stylesheet" href="/templates/yoo_planet/css/template2.css" type="text/css" />
  53.   <link rel="stylesheet" href="/templates/yoo_planet/css/variations/blackblue.css" type="text/css" />
  54.   <link rel="stylesheet" href="/templates/yoo_planet/css/custom.css" type="text/css" />
  55.   <link rel="stylesheet" href="http://xenano.net/modules/mod_yoo_search/mod_yoo_search.css.php" type="text/css" />
  56.   <style type="text/css">
  57.     <!--
  58. .wrapper { width: 900px; }
  59. #menu .dropdown { width: 250px; }
  60. #menu .columns2 { width: 500px; }
  61. #menu .columns3 { width: 750px; }
  62. #menu .columns4 { width: 1000px; }
  63.  
  64.     -->
  65.   </style>
  66.   <script type="text/javascript" src="/templates/yoo_planet/lib/js/mootools.js"></script>
  67.   <script type="text/javascript" src="/media/system/js/caption.js"></script>
  68.   <script type="text/javascript" src="/templates/yoo_planet/lib/js/addons/base.js"></script>
  69.   <script type="text/javascript" src="/templates/yoo_planet/lib/js/addons/accordionmenu.js"></script>
  70.   <script type="text/javascript" src="/templates/yoo_planet/lib/js/addons/fancymenu.js"></script>
  71.   <script type="text/javascript" src="/templates/yoo_planet/lib/js/addons/dropdownmenu.js"></script>
  72.   <script type="text/javascript" src="/templates/yoo_planet/lib/js/template.js"></script>
  73.   <script type="text/javascript" src="http://xenano.net/modules/mod_yoo_search/mod_yoo_search.js"></script>
  74.   <script type="text/javascript">
  75. var YtSettings = { tplurl: '/templates/yoo_planet', color: 'blackblue' };
  76.   </script>
  77.   <script type="text/javascript">var YOOeffects = { url: 'http://xenano.net/plugins/system/yoo_effects/lightbox/' };</script>
  78.  
  79. <script type="text/javascript" src="http://xenano.net/plugins/system/yoo_effects/yoo_effects.js.php?lb=1&amp;re=1&amp;sl=1"></script>
  80.  <style type="text/css">
  81.  
  82. .newsbar {
  83.  
  84.     background: #171717;
  85.  
  86.         padding: 5px;
  87.  
  88.         width: 98.5%;
  89.  
  90.     border: 1px solid #1d1d1d;
  91.  
  92.         text-align: center;
  93.  
  94.     color: #808080;
  95.  
  96.     font-size: 11px;
  97.  
  98.     font-weight: bold;
  99.  
  100. }
  101.  
  102. </style>
  103. <link rel="apple-touch-icon" href="/templates/yoo_planet/apple_touch_icon.png" />
  104. </head>
  105.  
  106. <body id="page" class="yoopage   ">
  107.  
  108.     <div id="page-body">
  109.         <div class="wrapper">
  110.  
  111.             <div id="header">
  112.  
  113.                 <div id="toolbar">
  114.                
  115.                                    
  116.                                         <div class="left">
  117.                         <div class="module mod-blank   first last">
  118.  
  119.  
  120.  
  121.    
  122.  
  123.        
  124.  
  125.     <ul class="menu menu-" />      
  126.  
  127.  
  128. </div>
  129.                     </div>
  130.                                        
  131.                                        
  132.                 </div>
  133.  
  134.                 <div class="header-bg">
  135.                    
  136.                     <div class="header-img"></div>
  137.                    
  138.                     <div class="header-t1">
  139.                         <div class="header-t2">
  140.                             <div class="header-t3"></div>
  141.                         </div>
  142.                     </div>
  143.                    
  144.                     <div class="header-1">
  145.                         <div class="header-2">
  146.                             <div class="header-3">
  147.                            
  148.                                 <div id="headerbar">
  149.    
  150.                                                                        
  151.                                                                        
  152.                                 </div>
  153.  
  154.                             </div>
  155.                         </div>
  156.                     </div>
  157.                    
  158.                     <div class="header-b1">
  159.                         <div class="header-b2">
  160.                             <div class="header-b3"></div>
  161.                         </div>
  162.                     </div>
  163.                    
  164.                 </div>
  165.  
  166.                        
  167.                 <div id="logo">
  168.                     <a class="logo-icon correct-png" href="/index.php" title="Home"></a>
  169.                 </div>
  170.                
  171.                                 <div id="menu">
  172.                     <ul class="menu menu-dropdown"><li class="level1 item1 first"><a href="http://xenano.net/" class="level1 item1"><span class="bg ">Home</span></a></li><li class="level1 item2 active current"><a href="http://xenano.net/videos" class="level1 item2"><span class="bg ">Videos</span></a></li><li class="level1 item3"><a href="/index.php?option=com_content&view=category&layout=blog&id=36&Itemid=171" class="level1 item3"><span class="bg ">News</span></a></li><li class="level1 item5 last"><a href="/forum" class="level1 item5 last"><span class="bg ">Forum</span></a></li></ul>
  173.                 </div>
  174.                
  175.                                 <div id="search">
  176.                     <div class="default">
  177.  
  178.     <div id="yoo-search-1" class="yoo-search">
  179.  
  180.    
  181.  
  182.         <form action="index.php" method="post">
  183.  
  184.             <div class="searchbox">
  185.  
  186.                 <button class="search-magnifier" type="submit" value="Search"></button>
  187.  
  188.                 <input class="searchfield" type="text" onfocus="if(this.value=='search...') this.value='';" onblur="if(this.value=='') this.value='search...';" value="search..." size="20" alt="search..." maxlength="20" name="searchword" />
  189.  
  190.                 <button class="search-close" type="reset" value="Reset"></button>
  191.  
  192.             </div> 
  193.  
  194.             <input type="hidden" name="task"   value="search" />
  195.  
  196.             <input type="hidden" name="option" value="com_search" />
  197.  
  198.         </form>    
  199.  
  200.  
  201.  
  202.         <div class="resultbox" style="width: 400px;"></div>
  203.  
  204.  
  205.  
  206.     </div>
  207.  
  208. </div><script type="text/javascript">
  209. // <!--
  210. window.addEvent('domready', function(){ new YOOsearch('yoo-search-1', { 'url': 'http://xenano.net/index.php?option=com_search&tmpl=raw&type=json&ordering=&searchphrase=all&Itemid=167', 'fieldText': 'search...', 'msgResults': 'Search results', 'msgCategories': 'Search categories', 'msgNoResults': 'No results found', 'msgMoreResults': 'More results' }); });
  211. // -->
  212. </script>
  213.  
  214.                 </div>
  215.                    
  216.                
  217.             </div>
  218.             <!-- header end -->
  219.  
  220.             <div class="inner-wrapper">
  221.  
  222.                    
  223.                 <div id="middle">
  224.                     <div id="middle-expand">
  225.    
  226.                         <div id="main">
  227.                             <div id="main-shift">
  228.    
  229.                                    
  230.                                 <div id="mainmiddle">
  231.                                     <div id="mainmiddle-expand">
  232.                                    
  233.                                         <div id="content">
  234.                                             <div id="content-shift">
  235.    
  236.                                                    
  237.                                                 <div class="wrapper-t1">
  238.                                                     <div class="wrapper-t2">
  239.                                                         <div class="wrapper-t3"></div>
  240.                                                     </div>
  241.                                                 </div>
  242.                                            
  243.                                                 <div class="wrapper-1">
  244.    
  245.                                                                                                         <div id="breadcrumbs">
  246.                                                         <span class="breadcrumbs">
  247.                                                     </div>
  248.                                                                                                        
  249.                                                     <div class="floatbox">
  250.                                                        
  251.                                                        
  252.  
  253.  
  254.  
  255.     <body scroll="yes">
  256.  
  257.         <center>
  258.         <?php if(count($msg) == 0)
  259.         { ?>
  260.         <br /><br />
  261.         Flash Video Player will load video from : <?php echo $url; ?>
  262.         </center>
  263.         <br /><br />
  264.         <p class="newsbar"><br /><font size="4"><?php echo $title; ?></font>
  265.         <br /><br /><?php echo $description; ?><br /><br /></p>
  266.         <?php } else { ?>
  267.         <br /><br />
  268.         <p class="newsbar"><br /><font size="4">Error</font>
  269.         <br /><br /><?php foreach($msg as $mssg) { echo "$mssg<br/>"; } ?><br /><br /></p><?php } ?>
  270.     </body>
  271.  
  272. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement