Aller au contenu

Problème pour récupérer un titre


Sujets conseillés

Bonjour à tous,

j'ai un problème pour récupérer un titre et le faire s'afficher dans l'url

en fait il s'agit d'une page qui affiche des photos corespondant à des annonces, et lorsque je passe la souris sur une photo l'url indiquée affiche bien l'id de l'annonce mais pas son titre.

En plus je comprends pas pourquoi lorsque je clique dessus et bien la page s'affiche malgré que l'url soit incomplète .

exemple : quand je passe la souris çà affiche çà www.monsite.com/ad522-.html , alors qu'il faudrait que çà affiche çà www.monsite.com/ad522-titre-de-l-annonce.html

Pourriez vous m'éclairer SVP ? merci d'avance

voici le code du htaccess

RewriteEngine On
RewriteRule ^ad([0-9]+)-(.*).html detail.php?id=$1
RewriteRule ^([0-9]+)-(.*).html index.php?catid=$1
RewriteRule ^user_([0-9]+)_(.*).html user_info.php?user_id=$1
RewriteRule ^ratemember_([0-9]+)_(.*).html rate_member.php?user_id=$1
RewriteRule ^contact_([0-9]+)_([0-9]+)_(.*).html detail.php?id=$1&user_id=$2&contact=1
RewriteRule ^rate_([0-9]+).html rate.php?id=$1
RewriteRule ^largepicture_([0-9]+).html large_picture.php?id=$1
RewriteRule ^tellafriend_([0-9]+).html detail.php?id=$1&tellafriend=1
RewriteRule ^print_([0-9]+).html detail.php?id=$1&print=1
RewriteRule ^removefav_([0-9]+).html fav_popup.php?remove_fav=$1
RewriteRule ^addfav_([0-9]+).html fav_popup.php?add_fav=$1
RewriteRule ^trm_(.*).html info.php?what=terms
RewriteRule ^ab_(.*).html info.php?what=aboutus
RewriteRule ^adv_(.*).html info.php?what=advertise
RewriteRule ^hlp_(.*).html info.php?what=help
RewriteRule ^rss_([0-9]+).html detail.php?id=$1

le code de picturebrowse.php

<?php
session_start();
include_once("admin/inc.php");
$catname = " :: $la_picture_gallery";
include_once("header_inc.php");
$tplPbrowse=new TplLoad;
$offset=getParam("offset",0);
writeLinkedTitle("");
if ($set_pg_login_need==1)
check_valid_user("$la_mem_gal");


if ($validation == 1) { $val_string = " AND ad_is_validated = 1"; } else { $val_string = ""; }

$option_list=getCategoriesDD(getParam("catid",""),2);
$tplPbrowse->assign("option_list", $option_list);

$number_of_ads_per_page = $set_num_browse;
$query = "select $ads_tbl.ad_id,$pic_tbl.id,pic_ad_id,ad_title,$pic_tbl.filename from $pic_tbl,$ads_tbl where $pic_tbl.pic_ad_id = $ads_tbl.ad_id AND main=1 $val_string";
$lAddOnQuery="";

if (getParam("catid",""))
{
$ltmpChilds=getCategoryChildren(getParam("catid",""));
if ($ltmpChilds)
$lAddOnQuery.=" AND ad_cat_id IN (". $ltmpChilds . ",". getParam("catid",0) .")";
else
$lAddOnQuery.=" AND ad_cat_id=". getParam("catid",0);
}



$query.=$lAddOnQuery;
$result = q ($query);
$num_links = mysql_num_rows($result);
$lNavigation=urlBar($num_links,$number_of_ads_per_page,getparam("page",1),getAllParams(array("page")));


$query = "select $ads_tbl.ad_id,$pic_tbl.id,pic_ad_id,ad_title,$pic_tbl.filename from $pic_tbl,$ads_tbl where $pic_tbl.pic_ad_id = $ads_tbl.ad_id AND main=1 $val_string";
$query.=" $lAddOnQuery order by pic_ad_id desc " . $lNavigation["sql_limit"];
$result = q ($query);
$this_screen = mysql_num_rows($result);

$tplPbrowse->assign("this_screen",$this_screen);

$break_counter=0;
while ($row = mysql_fetch_array($result))
{
$break_counter++;

$ad_id = $row["pic_ad_id"];
$id = $row["pic_ad_id"];
$sitetitle = $row["ad_title"];
$filename = $row["filename"];
$filename=ereg_replace("tmb2","tmb1",$filename);
if ($set_image_program==0)
{
$lSizeArray=setImageSize($filename,getManualSize("small"),0);
$lImageList[$i]["w"]=$lSizeArray[0];
$lImageList[$i]["h"]=$lSizeArray[1];
}
$lImageList[$i]["fancy_opentable"]=cornerTableLayout(150,100,1);
$lImageList[$i]["filename"]=$filename;
$lImageList[$i]["alt"]=htmlspecialchars($sitetitle,ENT_QUOTES);
$lImageList[$i]["id"]=$id;
$lImageList[$i]["fancy_closetable"]=cornerTableLayout(150,100,2);

$lImageList[$i]["break"]=$break_counter;
if ($break_counter==4)
$break_counter=0;
$i++;
}
$tplPbrowse->assign("set_gallery_catlist","$set_gallery_catlist");
$tplPbrowse->assign("set_image_program","$set_image_program");
$tplPbrowse->assign("image_list",$lImageList);
$tplPbrowse->assign("url_bar",$lNavigation["url_bar"]);
$tplPbrowse->display("picturebrowse.tpl");



function cornerTableLayout($aTableW,$aTableH,$aSection)
{
if ($aSection==1)
{
$retStr.="<table width='$aTableW' cellpadding='0' cellspacing='0' border='0' bgcolor='#CCCCFF'>";
$retStr.= "<tr><td><img src='layout_images/corner/tl.jpg' alt='' /></td>";
$retStr.= "<td valign='top'><img src='layout_images/corner/bline.jpg' width='$aTableW' style='height:1px;' class='top'></td>";
$retStr.= "<td><img src='layout_images/corner/tr.jpg' alt=''></td></tr>";
$retStr.= "<tr><td align='left'><img src='layout_images/corner/bline.jpg' alt='' height='$aTableH' style='width:1px' /></td>";
$retStr.= "<td valign='top'>";
return $retStr;
}

if ($aSection==2)
{
$retStr.= "</td><td align='right'><img src='layout_images/corner/bline.jpg' height='$aTableH' style='width:1px' alt='' /></td></tr>";
$retStr.= "<tr><td><img src='layout_images/corner/bl.jpg' alt='' /></td>";
$retStr.= "<td valign='bottom'><img src='layout_images/corner/bline.jpg' alt='' width='$aTableW' style='height:1px;' class='top'></td>";
$retStr.= "<td><img src='layout_images/corner/br.jpg' alt='' /></td></tr></table>";
return $retStr;
}
}

include_once("footer_inc.php");
?>

le code de la template

<!-- Picturebrowse.tpl -->

<h2>{$smarty.const.LA_PICTURE_GALLERY}</h2>
<p class="headline">{$smarty.const.LA_PICUTE_GALLERY_TEXT}</p>
<p> </p>
{if $set_gallery_catlist}
<center>
<form action="picturebrowse.php" name="itemForm" id="itemForm" method="get">
<select name="catid" class="txt" onchange="submit();">
<option value='0'>{$smarty.const.LA_ALL}</option>
{$option_list}
</select>
</form>
</center>
{/if}
<p class="headline">


{$url_bar}
</p>

{if $image_list}
<table cellpadding="3" cellspacing="4" style="clear:both;"><tr>

{foreach item=image from=$image_list}

<td class='gal' width="25%">

<center>
<a href="ad{$image.id}-{$ad.TITLE|truncate:34:"...":true|sanitize}.html" style="clear:both;">
{if $set_image_program==0}
<img src="images/{$image.filename}" title="{$image.alt}" hspace="2" border="0" width="{$image.w}" heigth="{$image.h}" />
{else}
<img src="images/{$image.filename}" title="{$image.alt}" vspace="5" hspace="5" border="0" />
{/if}
</a>
</center>


</td>

{if $image.break==4}
</tr><tr>
{/if}
{/foreach}

{if $image.break==4}
<td colspan="4"></td>
{elseif $image.break==3}
<td colspan="1"></td>
{elseif $image.break==2}
<td colspan="2"></td>
{elseif $image.break==1}
<td colspan="3"></td>
{/if}

</tr></table>
{else}
<p>{$smarty.const.LA_NO_PIC_THIS_CAT}</p>
{/if}

<p class="headline">
{$url_bar}

</p>

Modifié par Dax
Lorsque tu postes un code long, il vaut mieux utiliser les balises CODEBOX, qui ne déforment pas la mise en page. J'ai édité ton message en ce sens (captain_torche, modérateur)
Lien vers le commentaire
Partager sur d’autres sites

Salut captain_torche,

je veux pas te contrarier mais c'est en utilisant le codebox que l'affichage du forum est tout distordu , j'utilise IE comme navigateur et toi ? parce que quand j'utilise l'insertion de code sans codebox chez moi l'affichage du forum est parfait...

A voir ...

Lien vers le commentaire
Partager sur d’autres sites

Veuillez vous connecter pour commenter

Vous pourrez laisser un commentaire après vous êtes connecté.



Connectez-vous maintenant
×
×
  • Créer...