Changeset 87380 in spip-zone


Ignore:
Timestamp:
Feb 7, 2015, 10:09:15 AM (4 years ago)
Author:
cedric@…
Message:

on met la puce en cache dans la table des meta pour eviter une requete sql a chaque hit ou ce fichier est inclus

Location:
_squelettes_/eva-web/4_2/eva_habillage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _squelettes_/eva-web/4_2/eva_habillage/eva_habillage_fonctions.php

    r86197 r87380  
    33if (!defined("_ECRIRE_INC_VERSION")) return;
    44
    5 include_spip('base/eva_habillage_base');
    6 include_spip('base/abstract_sql');
    7 $test = sql_showtable('spip_eva_habillage_images', true);
    8 if ($test['field']){
    9         $test_puce = sql_select('nom_image', 'spip_eva_habillage_images', "type='puce_spip' AND nom_habillage='Defaut'");
    10         $tab_puce = sql_fetch($test_puce);
    11         $puce = $tab_puce['nom_image'];
    12         if ($puce){
    13                 $GLOBALS['puce'] = "<img src='" . _DIR_IMG . "eva_habillage/" . $puce . "' alt='-' align='top' border='0'>";
     5if (!isset($GLOBALS['meta']['puce_eva']) OR _request('var_mode')) {
     6        $GLOBALS['meta']['puce_eva'] = '';
     7        include_spip('base/eva_habillage_base');
     8        include_spip('base/abstract_sql');
     9        $test = sql_showtable('spip_eva_habillage_images', true);
     10        if ($test['field']){
     11                $test_puce = sql_select('nom_image', 'spip_eva_habillage_images', "type='puce_spip' AND nom_habillage='Defaut'");
     12                $tab_puce = sql_fetch($test_puce);
     13                $puce = $tab_puce['nom_image'];
     14                if ($puce){
     15                        $GLOBALS['meta']['puce_eva'] = $puce;
     16                }
    1417        }
    1518}
     19if ($GLOBALS['meta']['puce_eva']) {
     20        $GLOBALS['puce'] = "<img src='" . _DIR_IMG . "eva_habillage/" . $GLOBALS['meta']['puce_eva'] . "' alt='-' align='top' border='0'>";
     21}
    1622?>
  • _squelettes_/eva-web/4_2/eva_habillage/paquet.xml

    r86302 r87380  
    22  prefix="eva_habillage"
    33  categorie="squelette"
    4   version="4.2.7"
     4  version="4.2.8"
    55  etat="stable"
    66  compatibilite="[2.9.9;3.1.*]"
Note: See TracChangeset for help on using the changeset viewer.