____                     ______      __    
/ _____________ ___ ___ / __/ / ___ / /____
_\ \/ __/ __/ -_/ -_/ _ \_\ \/ _ / _ / __(_-<
/___/\__/_/ \__/\__/_//_/___/_//_\___\__/___/
Normal State:
Shift State:

AltGR State:

   ___     ___                   __  _         
/ ____ / ____ ______ _ ___ _/ /_(____ ___
_/ // _ \/ _/ _ \/ __/ ' / _ `/ __/ / _ \/ _ \
/___/_//_/_/ \___/_/ /_/_/_\_,_/\__/_/\___/_//_/

Urdu OpenPad Integration:

This hack integrates Urdu OpenPad in your vBulletin forum. I am providing instructions to modify several templates. These changes are aimed at converting specific edit areas into Urdu edit areas. You can use the same procedure to convert any other edit area into an Urdu edit area. Please note that this integration is available for textarea-mode i.e. it does not work for the wysiwyg mode.

NOTE: It has been brought to my notice that users on some forums are having problems logging in with Urdu user names. This is because of the way Unicode data is handled in a non-Unicode forum. I recommend skipping the modifications in the navbar, STANDARD_ERROR, STANDARD_ERROR_LITE, STANDARD_ERROR_LOGIN and the register templates on these forums. 

Upload files:

Upload the contents of the upload folder to your forum root.

Template Changes:


in the headinclude template
===========================

FIND:

<if condition="$vboptions['externalrss']">
<link rel="alternate" type="application/rss+xml" title="$vboptions[bbtitle] RSS Feed" href="external.php?type=RSS2" />
<if condition="$show['foruminfo'] OR $show['threadinfo']">
<link rel="alternate" type="application/rss+xml" title="$vboptions[bbtitle] - $foruminfo[title_clean] - RSS Feed" href="external.php?type=RSS2&amp;forumids=$foruminfo[forumid]" />
</if>
</if>

AFTER ADD:

<script type="text/javascript" src="clientscript/OpenPad.js"></script>
<script type="text/javascript">
initUrduEditor();
</script>


in the navbar template
======================

FIND:

<td><input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /></td>
<td class="smallfont" colspan="2" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />$vbphrase[remember_me]</label></td>

REPLACE WITH:

<td colspan="3"><input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /><br /><script language="javascript" type="text/javascript">writeToggleControl("vb_login_username");makeUrduEditor("vb_login_username", 11)</script></td>

<td class="smallfont" colspan="3" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />$vbphrase[remember_me]</label></td>

FIND:

<div><input type="text" class="bginput" name="query" size="25" tabindex="1001" /><input type="submit" class="button" value="$vbphrase[go]" tabindex="1004" /></div>

REPLACE WITH:

<div><input type="text" class="bginput" name="query" size="25" tabindex="1001" /><input type="submit" class="button" value="$vbphrase[go]" tabindex="1004" />
<script language="javascript" type="text/javascript">makeUrduEditor("query", 11)</script>
</div>


in the STANDARD_ERROR template
==============================

FIND:

<td>$vbphrase[username]:<br /><input type="text" class="bginput" name="vb_login_username" size="50" accesskey="u" tabindex="1" /></td>

REPLACE WITH:

<td>$vbphrase[username]:<br /><input type="text" class="bginput" name="vb_login_username" id="vb_login_username_2" size="50" accesskey="u" tabindex="1" />
<br /><script language="javascript" type="text/javascript">makeUrduEditorById("vb_login_username_2", 11);writeToggleControl("vb_login_username_2", true)</script>
</td>

in the STANDARD_ERROR_LITE template
===================================

FIND:

<td>$vbphrase[username]:<br /><input type="text" class="bginput" name="vb_login_username" size="35" accesskey="u" tabindex="1" /></td>

REPLACE WITH:

<td>$vbphrase[username]:<br /><input type="text" class="bginput" name="vb_login_username" id="vb_login_username_2" size="35" accesskey="u" tabindex="1" />
<br /><script language="javascript" type="text/javascript">makeUrduEditorById("vb_login_username_2", 11);writeToggleControl("vb_login_username_2", true)</script>
</td>


in the STANDARD_ERROR_LOGIN template
====================================

FIND:

<td>$vbphrase[username]:<br /><input type="text" class="bginput" name="vb_login_username" size="50" accesskey="u" tabindex="1" /></td>

REPLACE WITH:

<td>$vbphrase[username]:<br /><input type="text" class="bginput" name="vb_login_username" id="vb_login_username_2" size="50" accesskey="u" tabindex="1" />
<br /><script language="javascript" type="text/javascript">makeUrduEditorById("vb_login_username_2", 11);writeToggleControl("vb_login_username_2", true)</script>
</td>


in the register template
========================

FIND:

<div class="smallfont" style="margin-bottom:$stylevar[formspacer]px">
<strong>$vbphrase[username]</strong>:<br />
<input type="text" class="bginput" name="username" size="50" maxlength="$vboptions[maxuserlength]" value="$username" />
</div>

REPLACE WITH:

<div class="smallfont" style="margin-bottom:$stylevar[formspacer]px">
<strong>$vbphrase[username]</strong>:<br />
<input type="text" class="bginput" name="username" size="50" maxlength="$vboptions[maxuserlength]" value="$username" />
<br /><script language="javascript" type="text/javascript">writeToggleControl("username");makeUrduEditor("username", 11)</script></td>
</div>

FIND:

<div id="referrerfield"><input id="referrerfield_txt" type="text" class="bginput" name="referrername" value="$referrername" size="50" maxlength="$vboptions[maxuserlength]" /></div>

REPLACE WITH:

<div id="referrerfield"><input id="referrerfield_txt" type="text" class="bginput" name="referrername" value="$referrername" size="50" maxlength="$vboptions[maxuserlength]" />
<br /><script language="javascript" type="text/javascript">writeToggleControl("referrername");makeUrduEditor("referrername", 11)</script></td>
</div>

in the editor_toolbar_off template
=================================

FIND:

<div style="text-align:$stylevar[left]" style="padding-right:8px">
<textarea name="message" id="{$editorid}_textarea" rows="10" cols="60" style="width:100%; height:{$editor_height}px" tabindex="1">$newpost[message]</textarea>
<!--width:$stylevar[messagewidth]-->
</div>

REPLACE WITH:

<div style="text-align:$stylevar[left]" style="padding-right:8px">
<textarea name="message" id="{$editorid}_textarea" rows="10" cols="60" style="width:100%; height:{$editor_height}px" tabindex="1">$newpost[message]</textarea>
<!--width:$stylevar[messagewidth]-->
<br /><script language="JavaScript" type="text/javascript">writeToggleControl("{$editorid}_textarea", true);</script>
<br /><script language="JavaScript" type="text/javascript">writeKeyboard();</script>
</div>


FIND:

<script type="text/javascript">
<!--
vB_Editor['$editorid'] = new vB_Text_Editor('$editorid', $editortype, '$forumid', '$parsesmilie');
//-->
</script>

REPALCE WITH:

<script type="text/javascript">
<!--
vB_Editor['$editorid'] = new vB_Text_Editor('$editorid', $editortype, '$forumid', '$parsesmilie');
<if condition="$bbuserinfo['showvbcode'] != 2">
makeUrduEditorById('{$editorid}_textarea', 18);
</if>
//-->
</script>


in the editor_toolbar_on template
================================

FIND:

<tr valign="top">
<td class="controlbar">
<textarea name="message" id="{$editorid}_textarea" rows="10" cols="60" style="display:block; width:$stylevar[messagewidth]; height:{$editor_height}px" tabindex="1" dir="$stylevar[textdirection]">$newpost[message]</textarea>
</td>
<if condition="$smiliebox"><td class="controlbar">$smiliebox</td></if>
</tr>

ADD AFTER:

<if condition="$bbuserinfo['showvbcode'] != 2">
<tr>
<td>
<script language="JavaScript" type="text/javascript">
writeToggleControl("{$editorid}_textarea", true);
</script>
</td>
</tr>
<tr>
<td>
<script language="JavaScript" type="text/javascript">
writeKeyboard();
</script>
</td>
</tr>
</if>

FIND:

<script type="text/javascript">
<!--
vB_Editor['$editorid'] = new vB_Text_Editor('$editorid', $editortype, '$forumid', '$parsesmilie', undefined, '$ajax_extra');
//-->
</script>


REPLACE WITH:

<script type="text/javascript">
<!--
vB_Editor['$editorid'] = new vB_Text_Editor('$editorid', $editortype, '$forumid', '$parsesmilie', undefined, '$ajax_extra');
<if condition="$bbuserinfo['showvbcode'] != 2">
makeUrduEditorById('{$editorid}_textarea', 18);
</if>
//-->
</script>


in the newreply template
========================

FIND:

<td><input type="text" class="bginput" name="title" value="$title" size="50" maxlength="$vboptions[titlemaxchars]" tabindex="1" title="$vbphrase[optional]" /><td>

REPLACE WITH:

<td><input type="text" class="bginput" name="title" value="$title" size="50" maxlength="$vboptions[titlemaxchars]" tabindex="1" title="$vbphrase[optional]" />
<br /><script language="javascript" type="text/javascript">writeToggleControl("title");makeUrduEditor("title", 14)</script>
</td>

in the newthread template
=========================

FIND:

<td><input type="text" class="bginput" name="subject" value="$subject" size="40" maxlength="$vboptions[titlemaxchars]" tabindex="1" /></td>

REPLACE WITH:

<tr>
<td><input type="text" class="bginput" name="subject" value="$subject" size="40" maxlength="$vboptions[titlemaxchars]" tabindex="1" />
<br />
<script language="javascript" type="text/javascript">writeToggleControl("subject");makeUrduEditor("subject", 14)</script>
</td>

in the showthread_quickreply template
=====================================

FIND:

<textarea name="message" id="{$editorid}_textarea" rows="10" cols="60" style="width:100%; height:{$editor_height}px" tabindex="1" dir="$stylevar[textdirection]"></textarea>
</if>
</fieldset>
<!--width:$stylevar[messagewidth]-->

ADD AFTER:

<if condition="$bbuserinfo['showvbcode'] != 2">
<br /><script language="JavaScript" type="text/javascript">writeToggleControl("{$editorid}_textarea", true);</script>
<br /><script language="JavaScript" type="text/javascript">writeKeyboard();</script>
</if>

FIND:

<script type="text/javascript">
<!--
vB_Editor['$editorid'] = new vB_Text_Editor('$editorid', $editortype, '$forumid', '$parsesmilie');
var QR_EditorID = '$editorid';
//-->
</script>


REAPLCE WITH:

<script type="text/javascript">
<!--
vB_Editor['$editorid'] = new vB_Text_Editor('$editorid', $editortype, '$forumid', '$parsesmilie');
var QR_EditorID = '$editorid';
<if condition="$bbuserinfo['showvbcode'] != 2">
makeUrduEditorById('{$editorid}_textarea', 18);
</if>
//-->
</script>


in the pm_newpm template
========================

FIND:

<div id="pmrecips"><textarea id="pmrecips_txt" name="recipients" rows="<if condition="is_browser('mozilla')">1<else />2</if>" cols="50" tabindex="1">$pm[recipients]</textarea></div>

REAPLCE WITH:

<div id="pmrecips"><textarea id="pmrecips_txt" name="recipients" rows="<if condition="is_browser('mozilla')">1<else />2</if>" cols="50" tabindex="1">$pm[recipients]</textarea>
<br /><script language="javascript" type="text/javascript">makeUrduEditor("recipients", 14);writeToggleControl("recipients")</script>
</div>


FIND:

<div id="bccpmrecips"><textarea id="bccpmrecips_txt" name="bccrecipients" rows="<if condition="is_browser('mozilla')">1<else />2</if>" cols="50" tabindex="1">$pm[bccrecipients]</textarea></div>

REAPLCE WITH:

<div id="bccpmrecips"><textarea id="bccpmrecips_txt" name="bccrecipients" rows="<if condition="is_browser('mozilla')">1<else />2</if>" cols="50" tabindex="1">$pm[bccrecipients]</textarea>
<br /><script language="javascript" type="text/javascript">makeUrduEditor("bccrecipients", 14);writeToggleControl("bccrecipients")</script>
</div>


FIND:

<td><input type="text" class="bginput" name="title" value="$pm[title]" size="50" maxlength="85" tabindex="1" /></td>

REPLACE WITH:

<td><input type="text" class="bginput" name="title" value="$pm[title]" size="50" maxlength="85" tabindex="1" />
<br /><script language="javascript" type="text/javascript">makeUrduEditor("title", 14);writeToggleControl("title")</script>
</td>

Adding custom css classes:

Add the following css definitions to the additional css classes

.btnFlat {
background: #ECECEC;
border: 1px solid #D3D3D3;
cursor: pointer;
cursor: hand;
text-align:center;
font-family:Urdu Naskh Asiatype;
font-size:12px;
}

.btnRaised, .btnFlat:hover {
background: #D3D3D3;
border: 1px outset;
cursor: pointer;
cursor: hand;
text-align:center;
font-family:Urdu Naskh Asiatype;
font-size:12px;
}
.btnLowered, .btnFlat:active {
background: #D3D3D3;
border: 1px inset;
cursor: pointer;
cursor: hand;
text-align:center;
font-family:Urdu Naskh Asiatype;
font-size:12px;
}
.hiddentext {display:none}
.outline {cursor:hand; text-decoration:underline}


a.switch
{
font-family: Times New Roman;
color:#0000FF;
font-size:xx-small;
direction:rtl;
text-decoration:none;
unicode-bidi:embed;
}

a.switch:hover
{
background-color:#FF6699;
}


   ___                                 __
/ _ \___ ____ ____ _____ _______/ /
/ ___/ _ `(_-<(_-| |/|/ / _ \/ __/ _ /
/_/ \_,_/___/___|__,__/\___/_/ \_,_/
password:- newadvanceit.blogspot.com
   ___                  __            ___            __   _      __     
/ _ \___ _ _____ / ___ ___ ____/ (____ ___ _ / / (____ / /_____
/ // / _ | |/|/ / _ \/ / _ / _ `/ _ / / _ / _ `/ / /__/ / _ \/ '_(_-<
/____/\___|__,__/_//_/_/\___\_,_/\_,_/_/_//_\_, / /____/_/_//_/_/\_/___/

Post a Comment

 
Top