web/wp-content/themes/IRI-Theme/functions.php
branchwordpress
changeset 125 6d47ba214f30
parent 123 561aa6d282f6
child 126 9b7d841b551a
equal deleted inserted replaced
124:5cb854c0ff5a 125:6d47ba214f30
    79 						
    79 						
    80 			echo ('<li class="menu-h-li">');
    80 			echo ('<li class="menu-h-li">');
    81 			echo ('<a href="'.get_category_link($category->cat_ID).'">'.$category->name.' </a>');
    81 			echo ('<a href="'.get_category_link($category->cat_ID).'">'.$category->name.' </a>');
    82 			echo '<ul>';
    82 			echo '<ul>';
    83 			
    83 			
       
    84 		
    84 			$category_posts = get_posts('numberposts=15&category='.$category->cat_ID);
    85 			$category_posts = get_posts('numberposts=15&category='.$category->cat_ID);
    85 			$count2=0;
    86 			$count2 = 0;
    86 				 //echo("<!-- ".sizeof($category_posts)." -->");
    87 				 //echo("<!-- ".sizeof($category_posts)." -->");
    87 					foreach($category_posts as $post) {
    88 					foreach($category_posts as $post) {
    88 						
    89 						
    89 						echo '<li class="menu-h-li2" title="'.cache_cutter($post->post_title).'"><a href="'.$post->guid.'">'.text_cutter($post->post_title,200).'</a></li>';
    90 						echo '<li class="menu-h-li2" title="'.cache_cutter($post->post_title).'"><a href="'.$post->guid.'">'.text_cutter($post->post_title,200).'</a></li>';
    90 						//echo '<li class="menu-h-li2" title="'.$count2.'"><a href="'.$post->guid.'">'.$post->post_title.'</a></li>';
    91 						//echo '<li class="menu-h-li2" title="'.$count2.'"><a href="'.$post->guid.'">'.$post->post_title.'</a></li>';
    91 						$count2++; //if ($count2>6) break;
    92 						$count2++; //if ($count2>6) break;
    92 					};
    93 					};
       
    94 					
       
    95 
    93 				echo "</ul></li>";
    96 				echo "</ul></li>";
    94 			
    97 			
    95 		}
    98 		}
    96 		$count++; //if ($count>6) break; // limit to 5
    99 		$count++; //if ($count>6) break; // limit to 5
    97 		
   100 		
   116 	if (!mysql_select_db($MyLdtDataBase)) {
   119 	if (!mysql_select_db($MyLdtDataBase)) {
   117 	   echo "Impossible de sélectionner la base mydbname : " . mysql_error();
   120 	   echo "Impossible de sélectionner la base mydbname : " . mysql_error();
   118 	   exit;
   121 	   exit;
   119 	}
   122 	}
   120 
   123 
   121 	$MyLdtSql = "SELECT * FROM  ".$MyLdtTable."";// WHERE `NomFichier` NOT LIKE ''";
   124 	$MyLdtSql = "SELECT * FROM  ".$MyLdtTable." ORDER BY `Lignes`.`Auteur` ASC";// WHERE `NomFichier` NOT LIKE ''";
   122 
   125 
   123 	$result = mysql_query($MyLdtSql);
   126 	$result = mysql_query($MyLdtSql);
   124 
   127 
   125 	if (!$result) {
   128 	if (!$result) {
   126 	   echo "Impossible d'exécuter la requête ($MyLdtSql) dans la base : " . mysql_error();
   129 	   echo "Impossible d'exécuter la requête ($MyLdtSql) dans la base : " . mysql_error();
   135 	while ($row = mysql_fetch_assoc($result)) {
   138 	while ($row = mysql_fetch_assoc($result)) {
   136 	   $MyLdtLineTemplate = "<tr class='rollover'>
   139 	   $MyLdtLineTemplate = "<tr class='rollover'>
   137 							 <td>".$row['Auteur']."</td> <td>".$row['Titre']."</td>  <td>".$row['Contributeur']."</td> ";
   140 							 <td>".$row['Auteur']."</td> <td>".$row['Titre']."</td>  <td>".$row['Contributeur']."</td> ";
   138 							 
   141 							 
   139 		if ($row['NomFichier']!="") {
   142 		if ($row['NomFichier']!="") {
   140 			$MyLdtLineTemplate .= "<td> <a href='?URL=".$row['NomFichier']."' nicetitle='Cliquez ici pour télécharger le projet".$row['NomFichier']."'> <img src='".get_bloginfo('stylesheet_directory')."/images/get.png'/> </a> </td> </tr>";
   143 			$MyLdtLineTemplate .= "<td> <a href='?URL=".$row['NomFichier']."' title='Cliquez ici pour télécharger le projet".$row['NomFichier']."'> <img src='".get_bloginfo('stylesheet_directory')."/images/get.png'/> </a> </td> </tr>";
   141 		}else {
   144 		}else {
   142 			$MyLdtLineTemplate .= "<td> <a href='#' nicetitle='Fichier non disponible'> <img src='".get_bloginfo('stylesheet_directory')."/images/help.png'/> </a> </td> </tr>";
   145 			$MyLdtLineTemplate .= "<td> <a href='#' title='Fichier non disponible'> <img src='".get_bloginfo('stylesheet_directory')."/images/help.png'/> </a> </td> </tr>";
   143 		}
   146 		}
   144 		
   147 		
   145 	   $MyLdtTable .=  $MyLdtLineTemplate."\n";
   148 	   $MyLdtTable .=  $MyLdtLineTemplate."\n";
   146 	   
   149 	   
   147 	}
   150 	}