Developers Archive for the 'Html tags and issues' Category

Windows Media Player object in both Firefox and Internet Explorer

Windows Media Player object in both Firefox and Internet Explorer Wednesday, February 20th, 2008

We can create a media player which work well both in IE and netsacpe. It requires a windows media player plugin for firefox. You can install the plugin from Windows Media Plugin for Firefox.

This player can be used for playing audio and / or video.

For IE the object is

<object id=”contentPlayer” classid=”CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6″ width=”320″

height=”240″>
<param name=”URL” value=”‘+url+’” />
<param name=”uiMode” value=”none”>

Note: IE required the object ID. And url is a javascript variable for the location of the video /

audio file

And for Netscape the object is

<object id=”contentPlayer” type=”application/x-ms-wmp” data=”‘+url+’” width=”320″ height=”240″>
<param name=”URL” value=”‘+url+’” />
<param name=”uiMode” value=”none”>

Note: Netscape requires object type as application/x-ms-wmp this will be available from the

plugin mentioned earlier.

We can use additional parameter like
<param name=”autostart” value=”false”> to control the automatic playing of the audio/video.

Control can be create for various player events like play, pause, stop etc as follows

var wmp = document.getElementById(’contentPlayer’);

wmp.controls.play();
wmp.controls.pause();
wmp.controls.stop();
wmp.controls.fastForward();
wmp.controls.fastReverse();
wmp.settings.mute = true;
wmp.settings.volume = 50;
wmp.fullScreen = true;
wmp.URL = ‘./videos/my_video.wmv’;

convert BBCode to HTML

convert BBCode to HTML Tuesday, March 13th, 2007
BBCode is an abbreviation for Bulletin Board Code, the lightweight markup language used to format posts in many message boards. It is also called forum codes. The available tags are usually indicated by rectangular brackets surrounding a keyword, and they are parsed by the message board system before being translated into a markup language that web browsers understand, usually HTML or XHTML.<?php
function bbcode_format ($str) {
$str = htmlentities($str);

$simple_search = array(
‘/\[b\](.*?)\[\/b\]/is’,
‘/\[i\](.*?)\[\/i\]/is’,
‘/\[u\](.*?)\[\/u\]/is’,
‘/\[url\=(.*?)\](.*?)\[\/url\]/is’,
‘/\[url\](.*?)\[\/url\]/is’,
‘/\[align\=(left|center|right)\](.*?)\[\/align\]/is’,
‘/\[img\](.*?)\[\/img\]/is’,
‘/\[mail\=(.*?)\](.*?)\[\/mail\]/is’,
‘/\[mail\](.*?)\[\/mail\]/is’,
‘/\[font\=(.*?)\](.*?)\[\/font\]/is’,
‘/\[size\=(.*?)\](.*?)\[\/size\]/is’,
‘/\[color\=(.*?)\](.*?)\[\/color\]/is’,
);

$simple_replace = array(
‘<strong>$1</strong>’,
‘<em>$1</em>’,
‘<u>$1</u>’,
‘<a xhref=”$1″ mce_href=”$1″>$2</a>’,
‘<a xhref=”$1″ mce_href=”$1″>$1</a>’,
‘<div style=”text-align: $1;”>$2</div>’,
‘<img xsrc=”$1″ mce_src=”$1″ />’,
‘<a xhref=”mailto:$1″ mce_href=”mailto:$1″>$2</a>’,
‘<a xhref=”mailto:$1″ mce_href=”mailto:$1″>$1</a>’,
‘<span style=”font-family: $1;”>$2</span>’,
‘<span style=”font-size: $1;”>$2</span>’,
‘<span style=”color: $1;”>$2</span>’,
);

// Do simple BBCode’s
$str = preg_replace ($simple_search, $simple_replace, $str);

// Do <blockquote> BBCode

return $str;
}

?>

Mouse over text description

Mouse over text description Thursday, March 8th, 2007

We can create a mouseover text description, similar to an image alt tag, that will be viewed when mouse is placed over the text link. It will provide visitors regarding the information about the link.

We can place “TITLE=”text description”" within HTML link code.

<A href=”http://www.domainname.com/myaccount.php” mce_href=”http://www.domainname.com/myaccount.php” TITLE=”Click here to update your account”>User name</A>

In addition, we can display description text as a list by adding the characters following each text line.

<A href=”http://www.domainname.com/categories.php” mce_href=”http://www.domainname.com/categories.php” TITLE=”Various Categories:
Ringtones
Wallpapers
Video clips
and more… “>Categories</A>

We can view the above description list on mouse over.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.