8797 sujets

Développement web côté serveur, CMS

Bonsoir,
dernière petite aide... c'est toujours un peu génant de bombarder de questions...

J'utilise également un pluging (random Visual Index) permettant d'indexer les différentes pages, de mon site, contenant des photos.

Ce pluging fonctionnait à l'époque, seulement après avoir customisé le code lié aux sections de navigation (voir plus bas), il n'index plus qu'une seul page.


L'idéal serait d'arriver au résultat suivant:
http://www.ritxiostariz.com/

En résumé, il n'index qu'une seule page d'une de mes sections et non toutes les pages (contenant des photos) de toutes les sections.

Après avoir testé, bidouillé,…. je pense que c'est lié à cette partie du code:


function createExhibit()
{
	$OBJ =& get_instance();
	global $rs, $exhibit;
	
	$pages = $OBJ->db->fetchArray("SELECT id    
		FROM ".PX."objects  
		WHERE section_id = '2' 
		AND status = '1' 
		AND hidden != '1' 
		AND id != '$rs[id]' 
		ORDER BY ord ASC");



Qui est "sans doute" directement lié à une autre partie d'un pluging (customisation des sections de navigation):

// sections navigation
function sectional()
{
	$OBJ =& get_instance();
	global $rs;

	$pages = $OBJ->db->fetchArray("SELECT id, title, url, 
		section, sec_desc, sec_disp, year, secid    
		FROM ".PX."objects, ".PX."sections 
		WHERE status = '1' 
		AND hidden != '1' 
		AND section_id = secid  
		ORDER BY sec_ord ASC, ord ASC");
		
	if (!$pages) return 'Error with pages query';
	
	foreach($pages as $reord)
	{
		$order[$reord['sec_desc']][] = array(
			'id' => $reord['id'],
			'title' => $reord['title'],
			'url' => $reord['url'],
			'year' => $reord['year'],
			'secid' => $reord['secid'],
			'disp' => $reord['sec_disp']);
	}
	
 $i = 1;
 $s .= "<ul id='bloc-sections'>\n";
 foreach($order as $key => $out)
 {
     if ($out[0]['disp'] == 1)
        $s .= "<li class='sections' id='sections-$i'><span class='section-title' id='section-title-$i'>" . $key . "</span>";
     $j = 1;
     $s .= "<ul class= 'sous-sections-title' id='bloc-sous-sections-$i'>";
     foreach($out as $page)
     {
           $active = ($rs['id'] == $page['id']) ? "active" : '';
         $s .= "<li class='sous-section-title-$i $active' id='sous-section-title-$i-$j'><a href='" . BASEURL . ndxz_rewriter($page['url']) . "' onclick=\"do_click();\">" . $page['title'] . "</a></li>";
         $j++;
     }
     $s .= "</ul>\n";
    
      if ($out[0]['disp'] == 1)
         $s .= "</li>\n\n";
     $i++;
 }
 $s .= "</ul>\n";
 return $s;
 }








Mon avis,… il suffit juste de remplacer la valeur suivante (WHERE section_id = '2' ) par une autre, mais laquelle…?
Petite idée ?

Merci d'avance pour votre coup de main !


au cas ou...voici l'entièreté du premier code: random Visual Index


<?php if (!defined('SITE')) exit('No direct script access allowed');

/**
* Random Visual Index (Experimental)
*
* Exhibition format
* 
* @version 1.0
* @author Vaska 
* @author Simon Lagneaux
*/

// defaults from the general libary - be sure these are installed
$exhibit['dyn_css'] = dynamicCSS();
//$exhibit['lib_js'] = array('grow.vaska.js');
$exhibit['exhibit'] = createExhibit();

function createExhibit()
{
	$OBJ =& get_instance();
	global $rs, $exhibit;
	
	$pages = $OBJ->db->fetchArray("SELECT id    
		FROM ".PX."objects  
		WHERE section_id = '2' 
		AND status = '1' 
		AND hidden != '1' 
		AND id != '$rs[id]' 
		ORDER BY ord ASC");
		
	if (!$pages) return;
	
	// get the details
	foreach ($pages as $get)
	{
	$m=rand(1,1);
		$imgs = $OBJ->db->fetchRecord("SELECT media_file, url, title, year     
			FROM ".PX."media, ".PX."objects  
			WHERE media_ref_id = '$get[id]'
			AND id = media_ref_id   
			AND media_order = '$m'");
		
		if (isset($imgs['media_file'])) $nimgs[] = $imgs;
	}

	// ** DON'T FORGET THE TEXT ** //
	$s = $rs['content'];
	$s .= "\n<div class='cl'><!-- --></div>\n";
	
	if (!$nimgs) return;
	
	$thumb = 300;
	
	$i = 1; $j = 0; $a = '';

	foreach ($nimgs as $go)
	{
		$url = BASEURL . $go['url'];
		
		if ($go['break'] != 0)
		{
			if ($i == $go['break'])
			{
				$i = 0;
				$break = "<div style='clear:left;'><!-- --></div>";
			}
			else
			{
				$break = '';
			}
		}
		else
		{
			$break = '';
		}

		
		$a .= "<div class='imgr'>\n";
		        $a .= "<a href='$url'><img src='" . BASEURL . GIMGS . "/th-$go[media_file]' alt='$go[media_file]'/><span>$go[title] ($go[year])</span></a>\n";
		        
		    $a .= "</div>\n";

		//}
		
		$i++; $j++;
	}
	
	// images
	$s .= "<!--[if lte IE 6]><style type='text/css'>.thumb-img { #top: -50%; }</style><![endif]-->\n\n";
	$s .= $a;
		
	return $s;
}


function dynamicCSS()
{
	global $rs;
	
	// for .thumb-it we need #top: -50%; for IE...but it doesn't work.

	$thumb = 300;
	
	return "
	#content .container { width:100%;}
	 .imgr a img { margin-right:auto;}
	 .imgr a:hover span { position: relative; display:block; clear:both;background: none; color:black;padding:none;}
	 .imgr span:hover { background: none; color:black; padding:none;}
	 .imgr { float:left ; width: 250px; height:250px;  }
	.shadowbox3 {
	background-image: url(http://simonlagneaux.com/files/images/shadow3.png);
	background-position: right bottom; }
	
	";
}


?>




Merci merci.