vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   New Posting Features - Urdu Editor Integration for vBulletin 4.1.6 (https://vborg.vbsupport.ru/showthread.php?t=271855)

simunaqv 10-10-2011 10:00 PM

Urdu Editor Integration for vBulletin 4.1.6
 
1 Attachment(s)
Hello,

Since the introduction of CKEditor in newer versions of vbulletin, the Urdu editor cannot be integrated simply by including some javascript code inside the headinclude template. I have therefore written a ckeditor plugin to enable Urdu text editing. This plugin is part of the Urdu editor integration that I am providing here. This makes it possible to type Urdu even in the wysiwyg mode. The following screenshots show the editor on the post page in standard editor mode and the wysiwyg mode respectively.


https://vborg.vbsupport.ru/external/2011/10/52.png

https://vborg.vbsupport.ru/external/2011/10/53.png

Installation

1. Unpack the zip-archive and upload the contents of the upload folder to your forum file area.

2. Import the product file product-urdu_editor.xml

3. Open template headinclude
Add at the end the following code:


HTML Code:

<script src="{vb:raw vboptions.bburl}/clientscript/jquery/jquery-1.6.1.min.js" type="text/javascript"></script>
<script src="{vb:raw vboptions.bburl}/clientscript/jquery/jquery.UrduEditor.js" type="text/javascript"></script>

<script language="JavaScript" type="text/javascript">
    jqcc = jQuery.noConflict(true);
    jqcc.fn.UrduEditor.defaults.EditorFont = 'Jameel Noori Nastaleeq';
    jqcc.fn.UrduEditor.defaults.LineBreak = false;
    jqcc(document).ready(function () {
        <vb:if condition="THIS_SCRIPT == 'newthread'">
            jqcc('#title').UrduEditor("14px");
            jqcc('#subject').UrduEditor("14px");
            jqcc('#tagpopup_ctrl').UrduEditor("14px");
        <vb:elseif condition="THIS_SCRIPT == 'newreply'" />
            jqcc('#title').UrduEditor("14px");
            jqcc(this).UrduEditor.writeKeyboard(jqcc('#vB_Editor_001_textarea'));
            jqcc('#vB_Editor_001_textarea').UrduEditor("18px");   
        <vb:elseif condition="THIS_SCRIPT == 'showthread'" />
            jqcc(this).UrduEditor.writeKeyboard(jqcc('#vB_Editor_QR_textarea'));
            jqcc('#vB_Editor_QR_textarea').UrduEditor("18px");
        <vb:elseif condition="THIS_SCRIPT == 'member'" />
            jqcc(this).UrduEditor.writeKeyboard(jqcc('#vB_Editor_QR_textarea'));
            jqcc('#vB_Editor_QR_textarea').UrduEditor("18px");             
        <vb:elseif condition="THIS_SCRIPT == 'editpost'" />
            jqcc("input[name='reason']").UrduEditor("14px");
            jqcc('#titlefield').UrduEditor("14px");
            jqcc('#editreason').UrduEditor("14px");
            jqcc(this).UrduEditor.writeKeyboard(jqcc('#vB_Editor_001_textarea'));
            jqcc('#vB_Editor_001_textarea').UrduEditor("18px");           
        <vb:elseif condition="THIS_SCRIPT == 'profile'" />
            jqcc('#buddylist_add_txt').UrduEditor("14px");
        <vb:elseif condition="THIS_SCRIPT == 'private'" />           
            jqcc('#pmrecips_ctrl').UrduEditor("14px");
            jqcc('#bccpmrecips_ctrl').UrduEditor("14px");
            jqcc('#title').UrduEditor("14px");
            jqcc(this).UrduEditor.writeKeyboard(jqcc('#vB_Editor_001_textarea'));
            jqcc('#vB_Editor_001_textarea').UrduEditor("18px");           
            jqcc('#vB_Editor_QR_textarea').UrduEditor("18px");
            jqcc('#searchuser_ctrl').UrduEditor("14px");
            jqcc('#searchtitle').UrduEditor("14px");
        <vb:elseif condition="THIS_SCRIPT == 'blog'" />
            jqcc('#quicksearch_blog_text').UrduEditor("14px");       
        <vb:elseif condition="THIS_SCRIPT == 'blog_post'" />
            jqcc("input[name='title']").UrduEditor("14px");
            jqcc(this).UrduEditor.writeKeyboard(jqcc('#vB_Editor_001_textarea'));
            jqcc('#vB_Editor_001_textarea').UrduEditor("18px");       
            jqcc('#tag_input').UrduEditor("14px");
        <vb:elseif condition="THIS_SCRIPT == 'blog_report'" />
            jqcc("textarea[name='reason']").UrduEditor("16px");
        <vb:elseif condition="THIS_SCRIPT == 'report'" />
            jqcc('#message').UrduEditor("14px");
        <vb:elseif condition="THIS_SCRIPT == 'content'" />
            jqcc('#title').UrduEditor("14px");
            jqcc(this).UrduEditor.writeKeyboard(jqcc('#vB_Editor_001_textarea'));
            jqcc('#vB_Editor_001_textarea').UrduEditor("18px");
            jqcc('#html_title').UrduEditor("14px");
            jqcc("textarea[name='description']").UrduEditor("16px");
            jqcc('#keywords').UrduEditor("14px");
            jqcc("input[name='title']").UrduEditor("14px");
            jqcc('#cms_node_title').UrduEditor("14px");
            jqcc('#cms_node_title').UrduEditor("14px");
        <vb:elseif condition="THIS_SCRIPT == 'infraction'" />
            jqcc('#title').UrduEditor("14px");
            jqcc(this).UrduEditor.writeKeyboard(jqcc('#vB_Editor_001_textarea'));
            jqcc('#vB_Editor_001_textarea').UrduEditor("18px"); 
        <vb:elseif condition="THIS_SCRIPT == 'entry'" />
            jqcc(this).UrduEditor.writeKeyboard(jqcc('#vB_Editor_QR_textarea'));
            jqcc('#vB_Editor_QR_textarea').UrduEditor("18px");     
        <vb:elseif condition="THIS_SCRIPT == 'group'" />
            jqcc('#groupname').UrduEditor("14px");
            jqcc('#groupdesc').UrduEditor("16px");
            jqcc("input[name='Subject']").UrduEditor("14px");
            jqcc(this).UrduEditor.writeKeyboard(jqcc('#vB_Editor_001_textarea'));
            jqcc('#vB_Editor_001_textarea').UrduEditor("18px");
            jqcc('#message').UrduEditor("14px");
        <vb:elseif condition="THIS_SCRIPT == 'group_inlinemod'" />
            jqcc("input[name='deletereason']").UrduEditor("14px");     
        <vb:elseif condition="THIS_SCRIPT == 'album'" />
            jqcc('#ititle').UrduEditor("14px");
            jqcc('#idesc').UrduEditor("14px");       
        <vb:elseif condition="THIS_SCRIPT == 'register'" />
            jqcc('#regusername').UrduEditor("14px");       
        </vb:if>
       
        jqcc('#navbar_username').UrduEditor("12px");       
        jqcc("input[name='query']").UrduEditor("13px");
        jqcc("input[name='q']").UrduEditor("14px");
        jqcc('#userfield_txt').UrduEditor("14px");
        jqcc('#tag_add_input').UrduEditor("14px");
        jqcc('#vb_login_username').UrduEditor("14px");     
    });
</script>

4. Open template editor_contents.css
Add at the end the following code:


HTML Code:

body.forum {
    font: 18px 'Jameel Noori Nastaleeq';
    direction:rtl;
}
body.content {
    font: 18px 'Jameel Noori Nastaleeq';
    direction:rtl;
}



Customization of the Urdu editor


In order to modify the font of the non-wysiwyg editor, change the font name in the following line:

HTML Code:

jqcc.fn.UrduEditor.defaults.EditorFont = 'Jameel Noori Nastaleeq';
To modify the font of the wysiwyg editor you will need to adapt the css code added to the editor_content.css template.

Update October 12, 2011


-fixed a bug in the CKEditor plugin that prevented Urdu editor integration in the standard editor mode.

SpaceStar 10-11-2011 08:26 PM

Assalamo Allaikum

Where to find: Open template editor_contents.css ?

Shadow 10-11-2011 08:51 PM

AdminCP --> Styles and Templates --> Search in Templates.

Type in editor_contents.css in to the box and select Yes on "Search Titles Only". Click Find and you should get what you're looking for.

SpaceStar 10-11-2011 08:54 PM

Quote:

Originally Posted by Shadow786 (Post 2256036)
AdminCP --> Styles and Templates --> Search in Templates.

Type in editor_contents.css in to the box and select Yes on "Search Titles Only". Click Find and you should get what you're looking for.

I did that - but I didn't find anything - that's why I posted here :)

SpaceStar 10-11-2011 11:37 PM

1 Attachment(s)
I found out why I couldnt find editor_contents.css - I was using an elder version of vBulletin.

It's a much needed mod for urdu boards, I have installed it and it works ok, though I have disabled it again. Reason? None of the icons are showing in the WYSIWYG editor, see image attached.

If you reply to a post and click in on the Urdu, the cursor jumps to the title field instead of the editing field.

Reply with Quote - does not work anfter this mod neither do the Reply button.

Quick reply looks very odd

M.Iftikhar 10-12-2011 01:31 AM

very nice brother i will cheeked this i am very thankful to you.....i am waiting many days ago...thanks

M.Iftikhar 10-12-2011 02:40 AM

does it work 4.1.7 i try but it could not work....please tell me does it work or not in 4.1.7..thanks and reply me soon.

M.Iftikhar 10-12-2011 03:22 AM

Quote:

Originally Posted by Shadow786 (Post 2256036)
AdminCP --> Styles and Templates --> Search in Templates.

Type in editor_contents.css in to the box and select Yes on "Search Titles Only". Click Find and you should get what you're looking for.

you can find editor_contents.css in CSS Templates...thanks

simunaqv 10-12-2011 06:10 AM

Quote:

Originally Posted by SpaceStar (Post 2256089)
I found out why I couldnt find editor_contents.css - I was using an elder version of vBulletin.

It's a much needed mod for urdu boards, I have installed it and it works ok, though I have disabled it again. Reason? None of the icons are showing in the WYSIWYG editor, see image attached.

If you reply to a post and click in on the Urdu, the cursor jumps to the title field instead of the editing field.

Reply with Quote - does not work anfter this mod neither do the Reply button.

Quick reply looks very odd

You don't need buttons to type Urdu or to switch language mode. These buttons are not available for wysiwyg mode. You can instead use the CTRL+SPACE shortcut for switching the language mode. Alternatively you can change preferences in your profile settings to use the standard editor instead of the wysiwyg one. This will then appear with the language controls.


Quote:

Originally Posted by M.Iftikhar (Post 2256131)
does it work 4.1.7 i try but it could not work....please tell me does it work or not in 4.1.7..thanks and reply me soon.

I did not test it on 4.1.7. What is the problem that you are facing?

M.Iftikhar 10-12-2011 07:23 AM

Standard Editor - Extra formatting controls USE KIY HA LAKIN YA WORK NAHI KR REHA YA MOD SELECT KRNA SE URDU TU BILKUL EDITOR MEIN TYPE NAHI HOTI.....
Enhanced Interface - Full WYSIWYG Editing..KRNA SE TYPE HOTI HA LAKIN NA BACKGROUND COLOR SHOW HOTA HA OR NA LANGUAGE CONTROL SHOW HOTA HA....ZARA BAHI YA KAM KR DY.......THANKS


All times are GMT. The time now is 05:13 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01168 seconds
  • Memory Usage 1,787KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_html_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete