Posted by & filed under Bangla Blogs, Tips and Tricks, wordpress, Wordpress Plugin, Wordpress Themes.

গতকাল ওয়ার্ড প্রেস নিয়ে লিখেছিলাম এই টপিকে এবং আমার ব্লগে এখানে। আজকে আবার নতুন কিছু নিয়ে লিখবো ,সাথে সাথে গতকালের ধারবাহিকতা চলবে। আমরা এই সিরিজের মূল উদ্দেশ্য ওয়ার্ড প্রেসের নরমাল ইউজার থেকে শুরু করা ওয়ার্ড প্রেস বেসড ওয়েব ডেভেলপার সবার জন্য আমার জানা ট্রিক্স ও তথ্যগুলো শেয়ার করাঃ
তিনঃ ‘থীমে সাব থীম ফাইল যুক্ত করা’

আগের দিন বলেছিলাম কিভাবে নতুন হেডার ফাইল যুক্ত করা যায়। চাইলে নিচের মতো করেও আমরা নতুন ফাইল থীমের যে কোন জায়গায় যুক্ত করতে পারি। কারণ একই ফাইলে অনেক কিছু লিখলে ট্রাক রাখা সমস্যা হয়।

< ?php include (TEMPLATEPATH . '/yourfilename.php'); ?>

yourfilename.php নামের ফাইলটি আপনার বর্তমান এক্টিভ বা যে থীম নিয়ে কাজ করছেন তার ভেতর রাখুন। আর অন্য থীম ফাইলের যেখানে দরকার সেখানে ব্যবহার করুন। TEMPLATEPATH আপনার বর্তমান থীমের ডিরেক্টরী। প্রশ্ন করতে পারেন এমন ঝামেলা কেন করবো বা এটার সুবিধা কি তাই তো ? হুম… ওয়ার্ড প্রেস দিয়েই আপনি চাইলে জুমলার মতো সাইটে বানিয়ে ফেলতে পারেন। জুমলাতে আমরা মডুল প্লেস হিসাবে যা বলে থাকি ওয়ার্ড প্রেসে তাকে বলা হয় সাইডবার(sidebar) আর মডুল গুলোকে ওয়ার্ড প্রেসের ভাষায়(বলা যেতে পারে) উইজেস(widget). আপনি চাইলে ওয়ার্ড প্রেসে যত ইচ্ছা সাইড বার ব্যবহার করতে পারেন তবে আপনার থীমে সেই সাপোর্ট থাকতে হবে। এই বিষয়টা নিয়ে পরের পোস্টে লিখি তাহলে।

চারঃ ‘ওয়ার্ড প্রেসে যত ইচ্ছা সাইড বার যুক্ত করা’

প্রথমেই বলে রাখি নতুন কিছু জানার আগ্রহ না থাকলে বা এক্সপেরিমেন্ট করার ইচ্ছা না থাকলে এখনই মানে মানে কেটে পড়তে পারেন না হলে পরে পস্তাবেন। :ttt:

‘তিন’ নং টিপ্সের কিছু বলা দরকার। ওয়ার্ডপ্রেসে আমরা নিচের কোড টুকু দিয়ে সাইডবার ফাইলটি লোড করি।

< ?php get_sidebar(); ?>

এটা যা করে তা হলো থীমের ভেতর sidebar.php ফাইলটা include করে। এখন যদি আপনার বিশেষ পাতায় বিশেষ কোড লেখা সাইড বার দরকার হয় তাহলে কি করবেন সেটা যদি এখনও না ভেবে থাকেন তাহলে আপনার উপর আমি এখনি কিন্তু খেপে গেছি। >:D< হ্যাঁ সেই আগের ট্রিক্স এখন যে সাইড বার ফাইলটা আছে সেটা কপি করে নতুন ফাইলে হিসাবে সেইভ করুন আর নাম দিন আগের সেই ফরম্যাটে যেমন sidebar-mycustomsidebar.php আর এই ফাইলে নিজের ইচ্ছা মতো পরিবর্তন করুন। আর এটা লোড করুন এই ভাবে

<?php get_sidebar('mycustomsidebar'); ?>

। মজা ?

Read more »

Posted by & filed under Bangla Blogs, Tips and Tricks, wordpress.

“ওয়ার্ড প্রেস টিপ্স” এ ধারাবাহিক ভাবে ওয়ার্ড প্রেস বিষয়ক ছোট ছোট তথ্য দেওয়ার চেস্টা করবো।
নোটঃ কিছু কিছু টিপ্স এডভান্সড লেভেলের হতে পারে যা প্রফেশনাল ওয়ার্ড প্রেস বেসড ওয়েব ডেভেলপারদের জন্য কাজে দিবে আশা করি।

একঃ কাস্টম হেডার ফাইল বা header.php ফাইল কোন পাতায় যুক্ত করাঃ
সাধারণত আমরা এমন ভাবে থীম বানায় যে সাইট যেন হেডার, বডি, ফুটার এই ভাবে থাকে। আর এই চিন্তা থেকেই ওয়ার্ড প্রেস থীম এর কোর ফাইল হিসাবে header.php , footer.php ফাইল দুইটা থাকে। আর header.php ফাইল যুক্ত করার জন্য index.php, category.php ইত্যাদি ফাইলে আমরা ওয়ার্ড প্রেসের একটা টেমপ্লেট ফাংশন লিখিঃ

< ?php get_header(); ?>

যা header.php ফাইলটা লোড করে
এবং একই ভাবে footer.php ফাইলে যুক্ত করার জন্য লিখি এই রকমঃ Read more »

Posted by & filed under wordpress, Wordpress 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

$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');

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');

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

Posted by & filed under Java script, Joomla, Joomla Extention.

Dear Friends,

I know there is no update on tinybn for many days and it has so many bugs but I am not gone yet ! heh heh. I think who are very familiar with joomla and it’s content editor tinymce, are also familiar with jce(joomla content editor), a joomla conent editor based on tinymce with lots of feature. You can get jce here. Please check their donwload section to download the jce component and jce plugin/mambot(editor).

hmm, please don’t get sleep … I just made a plugin for jce to use my tinybn plugin directly in jce. No manuall install needed , I mean editing files to work with default tinymce.
So , here is the download file of tinybn for jce.

Download

  Tinybn JCE Editor (12.1 KiB, 8,618 hits)

How to install

1. Install jce component (that will help you to modify or control jce editor and install new plugin and much more)
2. Install jce plugin
3. Now install tinybn plugin for jce. Go to Administrator-> Components-> JCE Administrations-> Install (see screenshot bellow)
4. Now browser the downloaded zip file and install it.

tinybnjce1

that’s it.
Install finish 🙂 . Ok now go to article manager and try to open/write any new article. I think you are intelligent enough to make your editor default to jce or even disabled tinymce from plugins. If jce is your current editor and you have install the tinybn for jce according to instruction then you should see like bellow. Select keyboard and type in diff bengali layout.

tinybnjce2

mu ha ha…waiting for your feedback.

Posted by & filed under wordpress, Wordpress Plugin, Wordpress Themes.

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 😛

Tips:
1.If possible upgrade to wp2.8.2

      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');
    add_filter('get_comment_author_link','targetblank');

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, 1,850 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 ?

Posted by & filed under wordpress, Wordpress Plugin.

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]
wptinybn

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
Download:

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

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

update:
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

Posted by & filed under Joomla, Projects.

It’s many days I didn’t write any thing here. I am not lost yet ! heh heh really I am not lost. Within last 4/5 months I did lots of projects. I said in many place that I started my professional career in jan 2008 and then it was hampered by so many things. I back to work again 4/5 months ago and now working as a full time freelancer at home. Yes I like to work with full freedom though working from home has some bad sides. Let me introduce you with some of my last 4/5 months projects. Hei ! I am really and here every thing is in brief.

ISLAM TRIBUNE_1248087112584Time.com clone (look and feel) using wordpress: Though time.com changes their layout frequently, I made a clone of it’s interface using wordpress, I mean the theme of wordpress. Here is snapshot of that. Oh yes, at first I made it red as time.com and then changed the red color to greenish. It’s for islamtribune.com.

BBC NEWS_1248108686378
BCC.co.uk clone using wordpress: I mentioned in another post that I made a theme for wordpress with same look and feel of bbc.co.uk. It’s front page is like bbc.co.uk and innner pages are like news.bbc.co.uk . sexy na ? heh heh.. wana see demo. check here. Here is screenshot.

secondbillysecondbilly.com clone of mobile.de: A german site for furniture market. It’s using  joomla and market place component , though it’s customized too much. The main marketplace component is customized as needed and some custom modules are developed to give support to the component in front end. It’s in german language 🙂 Visit the site from here(http://www.secondbilly.com/).

Will update mores in another post 🙂

Posted by & filed under wordpress, Wordpress Plugin, Wordpress Themes.

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.
Read more »

Posted by & filed under Joomla, Joomla Extention.

I think JW Player(flash player) by longtailvideo.com is well known to u all. There are so many extension for joomla, wordpress, drupal and other cms using this tool. Simple_video_flash_player is a joomla module to show flash and other videos. Today I used it with one of project. But after checking in ie6 I was tempered becuase it was showing a js error in ie and the modules config file I meant he xml file has not param to show module class suffix which is very important to style module using css. I searched google and got so many solution. Here is my code that helped to solve this issue in ie6.
Read more »

Posted by & filed under Joomla.

I always like to share web related silly problems that I face in my works.
If u are a joomla fan and u like to make a image gallery in joomla then rsgallery2 can be ur better(to me it’s best) choise. But one thing that I faced in joomla1.5(don’t know about the condition in joomla1.x series) about rsgallery2 is it’s title and pathway problem when it’s just connected as component from menu I mean just when u go to rsgallery2 as from menu as a component it doesn’t show any breadcrumb(pathway) and pagetitle

I searched google and joomla forum for this but didn’t get much help actually. BTW, at this time the rsgallery2 site is down for maintenance. So I gave a try to fix this as I always do.

At first let me clear about the problem. When first time u will go to rsgallery2 as component, in this condition no gallery is selected and no items in any gallery ie, no gallery id or current gallery is as no gallery id

Not clear yet, check the code in com_rsgallery2\templates\meta\display.class.php and in function showRSPathWay()…To get it clearly u have to check this function dear

see this
if ( $gallery->id == $currentGallery && empty($item) )

this is true when just go to rsgallery2 because no items and both the gallery id is null and currentgallery id is null and
as it’s true the code is executed as $pathway->addItem($gallery->name );
but as gallery id is null then it’s doesn’t show any gallery name… isn’t it a bug huh ? that means pathway fails to show any thing for this condition and same problem in
function metadata() which shows the pagetitle for rsgallery2 and meta information.

Here is the code that I edited for those two functions


/**     * shows proper Joomla path     */
function showRSPathWay() {
		global $mainframe, $mosConfig_live_site, $Itemid, $option;
		// if rsg2 isn't the component being displayed, don't show pathway
		if( $option != 'com_rsgallery2' )	return;

		$gallery = rsgInstance::getGallery();
		$currentGallery = $gallery->id;
		$item = rsgInstance::getItem();
		$galleries = array();
		$galleries[] = $gallery;
		while ( $gallery->parent != 0) {
			$gallery = $gallery->parent();
			$galleries[] = $gallery;
		}
		$galleries = array_reverse($galleries);
		if( defined( 'J15B_EXEC' ) )
		{
			// J1.0 method
			foreach( $galleries as $gallery )
			{
				if ( $gallery->id == $currentGallery &amp;&amp; empty($item) )
				{
					$mainframe->appendPathWay($gallery->name);
				} else {
					$mainframe->appendPathWay('<a href="' . JRoute::_('index.php?option=com_rsgallery2&amp;Itemid='.$Itemid.'&amp;gid=' . $gallery->id) . '">' . $gallery->name . '</a>');
				}
			}
			if (!empty($item)) {
					$mainframe->appendPathWay( $item->title );
			}
		}
		else
		{
			// J1.5 method
			$pathway =&amp; $mainframe->getPathway();

			/*Edit start by manchumahara*/
			$document	=&amp; JFactory::getDocument();
			$params = &amp;$mainframe->getParams();
			$menus	= &amp;JSite::getMenu();
			$menu	= $menus->getActive();
			$pagetitle = '';
			if (is_object( $menu ))
			{
				$menu_params = new JParameter( $menu->params );
				if (!$menu_params->get( 'page_title'))
				{
					$pagetitle = JText::_('MRSGALLERYTITLE');
					//loading it from language file
				}
				else $pagetitle =$menu_params->get( 'page_title');
			}
			else
			{
				$pagetitle = JText::_('MRSGALLERYTITLE');
				//loading it from language file
			}
			//$pagetitle = $mainframe->getPageTitle();
			foreach( $galleries as $gallery )
			{
				if ( $gallery->id == $currentGallery &amp;&amp; empty($item) )
				{
					if($gallery->id== 0){
						//gallery id zero and no items ie, if menu is link to component directly
						$pathway->addItem($pagetitle);
					}
					else
					{
						//gallery id not zero,ie gid id ok but no items in this gallery
						$pathway->addItem($gallery->name );
					}
				} else
				{
					$link = 'index.php?option=com_rsgallery2&amp;gid=' . $gallery->id;
					$pathway->addItem( $gallery->name, $link );
				}
			}
			/*Edit end by manchumahara*/

			/*Edit start by manchumahara*/
			if (!empty($item)) {
				$mainframe->appendPathWay($item->title );
				//$mainframe->appendPathWay( $title );
			}
			else {$mainframe->appendPathWay($pagetitle);}
			/*Edit end by manchumahara*/
		}
	}
	/**	 * insert meta data into head	 */
	function metadata(){
		global $mainframe, $option;
		// if rsg2 isn't the component being displayed, don not append meta data
		if( $option != 'com_rsgallery2' )
			return;		/*Edit by manchumahara*/
		$document	=&amp; JFactory::getDocument();
		$params = &amp;$mainframe->getParams();
		$menus	= &amp;JSite::getMenu();
		$menu	= $menus->getActive();
		$pagetitle = '';
		if (is_object( $menu )) {
			$menu_params = new JParameter( $menu->params );
			if (!$menu_params->get( 'page_title')) {
				$pagetitle = JText::_('MRSGALLERYTITLE');
				//loading it from language file
			}
			else $pagetitle =$menu_params->get( 'page_title');
		}
		else
		{
			$pagetitle = JText::_('MRSGALLERYTITLE');
			//loading it from language file
		}

		/*Edit start by manchumahara*/
		$title = $this->gallery->get('name');
		$description = htmlspecialchars(strip_tags($this->gallery->get('description')), ENT_QUOTES );
		$item = rsgInstance::getItem();
		if ($item != null){
			$title .= ' - ' . $item->title;
			$description .= ' -  ' . htmlspecialchars(strip_tags($item->descr), ENT_QUOTES );
		}

		/*Edit end by manchumahara*/

		if($title == ''){ $title = $pagetitle;}

		/*Edit start by manchumahara*/
		$mainframe->setPageTitle( ' '. $title );
		$mainframe->appendMetaTag( 'description',  $description );
	}

BTW, as if there is nothig set as pagetitle from menu then I showed it from language file and for this I made an entry in language file as like this. Open en-GB.ini file and put this line at the end
MRSGALLERYTITLE = RSGallery2