samedi 12 juillet 2014

[Problème] 404 - Component not found (joomla 3 back office)

This article is for joomla components / modules developers.
Usually you have this error when trying to run/configure your joomla 2.5 component on joomla 3.x plateform.
This error is due to non 100% compatibility of 2.5 components with joomla 3.x
For some simple components proceed as follows :
  1. In every file that references DS variable
    put at the begin :
    if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR);
  2. rename admin.your_component.php file in admin section to your_component.php
  3. Change each JController or JView classes reference to JControllerLegacy or JViewLegacy
  4. Don't forget to do that to the 2 sections site and admin

This link may be useful

jeudi 26 juin 2014

Jquery ready function and problems with media queries

yesterday i have faced a problem
i had  to make a design responsive according to a psd
i've found that some blocks that were injected by jquery thanks to
$(".yourdiv").append(.....)
jQuery(function(){
if($window.width()<768)
{
     $("#mydiv").appendTo("#block1");
}else{
         $("#mydiv").appendTo("#block2");
}
}
and mydiv had two styles
@media screen and (max-width: 767px){
    #mydiv STYLE1
}
@media screen and (min-width: 768px){
    #mydiv STYLE2
}
i found that mydiv had the style 2 and was the child of block 1 which is incorrect for me

finally it was wrong to use jQuery(function(){} which fires before application of media queries
i've used modernizr library
with this hack

(function($){
    function doneResizing() {
        if(Modernizr.mq('screen and (max-width:767px)')) {
                     $("#mydiv").appendTo("#block1");
        }
        else if(Modernizr.mq('screen and (min-width:768px)')) {
                                  $("#mydiv").appendTo("#block2");
        }
    }

    var id;
    $(window).resize(function() {
        clearTimeout(id);
        id = setTimeout(doneResizing, 0);
    });

    doneResizing();
})(jQuery);
 

that's all

mercredi 18 juin 2014

joomla back office Failed to parse time string (jerror) at position ....

hello moto;
Pre conditions: Joomla 3.0
i've encountred this error when migrating website from a server to another...
front office worked correctly
back office  no
Try to change $log_path et $tmp_path in configuration.php file
To know the correct directory
create a php file simple.php
<?php
echo getcwd (  );
?>
copy it at the root of the site
invoke it from web browser
get your directory
copy it an d and add /logs for logs and tmp for tmp dir





lundi 19 mai 2014

Prestashop déclaration de variable globale de configuration (Module FB/Twitter pour prestashop)

Lors de la création d'un module spécifique sous presta, nous avons souvent besoin de stocker quelques variables dans la base de données du système.
Dans le cas ou la variable est simple et que l'utilisation d'un CRUD  n'est pas aussi nécessaire, l'utilisation d'une variable système peut suffire, on parle d'une variable de configuration.
Comment la créer ?
c'est simple le fait de mettre à jour une variable de configuration qui n'existe pas la crée et lui affecte la valeur indiquée.

Configuration::updateValue('MA_VARIABLE',"");
On met ça dans la fonction installe de notre module si vous voulez.

Comment la lire?
c'est simple aussi
Configuration::get("MA_VARIABLE") retourne la variable

Dans ce qui suit, j'ai crée un petit exemple qui illustre ce comportement:
Un module qui affiche' 2 icones (fb+twitter) dont les adresses sont configurables depuis le back-office



block-fbtwitter (lien de téléchargement)


screen shot

dimanche 23 mars 2014

Module JCounter, visits counter for joomla

Here is JCounter module, a visits counter for joomla 2.5/3.x.
You must unzip file first and install the two components (plugin then module) in order to use it.

Why plugin ?
When webmaster decide to disable this module on some web pages for design reasons or other, plugin continue to increase visits number, ever module is disabled on that page.


 Download link for joola 2.5 and joomla 3.x


Thanks for your suggestions

Module Evolution
April 2011 version 1.0 for joomla 1.5
March 2014  version 1.1 joomla 2.5/ 3.x + introduction of the plugin ( binaries of this version were removed from repository due to wrong binaries upload)
July 2014 version 1.2