 |
|
ไฟล์ตัวอย่างผมเป็นแบบนี้ครับ
-----------------------------------------------------------------------------------------------------------------
ต้องเขียนคำสั่ง php แบบไหนครับ
อยากให้ php สร้างไฟล์เก็บข้อมูลไว้ในรูปแบบ .XML
(ไม่อยากเก็บไว้แบบ MySQL น่ะคับ)
ขอบเขตเก็บไฟล์
flv/...>>โฟลเดอร์ไฟล์วีดิโอ
pic/...>>โฟลเดอร์ไฟล์รูปภาพ
text/...>>โฟลเดอร์เก็บไฟล์ชื่อเรื่อง
โดยสร้าง <item> เพิ่มขึ้นเรื่อยๆเมื่อมีการเพิ่มไฟล์..
ขอบคุณพี่ๆมากครับ.....
ไฟล์ list.xml >> อยากให้ php สร้างไฟล์เก็บข้อมูลไว้รูปแบบ .XML นี้ครับ
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:creativeCommons="http://www.google.com"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
xmlns:blip="http://blip.tv/dtd/blip/1.0"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:amp="http://www.adobe.com/amp/1.0"
xmlns:dcterms="http://purl.org/dc/terms"
xmlns:gm="http://www.google.com/schemas/gm/1.1"
xmlns:mediaad="http://blip.tv/dtd/mediaad/1.0"
>
<channel>
<title>VDO Clip Gallery</title>
<language>th-TH</language>
<item>
<title>กิจกรรมวันพ่อแห่งชาติ 51</title>
<description>
<![CDATA[
<embed src="http://blip.tv/play/AZyJSIaIEg" type="application/x-shockwave-flash" width="320" height="240" allowscriptaccess="always" allowfullscreen="true"></embed>
<br />]]>
</description>
<media:group>
//ที่อยู่ของไฟล์ vdo flv/......
<media:content url="flv/M2U00346.flv" type="video/x-flv" fileSize="17264110" isDefault="false" height="240" width="320" expression="full" blip:role="web"></media:content>
</media:group>
<media:player url="http://blip.tv/file/454612"><![CDATA[<embed src="http://blip.tv/play/AZyJSIaIEg" type="application/x-shockwave-flash" width="320" height="240" allowscriptaccess="always" allowfullscreen="true"></embed> ]]>
</media:player>
<media:thumbnail url="pic/DSC00578.JPG" /> //ที่อยู่ของรูปภาพ pic/......
</item>
</channel>
</rss>
------------------------------------------------------------------------------------------------------
ไฟล์ index.php >> ดึงข้อมูลมาแสดง
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Media Player</title>
<style type="text/css">
body {
background-color: #fff;
color:#000;
font: 13px/18px Arial, sans-serif;
margin: 0px;
padding-top: 0;
padding-right: 0px;
padding-bottom: 0;
padding-left: 0px;
}
a { color: #360; }
h3 {
padding-top: 0px;
}
ol {
margin:0px 0 0px 0px;
padding:0;
list-style-type:square;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=windows874"></head>
<body>
<!-- <h3>Example</h3>
<p>Here's a simple example of the <a href="http://www.jeroenwijering.com/?item=JW_FLV_Media_Player">JW FLV Media Player</a> embedded in a page. Copy-paste the source code and put the files on your site to get started.</p> -->
<div id="container">
<p> </p>
</div>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var s1 = new SWFObject("player.swf","mediaplayer","210","300","8");
s1.addParam('allowscriptaccess','always');
s1.addParam("allowfullscreen","true");
s1.addVariable("width","210");
s1.addVariable("height","300");
s1.addVariable("file","list.xml"); //ดึงขอมูลมาแสดงจากไฟล์นี้
s1.addVariable('displayheight','150');
s1.addVariable('autoscroll','true');
s1.write("container");
</script>
</body>
</html>
#################################################################
แสดงผลเป็น :

Tag : PHP, HTML/CSS, JavaScript, jQuery, JAVA
|
ประวัติการแก้ไข 2012-09-01 13:54:22 2012-09-01 16:58:27 2012-09-01 23:32:13 2012-09-01 23:33:02
|
 |
 |
 |
 |
Date :
2012-09-01 13:51:39 |
By :
virus2008 |
View :
2229 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |