Script Php classifieds PB URL Rewriting

WRInaute impliqué
Bonjour,

Je voulais savoir si quelqu'un utilise le script de petites annonces "Php Classifieds" ?

-http://www.deltascripts.com/phpclassifieds/

Si oui, as t-il un .htacess tout pret à m'offrir afin d'utiliser l'URL rewriting ??? :D :D :D

Merki :wink:
 
WRInaute impliqué
Bonjour...

Je suis toujours ennuyer avec mon URL Rewriting... :(

J'ai fait de nombreux essais mais sans résultats (mis à part les codes 500 and co)

Voilà mon .htaccess :
Code:
Options FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^annonce-([0-9]+)-([0-9]+)\.html$ index.php?catid=$1&set_add_ad_cat=$2 [QSA,L]
RewriteRule ^annonce-([0-9]+)-([0-9]+)\.html$ ?catid=$1&set_add_ad_cat=$2 [QSA,L]
RewriteRule ^([^-.]+)-([0-9]+)\.html$ detail.php?siteid=$1 [QSA,L]
RewriteCond %{HTTP_HOST} !^www.petite-annonce-gratuite.com$
RewriteRule ^(.*) http://www.petite-annonce-gratuite.com/$1 [QSA,L,R=301]

Mon site : -ttp://www.petite-annonce-gratuite.com

Si quelqu'un à une idée, parce que là, je suis perdu...

Merci :D
 
WRInaute impliqué
Réussi.... non, pas vriament :cry:

J'essaye de temps en temps je me prends la tete pendant une journée, j'avance, je recule, comment veux tu que... :lol: faut que j'arrete la moquete...!

Bref, j'avance à petit pas, j'ai rewritté un type de lien, mais pour les autres, je n'y arrive pas. Il faut mettre les mains dans le code su script pour le rewritter :?
J'ai trouvé sur le net une personne qui a rewritté la bete, mais il ne repond pas aux mails... (cf -http://www.saisoloc.com )

Je me demande si je ne vais pas payé qqu'un pour me finir le travail... (si quelqu'un est intéréssé... qu'il se fasse connaitre par MP)

Voilà ou j'en suis après de long mois de gualère... :roll:
 
Nouveau WRInaute
ah oui il la vraiment bien fait :eek:

mais le probleme c est que je n arrive meme pas a l installer ca commence bien :?
 
Nouveau WRInaute
Bonjour,

J'essaie de mettre aussi l'url rewriting pour ce script mais en vain

Avez vous trouvé la solution. Car là je galère.

Pourtant cela doit etre realisable car beaucoup de sites ont reussi à le faire.

Pourriez vous m'aidez ?

Cordialement
Thelliez
christine
Sinon j'ai trouve ce topic sur delta script
mais je n'y arrive pas non plus
http://www.deltascripts.com/board/viewtopic.php?id=5987
 
Nouveau WRInaute
Re-bonsoir,

En cherchant bien je penses avoir trouvé

Par contre je souhaitais obtenir :
http://www.mon-annonce-gratuite.com/ann ... isirs.html
et j'obtiens cela : un tirait en trop et je sais comment faire pour l'enlever
http://www.mon-annonce-gratuite.com/annonce-7--loisirs.html


Et certaines rubrique ou il y a un accent il me remplace l'accent par un - comme dans le mot véhicule
http://www.mon-annonce-gratuite.com/annonce-10--v-hicules.html


Si quelqu'un serait regler ce probleme se serait vraiment sympathique.

Sinon voici les modifs à faire :

Voici mon fichiers htaccess
RewriteEngine on
RewriteRule ^annonce-([0-9]+)-([0-9]*)-(.*).html$ /index.php?catid=$1&set_add_ad_cat=$2 [L,QSA]
RewriteRule ^details-annonce-([0-9]+)-(.*).html$ /detail.php?siteid=$1 [L,QSA]


J'ai modifier le fichier catcol.php (voici mon code complet) :
<!-- ## CATCOL.PHP START ## -->
<!-- Catcol.php: open 1 -->
<table border="0" width="100%" bgcolor="#A9B8D1" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" height="1"><img border="0" src="layout_images/spacerbig.gif" width="1" height="1" alt='' /></td>
</tr>
</table>
<!-- Catcol.php: close 1 -->


<!-- Catcol.php: open 1 -->
<table border="0" width="100%" cellspacing="0" cellpadding="5">
<tr>
<td width="100%">
<?
if (isset($_REQUEST["catid"]))
{
$sql = "select catname from $cat_tbl where catid=" . round($catid);
$row = mysql_fetch_array(q($sql));
$catname = $row["catname"];
}
print("<span class=\"title\">".strip_tags($catname)."</span><p />");

if ($catid==0) { $where_clause = "where catfatherid = 0";}
else { $where_clause = "where catfatherid=$catid"; }


print "<!-- START CATCOL COLUMS -->";


function column_y()
{

print("\n\n\n<!-- Column table start -->\n\n<table border=\"0\" width=\"100%\"><tr>");
global $cat_tbl;
global $where_clause;
global $categories_per_column;
global $file;
global $ccatid;
global $cantall;
global $frontpage;
global $catid;

$sql = "select * from $cat_tbl $where_clause order by catname";

$result = q ("$sql");
$catcounter = mysql_num_rows($result);

for ($i=0; $i<$catcounter; $i++)
{

$row = mysql_fetch_array($result);
print "<td>";
// Load template variables
$fArray["IMAGE"] ="<img src='catimages/".$row["catimage"]."' border='0' alt=''>";
$fArray["TOTAL_ADS"] = $row["total"];
$fArray["CATEGORYNAME"] = $row["catname"];
$cat_titre = strtolower($row["catname"]);
$cat_titre = preg_replace("/([^a-z0-9]+)/", "-", $cat_titre);
$cat_titre = trim($cat_titre, "-");
$fArray["ALLOWADS"] = $row["allowads"];
$fArray["CATFATHERID"] = $row["catfatherid"];
$fArray["CATFATHERID"] = $row["catfatherid"];

if ($row["sublinks_disp"]==1)
{
$fArray["CATDESCRIPTION"] = getYahooSubcat($row["catid"],$row["sublinks_ord"],$row["sublinks_lim"],$row["sublinks_sort"]);
}
else
{
$fArray["CATDESCRIPTION"] = $row["catdescription"];
}


if ($frontpage==2) {$fName="add_ad_cat";}
else {$fName="index";}

$set_add_ad_cat = "";
if (isset($_GET["set_add_ad_cat"])) {
$set_add_ad_cat = round($_GET["set_add_ad_cat"]);
}

//$fArray["URL"] = "<a href='" .$fName . ".php?catid=".$row["catid"] ."&set_add_ad_cat=". $set_add_ad_cat . "'>";
$fArray["URL"] = "<a href='annonce-".$row["catid"] ."-". $set_add_ad_cat . "-". $cat_titre .".html'>";
$fArray["/URL"] = "</a>";

writeTemplate("cat",$fArray);
// End of template variables

// Increase categorycounter by one
$catno = $catno + 1;

print "</td>";

if ($catno == $categories_per_column)
{
echo "</tr><tr>";
$catno = 0;
}

}

print("<td></td></tr></table>\n\n\n<!-- Column tables end -->\n\n");

}
// End of column type y

// Start column type x
function column_x()
{


print("\n\n\n<!-- Column table start -->\n\n<table border=\"0\" width=\"100%\"><tr><td valign=\"top\">");
global $cat_tbl;
global $where_clause;
global $categories_per_column;
global $file;
global $ccatid;
global $cantall;
global $frontpage;
global $catid;

$sql = "select * from $cat_tbl $where_clause order by catname";
$result = q ($sql);
$catcounter = mysql_num_rows($result);
$catno = 0;
for ($i=0; $i<$catcounter; $i++)
{
$row = mysql_fetch_array($result);

// Load template variables
$fArray["IMAGE"] ="<img src='catimages/".$row["catimage"]."' border='0' alt=''>";
$fArray["TOTAL_ADS"] = $row["total"];
$fArray["CATEGORYNAME"] = $row["catname"];
$cat_titre = strtolower($row["catname"]);
$cat_titre = preg_replace("/([^a-z0-9]+)/", "-", $cat_titre);
$cat_titre = trim($cat_titre, "-");
$fArray["ALLOWADS"] = $row["allowads"];
$fArray["CATFATHERID"] = $row["catfatherid"];
$fArray["CATFATHERID"] = $row["catfatherid"];

if ($row["sublinks_disp"]==1)
{
$fArray["CATDESCRIPTION"] = getYahooSubcat($row["catid"],$row["sublinks_ord"],$row["sublinks_lim"],$row["sublinks_sort"]);
}
else
{
$fArray["CATDESCRIPTION"] = $row["catdescription"];
}


if ($frontpage==2) {$fName="add_ad_cat";}
else {$fName="index";}

$set_add_ad_cat = "";
if (isset($_GET["set_add_ad_cat"])) {
$set_add_ad_cat = round($_GET["set_add_ad_cat"]);
}

//$fArray["URL"] = "<a href='" .$fName . ".php?catid=".$row["catid"] ."&set_add_ad_cat=". $set_add_ad_cat . "'>";
$fArray["URL"] = "<a href='annonce-".$row["catid"] ."-". $set_add_ad_cat . "-". $cat_titre .".html'>";
$fArray["/URL"] = "</a>";

writeTemplate("cat",$fArray);
// End of template variables

// Increase categorycounter by one
$catno = $catno + 1;

// If max categories for this column is reached
if ($catno == $categories_per_column)
{
print("</td>\n\n\n<td valign=\"top\">\n");
$catno = 0;
}

}
print("</td></tr></table>\n\n\n<!-- Column tables end -->\n\n");


}
// End column type x


if ($xy == 'y')
{
column_y();
}
else
{
column_x();
}
print "<!-- END CATCOL COLUMS -->";

// New structure, show add ad button
$allowads = 0;

if (!empty($catid))
{
$sql = "select * from $cat_tbl where catid=$catid";
$result_allow = q ($sql);
$row = mysql_fetch_array($result_allow);
$allowads = $row["allowads"];
}



// Check if admin have forgotten category creation...
$sql_check = "select allowads from $cat_tbl where allowads='on'";
$num_cat_check = mysql_num_rows(mysql_query($sql_check));

if ($num_cat_check<1)
{
if (!isset($from_adress_mail)) {
$from_adress_mail = " by email ";
}
print "Please note, <u>one</u> or <u>more</u> of the following problems exists:
<ul>
<li>Administrator of this site has not yet created any categories to add ad to.</li>
<li>Administrator has no categories that allow posting of ads (this requires the box
'Allow Ads' to be checked when creating categories). </li>
</ul>

Please contact webmaster " . $from_adress_mail . " in order to solve this issue.";
}

if ($allowads AND $frontpage==2)
{
?>


<table background="layout_images/bg_cat.gif" width="185" height="35" border="0" cellspacing="0" cellpadding="0" nowrap="true">
<tr>
<td><center>
<? print "<b><a href='item.php?catid=$catid'>$la_add_adcat</a></b>"; ?>
</center>
</td>
</tr>
</table>
<? }print "</td></tr></table>"; ?>













J'ai modifié aussi le fichier : items.php (code complet)

<?
session_start();
include_once("admin/inc.php");
$catname = " :: $la_add_ad";
include_once("header_inc.php");
$i = 0;
$sess = "";$siteid="";$sitecatid = "";$error = 0;$counter = 0;$sitetitle="";$sitedescription="";$expire_days = "";$sent = 0;



if (isset($_REQUEST["catid"]))
$catid = round($_REQUEST["catid"]);
if (isset($_REQUEST["siteid"]))
$siteid = round($_REQUEST["siteid"]);
if (isset($_REQUEST["sitecatid"]))
$sitecatid = round($_REQUEST["sitecatid"]);
if (isset($_REQUEST["expire_days"]))
$expire_days = round($_REQUEST["expire_days"]);

if (!$special_mode)
{ include("navigation.php"); }

include_once("member_header.php");

if (isset($_REQUEST["catid"]))
$catid = round($_REQUEST["catid"]);



$sql_top = "select catname from $cat_tbl where catid = '$catid' AND allowads = 'on'";
$result_1 = q ($sql_top);
$row_1 = mysql_fetch_array($result_1);
$catname = $row_1["catname"];

// Create clickable links

//print("<a href=\"javascript:eek:penWin2('suggestcategory.php?id=$siteid&adtitle=".htmlspecialchars($sitetitle)."')\">$suggestcategory</a>");
print "<h2>$catname</h2>";
if ((empty($catname) AND !isset($_GET["update_rq"])) AND (!isset($_POST["submit"])))
{
// Someone trying to bypass the posting limitation
print "<p><center>$la_not_permit</center></p>";
include_once("member_footer.php");
include_once("footer_inc.php");
exit();
}


if (isset($_REQUEST["sess"]))
{
if ($_REQUEST["sess"] == 1 AND isset($_SESSION["admin"]))
{
unset($_SESSION["valid_user"]);
$valid_user = $_GET["usr"];
$_SESSION["valid_user"] = $valid_user;
}
}
check_valid_user("");
if (!session_is_registered("admin"))
{
if ($siteid)
{
$result = mysql_query ("select ad_username from $ads_tbl where siteid = $siteid");
$row = mysql_fetch_array($result);
$ad_username = $row["ad_username"];

if ($ad_username <> $_SESSION["valid_user"])
{
print "$la_mustbeowner";
include_once("footer_inc.php");
exit;
}
}
}

?>
<table border="0" cellspacing="1" width="100%">
<tr>
<td width="100%" valign="top">
<?
$dagens_dato = date("d.m.Y");
$dy = date("d");
$mn = date("m");
$yr = date("Y");

if (isset($_POST["submit"]))
{

if (isset($_POST["sitetitle"]))
$sitetitle = $_POST["sitetitle"];
if (isset($_POST["sitedescription"]))
$sitedescription = $_POST["sitedescription"];

$sitetitle = htmlspecialchars("$sitetitle",ENT_QUOTES);
$sitedescription = htmlspecialchars("$sitedescription",ENT_QUOTES);


// A field is not filled out, which one?
print("<ol class=\"red\">");
if (!$sitetitle)
{
print("<li>$la_you_must <b>$title</b></li>");
$error = 1;
}
if (!$sitedescription)
{
print("<li>$la_you_must <b>$description</b></li>");
$error = 1;
}
if (!$expire_days AND $expire_days_option)
{
print("<li>$la_you_must <b>$la_ad_length</b></li>");
$error = 1;
}


// If we have a category, get all template fields
if (isset($_REQUEST["sitecatid"]))
{
$sql="select cattpl from $cat_tbl where catid = '".round($_REQUEST["sitecatid"])."'";
$result_2 = mysql_query ($sql);
$co = 0;
$warn = 0;
$row_cat = mysql_fetch_array($result_2);
$cattpl_cate = $row_cat["cattpl"];

$res = q("select q_field,q_question,q_page from $q_tbl where (q_tpl = '$cattpl_cate' OR q_tpl = 1) AND q_mand=1");

while($row = mysql_fetch_array($res))
{
$q_field = $row["q_field"];
$q_pagenb = $row["q_page"];
$q_question = $row["q_question"];
$fieldname = "e_" . $q_field;
//echo "$fieldname:" . print_r($_POST["$fieldname"]) . "<br>";

if (isset($_POST[$fieldname]))
{
$val_in = $_POST[$fieldname];

if (isset($val_in))
{
if (is_array($val_in))
{
foreach ($val_in as $check_var)
{
if (!empty($check_var))
$co++;
}

if ($co<1)
$warn = 1;

}
}
}


if (empty($_POST["$fieldname"]) OR $warn)
{
print("<li>$la_you_must <b>$q_question</b></li>");
$error = 1;
$warn = 0;
}

}

}

// Check for banned words. If a banned word appear, raise warning
$bad_words_list = split(",", $bad_words);
foreach($bad_words_list as $bad)
{
if ($bad)
{
$result1 = eregi($bad,$sitetitle);
$result2 = eregi($bad,$sitedescription);
}

if (!empty($result1) OR !empty($result2))
{
print("<li>$la_bad_words <b>$bad</b><br />");
$error = 1;
print "</li>";
}

}

print("</ol>");


if ($error==0)
{
$data = "";
$element = "";
$str = "";

foreach ($HTTP_POST_VARS as $key => $value)
{
if (ereg("e_", $key) AND $key<>"expire_days")
{
if (is_array($value))
{
$str="";
foreach ($value as $element)
{

$str = "$str" . "$element,";
}
$str = substr($str,0,-1);
$data = $data . "$key = '$str',";
}
else
{
$data = $data . "$key = '$value',";
}
}
}

$data = substr($data,0,-1);
if ($data)
{
$data = "," . $data;
}

if ($siteid)
{
## Modified Ad ##
$sql_update = "update $ads_tbl set sitetitle='$sitetitle',sitedate='$dagens_dato', sitedescription='$sitedescription',sitecatid=$sitecatid,
expire_days='$expire_days', valid='0', notify='0'$data where siteid = '$siteid' AND ad_username='".$_SESSION["valid_user"]."'";
$res_upd = q($sql_update);


// If any changes, we inform webmaster about the update.
if (mysql_affected_rows())
{
// Notify webmaster if he/she wants to
if ($set_inform_admin_update==1)
{
// Notify administator that they have a new ad
$ip = $_SERVER["REMOTE_ADDR"];

$url = "http://" . $url . "/detail.php?siteid=$siteid";
$subject = formatString($la_updated_ad_info,array($siteid,$sitetitle,$sitedescription,$url,$ip));
$body = formatString($la_updated_ad_inform,array($siteid,$sitetitle,$sitedescription,$url,$ip));

sendEmail($from_adress_mail,$from_adress_mail,$subject,$body);
}
}



}
else
{
## New Ad ##


// If credit option and the user is not admin, reduce number of credits by one
if ($credits_option AND !isset($_SESSION["admin"]))
$result = mysql_query ("update $usr_tbl set credits = credits - 1 where credits>0 AND email = '".$_SESSION["valid_user"]."'");

// Check if the ad has already been posted (exaxtly same sitetitle and user will raise warning)
$result = q("select siteid from $ads_tbl where sitetitle = '$sitetitle' AND ad_username='".$_SESSION["valid_user"]."'");
$num_already_posted = mysql_num_rows($result);

if ($num_already_posted>0)
{
echo "<p><b>" . formatString($la_posted_before,array("$sitetitle")) . "</b></p>";
include_once("member_footer.php");
include_once("footer_inc.php");
$error = 1;
exit;
}

$datestamp = date("Ymd");
$mode = "insert";
$sql_insert = "insert into $ads_tbl (ad_username,sitetitle,sitedescription,sitedate,datestamp,sitecatid, expire_days)
values ('".$_SESSION["valid_user"]."','$sitetitle','$sitedescription','$dagens_dato','$datestamp','".round($_REQUEST["sitecatid"])."','$expire_days')";
$result = q ($sql_insert);
$siteid = mysql_insert_id();
$data = substr($data,1);

$sql_update = "update $ads_tbl set $data where siteid = '$siteid'";

if ($data)
{
$result = q ($sql_update);
}
//echo $sql_update;



if (mysql_affected_rows())
{
$sql = "update $usr_tbl set num_ads = 0 where email ='" . $_SESSION["valid_user"] . "' AND num_ads IS NULL";
q($sql);

$sql = "update $usr_tbl set num_ads = num_ads + 1 where email ='" . $_SESSION["valid_user"] . "'";
q($sql);

// Notify webmaster if he/she wants to
if ($set_inform_admin_insert==1)
{
// Notify administator that they have a new ad
$ip = $_SERVER["REMOTE_ADDR"];

$url = "http://" . $url . "/detail.php?siteid=$siteid";
$subject = formatString($la_new_ad_info,array($siteid,$sitetitle,$sitedescription,$url,$ip));
$body = formatString($la_new_ad_inform,array($siteid,$sitetitle,$sitedescription,$url,$ip));

sendEmail($from_adress_mail,$from_adress_mail,$subject,$body);
}

}
else
{
failMsg("WARNING", "No id was returned from db, so no insert was done. Make sure that
ad table has auto-increment property on field siteid, and that ALL columns and tables exist.
<p>Here is the sql statement we just tried: <hr>$sql_insert<hr>");
}

// Update cat counters
updateCatCounter();



} // End of insert/update

if ($picture_upload_enable)
{
if (!isset($adid))
$adid = $siteid;
$url_forward = "upload_file.php?pictures_siteid=$adid";


print "$la_pic_upl<br />";
print "<br /><b />$la_choose</b /><br /><a href='$url_forward'><img src=\"layout_images/pointer.gif\" border=\"0\" />$la_i_want</a><br />";
print "<a href='index.php'><img src=\"layout_images/pointer.gif\" border=\"0\" />$la_ret</a><br />";
print "<a href='add_ad_cat.php'><img src=\"layout_images/pointer.gif\" border=\"0\" />$la_add_an</a><br /><p />";

if (!empty($set_special))
{
print "<img src=\"layout_images/pointer.gif\" border=\"0\" />";
print "<b>$la_special_listing</b> <br />";
print "$la_special_listing_1 $set_special_price $gw_paypal_currency_code ! ";
print "$la_choose_pay $la_choose_pay_2 <p />";


?>
<table><tr><td>

<?
if (!empty($gw_paypal))
{
?>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_new">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<? echo $gw_paypal_account ?>">
<input type="hidden" name="item_name" value="<? echo $la_special_text ?> <? echo $adid ?>">
<input type="hidden" name="amount" value="<? echo $set_special_price ?>">
<input type="hidden" name="option_name1" value="200">
<input type=hidden name="payer_email" value="<? echo $valid_user ?>">
<input type="hidden" name="currency_code" value="<? echo $gw_paypal_currency_code ?>">
<input type="image" src="http://images.paypal.com/images/x-click-butcc.gif" align='left' name="submit">

</form>
<? } ?>

</td>

<td>
<?
if (!empty($gw_worldpay))
{
?>

<form action="https://select.worldpay.com/wcc/purchase" target="_new" method="POST">
<input type=hidden name="instId" value="<? echo $gw_worldpay_install ?>">
<input type=hidden name="cartId" value="<? echo $gw_worldpay_cartid ?>">
<input type=hidden name="amount" value="<? echo $set_special_price ?>">
<input type=hidden name="currency" value="<? echo $gw_worldpay_currency_code ?>">
<input type=hidden name="desc" value="<? echo $la_special_text ?> <? echo $adid ?>">
<input type=hidden name="email" value="<? echo $valid_user ?>">
<input type="image" src="layout_images/smallwp.gif" valign='top' align='right' name="submit">
</form>
</html>
<? } ?>
</td></tr></table>
<?


}


} // End picture upload


//require("admin/config/general.inc.php");
} // End of Valid data, but still submitted info

// End of submit information
}

// If not submitted, or it was submitted with an error. Then we have to show all fields again with values.
if (!isset($_POST["submit"]) OR (isset($_POST["submit"]) AND $error>0))
{
if (isset($_REQUEST["siteid"]))
{

if ($_REQUEST["siteid"]>0)
{
$siteid = round($_REQUEST["siteid"]);
$result = mysql_query ("select * from $ads_tbl,$cat_tbl where siteid = $siteid AND sitecatid=catid");
$row = mysql_fetch_array($result);
$row2 = $row;
$siteid = $row["siteid"];
$sitetitle = $row["sitetitle"];
$sitedescription = $row["sitedescription"];
$sitedate = $row["sitedate"];
$sitecatid = $row["sitecatid"];
$catid = $sitecatid;
$sitehits = $row["sitehits"];
$sitevotes = $row["sitevotes"];
$cattpl = $row["cattpl"];
$expire_days = $row["expire_days"];

if (isset($_POST["sitetitle"]))
$sitetitle = htmlspecialchars($_POST["sitetitle"],ENT_QUOTES);
if (isset($_POST["sitedescription"]))
$sitedescription = htmlspecialchars($_POST["sitedescription"],ENT_QUOTES);
if (isset($_POST["expire_days"]))
$expire_days = htmlspecialchars($_POST["expire_days"],ENT_QUOTES);
if (isset($_POST["sitecatid"]))
$sitecatid = htmlspecialchars($_POST["sitecatid"],ENT_QUOTES);

//$sitedescription = ereg_replace("&quot;","",$sitedescription);
//$sitedescription = "";


}

}

?>
<script LANGUAGE="JavaScript">
function openWin2(URL) { aWindow=window.open(URL,"Large","toolbar=no,width=400,height=350,status=no,scrollbars=no,resize=no,menubars=no"); }
</script>

<?

if ($credits_option AND !session_is_registered("admin"))
{
$result = mysql_query ("select credits from $usr_tbl where email = '".$_SESSION["valid_user"]."'");
$row_c = mysql_fetch_array($result);
$credits = $row_c["credits"];

if (!$credits)
{
$sql = "update $usr_tbl set credits = 0 where email = '".$_SESSION["valid_user"]."'";
$r = mysql_query($sql);
}

if ($credits < 1 and !$siteid)
{
print "<hr />$la_credits_warning";
$la_to_addcre = ereg_replace("\{PAYMENTPAGE\}", "<a href='payment_options.php'><b>paymentpage</b></a>", $la_to_addcre);
print "<p />$la_to_addcre.<hr />";
}
else
{
print "<br />$la_credits_remaining $credits";
print "<form method='post' action='item.php' id='itemForm' name='itemForm'>";
}
}
else
{
print "<form method='post' action='item.php' id='itemForm' name='itemForm'>";
}

if ($credits_option AND isset($_SESSION["admin"]))
{
print "You have visited the admin area, and I assume you are an administrator. No credits will be reduced.";
}

echo "<input type='hidden' name='siteid' value='$siteid'>";

if (!$siteid)
{
?>
<input type="hidden" name="catid" value="<? echo round($_REQUEST["catid"]) ?>" />
<input type="hidden" name="sitecatid" value="<? echo round($_REQUEST["catid"]) ?>" />
<?
}

$sitedescription = ereg_replace('\\\\','', $sitedescription);
$sitetitle = ereg_replace('\\\\','', $sitetitle);


?>

<table border="0" cellpadding="1" cellspacing="1" width="100%">
<tr><td>
<table border="0" cellpadding="1" cellspacing="1" width="100%">


<tr>
<td width="50%" valign="top"><? echo $title ?> <font color=red>*</font></td>
<td width="50%" valign="top">
<input type="text" name="sitetitle" size="39" maxlength="150" class="txt" value="<?php echo $sitetitle ?>">
</td>
</tr>




<tr>
<td width="50%" valign="top"><? echo $description ?> <font color=red>*</font></td>
<td width="50%" valign="top"><textarea rows="7" name="sitedescription" cols="45"><?php echo $sitedescription ?></textarea>



</td>
</tr>

<?
if ($siteid)
{
?>

<tr>
<td width="50%" valign="top"><? echo $la_change ?> ?</td>
<td width="50%" valign="top">
<?
$sql = "select catid,catfullname from $cat_tbl where allowads='on' order by catfullname";
$res = mysql_query($sql);

print "<select name='sitecatid'>";
while ($catr=mysql_fetch_array($res))
{
$catid_sel = $catr["catid"];
$catfullname = $catr["catfullname"];

print "<option value='$catid_sel'";
if ($sitecatid == $catid_sel)
{
print " selected";
}
print ">$catfullname</option>";
}
print "</select>";
?>
</td>
</tr>
<?
}
?>


<?

if ($expire_days_option)
{
print("<tr>");
print("<td width=\"50%\" valign=\"top\">$la_rundays <font color=red>*</font></td>");
print("<td width=\"50%\" valign=\"top\"><select name=\"expire_days\">");

// Split up from settings, in order to let us have name on expire dates.
$array = split(",",$set_expire_optionvalues);
$numb = count($array);

$counter = 0;
while ($numb > $counter)
{

list ($v1,$v2) = split(":", $array[$counter]);

print "<option value='$v1'";
if ($v1 == $expire_days)
{
print " selected='selected'";
}
print ">$v2</option>";


$counter++;

}
print("</select>");
print("</td>");
print("</tr>");
}

$result_1 = mysql_query ("select cattpl from $cat_tbl where catid = '$catid'");
$row_cat = mysql_fetch_array($result_1);
$cattpl_cat = $row_cat["cattpl"];

$string = "select * from $q_tbl where q_tpl = '$cattpl_cat' OR q_tpl = 1 order by q_seq";
$result = mysql_query ($string);
$fieldid = 0;
while ($tpl=mysql_fetch_array($result))
{
$q_field = $tpl["q_field"];
$q_question = $tpl["q_question"];
$q_size = $tpl["q_size"];
$q_size_2 = $tpl["q_size_2"];
$q_type = $tpl["q_type"];
$q_catdescr = $tpl["q_catdescr"];
$q_seq = $tpl["q_seq"];
$q_page = $tpl["q_page"];
$q_mand = $tpl["q_mand"];
$q_tpl = $tpl["q_tpl"];
$q_between = $tpl["q_between"];
$q_between = "";
$q_include_search = $tpl["q_include_search"];

$fieldname = "e_" . $q_field;

echo "<tr><td>$q_question";
if ($q_mand)
echo " <font color=red>*</font>";
echo "</td><td>";

$val = "";

if (isset($_POST["$fieldname"]))
$val = $_POST["$fieldname"];
elseif (isset($row2["$fieldname"]))
{
$val = $row2["$fieldname"];
if ($q_type<>"t" AND $q_type<>"d")
$val = split(",",$val);


}

getItem($q_type,"e_".$q_field,$q_field,$q_size,$q_size_2,$q_mand,$val,$q_between);

echo "</td></tr>";
}


?>
<tr><td></td>
</tr>

<tr>
<td>
</td>
<td>
<?
print("<input type='submit' name='submit' class='txt' value='$submit_button' />");

?>
</td>
</tr>
</table>

</td><td valign=top>

</td></tr></table>
<?
print("</form>");
}
?>
</td></tr></table>
<?
include_once("member_footer.php");
include_once("footer_inc.php");
?>
 
Nouveau WRInaute
Bonsoir,

Merci beaucoup

Par contre je recherche tjrs ou j'ai fait une erreur pour les deux tirets et pour les problemes d'accents.

Si quelqu'un trouve sa serait gentil

Merci encore
christine
 
WRInaute discret
bonjour,

merci pour vos conseils
J ai recopiez le htacess de thelliez, ainsi que le cat col, et le item
et ca donne pas tout a fait ca:
regardez sur mon site -http://www.annonces-de-vacances.com


l url rewriting fonctionne bien pour le nom des catagories, mais
pas sur les annonces.

8O


y a une erreur quelquepart?

merci
 
WRInaute discret
bon script mais le referencement?

salut
c'est vrai que ce sript a de nombreusses options en plus qu'il soit gratuit dans la version non commercial.
je l'ai installé y a de sa 2 semaines pour voir que qu'il valait et ma grande surprise j'ai pu voir qu'il gérait le multlingue au niveau de la navigation.

Une template en standard plutot bien faite bien que pour la recentrer,la modifier , c'est pas mal de fichier a triturer.

cherchant toujours a mettre en place des scripts ou cms performants j'ai aussi regardé comme vous tous les possibilitées de mettre le rewriting sur ce script,
j'ai regardé le forum de ce script et malheureusement j'ai pas trouvé une solution complète de rewrite des catégories mais aussi des articles et encore moins la génération a la volée des meta description ,title, et metatags, ce qui me semble un minimum car la mise en page des annonces sont pareils avec des titres identiques et je suppose que au niveau référencement avec google sa vas tomber dans pages similaires.

les offres de scripts d'annonces performants et gratuit comme celui sont rares donc avis a ceux qui pourait faire avancer le dada coté rewriting + meta ;title ;description,tags sa serait top pour d'entre nous.

je repart en croisade chercher de mon coté , et si solution je trouve , c'est ici que je posterai.
 
Nouveau WRInaute
Bonsoir,

En faite c'est vrai j'ai tellement touché au fichiers pour trouvé une solution que j'ai peut etre oublier quelque chose à signalé.

Par contre si cela peut interressé je peux zippé le script, enfin mais fichiers et vous les donner :)

Cordialement
christine
 
WRInaute discret
je suis preneur

salut thelliez
j'ai fais un tour sur ton site , que je trouve tres sympatique,
le rewriting marche pour les catégories et aussi les annonces c'est deja plus parlant.

toutefois il reste des points a paufiner comme la suppression des virgules dans l'url des catégories , faire passer le numero de l'annonce en fin d'url , et la génération a la volée des meta title ,desctiption,tags.

je précise que je ne critique en aucun cas ton travail ,c'est pas mon genre de cracher sur les autres :wink: , je recherche juste une solution complete pour l'optimisation de ce script.

un truc a part , es tu contente d'oxado?
 
Nouveau WRInaute
Bonjour

je vois bien que vous avez reussie a le mettre en place, j'aimerai bien avoir votre copie si ca vous derange pas :)

Mais y a un probleme au niveau de votre site et ce n'est pas bien pour les moteurs de recherche surtout google

Voir l'example 1

http://www.mon-annonce-gratuite.com/det ... -vous.html

La source de la page :

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Mon annonce gratuite :: D&eacute;tails de l'annonce </title >

Vous devez avoir un titre different pour la page

<title>GAGNER BEAUCOUP D’ARGENT EN TRAVAILLANT DE CHEZ VOUS!</title>

et pour la description aussi
<meta name="description" content="Mon annonce gratuite est un portail totaleme

Example 2 :

http://www.petite-annonce-gratuite.com/ ... e-860.html

La source

<title>Petite-Annonce-Gratuite.com : Détails de l'annonce</title>
<meta name="description" content="Votre petite annonce gratuite avec photos ! De nombreuses catégories d'annonces différentes.">
<meta name="keywords" content="petite annonce, annonce gratuite, annonce photo, passer une petite annonce">

La Solution :

Vous devez changer un peu le code :

Je vais essayer de le mettre en place, si quelqu'un peut le faire ca sera cool, car je suis pas vraiment doué

Pour moi j'utilise PHP Classifieds 6.20 Released 10.12.2005


Merci
 
WRInaute discret
J'ai travaillé sur le sujet

Bonsoir
J'ai réussi à changer mes rubriques avec le rewriting mais pas les annonces,
cela m'échappe.

Rubriquée rewritée
http://www.graphic3000.com/annonces-nor ... ation.html

annonce non rewritée - ne prend pas
http://www.graphic3000.com/annonces-nor ... 1&catid=21

Pas évident quelqu'un pourrait m'éclairer ?


le code que j'ai fait :

php_flag register_globals off
Options FollowSymLinks
RewriteEngine on
RewriteRule ^petites-annonces-([0-9]+)-([0-9]*)-(.*).html$ /annonces-normandie/index.php?catid=$1&set_add_ad_cat=$2 [L,QSA]
RewriteRule ^details-petites-annonces-([0-9]+)-(.*).html$ /annonces-normandie/detail.php?siteid=$1 [L,QSA]
 
Nouveau WRInaute
Les solutions sont apportées dan le forum de support de phpclassifield

avec un site map généré pour les url rewrittées et celles non rewrittées

et aussi le title dynamique

je vais les installer et vous tenir informés
 
Nouveau WRInaute
Bonsoir,

J'ai posté des commentaires sur le forum
http://www.deltascripts.com/board/viewtopic.php?id=7153
Afin de pouvoir mettre l'url rewriting. Et je vous ai mis plus haut le fichier complet modifié, car j'ai tellement galerer que je ne sais plus qu'elle fichier j'avais modifié pour tous faire.

Mais normalement : htacces, catcol, items, details et links.

Voila j'espere que cela aidera tous le monde.

christine
 
Nouveau WRInaute
1 D'abord, je ne vois pas l'intérêt de réécrire les url de phpclassifeild

en effet, il faut revenir aux regles de base de l'intéret,c'est de réécrire des pages avec de longues séries de get $1.$2.$3.$4

or, ici, deux types de pages sot interessantes :
_ les catégories
_ les annonces

Il suffit d'un bon sitemap pour tout indexer tout cela.
En effet, il y a que 2 get pour les annonces et catégories
or, juste un seul est utilisé
le second sert au début pourle choix des langues

enfin, les solutions ne sont pasdans les discussions, amsi dans les Hacks and addons:

donc, dynamic meta title :
http://www.deltascripts.com/board/viewtopic.php?id=5942

generating rewritten and non rewritten url sitemap :
http://www.deltascripts.com/board/viewtopic.php?id=5977
 
WRInaute discret
Bonjour à tous,

J'ai crée un forum pour l'aide au script PHP Classifieds mais en français.

Si vous voulez participer à la communauté francophonne de ce logiciel qui mérite que l'on s'y attarde car c'est un bon script vous pouvez aller sur :

http://www.ziglou.com/forum

N'hésité pas à y laisser vos commentaires et tutos ou autre astuces tout expérience est bonne à prendre.

A bientôt.
 
Discussions similaires
Haut