Solutions for some standard erros in joomla

Hello friends,
Today we will discuss here about some standard errors comes in joomla website development.
1) Solve the error of function ereg() is deprecated :-
Generally this error comes when we are using ereg() functions. There is a standard solutions of it by using preg() function instead of ereg() function. Because ereg() functions are deprecated.
Suppose if you are using,

ereg_match("/foo/g",$needle,$haystack);

and you are getting the error like function ereg() is deprecated then you should write like,

preg_match("/foo/g",$needle,$haystack);

2) Solve the error of Call-time pass-by-reference has been deprecated :-
This type of errors because of some minor mistakes we made or it is in the module file that we use ready made.

Suppose if you are using,

call_user_func('Formo_'.$name.'::load', & $this);

and you are getting error like Call-time pass-by-reference has been deprecated than you have to just remove the & before $this.

call_user_func('Formo_'.$name.'::load', $this);

3) Solve the error of function split() is deprecated :-
Generally this error comes when we are using split functions. There is a standard solutions of it by using explode() function instead of split() function. Because split() functions are deprecated.
Suppose if you are using,

split_match("/foo/g",$needle,$haystack);

and you are getting the error like function split() is deprecated then you should write like,

explode_match("/foo/g",$needle,$haystack);

4) Another general error comes like Could not instantiate mail function :-

In this case you would have to follow the steps written as below,

Go to Admin panel > Global Configuration > Server > Mail Settings > Mailer and select SENDMAIL there,instead of PHP MAIL FUNCTION.

5) Remove index.php from the url :-

After making a joomla site many developers faces the problem of removing the index.php from the url.

For that you would have to follow below steps :-
• Go to the Global Configuration area within your Joomla admin.
• Under SEO Settings, click YES for the following 3 items:
• Search Engine Friendly URLs Yes
• Use Apache mod_rewrite Yes
• Add suffix to URLs Yes
• Rename you htaccess.txt file to .htaccess
• Use a text editor to remove the “#” before the words RewriteBase on line 70 (Joomla 1.5.23)

These were some standard errors comes in joomla website development. Solve and Enjoy.

Advertisements

Customize front page of your website [Joomla]

For Customizing joomla front page, there are so many methods and modules for customizing home page with your articles layout. But below code works at module level where you want to display some module only on front page, not other pages and some module display only on other pages except front page then this code is useful.

You can write the code given below in index.php in your template folder where you want to put module on front page, put below condition with your HTML code in index.php file.

Here i have shown two methods. Both are working well.
1.

//HTML code
<?php
$menu = & JSite::getMenu();
if ($menu->getActive() == $menu->getDefault()) {
?>
//HTML Code – YOUR HOME PAGE CODE
<?php    
}
else
{
?>
//HTML Code – YOUR OTHER PAGES CODE
<?php } ?>

2. This method works front-page component.

<?php 
if ($view=='frontpage') 
{
//HTML Code – YOUR HOME PAGE CODE
}
Else
{
?>
//HTML Code – YOUR OTHERS PAGE CODE
<?php    
} 
?>

How to add New field in Virtuemart 2.0?

If you need an additional field for your own business requirement, you can do that by changing data model as well as some php code.
To add new field for product you have to make changes in php code of 3 or more separate files in the previous Virtuemart joomla 1.5 but in virtuemart 2.0 and joomla 1.7 version you only have to make change in only one file to add field.

Admin interface

To add field in virtuemart admin side, first you have to create field in your product table into database then you need to add field for product in virtuemart.
Follow this path from your site root
administrator\components\com_virtuemart\views\product\tmpl
File Name: product_edit_information.php for product
Add this type of code wherever you want to put new field.

<td width="21%" >[Your_Field_Name] </td>
<td >
<input type="text" class="inputbox" name="Your_Field_Name" value="<?php echo $this->product-> Your_Field_Name; ?>" size="32" maxlength="64" />
</td>

I hope this will help you.

Posted in Joomla. 3 Comments »

Show Rockstories module in Module manager in JOOMLA

When I installed Rockstories modules in my Joomla site. I couldn’t see in Module manager. I tried wasting lots of time but after sometime I got solution. And now I can see Rockstories module in Module manager. Now it’s listing with other modules.

Follow the steps to install Rockstories Module:

1) After installing Rockstories Module from Extension Manager, you have to follow following steps.

Open Module manager and Click on the “New” button

It will opened lightbox window, now you can see that module and click on that one so it will added in Module Manager List.

Now, we can see it in Module manager.

After installing process, you can customize in front in Joomla site.