Categories
Ramblings

SOLVED : Can't update to Joomla 1.7?

To Joomla 1.7…

If you are running a Joomla! website, you’ve already heard about the Joomla 1.7 upgrade. It’s recommended to upgrade to this version specially if you run Joomla 1.6.

 

Basic steps to update/upgrade to Joomla 1.7:

 

In some situtations, you might have trouble upgrading Joomla with the built-in “Joomla Updater”.

Joomla 1.7 Upgrade errors:

  • “Update: :Collection: Could not open https://update.joomla.org/core/list.xml”

    To solve this errror, you need to “allow fopen” on your server:

    1. Create a php.ini file in your Joomla site’s root. This file should contain the following line:
         
      allow_url_fopen = on
    2. Make sure that the file is having the 644 permissions at least.
    3. Check if fopen is allowed by running a simple php file inside your Joomla root directory containing the following line:
      <?php phpinfo(); ?>

      and look for “allow_url_fopen”, it should say “ON”

    To upgrade to Joomla 1.7 on a Godaddy hosting running PHP5, you should create a “php5.ini” instead of the php.ini stated above.

  • Joomla updates do not appear, and Joomla says there is no upgrade available at the moment?

    If you run Joomla 1.6.x,

    1. Go to the “Extension Manager”, hit the “Manage” tab, click the “Refresh Cache” button.
    2. Go back to “Update” tab, click “Purge Cache”
    3. Click on the “Find updates” button,
    4. Joomla should appear as an update option, check it and click the “Update” button.
  • Fatal error: Cannot instantiate abstract class JDatabaseQuery in mysite/plugins/system/jat3/jat3/core/joomla/modulehelper.php on line 292

    When you run a JoomlaArt template, as of today, you will get an error after upgrading to Joomla 1.7.

    As the error message says it, the error is on line 292 of the above file. With your FTP client, or web file manager, navigate to the file mentioned above and edit the file.

    On line 292, comment out this:

    $query = new JDatabaseQuery;

    and insert this line below it:

    $query = $db->getQuery(true);

    so the final result at lines 292 and 293 looks like this:

    //$query = new JDatabaseQuery;<br />$query = $db->getQuery(true);
  • Fatal error: Cannot instantiate abstract class JDatabaseQuery in mysite/plugins/system/jat3/jat3/core/menu/base.class.php on line 329

    If you use the mega menu of JoomlaArt, you need to do the same proccess for the file base.class.php

    That is, the lines 329 and 330 should be as follows:

    //$query = new JDatabaseQuery;$query = $db->getQuery(true);
Categories
Ramblings

Add a Google +1 button to your PrestaShop store for Free!

Today I’m going to give you some great news.

 

Online stores, e-commerce software…

More than 50 thousand online stores run on PrestaShop, an online e-commerce software. There are lots of advantages using this software, e.g. it’s open source, it’s got a huge community of developers and users, lots of modules and themes are being added to it regularly…

 

PrestaShop’s Drawback

But the main drawback of PrestaShop is that most of its modules are not free and to run a decent business you gonna spend a lot of money over the modules. Well, I would recommend to buy the modules you need without hesitation, because it is an investment in your business, but I know that you are looking for the Free ones at first.

 

Google +1

You’ve certainly heard of the “+1” button from Google, and it would be nice to add it to your shop so that your users can recommend your products on Google.

There are modules on the PrestaShop’s market to allow you putting a “Google +1” button to you store, and they are priced at around 40€ (about 50USD).

 

Free Google +1 for PrestaShop

oGooglePlusOne module Logo

The great news is that odience.net offers a “Google +1” button for PrestaShop, completely FREE! and that saves you about 50USD!

 

As you know, you can donate to thank the developer ;)

 

I got a copy of the oGooglePlusOne module from odience.net and tested it on one of my e-commerce websites. It is complete and integrates itself automatically! Go to odience.net and grab yourself a Free copy of oGooglePlusOne for Prestashop!

 

Don’t forget to say Thank You and send a donation if you think it’s worth it.

Categories
Ramblings

Embed Images in PHPMailer

I’ll keep this one short and fast:

PHPMailer has lots of features, even if it’s a bit old.

One great feature is that it allows you to embed images inline within your e-mail’s body. In most email clients, the inline embedded images are shown in their right place just as on a web page and are “also” in the attachements list.

To be able to use this feature, proceed as follows:

1- Instantiate PHPMailer:


$mail = new PHPMailer(true);
$mail->CharSet='UTF-8';
...
...
//Path to image file (use full path)
$filepath= '/path/to/file/logo_mail.jpg';
//File token ID, use unique interger.
$filecid = 1001;
//File name which will be in the mail, overrides default filename.
$filename= 'shop-logo.jpg';
//Encoding
$encodingtouse = 'base64';
//File type MIME
$filemime = 'image/jpeg';
//EMBED IT
$mail->AddEmbeddedImage($filepath, $filecid, $filename, $encoding, $filemime);
//Message Html Body
$mail->MsgHTML(file_get_contents('/path/to/contents.html'));

2- In your /path/to/contents.html file, which is your mail template message, you can include the inline image. Use this syntax for the <img> tag:

<img src=”cid:1001” alt=”shop logo used in emails” width=”182″ height=”75″ />

Note the CID here, it should be the same as the one you defined for your embedded inline image.

Tested and working with PHPMailer 5.1 on GMAIL, Yahoo!Mail and Mac Mail application

 

ref: https://www.sitepoint.com/forums/php-34/embed-images-phpmailer-586789.html

Categories
Ramblings

[SOLVED] Could not instantiate mail function in PHPMailer

(This article has an advanced technical level, written for people with PhpMailer experience.)

PHPMailer 5.1 in PrestaShop 1.4

Trying to integrate PHPMailer in Prestashop and use it instead of SWIFT Mailer 3 (which is the default mailer script included with Prestashop 1.4), I spent hours to no avail and was getting the Could not instantiate mail function error.

mail() function

The mail() function by itself  was working correctly before and after loading Prestashop and every passed argument seemed to be correct. I did get the “Bad parameters to mail() function, mail not sent” error for mail() too.

Debugging and Abracadabra!

I’ve done lots of debugging and found in my case that the following functions were causing the error, when passing the $Subject parameter to mail():

SecureHeader();
EncodeHeader();

To solve the “Could not instantiate mail function” error in PHPMailer, I removed the above 2 functions from the mail() function arguments.

Just be careful to remove these functions correctly from all places in your class.phpmailer.php.

I recommend using the PHP function

mb_encode_mimeheader()

https://php.net/manual/en/function.mb-encode-mimeheader.php

because it encodes your stuff correctly for the headers in emails.

To be more clear,

1- open the PHPMAILER class file (class.phpmailer.php)

2- Locate:

protected function MailSend($header, $body)

function and in its body,

3- In every call to mail(),

replace this:

@mail($val, <strong>$this->EncodeHeader($this->SecureHeader($this->Subject))</strong>, $body, $header, $params);

by this:

@mail($val, <strong>mb_encode_mimeheader($this->Subject,$this->CharSet, 'B', '')</strong>, $body, $header, $params);

 

This way you are sure to correctly encode your subjet.

Remember to set the correct Charset for your PHPMAILER instance. That is, when calling PHPMailer, just after:

$mail=new PHPMailer(true);

add:

$mail->CharSet = 'UTF-8';

(or any other charset you need).

This solved my “Could not instantiate mail() function in PHPMailer issue. I hope it helps you out if you got this issue too.

Evenmore:

I’ll write more about PHPMailer and PrestaShop later,

In my next post, learn how to correctly include inline images in PHPMailer email to display in GMAIL, YAHOO, Mac Mail app and other email clients correctly as inline images.

Categories
Ramblings

Bug Prestashop, la liste des magasins n'apparait pas

Cette article est sponsorisé par odience.net¦works

En plein developpement

En plein développement de plusieurs modules PrestaShop, j’ai rencontrer plusieurs souci dans les code du package PrestaShop. Ce qui m’étonne, c’est qu’il y a beaucoup de gens qui utilise PrestaShop, même si c’est du gros n’importe quoi en terme de codage et programmation.

 

Alors pourquoi je créer des module?

Tout simplement parcequ’il y a de la demande.

(Restez connecté pour avoir des nouvelles de mes modules:

Ces modules sont créer pour odience.net et seront sont disponible sur odience.net)

Retour à nos moutons

Je vous explique un bug que j’ai trouver aujourd’hui et la solution.

Le problème est ceci:

La variable SMARTY qu’utilise PrestaShop pour stocker les informations des magasin est nomée “$stores”. On peut y acceder et donc afficher les details de nos magasin un peu partout dans les pages et les modules sans diriger le visiteur sur la page de “nos-magasin”.Module Contact PrestaShop avec formulaire de contact et carte google maps

Quand vous changez la configuration de l’affichage simplifié dans le Back Office, la variable $stores devient VIDE partout sur votre boutique. Donc vous ne pouvez plus afficher les details comme un numéro téléphone ou une photo tiré directement de la variable $stores.

Ceci est du au faite que une fois la configuration dans le Back Office modifié, PrestaShop relance une requete vers la base de donnée pour recréer $stores, mais cette fois il relance la requete en cherchant a calculer un distance! Donc la variable $stores reste vide.

Essayez d’ouvrir votre boutique en ligne en ajoutant “?all=1” à la fin de votre URL et vous verrez que la variable $stores fonctionne correctement et affiche bien les infos de vos magasins.

Remède, Solution

Le remède a ceci est de modifier le fichier

PSdir ->controllers -> StoresController.php

qui gère la variable $stores.

 

Au environs de la ligne 73, on ajoute une nouvelle requete SQL qui remplit la variable $stores avec la liste de tous nos magasins, et une deuxième requete SQL qui servira a calculer la distance en cas de recherche.

$stores = Db::getInstance()->ExecuteS(' SELECT s.*, cl.name country, st.iso_code state FROM '._DB_PREFIX_.'store s LEFT JOIN '._DB_PREFIX_.'country_lang cl ON (cl.id_country = s.id_country) LEFT JOIN '._DB_PREFIX_.'state st ON (st.id_state = s.id_state) WHERE s.active = 1 AND cl.id_lang = '.(int)($cookie->id_lang)); $results = Db::getInstance()->ExecuteS(' SELECT s.*, cl.name country, st.iso_code state, ('.(int)($multiplicator).' * acos(cos(radians('.(float)(Tools::getValue('latitude')).')) * cos(radians(latitude)) * cos(radians(longitude) - radians('.(float)(Tools::getValue('longitude')).')) + sin(radians('.(float)(Tools::getValue('latitude')).')) * sin(radians(latitude)))) distance, cl.id_country id_country FROM '._DB_PREFIX_.'store s LEFT JOIN '._DB_PREFIX_.'country_lang cl ON (cl.id_country = s.id_country) LEFT JOIN '._DB_PREFIX_.'state st ON (st.id_state = s.id_state) WHERE s.active = 1 AND cl.id_lang = '.(int)($cookie->id_lang).' HAVING distance < '.(int)($distance).' ORDER BY distance ASC LIMIT 0,20');

A savoir que la variable $results sera vide si il n’y a pas de demande de recherche de distance et donc StoresController.php ne genèrera pas de fichier XML servant a la mise en place d’une carte Google Maps dans le Store Locator. Pour assurer que le fichier XML sera créer seulement si $results contient quelque chose, je fait une verification avec:

if (!empty($results))

Téléchargez, tout simplement

Vous pouvez télécharger la version corrigée de ce fichier dans la page téléchargement de Gibni.com (nom du fichier: StoresController-1.4.Amir.zip)

 

Pour l’utiliser,

1- Allez dans:

DossierPrestaShop/controllers/

2- Renommez votre present fichier StoresController.php en StoresController.php.bak,

3- Placez le fichier php que vous avez télécharger et décompresser dans le même dossier.

 

Maintenant la variable $stores est de nouveau accessible, quelconque la configuration dans le Back Office de PrestaShop.

Je souhaite un grand succès à la communauté PrestaShop et j’espère qu’un jour ils auront du code concrete, correcte, scientifiquement étudié et structuré.


Cette article est sponsorisé par odience.net¦works

Categories
Ramblings

Must have mobile applications – Part 3

Here’s  “Must have mobile applications” Part 3. Be sure to read the  Intro , the First Part and the Second Part.


ybrowser_iconY-Browser


Here’s another Symbian file browser which lets you browse all the system folders and drives on your phone. It comes with plugins to let you access your inbox and message folders for easy file transfers from your messages to your phone’s memory card. More details here.


Mobiola Web Camera

If you need to use your mobile phone as a wireless webcam, here’s Mobiola Web Camera, which is very reliable and supports bluetooth, wifi, and even USB cable connection, read more on this in Use you mobile phone as a wireless webcam.



… I’m actually writing next items, give me some time…



IntroPart 1Part 2Part 3


48px-warning_iconWarning!


Installing the stated applications stated, and using them, might require a large amount of data transfer over the internet from your phone, be aware of the connection fees that may apply to you by your mobile operator.

Categories
Ramblings

Must have mobile applications – Part 2

Here comes the second part of  “Must have mobile applications” articles. Be sure to read the  Intro , and the First Part.


Interactive Voice Call Manager

This application by Mobisophy provides you with tons of features and is one of the best and most reliable call manager applications available on the market. Use this application to record voice conversations (without beep), have a personalized answering machine, send busy tone when you don’t want to answer a call, reply with text message when you’re not available, mute the ringer on scheduled hours and so on…


salling_clicker_icon1 Salling Clicker


Salling Clicker is the ultimate bluetooth remote control from your computer. With Salling Clicker you can use your phone as a remote control, more details and download


yahoo_go_icon Yahoo GO


Here’s the application for all your Yahoo needs, more details here.


google-maps-icon Google Maps


Google maps is a must have application, it allows you to search local businesses and addresses, and can use your phone’s internal GPS for advanced maps features. Enjoy Google Latitude on your phone, computer or both to locate your friends and familly. More details here.


activefile_scr ActiveFile


ActiveFile is a free browser giving you access to all your files and directories on the phone. You can navigate through your sms messages and backup your sms. It has lots of advanced features and tools. I recommend this application for free and advanced file browsing.


IntroPart 1Part 2Part 3



48px-warning_iconWarning!


Installing the stated applications stated, and using them, might require a large amount of data transfer over the internet from your phone, be aware of the connection fees that may apply to you by your mobile operator.

Categories
Ramblings

Must have mobile applications – Part 1

Once you’re through the Intro, let’s see the first part on “Must have mobile applications”:


icon_vodafone SFR Vodafone Live (French users)


Download and install the SFR Vodafone Live application, and run the application from your phone to get it updated with the lastest version.


mobitubia_icon MobiTubia

MobiTubia application is one of the best YouTube players available. You can search, watch and save YouTube mmovie clips on your phone. If for any reason MobiTubia is not the right choice for you, I recommend using either YouTube Player or emTube.


Nokia Photo Browser

This is a very easy to use and cool photo browsing application with stunning 3D effects from Nokia Beta Labs.

[video_generic]pV18PH5LjT4[/video_generic]



Nokia Conversations

Nokia Conversations is an add-on application that allows you to follow your communication with contacts as streams of conversations, which it organizes, based on individual contacts. The application also makes it very easy to reply to received messages and continue an ongoing conversation with the contact.


garmin_icon Garmin Mobile XT (GPS Software)


This is the best GPS application available for Nokia N95 , E71, E73 and other Symbian OS phones. Detailed installation instructions is available here: Garmin Mobile XT on Nokia E71 and N95 (Internal GPS supported)


IntroPart 1Part 2Part 3


48px-warning_iconWarning!


Installing the stated applications stated, and using them, might require a large amount of data transfer over the internet from your phone, be aware of the connection fees that may apply to you by your mobile operator.

Categories
Blogging Money Talks Ramblings Web Development

Mark Gibni.com's History

Have you found an article, post or comment useful on this site and it saved you time or/and money?

Many people have visited Gibni.com since its first day and the number grows everyday. Do you want to mark the history of this site by bringing some help to it?


Helping_hand_gibni


Currently I am writing the 3rd article on the Delayed Write Failed error message which will hopefully help people with this issue to get their hardware work properly as expected.

The 4th part of TOP Symbian Applications is on the way too.


I expect an increase in my unique visitors by 7 000/month. Which will lead to about 30 000 unique visitors per month.

My first goal is to provide information for free, and make it accessible to everyone. All of this takes time, a lot of time.


Many visitors wanted to say “Thanks” for the information I provided here and that helped them in some way, so I recently started a new section, which you might have already seen, it’s the Donations page. Here you can donate any amount of money to help me continue the developpement of Gibni and if you donate more than 10 USD, you can show a name and a link of your choice on the Donators list.


Go ahead and Buy me a drink (Coffee: 3.5 USD, Beer: 4.5 USD or Fresh soda: 2.5 USD) at least if you can’t donate a larger amount.

Thanks for your great support.

Categories
Ramblings

Optimizing Global Translator Plugin for WordPress

UPDATE: Version 0.2 released
In the new theme designed for Gibni.com, one of the main goals is to attain maximum speed and shorter page loading times. This post is for people who have the basics of website optimizations. In this post, I’ll discuss a very popular WordPress Plugin, Global Translator, made by www.Nothing2Hide.net, which is used to provide translated version of your blog to visitors. This plugin improved a lot over time, and it gives better and better results after each upgrade. Latest version till date is 1.0.7.1, which is a stable version.
In the process of optimizing my website, I found out that this plugin consumes a large amount of loading time and keeps pages in a loading state for a long period of time, and it makes many connections busy between the client and the server to download all the flag pictures to the client’s computer. This slows down the page as there’s a limited number of simultaneous connections allowed between the client and the server. On the other side, this increases the ‘account hits’ on shared hosting plans.
To make the plugin and the page load and respond faster, I’ve thought of a solution, which is: instead of the plugin sending multiple small image files, it should send a merged image file containing all the required flag images and generate an image map to build the links.
First of all, I’ll stick to a specific model, which is a single line bar. The functions are easy to understand an you can build any shape you want.
Now I’ve to edit Global Translator’s core to give flag images to the merging script. and then create an image map for the translator bar.
After a lot of tests, I finally figured it out! You can find the code for ‘translator.php’ in the Page.
My modified PHP, will generate a fresh PNG file upon user request and store it in the root directory and then creates an image map to create the links for the translator. The good news is everything remains dynamic and if you change the combination of translations available, the PNG and Image Map will change automatically too!
There are still improvements to be done, for example, forcing the code to create the PNG file in the plugins directory and not the site root! So, if you have any ideas, just let me know!