Index du Forum » » Thèmes Dynamic

Auteur

Faire des blocs differents ...
GiamDoc
7063       
 

  Posté : 23-09-2006 17:52

d'aprés le code du mainfile c'est :

     // For including CLASS AND URI in Block
      global $B_class_title, $B_class_content;
      $B_class_title=""; $B_class_content=""; $R_uri="";
      if (stristr($content,"class-") or stristr($content,"uri")) {
         $tmp=explode("\n",$cont ent);
         $content="";
         while(list($id,$class)= each($tmp)) {
            $temp =explode("#",$class);
            if ($temp[0]=="class-title") {
              ;  $B_class_title=str_replace("\r","",$temp[1]);
            } else if ($temp[0]=="class-content") {
              ;  $B_class_content=str_replace("\r","",$temp[1]);
            } else if ($temp[0]=="uri") {
              ;  $R_uri=str_replace("\r","",$temp[1]);
            } else {
              ;  if ($content!="") {$content.="\n ";}
              ;  $content.=str_replace("\r","",$class);
            }
         }
      }

      // For BLOC URIs
      if ($R_uri) {
         global $REQUEST_URI;
         $page_ref=basename($REQ UEST_URI);
         $tab_uri=explode(" ",$R_uri);
         $R_content=false;
         $tab_pref=parse_!url(!$ page_ref);
         $racine_page=$tab_pref[ path];
         $tab_pref=explode("& ;",$tab_pref[query]);
         while (list(,$RR_uri)=each($tab_uri)) {
            $tab_ puri=parse_!url(!$RR_uri);
            $raci ne_uri=$tab_puri[path];
            if ($racine_page==$racine_uri) {
              ;  $tab_puri=explode("&",$tab_puri[query]);
              ;  while (list($idx,$RRR_uri)=each($tab_puri)) {
              ;     if (substr($RRR_uri,-1)=="*") {
              ;        // si le token contient *
              ;        if (substr($RRR_uri,0,strpos($RRR_uri,"="))==substr($tab_pref[$idx],0,strpos($tab_ pref[$idx],"=")))
              ;           $R_content=t rue;
              ;     } else {
              ;        // sinon
              ;        if ($RRR_uri!=$tab_pref[$idx]) {
              ;           $R_content=f alse;
              ;        } else {
              ;           $R_content=t rue;
              ;        }
              ;     }
              ;  }
            }
         }
         if (!$R_content) $content="";
      }




Cet article provient de NPDS

http://www.npds.org/viewtopic.php?topic=21141&forum=48