Fork me on GitHub

Rapport de message :*
 

Re: Centrer la carte du module DiffuAds

Titre du sujet : Re: Centrer la carte du module DiffuAds
par Guitariste sur 21/07/2012 08:32:33

C'est résolu matrix59,

Voilà ce qu'il fallait faire:

- Cloner les module en allant dans l'admin sur: modules > Système > Templates
- Puis dans la page de templates cloner selon le thème que tu utilises (XDBiz)et dans le menu de ta gauche tu entre dans XDBiz > DiffuAds > Index.html
- Dans ce fichier t'as une cellule sur la gauche de la Carte qui prend une largeur de 40%, Donc tu pouvez passer l'année essayant de centrer la Carte et sans succès, car les 40% du tableau que utilise le module DiffuAds empêchent la cellule de la carte de tout prendre. Vu que cette cellule tu peux l’utiliser après pour montrer les dernières annonces, il fallait pas enlever tout le code mais seulement la valeur 40%.

Donc le code était comme ça:

<td width="40%" align="center">
  <!--
//bloc Nombre annonces -->
  
<{if $affiche_bloc_indic == 1}>  
    <
div class="odd"><{$smarty.const._MD_DIFFUADS_INFO_ADS}></div>
    <
table border="0" cellspacing="0" cellpadding="0">
      <
tr>
        <
td>
          <
table border="0" cellspacing="0" cellpadding="0" class="block_decoads" style="float: right;">
          <
tr>
          <
td>
            <{if 
$affiche_ads_visible == 1}>
              <{
$smarty.const._MD_DIFFUADS_ACTUALLEMENT}>
              <
div style="clear: both;"></div>
            <!-- 
Bloc nombre annonces en mode anonyme -->
              <{
$total_annonces}>
            <{/if}>
              <
div style="clear: both;"></div>
            <{if 
$moderated}>
              <!-- 
annonces en attente de validation -->
              <{if 
$xoops_isadmin}>
              <!-- 
en mode connecte (admin) -->
              <{
$confirm_ads}>
              <{else}>
              <!-- 
sinon en mode anonyme (non connecte) -->
              <{
$validation_ads}>
              <{/if}>
              <
div style="clear: both;"></div>            
              <{if 
$xoops_isadmin}>
              <!-- 
en mode connecte (admin) -->
              <{
$confirm_suspendadmin}>
              <
div style="clear: both;"></div>
              <{else}>
              <!-- 
sinon en mode anonyme -->
              <{if 
$aff_suspendadmin == 1}>
              <{
$indicateur_suspendadmin}>
              <
div style="clear: both;"></div>
              <{/if}><{/if}>  
              <{if 
$xoops_isadmin}>
              <!-- 
en mode connecte (admin) -->
              <{
$confirm_suspend}>
              <{else}>
              <!-- 
sinon en mode anonyme -->
              <{if 
$aff_suspend == 1}>              
              <{
$indicateur_suspend}>
              <{/if}><{/if}>
              <
div style="clear: both;"></div>
              <{if 
$xoops_isadmin}>
              <{
$confirm_signalementannonce}>
              <{/if}><{/if}>
              <
div style="clear: both;"></div>
              <{if 
$pub_bloc_info == 1}>
              <
table border="0" cellspacing="5" cellpadding="0">
              <
tr>
              <
td align="center"><{$pub_bloc}></td>
              </
tr>
              </
table>
              <{/if}>
          </
td>
          </
tr>
          </
table>
        </
td>
      </
tr>
    </
table>
    <
br />
  <{/if}>
    <!-- 
Affichage des dernieres annonces -->
      <{if 
$bloc_dernieres_annonces == 1}>
        <
div class="odd"><{$smarty.const._MD_DIFFUADS_LASTADD}></div>
           <{foreach 
item=item from=$items}>
                <
table width="100%" border="0" class="block_listlastads">
                  <
tr>
                  <
td width="20%" rowspan="4" align="left"><{$item.photo}></td>
                  <{if 
$show_ad_type == 1}>
                  <
td width="80%" align="left" style="padding-left:5px"><b><{$item.type}></b> : <a href="<{$xoops_url}>/modules/DiffuAds/adsitem.php?ads_id=<{$item.id}>"><{$item.title}></a></td>
                  <{else}>                    
                  <
td width="80%" align="left" style="padding-left:5px"><a href="<{$xoops_url}>/modules/DiffuAds/adsitem.php?ads_id=<{$item.id}>"><b><{$item.title}></b></a></td>
                  <{/if}>                    
                 </
tr>
                 <{if 
$item.price != ''}>
                  <
tr>
                  <
td align="left" style="padding-left:5px"><{$smarty.const._MD_DIFFUADS_PRICE2}> <{$item.price}></td>
                  </
tr>
                  <{else}>
                  <
tr>
                   <
td align="left" style="padding-left:5px"><{$smarty.const._MD_DIFFUADS_PRICE2}> <{$smarty.const._MD_DIFFUADS_NO_INDIC}></td>                  
                  </
tr>
                  <{/if}>  
                  <{if 
$item.local != ''}>
                  <
tr>
                  <
td align="left" style="padding-left:5px"><{$smarty.const._MD_DIFFUADS_BLOC_VILLE}> <{$item.local}></td>
                  </
tr>
                  <{else}>
                  <
tr>
                    <
td align="left" style="padding-left:5px"><{$smarty.const._MD_DIFFUADS_BLOC_VILLE}> <{$smarty.const._MD_DIFFUADS_NO_INDIC}></td>
                  </
tr>
                  <{/if}>  
                  <
tr>
                  <
td align="left" style="padding-left:5px"><{$smarty.const._MD_DIFFUADS_DATE_ANNO}> <{$item.date_pub}> </td>
                  </
tr>
                </
table>
          <{/foreach}>
      <{/if}>    
    <!-- 
Fin affichage des dernieres annonces -->
      </
td>


En enlevant la valeur width="40%", on a maintenant ceci:

<td align="center">
  <!--
//bloc Nombre annonces -->
  
<{if $affiche_bloc_indic == 1}>  
    <
div class="odd"><{$smarty.const._MD_DIFFUADS_INFO_ADS}></div>
    <
table border="0" cellspacing="0" cellpadding="0">
      <
tr>
        <
td>
          <
table border="0" cellspacing="0" cellpadding="0" class="block_decoads" style="float: right;">
          <
tr>
          <
td>
            <{if 
$affiche_ads_visible == 1}>
              <{
$smarty.const._MD_DIFFUADS_ACTUALLEMENT}>
              <
div style="clear: both;"></div>
            <!-- 
Bloc nombre annonces en mode anonyme -->
              <{
$total_annonces}>
            <{/if}>
              <
div style="clear: both;"></div>
            <{if 
$moderated}>
              <!-- 
annonces en attente de validation -->
              <{if 
$xoops_isadmin}>
              <!-- 
en mode connecte (admin) -->
              <{
$confirm_ads}>
              <{else}>
              <!-- 
sinon en mode anonyme (non connecte) -->
              <{
$validation_ads}>
              <{/if}>
              <
div style="clear: both;"></div>            
              <{if 
$xoops_isadmin}>
              <!-- 
en mode connecte (admin) -->
              <{
$confirm_suspendadmin}>
              <
div style="clear: both;"></div>
              <{else}>
              <!-- 
sinon en mode anonyme -->
              <{if 
$aff_suspendadmin == 1}>
              <{
$indicateur_suspendadmin}>
              <
div style="clear: both;"></div>
              <{/if}><{/if}>  
              <{if 
$xoops_isadmin}>
              <!-- 
en mode connecte (admin) -->
              <{
$confirm_suspend}>
              <{else}>
              <!-- 
sinon en mode anonyme -->
              <{if 
$aff_suspend == 1}>              
              <{
$indicateur_suspend}>
              <{/if}><{/if}>
              <
div style="clear: both;"></div>
              <{if 
$xoops_isadmin}>
              <{
$confirm_signalementannonce}>
              <{/if}><{/if}>
              <
div style="clear: both;"></div>
              <{if 
$pub_bloc_info == 1}>
              <
table border="0" cellspacing="5" cellpadding="0">
              <
tr>
              <
td align="center"><{$pub_bloc}></td>
              </
tr>
              </
table>
              <{/if}>
          </
td>
          </
tr>
          </
table>
        </
td>
      </
tr>
    </
table>
    <
br />
  <{/if}>
    <!-- 
Affichage des dernieres annonces -->
      <{if 
$bloc_dernieres_annonces == 1}>
        <
div class="odd"><{$smarty.const._MD_DIFFUADS_LASTADD}></div>
           <{foreach 
item=item from=$items}>
                <
table width="100%" border="0" class="block_listlastads">
                  <
tr>
                  <
td width="20%" rowspan="4" align="left"><{$item.photo}></td>
                  <{if 
$show_ad_type == 1}>
                  <
td width="80%" align="left" style="padding-left:5px"><b><{$item.type}></b> : <a href="<{$xoops_url}>/modules/DiffuAds/adsitem.php?ads_id=<{$item.id}>"><{$item.title}></a></td>
                  <{else}>                    
                  <
td width="80%" align="left" style="padding-left:5px"><a href="<{$xoops_url}>/modules/DiffuAds/adsitem.php?ads_id=<{$item.id}>"><b><{$item.title}></b></a></td>
                  <{/if}>                    
                 </
tr>
                 <{if 
$item.price != ''}>
                  <
tr>
                  <
td align="left" style="padding-left:5px"><{$smarty.const._MD_DIFFUADS_PRICE2}> <{$item.price}></td>
                  </
tr>
                  <{else}>
                  <
tr>
                   <
td align="left" style="padding-left:5px"><{$smarty.const._MD_DIFFUADS_PRICE2}> <{$smarty.const._MD_DIFFUADS_NO_INDIC}></td>                  
                  </
tr>
                  <{/if}>  
                  <{if 
$item.local != ''}>
                  <
tr>
                  <
td align="left" style="padding-left:5px"><{$smarty.const._MD_DIFFUADS_BLOC_VILLE}> <{$item.local}></td>
                  </
tr>
                  <{else}>
                  <
tr>
                    <
td align="left" style="padding-left:5px"><{$smarty.const._MD_DIFFUADS_BLOC_VILLE}> <{$smarty.const._MD_DIFFUADS_NO_INDIC}></td>
                  </
tr>
                  <{/if}>  
                  <
tr>
                  <
td align="left" style="padding-left:5px"><{$smarty.const._MD_DIFFUADS_DATE_ANNO}> <{$item.date_pub}> </td>
                  </
tr>
                </
table>
          <{/foreach}>
      <{/if}>    
    <!-- 
Fin affichage des dernieres annonces -->
      </
td>


Ta carte est maintenant centrée car la cellule qui prenez l'espace est encore là, mais sans valeur de largeur. Et sans contenu dedans elle prend la valeur 0%.

Bon courage!


Salutations !
Propulsé avec XOOPS | Graphisme adapté par Tatane, Grosdunord, Montuy337513

114 Personne(s) en ligne (98 Personne(s) connectée(s) sur Forum) | Utilisateur(s): 0 | Invité(s): 114 | Plus ...