Index du Forum » » Questions

Auteur

Meta Mot dans une page static
PhilGuen
986      

  Posté : 27-06-2009 08:46

1°)vérifier la présence d'un dossier "default" dans le répertoire "themes" (fournit avec évolution)

2°) j'ai modifié la fonction themesidebox() du fichier theme.php de mon theme (en l'occurence XP-Olive) en m'inspirant d'un thème existant de la manière suivante



/************************************************************/
/* Function themesidebox()            ;                        */
/************************************************************/

//cette partie a été modifiée pour faire appel aux modèles html

function themesidebox($title, $content) {
   global $theme, $B_class_title, $B_class_content, $bloc_side;
   $inclusion=false;
   if (file_exists("themes/".$theme."/html/bloc-right.html") and ($bloc_side=="RIGHT")) {$inclusion="themes/".$theme."/html/bloc-right.html";}
   if (file_exists("themes/".$theme."/html/bloc-left.html") and ($bloc_side=="LEFT")) {$inclusion="themes/".$theme."/html/bloc-left.html";}
   if (!$inclusion) {
      if (file_exists("themes/".$theme."/html/bloc.html")) {$inclusion="themes/".$theme."/html/bloc.html";}
      elseif (file_exists("themes/default/html/footer.html")) {$inclusion="themes/default/html/bloc.html";}
      else {
         echo "bloc.html manquant / not find !<br />";
         die();
      }
   }
   ob_start();
   !include!($inclusion);
   $Xcontent=ob_get_contents();
   ob_end_clean();
   $npds_METALANG_words=array(
   "'!B_title!'i"=>"$title",
   "'!B_class_title!'i"=>"$B_class_title",
   "'!B_class_content!'i"=>"$B_class_content",
   "'!B_content!'i"=>"$content"
   );
   echo meta_lang(preg_replace(array_keys($npds_METALANG_words),array_values($npds_META LANG_words), $Xcontent));
}



3°) dans le dossier de mon thème, j'ai créé un répertoire "html" contenant, entre autres, un fichier "bloc.html" (à toi d'adapter en fonction de ta présentation)


<table border="0" cellpadding="0" cellspacing="0" width="220">
<tr>
    <td>
        <table border="0" cellpadding="0" cellspacing="0" width="100%" background="themes/XP-Olive/images/sidebox-title-bg.gif" >
              ;  <tr>
              ;      <td align="left" valign="top" width="26" height="30">
              ;          <img src="themes/XP-Olive/images/sidebox-title-left.gif">
              ;      </td>
              ;      <td align="left" valign="middle" width="188" height="30" class="bloc_l_titre">
              ;          <font class="option" color="#ffffff"> <b>!B_title!</b></font>
              ;      </td>
              ;      <td align="left" valign="top" width="6" height="30">
              ;          <img src="themes/XP-Olive/images/sidebox-title-right.gif">
              ;      </td>
              ;  </tr>
        </table>
    </td>
</tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" width="220">
<tr valign="top">
    <td width="4" align="left" valign="top" background="themes/XP-Olive/images/sidebox-bar-left.gif">
        <img src="themes/XP-Olive/images/sidebox-bar-px.gif">
    </td>
    <td bgcolor="#ECE9D8" width="211" align="center" valign="top">
        <table border="0" cellpadding="3" cellspacing="0" width="211">
              ;  <tr>
              ;      <td class="bloc_l_corps">
              ;          !B_content!<br />
              ;      </td>
              ;  </tr>
        </table>
    </td>
    <td width="4" align="left" valign="top" background="themes/XP-Olive/images/sidebox-bar-right.gif">
        <img src="themes/XP-Olive/images/sidebox-bar-px.gif">
    </td>
</tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" width="220">
<tr>
    <td align="left" valign="top" height="29">
        <img src="themes/XP-Olive/images/sidebox-bottom.gif" width="220">
     </td>
</tr>
</table>



et ca fonctionne parfaitement. J'ai ainsi modifié XP-Olive et Royal et créé 3 autres thèmes originaux.



Cet article provient de NPDS

http://www.npds.org/viewtopic.php?topic=24420&forum=9