A poor or faster way to add wptinybn support to wp TinyMCEComments plugin

3Ok let me at first tell why this post ?
I have a wp plugin named wptinybn which enables users to write in unicode bangla for different types of bengali keyboard in wp visual editor which is based on tinymce. Actually my wp plugin is based on my tinymce plugin tinybn. That means besides the wptinybn the tinybn plugin is a standalone tinymce plugin. So it should work with everywhere with tinymce. ok.. I am 25% done 🙂

There is another wp plugin named TinyMCEComments which enables wp users to write comments through tinymce editor. I am 50% done. Cool na ?

One of my reader asked me how to add the tinybn support to TinyMCEComments. I just check that plugin’s code and I have that plugin installed in my own blog too though not enabled! Yes my answer is yes … that means it’s possible. It can be done in different ways. As a quick thinking I am giving a poor or faster (whatever u think) way to do that. I am 75% done… wait a bit man.

Download the wptinybn and TinyMCEComments plugin and install them. (if u want not to install wptinybn to do that then it’s ok, I mean no dependency). Check wptinybn(unzip first!) folder and you should find a folder in it named “banglafkb”.Copy this and paste in wp-includes/js/tinymce/plugins folders in your blog wp installation. Done ? ok now …

hmm now you have to be more brave to edit the TinyMCEComments plugin… not much in deed. Open file tinyMCEComments.php and find the word “pls”. Stop to it’s first occurance the word will be like $pls and it’s a array and here parts of code is like
[code=’php’]$pls = array(‘separator’,’bold’,’italic’,’underline’,’strikethrough’,’justifyleft’,’justifycenter’,’justifyright’,’justifyfull’,’bullist’,’numlist’,’outdent’,’indent’,’cut’,’copy’,’paste’,’undo’,’redo’,’link’,’unlink’,’cleanup’,’help’,’code’,’hr’,’removeformat’,’sub’,’sup’,’forecolor’,’backcolor’,’charmap’,’visualaid’,’blockquote’,’spellchecker’,’fullscreen’);[/code]
now place // before this line and it will be like bellow
//$pls = array(‘separator’,’bold’,’italic’,’underline’,’strikethrough’,’justifyleft’,’justifycenter’,’justifyright’,’justifyfull’,’bullist’,’numlist’,’outdent’,’indent’,’cut’,’copy’,’paste’,’undo’,’redo’,’link’,’unlink’,’cleanup’,’help’,’code’,’hr’,’removeformat’,’sub’,’sup’,’forecolor’,’backcolor’,’charmap’,’visualaid’,’blockquote’,’spellchecker’,’fullscreen’);[/code]
we just kept the old code .
now in new line put this bellow code
$pls = array(‘separator’,’bold’,’italic’,’underline’,’strikethrough’,’justifyleft’,’justifycenter’,’justifyright’,’justifyfull’,’bullist’,’numlist’,’outdent’,’indent’,’cut’,’copy’,’paste’,’undo’,’redo’,’link’,’unlink’,’cleanup’,’help’,’code’,’hr’,’removeformat’,’sub’,’sup’,’forecolor’,’backcolor’,’charmap’,’visualaid’,’blockquote’,’spellchecker’,’fullscreen’,’banglafkb’);

If you check the above code what I have added new here ? just that ,’banglafkb’

I am 90% done. Now to to your admin panel activate tinymcecomments plugin then from menu Settings go to it’s(that plugin’s) setting page and check (if you done above copy pase and code editing) ‘banglafkb’ is in the button list and in the available plugin list. Just click both banglafkb to add from button list and plugin list. For button list click seperator before banglafkb that will be make a | seperator in editor. Now save this new option and check your comment form.

Angry one me ? You have done every thing properly but nothing new in the editor and u don’t see any change in the preview editor int the plugin options page. Don’t worry. The plugin keeps the setting in cache for 10 days. So to get the changes within one sec just open the tinyMCEComments.php file and pls check from top few liens code

there is a line like
$mcecomment_expiresOffset = 3600 * 24 * 10; // Cache for 10 days in browser cache
make this line comment I mean like
//$mcecomment_expiresOffset = 3600 * 24 * 10; // Cache for 10 days in browser cache
and now put a new line bellow it like
$mcecomment_expiresOffset = 1; // Cache for 1 sec in browser cache

now save this file and check the option’s page’s preview editor.

I think I am 100% done now. mu ha ha.

Oh I forgot to say currently I am working on a joomla plugin to make the dates in bangla for front end for articles, actually it will work with com_content …hope to release this on the eid-durga puja vacation.

Again here is some screenshot(one is above) of this post’s summary.MCEComments Options ‹ Let’s start again… — WordPress_1251930556673MCEComments Options ‹ Let’s start again… — WordPress_1251930589424MCEComments Options ‹ Let’s start again… — WordPress_1251930628482

Adding no follow for links in wp comments

Don't Follow MeOne of my senior brother just asked me, how to add no follow rel for comments in wordpress. May be there is plugin for this. Look to my code 🙂
How to use:
1.Open the functions.php file in ur current theme and put these code within php tags.

What it will do:
1. Will add ‘no follow’ as rel in url , if comment contains any url.
2. Will ad ‘external’ as rel in url , if comment contains any url.
3. Will add target=”_blank” in comment author’s url so that their web url open’s in new window/new tab as in browser settings
4. Will add target=”_blank” to url, if comment contains any url
5. Wp adds ‘no follow’, ‘external’ rel in comment author’s url by default. So we don’t need to add this 😛

1.If possible upgrade to wp2.8.2

[code language=”php”]
function nofollow($text) {
$text = preg_replace(‘/<a /i’,'<a rel="nofollow external" ‘,$text);
$text = preg_replace(‘/<a /i’,'<a target="_blank" ‘,$text);
return $text;
function targetblank($text){
$text = preg_replace(‘/<a /i’,'<a target="_blank" ‘,$text);
return $text;

add_filter(‘comment_text’, ‘nofollow’);

any question ask me 🙂
p.s.: post image is just for fun 😛

BTW, are you afraid of editing your functions.php ? Ok, no problem you can add the above piece of code using the bellow wp plugin.

  Wp nofollow plugin for comment (997 bytes, 2,108 hits)

Duh, you are totally unhappy with this post, na ? You can to treat your commentors with “cake and cook”, ok no problem.Just forget my post and read this blog post …“The Single, Most Profound Way To Thank Your Commenters”.
Happy now ?

Tinybn for wordpress

Yah, I know my developed tinybn (an ekushey project ,  tinymce plugin to write bangla in tinymce editor) has so many bugs and even I will recommend not to use in any live :P. But we are crazy to write bangla in web in any condition… heh heh.. hmm I didn’t get time to update the scripts. Though updated them to make compatible for tinymce3.x. Yes, I am so lazy …I didn’t udpate the lastest version in ekushey 🙁

Even I made a plugin for wordpress to use this plugin in wordpress editor in Visual mode (that means tinymce is enabled :D).hmm I didn’t release this too. Let me release this for every body. Please keep this mind that it has bugs, yes it has so many bugs but I will be happy if ppl use this and give me feedback so that I can update this when I am free.

Let me show how the tinybn plugin in wordpress will show [ Screenshot taken from my blog,wp2.8.2]

How to use:
1. Download the zip given here for download and then unzip.
2. Copy the folder wp_tinybn_fixed to your wodpress plugin dir.
3.Activate the plugin
4. Try to write any new post/page in visual mode
Licence: GPL2

  Wp tinybn plugin 2.2 (20.6 KiB, 2,351 hits)

Any kind of negative and positive comment/feedback is welcome 🙂

version 2.1 released
1. Fixed bug for js if the language mode is in bangla :P. That was my mistake to migrate the plugin from tinymce2.x compatible to 3.x. I forgot to change the language file setting for bangla language and I didn’t use this plugin while bangla is active in backend :(. Oh I have to fix same thing for jce version of tinybn.
2. Special thank to Hasan

How to use timthumb in WP MU

I think to show the first image as thumb in wp front page or blog layout is very common for any theme. But to use it in wordpress mu version is not direct or need to do some hack or modify the normall process of adding timthub. Normally we upload images from wp media manager and use those in posts. In normal wordpress the upload dir is wp-content/uploads and files and images are uploaded to that directory. In wordpress mu version files are uploaded by user basis folder and for this wp-content/blogs.dir/userid is the uploaded dir for any image. here user id is named as folder name for each user. then wp-content/blogs.dir/userid/files. But when u browse the site the image link format is like http://yoursitename/files/year/month/image name but format is reshaped by the wp mu htacces which real physical path is like wp-content/blogs.dir/userid/files/year/month/image name.
Continue reading

Conflict between WP Security scanner plugin and Avatar Display

I think you are not clear yet about my post title. But I am posting this because I faced this problem in my blog. I used Gravatar to show comment author’s avatar in my blog’s comment page. But for some days avatar was not displayed in comment page and it’s was really big pain for me why the avatar was not showing ???? 🙁 . I checked the avatar display setting and didn’t find any problem there. At last I lost hope to solve this problem. One thing is I like to solve problem and max time I am passionate to solve my problems 😀 .

Today, at noon I had a good sleep and when I woke up, some thing came to my mind about my blog. I got the solution about my problem. Currently I am using 100 plugins(both active and inactive) in blog and WP Security Scan 2.3 is one of theme. Wp Security Scan has a feature that it can hide the wp version. 😛 Continue reading

Simple Ajax Tab for wordpress (Manchuwpajaxtab) v1.1

manchuajaxtabSimple Ajax Tab for wordpress or just Manchuwpajaxtab is a small plugin/widget for wordpress to show some important features of a blog in one place and make them ajax based so the loading time of blog is minimun. Here Recent Posts, Recent Comemnts, Tag clouds, Archives, Blogroll and Categories are packed together as tab..ajax based tab. I think it’s clear what the plugin does.

Demo: pls see the ajax tab in sidebar in my blog. Hope people using theme like me will like this plugin/widget.

How to install: Just download the attached file, unzip and upload to plugins folder. Activate the plugin from plugins  list , Now add the widget from Design->widgets. Continue reading