একটা নাটকের কাহিনী পরিকল্পনা করে ফেল্লাম !

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

আচ্ছা নাটকের কাহিনী বলার আগে একটা প্রশ্ন করি, কেউ কি কখনো মুরগীর স্বাভাবিক মৃত্যু দেখেছেন ? এই ব্যাপারটা গত দুই তিন ধরে মাঝে মাঝেই চিন্তা সীমানায় আছড়ে পড়ছে !

এখন নাটকে আসা যাক, কাহিনীর নায়ক বলেন আর কুশিলব বলেন, প্রধান চরিত্রে আছেন একজন কুকুর(দ্য ডগ )।

এটা একটা কুকুরের আত্মকাহিনী বা এই রকম কিছু না, এটা একটা কুকুরের জীবনের এক খাবলা কাহিনী মানে কাহিনীর আগে পরে আরো অনেক ঘটনা আছে যা আমার জানা নাই।
Continue reading

How about joomla admin branding ?

I think if you are familiar with wordpress then you must know there are so many plugins to brand the wordpress login page(as well as registration page etc) but did u think something about joomla admin branding ? like changing the admin panel header joomla logo or header color etc ?

Good news is I just made a small system plugin which will do some cool things. Please, it’s a start, I will add more features if you ask, just ask me 😛
Let’s download the plugin, it’s for joomla1.5
To download please click here.

আসুন ওয়ার্ডপ্রেসের ড্যাশ বোর্ড পরিস্কার করি

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

ধাপ একঃ প্রথমে আপনার থীমের functions.php ফাইলে এ ২টি ফাংশন লিখতে হবে। মনে রাখবেন প্লাগিন এর কোডগুলো চাইলে functions.php ফাইলেও লেখা যায়। তাহলে শুরু করা যাকঃ
[code language=”php”]
//Define the function which unsets the boxes
function remove_dashboard_widgets() {
global $wp_meta_boxes;
myprint_r($wp_meta_boxes);
/*
//unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_right_now’]);
# Remove plugins feed
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_plugins’]);
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_plugins’]);
# Remove "WordPress News"
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_primary’]);
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_primary’]);
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_secondary’]);
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_secondary’]);
# Remove incoming links feed
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_incoming_links’]);
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_incoming_links’]);

unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_recent_drafts’]);
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_recent_comments’]);
unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_quick_press’]);
unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘events_dashboard_window’]);
*/
}
// Now hook in to the action
add_action(‘wp_dashboard_setup’, ‘remove_dashboard_widgets’, 20, 0);

//better print_r function taken from
//http://stackoverflow.com/questions/1386331/php-print-r-nice-table
function myprint_r($my_array) {
if (is_array($my_array)) {
echo "<table border=1 cellspacing=0 cellpadding=3 width=100%>";
echo ‘<tr><td colspan=2 style="background-color:#333333;"><strong><font color=white>ARRAY</font></strong></td></tr>’;
foreach ($my_array as $k => $v) {
echo ‘<tr><td valign="top" style="width:40px;background-color:#F0F0F0;">’;
echo ‘<strong>’ . $k . "</strong></td><td>";
myprint_r($v);
echo "</td></tr>";
}
echo "</table>";
return;
}
echo $my_array;
}

[/code]
Continue reading

Adding custom article submission form in joomla

In joomla registered user can submit article from front end. Today I am going to show how we can create new/custom view for article submission form. Here we need to go some technical steps. So let’s make a plan what we are going to do:

  1. Create new view
  2. Add custom option for that view via xml configuration
  3. Adding new menu with the new custom view
  4. Edit a core file to make this happen.

Create new view

To create a new view(view of MVC model used in joomla) at first copy paste the two files(form.php and form.xml) and rename as form2.php and form2.xml from directory components/com_content/views/article/tmpl.

Now modify the code for form2.php
Continue reading

Show/Hide comment status text in wordpress

I am again confused if my post title is perfect or not 🙁 So let me explain, sometimes we disable comment for any post or page and at last the text shows “Comments are closed” or something else in different ways. But in commercial projects we need to follow some good design where in some posts or pages we may need to enable comment or not. So, let’s put a trick in theme to show the comment text(comment status in more smart way)

In latest wordpress version the loop is in the loop.php file in the theme folder. So for comment we will get this line

[code language=”php”]
<?php comments_template( ”, true ); ?
[/code]

But how about we put

[code language=”php”]
<?php if($post->comment_status == "open"){comments_template( ”, true );} ?>
[/code]

That means if comment is off then we will not show any text like “Comments are closed” . I strongly believe this trick will make the design clean in some condition 😛

Thank you

Loading only component in joomla

I am not sure if my post title is perfect about what I want to express 😛 , let me clear. When we hit any link in joomla that must load any component with modules, header, footer … etc so many things. But what we need to do  if we want to load only the component part ? Ok if still you are not clear, then go to your template index.php file and check what you do with the following line

[code]<jdoc:include type="component" />[/code]

Yes I am talking about how we can load only the component with any link that the above line does. let you are in a link in your site for com_content, for me now I am in that link in my local test site. http://localhost/jtest/index.php?option=com_content&view=category&layout=blog&id=1&Itemid=50

If I go to the link I see full site. Ok now if I modify the url by appending &tmpl=component at end
http://localhost/jtest/index.php?option=com_content&view=category&layout=blog&id=1&Itemid=50&tmpl=component

I see only the component part. Please try yourself. This is how we can just show the component part. If you check your template folder there is a file named component.php which actually shows if component only link is opens. If that file is missing in your template then find in the system template folder. Also there are another two template files for error.php and offline.php which shows the error page and site offline mode page.

Now let me discuss when you may need to load the component only part. Let’s you want to show something via joomla native popup window, like you want to make popup login you can do this trick. Once I wrote a article about how to make modal (popup window) using joomla native modal javascript library.

Example: go to my joomla demo site  http://idea52.com/old/ click the feedback button, it will load the com_contact component in joomla native modal window.

Thank you.

Vacation is already great :)

Just back from a long and great vacation 🙂 May be thing last two years, I didn’t take such long break, around 14 days, yes it’s true 🙂 Had lots of fun with Family mates. First time some one from my family came dhaka to meet me, My senior brother and sister came to my place in dhaka , I was so happy to see them.

Senior Brother(Sumon) and Sister in law(Vabi) -Sanchita


Continue reading

How to Insert custom Quicktags into the WordPress Editor

WordPress has two type of editor, one is visual/wysiwyw that is tinymce or replace with other such editors and another is HTML editor that is we call quick tag editor. Today, I want to write something about how to add custom quick tags or custom buttons. I search about it in google and most guides to edit core quick tag javascript file. But I don’t like that and I made my own hack in my own way, though experts may think it’s childish 😛

So let come to point, I wanted to add some buttons that will give me option to add custom class name so that I can format the text well. Same thing can be done via Visual editor but you have to use a plugin named “Tinymce Advanced” which helps to add more advance buttons like styles(class lists) and so on. But for HTML mode or for quick tags editor I didn’t such plugins.
Continue reading