Title:  Real Media Files 2.0

Author: Ahmad

Description:
This mod will allow you to add ( rm & ram ) files into your post.
This mod will display real player to control the files.
The default behaviour of the player is off , The file wont start playing till the member click ( Play ).
This mod need Real Player plugin installed on the user's machine.

Updates on this version:
Enhanced function code.
Can now play movie files.
Show how much of the file is loaded.

Compatability: 1.9.5

Bonus :
BB buttons for default XMB board theme
BB buttons for xmbmods.com theme

Install Note: Before adding this mod to your forum, you should back up all files related to this mod.

License Note: This mod is released under the GPL License. A copy is provided with this software.

Author Note:
You downloaded this hack from XMBMods.com, the #1 source for XMB related downloads.
Please visit http://www.xmbmods.com/ for support.
=======================================================================================================

=======
Step 1:
=======

===================
Edit functions.php:
===================

=====
Find:
=====
        $patterns[] = "#\[email=([^\"'<>]*?){1}([^\"]*?)\](.*?)\[/email\]#Smi";
        $replacements[] = '<a href="mailto:\1\2">\3</a>';

==========
Add Below:
==========

        $patterns[] = '#\[real\](http[s]?|ftp[s]?){1}://([:a-z\\./_\-0-9%~]+){1}(\?[a-z=_\-0-9&;~]*)?\[/real\]#mi';
        $replacements[] = '<table border="0" cellpadding="0" align="center">
        <tr><td>
        <OBJECT id="rvocx" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="320" height="240">
        <param name="src" value="\1://\2\3">
        <param name="autostart: value="false">
        <param name="controls" value="imagewindow">
        <param name="console" value="video">
        <param name="loop" value="true">
        <EMBED src="http://servername/path/to/media.file" width="320" height="240" loop="true" type="audio/x-pn-realaudio-plugin" controls="imagewindow" console="video"autostart="false">
        </EMBED>
        </OBJECT>
        </td></tr>
          <tr><td>
          <OBJECT id="rvocx" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="320" height="30">
          <param name="src" value="\1://\2\3">
          <param name="autostart" value="false">
          <param name="controls" value="ControlPanel">
          <param name="console" value="video">
          <EMBED src="http://servername/path/to/media.file" width="320" height="30" 
          controls="ControlPanel" type="audio/x-pn-realaudio-plugin" console="video" autostart="false">
          </EMBED>
          </OBJECT>
          </td></tr>
        <tr><td align="center">
        <a href="\1://\2\3" style="font-size: 85%;" target="_blank">Launch in external player</a>
        </td></tr>
      </table>';

        
=======================================================================================================

=======
Step 2:
=======

=============================
Edit include/bbcodefns-ie.js:
=============================

=====
Find:
=====

function underline() {
      if (helpmode) {
        alert(bbcode_help_underline);
    }else if (advmode) {
        AddText('', '', "[u] [/u]", messageElement);

    }else {
        txt=prompt(bbcode_prompt_underline,"Text");
        if (txt!=null) {
            AddText('', '', "[u]"+txt+"[/u]", messageElement);
        }
    }
}

==========
Add below:
==========

function real() {
    if (helpmode) {
        alert(bbcode_help_real);
    } else if (advmode) {
        AddText('', '', '[real] [/real]', messageElement);
    } else {
        txt = prompt(bbcode_prompt_real, 'http://');
        if (txt != null) {
            AddText('', '', '[real]'+txt+'[/real]', messageElement);
        }
    }
}

=======================================================================================================

=======
Step 3:
=======

==================================
Edit include/bbcodefns-mozilla.js:
==================================

=====
Find:
=====

function underline() {
    if(helpmode) {
        alert(bbcode_help_underline);

    } else if(advmode) {
        if(hasSelection(messageElement)) {
            wrapText('[u]', '[/u]', messageElement);
        } else {
            AddText('[u]', '[/u]', ' ', messageElement);
        }

    } else {
        if(hasSelection(messageElement)) {
            text = prompt(bbcode_prompt_underline, fetchSelection(messageElement));
            if(text == fetchSelection(messageElement)) {
                wrapText('[u]', '[/u]', messageElement);
            } else {
                AddText('[u]', '[/u]', text, messageElement);
            }
        } else {
            text = prompt(bbcode_prompt_underline, 'Text');
            AddText('[u]', '[/u]', text, messageElement);
        }
    }
}

==========
Add below:
==========

function real() {
    if(helpmode) {
        alert(bbcode_help_real);

    } else if(advmode) {
        if(hasSelection(messageElement)) {
            wrapText('[real]', '[/real]', messageElement);
        } else {
            AddText('[real]', '[/real]', ' ', messageElement);
        }

    } else {
        if(hasSelection(messageElement)) {
            text = prompt(bbcode_prompt_real, fetchSelection(messageElement));
            if(text == fetchSelection(messageElement)) {
                wrapText('[real]', '[/real]', messageElement);
            } else {
                AddText('[real]', '[/real]', text, messageElement);
            }
        } else {
            text = prompt(bbcode_prompt_real, 'Text');
            AddText('[real]', '[/real]', text, messageElement);
        }
    }
}

=======================================================================================================

=======
Step 4:
=======

================================
Edit include/bbcodefns-opera.js:
================================

=====
Find:
=====

function underline() {
      if (helpmode) {
        alert(bbcode_help_underline);
    }else if (advmode) {
        AddText('', '', "[u] [/u]", messageElement);

    }else {
        txt=prompt(bbcode_prompt_underline,"Text");
        if (txt!=null) {
            AddText('', '', "[u]"+txt+"[/u]", messageElement);
        }
    }
}

==========
Add below:
==========

function real() {
      if (helpmode) {
        alert(bbcode_help_real);
    }else if (advmode) {
        AddText('', '', "[real] [/real]", messageElement);

    }else {
        txt=prompt(bbcode_prompt_real,"Text");
        if (txt!=null) {
            AddText('', '', "[real]"+txt+"[/real]", messageElement);
        }
    }
}

=======================================================================================================

=======
Step 4:
=======

========================================
Go to Administration Panel -> Templates:
========================================

==============================
Edit template functions_bbcode
==============================

=====
Find:
=====

var bbcode_help_code = "$lang[bbcode_help_code]";
var bbcode_prompt_code = "$lang[bbcode_prompt_code]";

==========
Add Below:
==========

var bbcode_help_real = "$lang[bbcode_help_real]";
var bbcode_prompt_real = "$lang[bbcode_prompt_real]";

=======================================================================================================

=======
Step 5:
=======

========================================
Go to Administration Panel -> Templates:
========================================

====================================
Edit template functions_bbcodeinsert
====================================

=====
Find:
=====

<a href="javascript:list()"><img src="$imgdir/bb_list.gif" border="0" width="23" height="22" alt="$lang[cb_insert_list]"></a></td>

==========
Add Above:
==========

<a href="javascript:real()"><img src="$imgdir/bb_real.gif" border="0" width="23" height="22" alt="$lang[cb_insert_real]"></a>

=======================================================================================================

=======
Step 6:
=======

=====================
Edit English.lang.php
=====================

===========
Add to end of file:
===========

$lang['bbcode_prompt_real'] = "Please enter the URL for the Real media file ( rm or ram )";
$lang['bbcode_help_real'] = "Real Tag\\nInserts a Real media file into the post.Usage: [real]http://www.anywhere.com/file.rm[/real]";


=======================================================================================================

Upload bb_real.gif from the 'Contents' folder to your theme directories and enjoy!