Archive for June, 2008

JW Flash Video Player

Tuesday, June 17th, 2008

Reference:
- Flash Player
- Example

<div id=”flvcontainer”>
<a href=”http://www.macromedia.com/go/getflashplayer”>Get the Flash Player</a> to see this player.</div>
<script type=”text/javascript” src=”swfobject.js”></script>
<script type=”text/javascript”>
var s1 = new SWFObject(”mediaplayer.swf”,”mediaplayer”,”428″,”268″,”8″);
s1.addParam(”allowfullscreen”,”true”);
s1.addVariable(”width”,”428″);
s1.addVariable(”height”,”268″);
s1.addVariable(”file”,”pele.flv”);
s1.write(”flvcontainer”);
</script>

HTML Meta Http-Equiv Refresh

Tuesday, June 17th, 2008

Specifies a delay in seconds before the browser automatically reloads the document. Optionally, specifies an alternative URL to load. E.g.

<META HTTP-EQUIV="Refresh" CONTENT="3;URL=http://www.some.org/some.html">

or (HTTP header)

Refresh: 3;URL=http://www.some.org/some.html

In Netscape Navigator, has the same effect as clicking “Reload”; i.e. issues an HTTP GET with Pragma: no-cache (and If-Modified-Since header if a cached copy exists).

Note: If a script is executed which reloads the current document, the action of the Refresh tag may be undefined. (e.g. <body onLoad= “document.location=’otherdoc.doc’>)

Javascript: addEventListener and attachEvent

Monday, June 16th, 2008


<script type=”text/javascript”>
function addListener(el, act, func) {
if (window.addEventListener) {el.addEventListener(act,func,false);}
else if (window.attachEvent) {el.attachEvent (”on”+act,func);}
else { eval(”el.on”+act+” = func;”);}
}
function documentOnLoad() { alert(123); }
addListener(window, “load”, documentOnLoad);
</script>

RSS Example

Monday, June 16th, 2008

<?php
header(’Content-Type: text/xml; charset=UTF-8′, true);
?>
<?php echo ‘<?xml version=”1.0″ encoding=”UTF-8″?’.'>’; ?>
<rss version=”0.92″>
<channel>
<title><?=$channel_title?></title>
<link><?=”http://”.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF'])?></link>
<description><?=$channel_description?></description>
<lastBuildDate><?php echo date(’D, d M Y H:i:s +0000′); ?></lastBuildDate>
<docs>http://backend.userland.com/rss092</docs>
<language>id</language>

<?php
// begin loop
?>
<item>
<title><?=$the_title_rss?></title>
<description><?=$the_content_rss?></description>
<link><?=$the_permalink_rss?></link>
</item>
<?php
// end loop
?>
</channel>
</rss>

Template Tags/query posts

Friday, June 13th, 2008

Query_posts can be used to control which posts show up in The Loop. It accepts a variety of parameters in the same format as used in your URL. (e.g. p=4 to show only post of ID number 4)

Why go through all the trouble of changing the query that was meticulously created from your given URL? You can customize the presentation of your blog entries by combining it with page logic (like the Conditional Tags) — all without changing any of the URLs.

(more…)

What is OpenID?

Wednesday, June 11th, 2008

OpenID eliminates the need for multiple usernames across different websites, simplifying your online experience.

You get to choose the OpenID Provider that best meets your needs and most importantly that you trust. At the same time, your OpenID can stay with you, no matter which Provider you move to. And best of all, the OpenID technology is not proprietary and is completely free.

(more…)