Category Archives: Tips and Tricks

কপাল ! লোকজন কেমনে বুঝল আমি বড় মনিদের ভিডিও দেখছি অমুক সাইটে !!

“কপাল ! লোকজন কেমনে বুঝল আমি বড় মনিদের ভিডিও দেখছি অমুক সাইটে !!”  এই রকম অনুভূতি যে কারো হতে পারে। তবে কেন  এবং কিভাবে অন্য কেউ বুঝে ফেলছে থলের বিড়াল :) এমন প্রশ্ন মনে আসতেই পারে।

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

“Mr. X watched a video on Dailymotion”

Continue reading

Posted in Bangla Blogs, Tips and Tricks | 1 Comment

সম্ভাবনাময় নতুন তিনটি সোস্যাল নেটওয়ার্ক

ফেসবুক কিংবা টুইটার দীর্ঘদিন ধরে রাজত্ব করে যাচ্ছে আর সেই সাথে গুগল প্লাস এসে নিজের ব্যর্থ অবস্থান তৈরির চেস্টা করে যাচ্ছে। এতোদিন আমরা একটা সোস্যাল নেটওয়ার্কেই ক্ষুদ্র/বড় বার্তা শেয়ার(স্ট্যাটাস আপডেট), ছবি শেয়ার, ভিডিও শেয়ার ইত্যাদি করতাম… যেমন ফেসবুকে একই সাথে স্ট্যাটাস আপডেট, ছবি, ওডিও, ভিডিও, নোট লেখা, গেম খেলাসহ অনেককিছু করা যাচ্ছে। কিন্তু আমার মনে হচ্ছে আগামীতে এই ধারা অচিরেই এলোমেলো হয়ে যাবে… শুরু হবে ছবি শেয়ার নেটওয়ার্ক, ভিডিও শেয়ারিং নেটওয়ার্ক … একটা ব্যাপার হচ্ছে এই ধরনের সাইট কিন্তু আছে যেমন ফ্লিকার কিংবা ইউটিউব তবে এখানে যতনা বেশি শেয়ার হয় তার থেকে নেটওয়ার্কিং বা ফলোয়িং-ফলোয়ার সম্পর্ক এর টানাপোড়েন নিতান্তই কমই হয়। আর তাই খুব কম সময়ে তিনটি সোস্যাল নেটওয়ার্ক নতুন করে জায়গা করে নিচ্ছে যারা যথাক্রমে ছবি, ভিডিও এবং ওডিও শেয়ারিং সোস্যাল নেটওয়ার্ক …

পিন্টারেস্ট(http://pinterest.com/)

চিল(http://chill.com)

দিজইজমাইজ্যাম(http://www.thisismyjam.com/)

Posted in Tips and Tricks | 4 Comments

Break long url or word using css to prevent overflow of div container

First of all I am not design expert, not a designer but I learnt many thing about design I mean css, html while working with website projects. Something gave me pain when I found a long url is getting outside of a box(div) in google chrome. After a google search I found a solution… need to use word break though it doesn’t support all browser.

See how a long url go outside of a div box

I found a solution

.box{
white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap;    word-wrap: break-word;
}

thanks

Posted in CSS, Tips and Tricks | Tagged , , | Leave a comment

Detect User type in joomla 1.6 or later

In Joomla1.5.x we can detect user type easily or check if a user is admin type.

    $isadmin = false;
    $user           =&JFactory::getUser();
    if($user->usertype == "Super Administrator" || $user->usertype == "Administrator"){
        $isadmin = true;
    }

But from joomla 1.6 as the user group architecture is changed the above way will not work.
From j1.6 we can do this in this way, here actually I was trying to detect if the user is super user or not like admin user in j1.5

$isadmin = false;
    $user           =&JFactory::getUser();
    $db = JFactory::getDbo();
    //var_dump($user->getAuthorisedGroups());
    $userid         = intval($user->get( 'id' ));
    if($userid > 0){
        $query = $db->getQuery(true);
        $query->select('g.title AS group_name')
        ->from('#__usergroups AS g')
        ->leftJoin('#__user_usergroup_map AS map ON map.group_id = g.id')
        ->where('map.user_id = '.(int) $userid);
        $db->setQuery($query);
        $ugp = $db->loadObject();
        $usertype =  $ugp->group_name;
        if(is_string($usertype)) $usertype = array($usertype);
        if(in_array('Super Users', $usertype)){
            $isadmin = true;
        }
        //var_dump($usertype);
    }

thanks

Posted in Joomla, Tips and Tricks | Tagged | Leave a comment

My trouble story about ‘onContentPrepare’ hook for joomla

1. I was developing a content plugin for joomla, currently I was working with joomla1.6 or earlier.
2. My target was skip some specific or used defined category for the plugin execution as this is very useful feature.
3. It works in article details page but doesn’t work in other view of com_content component. Why
4. Here is the function that get’s hooked in content plugin for onContentPrepare
Continue reading

Posted in Joomla, Tips and Tricks | Tagged , , | 1 Comment

Showing custom taxonomy filter in custom post types in wordpress admin post listing

Please note that “this post is for them who knows custom post types and custom taxonomy in wordpress”

Isn’t the title enough to get what my article about ?

Let me paste the code what I did: I think I collected the basic code from somewhere and then edited as I need.
Continue reading

Posted in Tips and Tricks, wordpress, Wordpress Themes | 8 Comments

Virtuemart2.0 content plugin support/fix for joomla1.6+

I see virtuemart2 is compatible with joomla 1.6 , hope for 1.7 too. I see there is a issue for content plugin compatibility for vm2 in joomla1.6. Then checked the vm2 code where the plugin event if fired. I see the plugin trigger method is not compatible with 1.6 content plugin structure, the hook name is for old joomla 1.5 series

note: paths are windows style
folder components\com_virtuemart\views\productdetails open file view.html.php line 97
Continue reading

Posted in Joomla, Tips and Tricks | Tagged , | Leave a comment

Hirarchycal Category or Custom Taxonomy Select or Radio list for wordpress


I think the post title “Hirarchycal Category or Custom Taxonomy Select or Radio list for wordpress” says all what I want to say. I was just thinking to make admin like category or term widget to use on front end or theme or other places. So I took the code from wordpress core and used it. So here I am sharing the code with all.
Continue reading

Posted in Tips and Tricks, wordpress | Leave a comment

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

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

ধাপ একঃ প্রথমে আপনার থীমের functions.php ফাইলে এ ২টি ফাংশন লিখতে হবে। মনে রাখবেন প্লাগিন এর কোডগুলো চাইলে functions.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;
    }

Continue reading

Posted in Bangla Blogs, Tips and Tricks, wordpress, Wordpress Themes | Tagged | 8 Comments

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

Posted in Joomla, Tips and Tricks | 24 Comments