Today's market is based on 3D and most things are doing by jQuery or Javascript to make fast loading application. Opacity is a part of CSS to make transparent image without PNG format. To set the opacity property to an image you can use: .img_transparent_class{ opacity: 0.5; } But this line will suitable for some latest browsers and it will not show effects in some browsers like IE 7 and IE8, etc. To apply in all browsers you can follow: .img_transparent_class { /* IE 8 */ ...

 

Wordpress is a powerfull tool for blog and it keep all data  in serialize format and user can easily get these values from database by get_option() function. But some time we need to use unserialize function to get some specific value from the string. So we simply use unserialize function on stored string and get value. Wordpress provides many type of widgets and some widgets provide interaction with social networks like linkedin, facebook, etc. and wordpress store its related value as...

 

Joomla 1.5 version provides facility to set page title for each page. But some times we do not need to show this page title on the page or can say that we want to change this page title. To do this process follow below steps: Go to Menu >> Main Menu Click on Main menu link in the Menus tab. You will redirect to all menus listing page. Click on Home link, you will redirect to Edit page of Home link. Here, you can edit the page title. and also if you do not want to show this...

 

If you are new to Joomla then you will do this silly mistake definitely. because in most cases new user don't aware from all terms of joomla and its admin panel. Joomla created for best content management system and during write the code, developers kept in mind each small users requirements. When you are creating an article and filled all information like article title, its description and also selected its section and category. Also you have assigned this article to a link in menu. But...

 

Joomla is a best custom management open source tool. It provides many type of functionality regarding theme, module and components. During development time we need to create some special function to use on home page only. or we can say that sometimes we want to show something (content) on the home page only. Joomla says Front page to the Home page in development environment. you can see the code in below: ...

 

In windows we can easily find the any file in the folder and it doesn't matter that how many folders inside that folder.. and it is possible by pressing F3 key on the keyboard. But in the linux we have to use command prompt to find such type of searching. In ubuntu we can do by following command: sudo grep -ir "keyword" . To run this command we need to go in the particular folder first. then we will run this command by terminal. Grep will search the keyword which typed in double quoted...

 

In many cases we add content in the database with replacing all html tags into special characters. But it generate problems when we want to show at front side. So here we are giving a best solution to show result as HTML: function __htmlConvertor($str) { $string = str_replace(array("<", ">", '&', ''', '"','<', '>'), array("<", ">",'&','\'','"','<','>'), htmlspecialchars_decode($str, ENT_NOQUOTES)); return $string; } Above function takes the string from...

 

When you install the phpmotion on your system you will find that captcha code is not showing on registration page. open includes/captcha.php and replace var $font = 'DoradoHeadline.ttf'; by var $font = './DoradoHeadline.ttf';

 

To view any changes in php.ini file or some LAMP server files we should restart the apache server again.  and you can do this by following commands: sudo /etc/init.d/apache2 stop sudo /etc/init.d/apache2 start Above both commands will stop the apache server and start again. But you can do restart apache server by single command only: sudo /etc/init.d/apache2 restart

 

We are assuming that you have installed LAMP on your ubuntu operating system. But you are not getting errors in php files when file has any syntax or fatal error. So you see these errors by following below steps: Open you php.ini file by below command: sudo gedit /etc/php5/apache2/php.ini First confirm your php.ini file location by phpinfo. Search display_errors = Off and change this line by display_errors = On and save and close. Now, restart your apache by below...

 

In many cases we do not want make two buttons to show or hide a same div area. for example expand and collspan method. jQuery provides a simple technique to check div id is already shown or hidden. Create a div are on which you want to do operation: Click on me Content will be here!!! Then make a function in the javascript in your head tag. function __showHideFullDetail(divID) { if ( jQuery('#' + divID).is(':hidden') ) { jQuery('#' + divID).show('slow'); } else...

 

In some cases we need to remove old entries from the database or remove entries before specific days. So mysql provides the syntax to delete records:

 DELETE FROM $table_name WHERE $date_field < date_sub(CURDATE(), $numberOfDays day)
If above query does not work for you then its version issue. So you can do same thing like this:
  DELETE FROM $table_name WHERE DATEDIFF(CURDATE(), $date_field) >= $numberOfDays

 

In php we have a function to replace nl2br means new line to break format. but when we need this functionality in our javascript code then what we do? We can do by simply manner: function nl2br(value) { return value.replace(/\n, ""); } Above function will return the converted '\n' to ''. But above function has a disadvantage. It convert only first line of the value. We can convert all new lines to break format with below function: function nl2br(value) { ...

 

If customer is logged in on site and you want to get all information of that customer then you can get by below script: if( $customer = Mage::getSingleton('customer/session')->isLoggedIn()) { $customerData = Mage::getModel('customer/customer')->load($customer->getId())->getData(); print_r($customerData); } It will show you result in an array format: Array ( [entity_id] => 1 [entity_type_id] => 1 [attribute_set_id] => 0 [website_id] => 1 ...

 

Joomla provides some basic themes which are already installed in the templates folder. When any developer develop the CMS in the joomla , he use his own template with new design. On the index page $this->baseurl works well but when he want to own module then he create a folder in custom template folder. But in that module folder $this->baseurl doesn't work. Why? because joomla does not provide to access $this in the custom module folder. You should replace below code...

 

Numeric validation require in mostly cases when we want that user enter only numeric value in any text field. For example 'Age' field. Obviously, age can not be in string format. function checkNumericValueValidation() { var enteredValue = document.getElementById('numeric_value').value; if (enteredValue == '' || isNaN(enteredValue)) { alert('Ohh! You entered wrong number format.'); } else { alert('Congrates! You entered correct Numeric Value.'); } } Above,...

 

Are you looking for a regular expression to make clickable url in the string? Yes!, you will get your solutions here:


echo preg_replace("/http\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/", "$0", $string);

If you want to open url in new tab then :

echo preg_replace("/http\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/", "$0", $string);

 

Categories

Users who liked us on Facebook