Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5

Module forum
#11

Pas facile cela ne marche pas, je te mets les pages modifiées pour controles :

Gabarit Ncleanblue2 :
Code :
{process_pagedata}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
{* Change lang="en" to the language of your site *}

{* note: anything inside these are smarty comments, they will not show up in the page source *}
  <head>
{if isset($canonical)}<link rel="canonical" href="{$canonical}" />{elseif isset($content_obj)}<link rel="canonical" href="{$content_obj->GetURL()}" />{/if}

<title>{title} | {sitename}</title>
{* The sitename is changed in Site Admin/Global settings. {title} is the name of each page *}

{metadata}
{* Don't remove this! Metadata is entered in Site Admin/Global settings. *}
<CMSMS>
{cms_stylesheet}
{* This is how all the stylesheets attached to this template are linked to *}
<CMSMS>
{cms_selflink dir="start" rellink=1}
{cms_selflink dir="prev" rellink=1}
{cms_selflink dir="next" rellink=1}
{* Relational links for interconnections between pages, good for accessibility and Search Engine Optmization *}

<!--[if IE 6]>
<script type="text/javascript" src="modules/MenuManager/CSSMenu.js"></script>
<![endif]-->
{* The above JavaScript is required for Menu - NCleanBlue-css to work in IE6 *}

{* the literal below and the /literal at the end are needed whenever there are {"curly brackets"} as smarty will think it's something to process and will throw an error *}
{* IE6 png fix *}
{literal}
<!--[if IE 6]>
<script type="text/javascript"  src="uploads/NCleanBlue/js/ie6fix.js"></script>
<script type="text/javascript">
// argument is a CSS selector
DD_belatedPNG.fix('.sbar-top,.sbar-bottom,.main-top,.main-bottom,#version');
</script>
<style type="text/css">
/* enable background image caching in IE6 */
html {filter:expression(document.execCommand("BackgroundImageCache", false, true));}
</style>
<![endif]-->
{/literal}

  </head>
  <body>
  <CMSMS>
    <div id="ncleanblue">
      <div id="pagewrapper" class="core-wrap-960 core-center">
{* start accessibility skip links *}
        <ul class="accessibility">
          <li>{anchor anchor='menu_vert' title='Skip to navigation' accesskey='n' text='Skip to navigation'}</li>
          <li>{anchor anchor='main' title='Skip to content' accesskey='s' text='Skip to content'}</li>
        </ul>
{* end accessibility skip links *}
        <hr class="accessibility" />
{* Horizontal ruler that is hidden for visual browsers by CSS *}

{* Start Header, with logo image that links to the default start page *}
        <div id="header" class="util-clearfix">
{* logo image that links to the default start page. Logo image is changed in the style sheet  "Layout: NCleanBlue" *}
          <div id="logo" class="core-float-left">
            {cms_selflink dir="start" text="$sitename"}
          </div>
          
{* Start Search, the input "Submit" is using an image, CSS: div#search input.search-button *}
          <div id="search" class="core-float-right">
            {search search_method="post"}
          </div>
{* End Search *}
          <span class="util-clearb">&nbsp;</span>
          
{* Start Navigation, style sheet  "Layout: NCleanBlue", starting at Menu  ROOT *}
          <h2 class="accessibility util-clearb">Navigation</h2>
{* anything class="accessibility" is hidden for visual browsers by CSS *}
          <div class="page-menu util-clearfix">
          {menu loadprops=0 template='cssmenu_ulshadow.tpl'}
          </div>
          <hr class="accessibility util-clearb" />
{* End Navigation *}

        </div>
{* End Header *}

{* Start Content (Navigation and Content columns) *}
        <div id="content" class="util-clearfix">

{* Start Optional tag CMS Version Information, also is a good example how smarty works, the big star that holds the version number, you may remove it here and the style sheet where it is marked.
          <div title="CMS - {cms_version} - {cms_versionname}" id="version">
          {capture assign='cms_version'}{cms_version|lower}{/capture}{"/-([a-z]).*/"|preg_replace:"":$cms_version}
          </div>*}
{* End Optional tag  *}

{* Start Bar *}
          <div id="bar" class="util-clearfix">
{* Start Breadcrumbs, a bit of letting you know where your at *}
            <div class="breadcrumbs core-float-right">
              {breadcrumbs starttext='You are here' root='Home' delimiter='&raquo;'}
            </div>
{* End Breadcrumbs *}

            <hr class="accessibility util-clearb" />
          </div>
{* End Bar *}

{* Start left side *}
          <div id="left" class="core-float-left">
            <div class="sbar-top">
              <h2 class="sbar-title">News</h2>
            </div>
            <div class="sbar-main">
{* Start News *}
              <div id="news">
              {news number='3' detailpage='news'}
              </div>
              <img class="screen" src="uploads/NCleanBlue/screen-1.6.jpg" width="139" height="142" title="CMS - {cms_version} - {cms_versionname}" alt="CMS - {cms_version} - {cms_versionname}" />
{* End News *}
            </div>
            <span class="sbar-bottom">&nbsp;</span>
          </div>
{* End left side *}

{* Start Content Area, right side *}
          <div id="main"  class="core-float-right">

{* main top, holds top image and print image *}
            <div class="main-top">
              <div class="print core-float-right">
                {print showbutton=true}
              </div>
            </div>
  <CMSMS>          
{* main content *}
            <div class="main-main util-clearfix">
              <h1 class="title">{title}</h1>
            {content}
            </div>
            
{* Start main bottom and relational links *}
            <div class="main-bottom">
              <div class="right49 core-float-right">
              {anchor anchor='main' text='^&nbsp;&nbsp;Top'}
              </div>
              <div class="left49 core-float-left">
                <span>
                  {cms_selflink dir="previous" label="Previous page: "}&nbsp;
{* The label parameter doesn't need to be there if you're using English, but is here to show how it's used if you don't want the English text "Previous page" *}
                </span>
                <span>
                  {cms_selflink dir="next"}&nbsp;
                </span>
              </div>
{* End relational links *}

              <hr class="accessibility" />
            </div>
{* End main bottom *}

          </div>
{* End Content Area, right side *}

        </div>
{* End Content *}
<CMSMS>
      </div>
{* end pagewrapper *}
      <span class="util-clearb">&nbsp;</span>
      
{* Start Footer *}
      <div id="footer-wrapper">
<div id="footer" class="core-wrap-960">

       {* first foot menu *}
          <div id="ffbb" class="block core-float-left">
           {cms_selflink ext='http://www.ffbb.com/' text='FFBB '}
          </div>  


{* second foot menu if active page has children *}
        
          <div id="comite" class="block core-float-left">
           {cms_selflink ext='http://www.basketmayenne.com/' text='Comite 53'}
          </div>
{* edit the footer in the Global Content Block called "footer" *}
          <div class="block cms core-float-left">
            {global_content name='footer'}
          </div>
          
          <span class="util-clearb">&nbsp;</span>
        </div>
      </div>
{* End Footer *}
    </div>
{* End Div *}
  </body>
</html>

le TPL :
Code :
<?php


$cmsms = array();
//Lecture du fichier de cache
$root_url = "http://localhost:8888/cmsmadesimple-1.9.4.3-full";
$filename = PUN_ROOT."tplcmsms/cache.php";

//echo '<!--'.$filename .'-->';

if(is_file($filename))
{
  require($filename);
  $cmsms = $cmsarr;
} else
{
    $cms = file_get_contents("$root_url/index.php?page=forum");
    #$cms = str_replace('<base href="'.$root_url.'/" />','<base href="'.$root_url.'/forum/" />',$cms);
    $cms = str_replace('<base href="'.$root_url.'/" />','',$cms);
    
    $searchD = '<link rel="stylesheet" type="text/css" href="'.$root_url.'/tmp/cache/';
    $searchF = '.css"';
    $posD = stripos($cms, $searchD);
    
    $arrayOldCss = array();
    $arrayNewCss = array();
    
    while($posD !== FALSE)
    {
        $posF = stripos($cms, $searchF, $posD);        
        $mycss = substr($cms, $posD + 45, $posF - $posD - 45 + 4);
        $mycssContent = file_get_contents($mycss);
        $mynewcss = str_replace('/tmp/cache/', '/forum/tplcmsms/', $mycss);
        $filenamecss = "./tplcmsms/".substr($mynewcss, stripos($mynewcss, '/forum/tplcmsms/') + strlen('/forum/tplcmsms/'));
        
        //creation du fichier de cache pour css
        $handle = @fopen($filenamecss , "w");
         if (fwrite($handle, $mycssContent) === FALSE) {
            echo "Impossible d'ecrire dans le fichier ($filenamecss)";
            exit;
        }
        fclose($handle);
        
        $arrayOldCss[] = $mycss;
        $arrayNewCss[] = $mynewcss;
        
        $posD = stripos($cms, $searchD, $posF);
    }
    
    for($i = 0; $i < count($arrayOldCss); $i++)
    {
        $cms = str_replace($arrayOldCss[$i], $arrayNewCss[$i],$cms);
    }
    
    
    $cms = explode('<CMSMS>',$cms);

       $cmsms = array();
    $cmsms['<CMS_css>'] = $cms[1];
    $cmsms['<CMS_menu>'] = $cms[3];  
    
    //creation du fichier de cache
    $handle = @fopen($filename, "w");
     if (fwrite($handle, print_out($cmsms)) === FALSE) {
        echo "Impossible d'ecrire dans le fichier ($filename)";
        exit;
    }
    fclose($handle);
}


$tpl_main = cmsms_parse($cmsms,'<CMS_header_content>', $tpl_main);
$tpl_main = cmsms_parse($cmsms,'<CMS_body_haut>', $tpl_main);
$tpl_main = cmsms_parse($cmsms,'<CMS_body_bas>', $tpl_main);
$tpl_main = cmsms_parse($cmsms,'<CMS_js>', $tpl_main);


function cmsms_parse($cmsms, $balise,$tpl)
{
    if(!isset($cmsms[$balise]))
    {
        return $tpl;
    }
        
        
    return str_replace($balise, $cmsms[$balise], $tpl);
}

function print_out($cmsms)
{
    $buffer = '<?php
    
    $cmsarr = array();
    ';
    
    foreach($cmsms as $key => $value)
    {
        $buffer .= '$cmsarr["'.$key.'"] =
<<<TEXT
        '.$value.'
TEXT;
        ';
    }
    $buffer .= '
?>';

    return $buffer;
}

?>

pour les fichiers main et autres c bon, je pense Smile

et voici des vue de la page que cela me crées.

http://bacdaon.infos.st/forum/vue.tiff
http://bacdaon.infos.st/forum/vue2.tiff
http://bacdaon.infos.st/forum/vue3.tiff
Merci d'avance
Tu dis de ne pas mettre le titre dans le menu, mais comment retourne tu dans le forum alors?
Un tare, je sais Big Grin
Tentative en ligne idem.
http://bacdaon.infos.st/forum , comme ca tu peux le code source du forum, on y vois <CMS_css> et <CMS_menu>
Répondre


Messages dans ce sujet

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)