Topic: categories in HTML

Hello,

I wanted to know how one fesait to put the categories in HTML as on this site

http://www.annonce-gratuite-europe.com

Because I seek in vain but I do not find how to make.  Afflicted for my English I am French.

My site : http://www.mon-annonce-gratuite.com/

Many thanks
christine

My files .htaccess
#php_flag register_globals off
RewriteEngine on
#RewriteRule ^~(.*)$ /profile.php?profile=$1 [L]
RewriteRule ^([a-zA-Z0-9]*).html detail.php?siteid=$1

Last edited by tocane (2006-01-31 16:01:55)

+ -

Re: categories in HTML

hello

I find a proc

+ -

Re: categories in HTML

Thanks Tocane!!

Do you have modified details.php also? Because I have some problems to get articles listed as HTML.

By

+ -

Re: categories in HTML

hello

My files detail.php

<?
session_start();
$counter = 0;
$wsize=100;
$hsize=100;
$cur_grade = 0;
$cur_user_grade = 0;
$cur_grade=0;
$pre = "";
include_once("admin/inc.php");
$catname = " :: $ad_details_text";
if (isset($_REQUEST["print"]))
    $print = 1;

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

if (isset($_REQUEST["pre"]))
    $pre = round($_REQUEST["pre"]);
   
   
if (!isset($print))
    include_once("header_inc.php");



if (!$special_mode)
{
    if (!isset($print))       
            include("navigation.php");
        else {
            print "<script language='javascript'>window.print()</script>";
            print "<p><a href='detail.php?siteid=$siteid'><h2>$la_p</h2></a></p>";
        }
}

// Print out linked title
writeLinkedTitle(getCategoryId($siteid));


if ($set_detail_login_need==1)
    check_valid_user("");



// If setting is not set, use these defaults...
if (!$set_outer_color) { $set_outer_color = "#A9B8D1";     }
if (!$set_inner_color) { $set_inner_color = "#FFFFFF";     }
if (!$set_descr_color) { $set_descr_color = "#FFFFFF";     }
if (!isset($set_descr_cell)) {    $set_descr_cell = 10;     }
if (isset($preview)) { $siteid = $preview; $validation = 0;     }

if ($validation == 1 AND empty($pre)) { $val_string = " AND valid = 1"; } else { $val_string = ""; }
$sql_links = "select * from $ads_tbl, $cat_tbl, $usr_tbl where catid=sitecatid AND ad_username = $usr_tbl.email AND siteid=$siteid $val_string";
$sql_result = q ($sql_links);
$num_links =  mysql_num_rows($sql_result);

for ($i=0; $i<$num_links; $i++)
{
       
                $row = mysql_fetch_array($sql_result);
                $row2 = $row;
        $siteid = $row["siteid"];
        $sitetitle = $row["sitetitle"];
        $sitedescription = $row["sitedescription"];
        $userid = $row["userid"];
        $sitedate = $row["sitedate"];
        $sitehits = $row["sitehits"];
        if (!$sitehits)
            $sitehits = 1;
        $sitevotes = $row["sitevotes"];
        $sitevoters = $row["sitevoters"];
        $votes = $row["votes"];
        $voters = $row["voters"];
        $name = $row["name"];
        $phone = $row["phone"];
        $email = $row["email"];
        $adressfield1 = $row["adressfield1"];
        $adressfield2 = $row["adressfield2"];
        $catname = $row["catname"];
        $catid = $row["catid"];
        $catid = $row["catid"];
        $vendor_url = $row["vendor_url"];
        $vendor_homepage = $row["vendor_homepage"];
        $usr_1 = $row["usr_1"];
        $usr_2 = $row["usr_2"];
        $usr_3 = $row["usr_3"];
        $usr_4 = $row["usr_4"];
        $usr_5 = $row["usr_5"];
                $sold = $row["sold"];
        $cattpl = $row["cattpl"];
        $datestamp = $row["datestamp"];
        $picture = $row["picture"];
        $is_vendor = $row["is_vendor"];
       
        $hide_email = $row["hide_email"];
        $img_stored = $row["img_stored"];
        $expire_days = $row["expire_days"];
        //$expire_ad = $row["expiredate"];
        $year=substr($row["datestamp"],0,4);
        $month=substr($row["datestamp"],4,2);
        $day=substr($row["datestamp"],6,2);
           if ($voters > 0)
                {
                    $sum = $votes/$voters;
                    $cur_user_grade = round($sum, 1);
                }
        $sitedescription = preg_replace( "/(?<!<a href=\")((http|ftp)+(s)?:\/\/[^<>\s]+)/i", "<a href=\"\\0\" target='new'>\\0</a>", $sitedescription );
       
       
        // Date_format grabbed from settings...
        $date_added_1 = $date_format;
        $date_added_1 = ereg_replace("d", "$day", $date_added_1);
        $date_added_1 = ereg_replace("m", "$month", $date_added_1);
        $date_added_1 = ereg_replace("y", "$year", $date_added_1);
        $sitedate1 = $date_added_1;
       

           
        // If vote enabled, use this
        if ($sitevoters and $sitevotes)
        {
           
            $cur_grade = round($sitevotes / $sitevoters, 1);
        }
       
               
        if ($expire_days_option)
        {
            //find ($year, $month, $day, $expire_days);
             $num_days = getNumDaysRemain($row["datestamp"],$expire_days); # If user-supplied expire date
             $delete_ad = getExpireDate($row["datestamp"],$expire_days); # If system expire date                       
        }
        else
        {
            //find ($year, $month, $day, $delete_after_x_days);
            $num_days = getNumDaysRemain($row["datestamp"],$delete_after_x_days); # If system expire date
            $delete_ad = getExpireDate($row["datestamp"],$delete_after_x_days); # If system expire date
        }
       
        if ($num_days<0 AND $auto)
        {
            updateExpireAds("");   
        }
       
?>
<!-- 1 -->

<table border="0" width="100%" bgcolor="<? echo $set_outer_color ?>" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%" height="1"><img border="0" src="layout_images/spacerbig.gif" width="1" height="1" /></td>
  </tr>
</table>       
<!-- // 1 -->       
<script language="JavaScript">
<?
if (!empty($magic_xlarge_size))
{
    $split = split("x",$magic_xlarge_size);
    $size_1 = $split[1]+70;
    $size_2 = $split[0]+70;
}

if (empty($size_1) OR empty($size_2))
{
    $size_1 = 300;
    $size_2 = 300;
}
?>

function openWin(URL) { aWindow=window.open(URL,_new,"toolbar=no,width=<? echo $wsize ?>,height=<? echo $hsize ?>,status=no,scrollbars=no,resize=no,menubars=no",true);
aWindow.resizeTo(<? echo $wsize ?>, <? echo $hsize ?>)
}
function openWin2(URL) {
aWindow=window.open(URL,"Large","toolbar=no,width=400,height=350,status=no,scrollbars=no,resize=no,menubars=no");
}
</script>



<!-- 1 -->
<table border="0" width="100%" cellspacing="0" cellpadding="10">
  <tr>
    <td>
       
   
   
   
    <!-- 2 -->
    <table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td>


        <span class="title"><? echo $sitetitle ?></span>
       
       
        <br /><br />
       
       
        <?
        // Code for prev next result

        if ($sold == 1)
        {
            print "<p> <b>$la_sold</b> </p>";
        }
       
        if ($vendor_url AND $set_vendor AND $is_vendor)
        {
            print "<a href='$vendor_homepage' target='new'><img src='$vendor_url' border='0'></a>";   
        }
       
        print "<center>";
       
       
        $sql_prevsiteid = "select siteid from $ads_tbl, $cat_tbl, $usr_tbl where catid=sitecatid AND ad_username = $usr_tbl.email AND siteid < $siteid AND catid = $catid $val_string order by siteid desc limit 1";
        $result_prevsiteid = q($sql_prevsiteid);
        $row_prev = mysql_fetch_array($result_prevsiteid);
        $prevsiteid = $row_prev["siteid"];

        $sql_nextsiteid = "select siteid from $ads_tbl, $cat_tbl, $usr_tbl where catid=sitecatid AND ad_username = $usr_tbl.email AND siteid > $siteid AND catid = $catid $val_string order by siteid asc limit 1";
        $result_nextsiteid = q($sql_nextsiteid);
        $row_next = mysql_fetch_array($result_nextsiteid);
        $nextsiteid = $row_next["siteid"];

       
        if ($prevsiteid)
        {
            print "<a href='detail.php?siteid=$prevsiteid&catid=$catid'><img src='layout_images/arrow-back.gif' border='0' /> $la_p</a>";   
        }
       
        print "&nbsp;&nbsp;&nbsp;";
       
        if ($nextsiteid)       
        {
            print "<a href='detail.php?siteid=$nextsiteid&catid=$catid'>$la_n <img src='layout_images/arrow-forw.gif' border='0' /></a>";
        }
        print "</center>";
       
        // End of Code for prev next result
        ?>
       
       
        <p />
        <!-- 3 -->
        <table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td width="100%">
       
            <!-- 4 -->
            <table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td width="100%" valign="top" align="left">
       
                <!-- 5 -->
                <table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td valign="top" align="left">

                   
<?



if ($nl2br == 1)
{
$sitedescription = nl2br($sitedescription);
}

?>


<?
if (isset($_REQUEST["contact"]))
{
    include "contact.php";
}
if (isset($_REQUEST["tellafriend"]))
{
    include "tellafriend.php";
}

?><p>

<!-- 6 -->
<table border="0" bgcolor="<? echo $set_outer_color ?>" cellspacing="0" cellpadding="1" width="100%"><tr><td>

    <!-- 7 -->
    <table border="0" bgcolor="<? echo $set_descr_color ?>" cellspacing="0" cellpadding="<? echo $set_descr_cell ?>" width="100%"><tr><td valign="top" align="left">
      <b><? print(" $description ");?></b><br /><? print(" $sitedescription "); ?>
      </td></tr>
      </table>
      <!-- // 7 -->
     
      </td></tr>
</table>
<!-- // 6 -->
 
       
    <!-- 6 -->   
    <table border="0" cellpadding="1" cellspacing="1" width="90%">
      <tr><td>
        <br />
    </td>
   
    <td></td>
      </tr>
        <tr>
                <td colspan="2"><b> <? echo $general_details ?></b> </td>
        </tr>

  <tr>
    <td> <? echo $sold_by_text?></td>
    <td> <? echo $name ?>
   
    <?
    if ($set_vote_on_member)
        {
            if ($set_ratemem_login_need)
            {
                if (isset($_SESSION["valid_user"]))
                {
                    echo " ($votes/# $voters) <small> <a href='javascript:openWin2(\"rate_user.php?id=$siteid\")'><u>$la_grade $name</u></a> </small>";        
                }   
            }
            else
            {
                echo " ($votes/# $voters) <small> <a href='javascript:openWin2(\"rate_user.php?id=$siteid\")'><u>$la_grade $name</u></a> </small>";
            }
           
          }
          ?>   
       
        </td>
  </tr>
  <tr>
    <td> <? echo $add_user_email ?></td>
    <td>
<?

if ($email)
{
        if ($hide_email == 1)
        {
                print "<a href=\"detail.php?siteid=$siteid&contact=1\">$la_contact_sale</a>";
        }
        else
        {
                print "<a href='mailto:$email'>$email</a>";
        }
}
else
{
                print $la_call;
}



?>

</td>
  </tr>
<?
if ($adressfield1 OR $adressfield2)
{
    print("<tr>");
    print("<td> $location_text</td>");
    print("<td> $adressfield1, $adressfield2</td>");
    print("</tr>");
}

if ($phone)
{
    print("<tr>");
    print("<td> $add_user_phone</td>");
    print("<td> $phone</td>");
    print("</tr>");
}
if (isset($usr_1_text) AND isset($usr_1))
{
    print("<tr>");
    print("<td> $usr_1_text</td>");
    if ($usr_1_link)
    {
        $usr_1=eregi_replace("http://","",$usr_1);
        echo "<td>";
        if (!empty($usr_1))
            print "<a href='http://$usr_1' target='_blank'>$la_link</a>";
        echo "</td>";
    }
    else {
    print("<td> $usr_1</td>");
    }
    print("</tr>");
}

if (isset($usr_2_text) AND isset($usr_2))
{
     print("<tr>");
    print("<td> $usr_2_text</td>");
    if ($usr_2_link)
    {
        $usr_2=eregi_replace("http://","",$usr_2);
        echo "<td>";
        if (!empty($usr_2))
            print "<a href='http://$usr_2' target='_blank'>$la_link</a>";
        echo "</td>";
    }
    else {
    print("<td> $usr_2</td>");
    }
    print("</tr>");
}

if (isset($usr_3_text) AND isset($usr_3))
{
   print("<tr>");
    print("<td> $usr_3_text</td>");
    if ($usr_3_link)
    {
        $usr_3=eregi_replace("http://","",$usr_3);
        echo "<td>";
        if (!empty($usr_3))
            print "<a href='http://$usr_3' target='_blank'>$la_link</a>";
        echo "</td>";
    }
    else {
    print("<td> $usr_3</td>");
    }
    print("</tr>");
}

if (isset($usr_4_text) AND isset($usr_4))
{
    print("<tr>");
    print("<td> $usr_4_text</td>");
    if ($usr_4_link)
    {
        $usr_4=eregi_replace("http://","",$usr_4);
        echo "<td>";
        if (!empty($usr_4))
            print "<a href='http://$usr_4' target='_blank'>$la_link</a>";
        echo "</td>";
    }
    else {
    print("<td> $usr_4</td>");
    }
    print("</tr>");
}

if (isset($usr_5_text) AND isset($usr_5))
{
   print("<tr>");
    print("<td> $usr_5_text</td>");
    if ($usr_5_link)
    {
        $usr_5=eregi_replace("http://","",$usr_5);
        echo "<td>";
        if (!empty($usr_5))
            print "<a href='http://$usr_5' target='_blank'>$la_link</a>";
        echo "</td>";
    }
    else {
    print("<td> $usr_5</td>");
    }
    print("</tr>");
}

$sql = "select cattpl from $cat_tbl where catid = ".getCategoryId($siteid);
$result_1 = q($sql);
$row_cat = mysql_fetch_array($result_1);
$cattpl = $row_cat["cattpl"];
$string = "select * from $q_tbl where q_tpl = '$cattpl' 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_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_isurl = $tpl["q_isurl"];
    $q_between = $tpl["q_between"];
    $q_include_search = $tpl["q_include_search"];
   
    $fieldname = "e_" . $q_field;
   
    if ($q_catdescr)
        echo "<tr><td colspan='2'><br><b>$q_catdescr</b></td></tr>";
   
   
    echo "<tr><td>$q_question";
    echo "</td><td>";
   
    $val = "";
    $array = array();
    if (isset($row["$fieldname"]))
    {
        $val = $row["$fieldname"];
       
        if ($q_type<>"t" AND $q_type<>"d")
        {
            $array = split(",",$val);
            echo showItems($q_type,"e_".$q_field,$q_field,$q_size,$q_mand,$array,$q_isurl);       
        }
        else
        {
            echo showItems($q_type,"e_".$q_field,$q_field,$q_size,$q_mand,"$val",$q_isurl);       
        }
       
    }
    echo "</td></tr>";
}


?>

<tr>
    <td><br />
    </td>
    <td></td>
  </tr>

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

  <tr>
    <td colspan="2"><b> <? echo $ad_details_text ?> </b> </td>

  </tr>
  <tr>
    <td> <? echo $la_adid ?></td>
    <td> <? echo $siteid ?></td>
  </tr>
  <tr>
    <td> <? echo $ad_views ?>&nbsp;</td>
    <td> <? echo $sitehits ?></td>
  </tr>
  <?
  if ($advanced_delete_activated)
  {
  ?>

  <tr>
    <td> <? echo $ad_expire ?></td>
    <td>
     <?
     print "<b>$delete_ad </b> ($la_in $num_days $days)";
     ?>
     </td>
  </tr>

  <?
  }
  ?>
  <tr>
    <td> <? echo $date_added ?></td>
    <td> <? echo $sitedate1  ?></td>
  </tr>
  <? if ($cur_grade) {?>
   <tr>
    <td> <? echo $la_curr_grade ?></td>
    <td> <? echo $cur_grade ?> (# <? echo $sitevoters ?>)</td>
  </tr>
  <? } ?>
 
<tr><td colspan="2">&nbsp;<p />
<?
if ($set_favourites AND isset($_SESSION["valid_user"]))
{
    $sql = "select fid from $fav_tbl where f_adid=$siteid AND femail = '".$_SESSION["valid_user"]."'";
    $r = mysql_query($sql);
    $number = mysql_num_rows($r);
   
    if ($number)
    {
        print "<a href=\"javascript:openWin2('fav_popup.php?remove_fav=$siteid')\"><img src='layout_images/garb.gif' border='0' align='left'>&nbsp;<b>$la_remove_fav</b></a>";
    }
    else
    {
        print "<a href=\"javascript:openWin2('fav_popup.php?add_fav=$siteid')\"><img src='layout_images/bookmark.gif' border='0' align='left'>&nbsp;<b>$la_add_fav</b></a>";
    }
}
?>   
</td></tr> 
</table> 
<!-- // 6 -->






</td><td width="20"><img src="layout_images/spacerbig.gif" width="10" height="5" alt="" /></td>
</tr>
</table>
<!-- // 5 -->


</td><td valign="top" align="right">


<?

$query = "select id,imageh,imagew,filename from $pic_tbl where pictures_siteid=$siteid";
$sql_result = mysql_query ($query);
$num_pictures =  mysql_num_rows($sql_result);
   
for ($i=0; $i<$num_pictures; $i++)
{

?>
<!-- 5 -->
<table cellspacing="0" cellpadding="1" bgcolor="<? echo $set_outer_color ?>" border="0" width="100%"><tr><td>

<!-- 6 -->
<table border="0" width="100%" bgcolor="<? echo $set_inner_color ?>" cellspacing="0" cellpadding="5"><tr><td width="100%" align="center"> 


<?


if (!isset($_REQUEST["show_still"]) AND $set_slideShow AND $num_pictures>1)
{
    print "<a href='detail.php?siteid=$siteid&show_still=1'><b>$la_show_still</b></a><p />";
    include "pg_include.php";
}
if (isset($_REQUEST["show_still"]) OR !$set_slideShow OR (!isset($_REQUEST["show_still"]) AND $set_slideShow AND $num_pictures<2))
{
   
    if ($set_slideShow AND $num_pictures>1)
        print "<a href='detail.php?siteid=$siteid'><b>$la_show_show</b></a><p />";
   
    $row = mysql_fetch_array($sql_result); 

    $w = $row["imagew"];
    $h = $row["imageh"];
    $id = $row["id"];
    $filename_stored = $row["filename"];
    $imgSizeArray = setImageSize($maxSize_large,$w,$h);
    $imagehw = GetImageSize("images/$filename_stored");
    $w =  $imagehw[0]+30;
      $h = $imagehw[1]+90;
           
    if (!empty($set_gd) OR !empty($magic))
    {
        print "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"100%\" align=\"center\">";
        echo "<a href=\"large_picture.php?id=$id\" onclick=\"popWin = open('large_picture.php?id=$id','my','width=$w,height=$h');popWin.focus();popWin.resizeTo($w, $h);return false\">";
        echo getOneImage($siteid,"$la_large_pic",$maxSize_large,$id)."<img border=\"0\" src=\"layout_images/zoom.gif\" width=\"19\" height=\"24\" alt='' /></a></td></tr></table>";
    }
    else
    {
               
        print "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"100%\" align=\"center\">";
        echo "<a href=\"large_picture.php?id=$id\" onclick=\"popWin = open('large_picture.php?id=$id','my','width=$w,height=$h');popWin.focus();popWin.resizeTo($w, $h);return false\">";
        echo getOneImage($siteid,"$la_large_pic",$maxSize,$id)."<img border=\"0\" src=\"layout_images/zoom.gif\" width=\"19\" height=\"24\" alt='' /></a></td></tr></table>";
    }
   
   
   
   
   
}
?>
</td></tr>
</table>
<!-- // 6 -->


</td></tr></table>
<!-- // 5 -->

<table border="0" width="100%" height="10" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%"></td>
  </tr>
</table>

<?

}


?>






</td></tr></table>
<!-- // 4 -->


</td></tr><tr><td width="100%">
</td></tr>
</table>
<!-- // 3 -->




    </td>
  </tr>
</table>
<!-- // 2 -->

    </td>
  </tr>
</table>
<!-- // 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>

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

<?

print("<table border='0' cellspacing='0' cellpadding='0'><tr><td><a href='index.php?catid=$catid'><img border='0' src='layout_images/icon_moreadsincat.gif' width='28' height='20'></a></td><td><a href='index.php?catid=$catid'>$la_similar</a>");
print("</td><td width='15'></td><td><a href='useritems.php?user_siteid=$siteid'><img border='0' src='layout_images/icon_adsfromseller.gif' width='28' height='20'></a></td><td><a href='useritems.php?user_siteid=$siteid'>$la_similar_ads</a>");
print("</td><td width='15'></td><td><a href=\"detail.php?siteid=$siteid&contact=1\"><img border='0' src='layout_images/icon_contactsalesperson.gif' width='28' height='20'></a></td><td><a href=\"detail.php?siteid=$siteid&contact=1\">$la_contact_sale</a>");
print("</td><td width='15'></td><td><a href=\"detail.php?siteid=$siteid&tellafriend=1\"><img border='0' src='layout_images/icon_tellafriend.gif' width='28' height='20'></a></td><td><a href=\"detail.php?siteid=$siteid&tellafriend=1\">$la_tell_a_friend</a>");
if ($set_rate)
{
    print("</td><td width='15'></td><td><a href=\"javascript:openWin2('rate.php?id=$siteid&adtitle=$sitetitle')\"><img border='0' src='layout_images/icon_tellafriend.gif' width='28' height='20'></a></td><td><a href=\"javascript:openWin2('rate.php?id=$siteid')\">$la_rate</a>");
}
?>
</td><td width="15"></td><td><a href="detail.php?siteid=<? echo $siteid ?>&print=1"><img border="0" src="layout_images/icon_print.gif" width="28" height="20"></a></td><td><a href="detail.php?siteid=<? echo $siteid ?>&print=1"><? echo $la_print ?></a>
</td></tr></table>


<?
}

if ($num_links == 0)
{
    include_once("header_inc.php");
    include_once("admin/inc.php");
    include_once("navigation.php");
       
    print "<p><img border='0' src='images/blank.gif' height='20' align='left'>";
    print "<b>$la_ad_removed_caption</b><br>";
    echo formatString($la_ad_removed_content,array("http://$url"));
    print "</p></td></tr></table>";
    include_once("footer_inc.php");
    exit;
}


$tell=$sitehits+1;
$s = "UPDATE $ads_tbl set sitehits=$tell,datestamp='$datestamp' where siteid=$siteid";
$result1=q($s);

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


<?
if (!isset($print))
    include_once("footer_inc.php");
else
    echo formatString("<center>$la_print_clean</center>", array(formatDate(date("Ymd")),date("H:m"),"http://$url/detail.php?siteid=$siteid"));

   
   
?>

+ -

Re: categories in HTML

Dear Christine, could you list your links.php file?

Thanks in advance, Hugo

+ -

Re: categories in HTML

My files links.php

<?
$val_string = "";
$color = "";
$count_ads = 0;
$ascdesc = "desc";
$way = "";
$catid = 0;
$do_search = 0;
$order = "";
if (!isset($allowads))
    $allowads = "";
if (!isset($par_list))
    $par_list = "";

if (!isset($useritems))
    $useritems = "";

if (isset($validation))  {
    if ($validation != "")   
        $val_string = " AND valid = 1";       
}

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

if (isset($_REQUEST["do_search"])) {
    $do_search = $_REQUEST["do_search"];
}


// User Option: What field to order the result after. Example:    siteid.
if (isset($_REQUEST["order"])) {
  if (trim($order) <> "password_enc")     
        $order = htmlspecialchars($_REQUEST["order"]);
}

// User Option: Oldest result first or last ?. Example:    1 (descending), 2 (ascending).
if (isset($_REQUEST["way"])) {
        $way = round($_REQUEST["way"]);
}

// How we arrange the hits, convert 0 til actual sql for security purposes.
if (isset($way))
{
    if ($way==1)    {
        $ascdesc = "asc";
    }
    elseif ($way==0) {
        $ascdesc = "desc";
    }
    else {
        $ascdesc = "desc";
    }
}
else
{
    $ascdesc = "desc";
}

if (!isset($order) AND !isset($mostviewed)) {
        $order = "siteid";
}

if (isset($_REQUEST["offset"])) {
    $offset = round($_REQUEST["offset"]);
} else { $offset = 0; }


$til = $number_of_ads_per_page;   


// Find out what page and what to do about it

if (($catid==0) AND isset($fp))
{
    // Frontpage
    if (isset($set_latest_override))
    {
        // Custom setting from webmaster
        if ($set_frontpage_override>0)
        {
            $til = $set_frontpage_override;   
           
            // To correct the prev/next counter, this correction must also be made
            $number_of_ads_per_page = $set_frontpage_override;
        }
    }
    if (!$order) {
        $order = "siteid";
    }
    $sql_string = "select * from $ads_tbl, $cat_tbl where catid=sitecatid $val_string order by $order $ascdesc limit $offset, $til";
   
    // Template to use for this page
    $tpl = "latestfp_links";
   
}
else if ($catid>0)
{
    // Category View of Ads
    if (isset($set_general_override))
    {
        // Custom setting from webmaster
        if ($set_general_override>0)
        {
            $til = $set_general_override;   
           
            // To correct the prev/next counter, this correction must also be made
            $number_of_ads_per_page = $set_general_override;
        }
    }
    if (!$order) {
        $order = "siteid";
    }
    $sql_string = "select * from $ads_tbl, $cat_tbl where catid=sitecatid AND catid=".round($_REQUEST["catid"])."$val_string order by $order $ascdesc limit $offset, $til";
   
    // Template for use for this page
    $tpl = "links";
}
else if (isset($mostviewed))
{
    // Most Viewed Page
    if (isset($set_mostviewed_override))
    {
        // Custom setting from webmaster
        if ($set_mostviewed_override>0)
        {
            $til = $set_mostviewed_override;   
           
            // To correct the prev/next counter, this correction must also be made
            $number_of_ads_per_page = $set_mostviewed_override;
        }
    }
    if (!$order)
    {
        $order = "sitehits";   
    }
    $sql_string = "select * from $ads_tbl, $cat_tbl where catid=sitecatid $val_string order by $order $ascdesc limit $offset, $til";
   
    // Template to use for this page
    $tpl = "mostviewed_links";
   
}
else if (isset($latestmode))
{
    // Latest Ads Page
    if (isset($set_latest_override))
    {
        // Custom setting from webmaster
        if ($set_latest_override>0)
        {
            $til = $set_latest_override;   
           
            // To correct the prev/next counter, this correction must also be made
            $number_of_ads_per_page = $set_latest_override;
        }
    }
    if (!$order)
    {
        $order = "siteid";   
    }
    $sql_string = "select * from $ads_tbl, $cat_tbl where catid=sitecatid $val_string order by $order $ascdesc limit $offset, $til";
   
    // Template to use for this page
    $tpl = "latest_links";
}
else if (isset($best_rated))
{
    // Best Rated Ads Page
    if (isset($set_bestrated_override))
    {
        // Custom setting from webmaster
        if ($set_bestrated_override>0)
        {
            $til = $set_bestrated_override;   
           
            // To correct the prev/next counter, this correction must also be made
            $number_of_ads_per_page = $set_bestrated_override;
        }
    }
    if (!$order)
    {
        $order = "sitescore";   
    }
    $sql_string = "select * from $ads_tbl, $cat_tbl where catid=sitecatid $val_string order by $order $ascdesc limit $offset, $til";
   
    // Template to use for this page
    $tpl = "bestrated_links";
   
}
else if (isset($fav))
{
    // Members Favorite Ads (member area)
   
    if (isset($set_fav_override))
    {
        // Custom setting from webmaster
        if ($set_fav_override>0)
        {
            $til = $set_fav_override;   
           
            // To correct the prev/next counter, this correction must also be made
            $number_of_ads_per_page = $set_fav_override;
        }
    }
    if (!$order)
    {
        $order = "siteid";   
    }
    $sql_string = "select * from $ads_tbl, $cat_tbl, $fav_tbl where catid=sitecatid AND $fav_tbl.f_adid=$ads_tbl.siteid $val_string AND femail='".$_SESSION["valid_user"]. "' order by $order $ascdesc limit $offset, $til";
    // Template to use for this page
    $tpl = "fav_links";
   
   
}
else if (isset($my_items))
{
    // Members Favorite Ads (member area)
   
    if (isset($set_myitems_override))
    {
        // Custom setting from webmaster
        if ($set_myitems_override>0)
        {
            $til = $set_myitems_override;   
           
            // To correct the prev/next counter, this correction must also be made
            $number_of_ads_per_page = $set_myitems_override;
        }
    }
    if (!$order)
    {
        $order = "siteid";   
    }
    $sql_string = "select * from $cat_tbl, $ads_tbl, $usr_tbl where catid=sitecatid  AND ad_username = email AND email = '".$_SESSION["valid_user"]. "' order by $order $ascdesc limit $offset, $til";
    // Template to use for this page
    $tpl = "my_items_links";
   
   
}
else if (isset($useritems) AND !$do_search)
{
    // Members Favorite Ads (member area)
    if (isset($set_myitems_override))
    {
        // Custom setting from webmaster
        if ($set_myitems_override>0)
        {
            $til = $set_myitems_override;   
           
            // To correct the prev/next counter, this correction must also be made
            $number_of_ads_per_page = $set_myitems_override;
        }
    }
    if (!$order)
    {
        $order = "siteid";   
    }
    $sql_string = "select * from $cat_tbl, $ads_tbl, $usr_tbl where catid=sitecatid  AND ad_username = email AND email = '$ad_username' order by $order $ascdesc limit $offset, $til";
    // Template to use for this page
    $tpl = "useritems_links";
   
   
}
else if ($do_search)
{
   
    $extra = "";
    // Search in ads   
    if (isset($_REQUEST["searchword"]))
    {
        $searchword = $_REQUEST["searchword"];
    }
    else
    {
        $searchword = "";
    }
   
    // Members Favorite Ads (member area)
   
    if (isset($set_myitems_override))
    {
        // Custom setting from webmaster
        if ($set_myitems_override>0)
        {
            $til = $set_myitems_override;   
           
            // To correct the prev/next counter, this correction must also be made
            $number_of_ads_per_page = $set_myitems_override;
        }
    }
    if (!$order)
    {
        $order = "siteid";   
    }
    $sql_string = "select * from $cat_tbl, $ads_tbl, $usr_tbl where catid=sitecatid  $val_string AND ad_username = email ";
    $sql_string = $sql_string . "AND (name like '%$searchword%' or sitetitle like '%$searchword%' or catname like '%$searchword%' or sitedescription like '%$searchword%') ";
   
   
if (isset($_REQUEST["catid_search"]))
{
    if (round($_REQUEST["catid_search"])>0)
    {
         $extra = $extra . "catid =". round($_REQUEST["catid_search"]);
         $sql = "SELECT C1.catid FROM $cat_tbl as C1, $cat_tbl as C2 where C2.catid = ".round($_REQUEST["catid_search"]) ." AND C1.lft > C2.lft AND C1.rgt < C2.rgt";
         $result = mysql_query( $sql );
        
        while( $row = mysql_fetch_array( $result ) )
        {
            $extra = $extra . " OR catid = " . $row['catid'] . " ";
        }
        $sql_string = $sql_string . "AND ($extra) ";
       
    }
}
else
{
    $catid = '%%';
    $sql_string = $sql_string . "AND (    catid like '$catid') ";
}

    $data = "";
        $element = "";
        $str = "";
        $par_list = "";
       
        foreach ($HTTP_GET_VARS as $key => $value)
        {
            if (ereg("e_", $key) AND $key<>"expire_days")
            {
                if (is_array($value))
                {
                    $data = $data . " (";
                    foreach ($value as $element)
                    {
                       
                        if ($element<>"")
                        {
                            $element=eregi_replace("\\\$","",$element);
                            $element=ereg_replace("\|","",$element);
                            $element=ereg_replace("<","",$element);
                            // If posted variables in fact is filled in, make parlist
                            $data = $data . "$key like '%$element%' OR ";
                            $par_list = $par_list . "&" . "$key%5B%5D=$element";
                           
                        }   
                       
                    }
                    $str = substr($str,0,-1);
                    $data = substr($data,0,-4);
                    $data = $data . " ) AND ";
                   
                    if ($str>0)
                    {
                        //$data = $data . "$key = '$str' AND ";
                        //$par_list = $par_list . "&" . "$key%5B%5D=$str";
                       
                    }
                    else
                    {
                        //$data = $data . "$key like '%$str%' AND ";
                        //$par_list = $par_list . "&" . "$key=$str";
                    }
                }
                else
                {
                    //$value=avoidSqlBreakDown($value);
                    $value=eregi_replace("\\\$","",$value);
                    $aValue=ereg_replace("\|","",$aValue);
                    $aValue=ereg_replace("<","",$aValue);
                   
                    $value=strip_tags($value);
                   
                   
                    if ($value<>"")
                    {

                        if (ereg("from", $key))
                        {
                            $value=avoidSqlBreakDown($value);
                            $key_from = ereg_replace("_from","",$key);
                            $data = $data . " $key_from >= '" . avoidSqlBreakDown($value) . "' AND ";
                            $par_list = $par_list . "&" . "$key=$value";
                        }
                        elseif (ereg("to", $key))
                        {
                            $value=avoidSqlBreakDown($value);
                            $key_to = ereg_replace("_to","",$key);
                            $data = $data . "$key_to <= '" . avoidSqlBreakDown($value) . "' AND ";
                            $par_list = $par_list . "&" . "$key=$value";
                        }   
                        elseif ($value>0)
                        {
                            $value=avoidSqlBreakDown($value);
                            $data = $data . "$key = '$value' AND ";
                            $par_list = $par_list . "&" . "$key=$value";
                        }
                        else
                        {
                            $data = $data . "$key like '%$value%' AND ";
                            $par_list = $par_list . "&" . "$key=$value";
                        }
               
                    }
                }
            }
        }
        //echo $par_list;
       
        if ($data)
        {
            $data = "and " . $data;
            $data = substr($data,0,-4);
        }

// End of extra fields search
   
    $sql_string = $sql_string . " $data order by $order $ascdesc limit $offset, $til";
    // Template to use for this page
    $tpl = "search_links";   
   
}

// Do the queries...
//echo $sql_string;
$sql_resultads = q($sql_string);
$num_ads =  mysql_num_rows($sql_resultads);


//echo "<p>STRING: $sql_string ($num_ads) ($catid) ($allowads)</p>";

$show_results = "";

// If is frontpage and latest mode is activated, do show link bar
if (!empty($fp) AND empty($latest))
    $not_show_result_nav = 1;
   
   
if (empty($not_show_result_nav))
{
    $show_results = 1;   
}

if ($num_ads==0 AND $catid>0 AND $row["allowads"]=="on")
{
   
    if (isset($_SESSION["valid_user"])) {
        $cid = round($_REQUEST["catid"]);   
       
        echo formatString("$la_no_ads_member",array("$cid"));
    }
    else {
        echo $la_no_ads;
    }
}
elseif ($num_ads==0)
{
   
}
elseif ($show_results)
{
    $adv = "";
    $tall = 0;
    $s_userid = "";
    $searchword = "";
    //$catid = "";
    $sp = "";
    $user_siteid = "";
    if (isset($_REQUEST["s_userid"])) {
            $s_userid = round($_REQUEST["s_userid"]);
    }
   
    if (isset($_REQUEST["searchword"])) {
            $searchword = htmlspecialchars($_REQUEST["searchword"]);
            $sp = $sp . "&searchword=$searchword";
           
    }
   
    if (isset($_REQUEST["catid_search"])) {
            $catid = round(($_REQUEST["catid_search"]));
            $sp = $sp . "&catid_search=$catid";
    }

    if (isset($_REQUEST["user_siteid"]))
    {
            $user_siteid = round(($_REQUEST["user_siteid"]));
            $sp = $sp . "&user_siteid=$user_siteid";
    }
    if (isset($_REQUEST["do_search"]))
        $sp = $sp . "&do_search=1";
    if ($par_list)
        $sp = $sp . "&par_list=$par_list";

    if (!empty($_REQUEST["do_search"]))
                $catid = 0;
       
    $common_url = "?catid=$catid$sp";

    $fArray["CATEGORYNAME"] = $category;
    $fArray["TOTAL_ADS"] = $num_ads;
    $fArray["CATID"] = $catid;
    $fArray["CATEGORY_URL"] = "<a href='$common_url&order=catname&way=1'>";
    $fArray["CATFATHERID"] = $row["catfatherid"];
    $fArray["/CATEGORY_URL"] = "</a>";
    $fArray["AD_URL"] = "<a href='$common_url&order=sitetitle&way=1'>";
    $fArray["/AD_URL"] = "</a>";
    $fArray["ADTITLE"] = $title;
    $fArray["DATE_URL"] = "<a href='$common_url&order=datestamp'>";
    $fArray["/DATE_URL"] = "</a>";
    $fArray["DATEADDED"] = "$date_added";
    $fArray["YESNOPICTURE"] = "$picture_text";
    $fArray["PICTURE_URL"] = "<a href='$common_url&order=picture&way=0'>";
    $fArray["/PICTURE_URL"] = "</a>";
    $fArray["ADVIEWS_URL"] = "<a href='$common_url&order=sitehits&way=0'>";
    $fArray["/ADVIEWS_URL"] = "</a>";
    $fArray["GRADE_URL"] = "<a href='$common_url&order=sitescore&way=0'>";
    $fArray["/GRADE_URL"] = "</a>";
    $fArray["VIEWED"] = "# $ad_views";
    $fArray["GRADE"] = "$la_grade";
    $fArray["REMOVE"] = "$la_remove_fav";
   
   
    if (isset($my_items)) {
                $fArray["ACTION"] = $la_change;   
    }
   
   
        writeTemplate($tpl . "_headrow",$fArray);
   
}


if ($show_results)
{

for ($i=0; $i<$num_ads; $i++)
{
      $row = mysql_fetch_array($sql_resultads);
      $siteid = $row["siteid"];
      $sitetitle = $row["sitetitle"];
      $sitedescription = $row["sitedescription"];
      //$siteurl = $row["siteurl"];
      $sitedate = $row["sitedate"];
      $sitehits = $row["sitehits"];
      if (!$sitehits)
          $sitehits = 0;
      $sitevotes = $row["sitevotes"];
      if (!$sitevotes)
          $sitevotes = 0;
      $sitescore = $row["sitescore"];
      if (!$sitescore)
          $sitescore = 0.0;
      $sitevoters = $row["sitevoters"];
      if (!$sitevoters)
          $sitevoters = 0;
      $catname = $row["catname"];
      $datestamp = $row["datestamp"];
      $year=substr($row["datestamp"],0,4);
      $month=substr($row["datestamp"],4,2);
      $day=substr($row["datestamp"],6,2);
          
     
      // Date format from settings
     
      $date_added_1 = $date_format;
      $date_added_1 = ereg_replace("d", "$day", $date_added_1);
      $date_added_1 = ereg_replace("m", "$month", $date_added_1);
      $date_added_1 = ereg_replace("y", "$year", $date_added_1);
      $regdate = $date_added_1;
     
     
          $data = "";
        $element = "";
        $str = "";
      
        $sql = "select cattpl from $cat_tbl where catid = '".$catid . "'";
        $result_1 = q($sql);
        $row_cat = mysql_fetch_array($result_1);
        $cattpl = $row_cat["cattpl"];           
       
        $string = "select * from $q_tbl where q_tpl = '$cattpl' OR q_tpl = 1 order by q_seq";
        $result = mysql_query ($string);
        $fieldid = 0; 
        while ($extra_fields=mysql_fetch_array($result))
        {
            $q_field = $extra_fields["q_field"];
            $q_question = $extra_fields["q_question"];
            $q_size = $extra_fields["q_size"];
            $q_type = $extra_fields["q_type"];
            $q_catdescr = $extra_fields["q_catdescr"];
            $q_seq = $extra_fields["q_seq"];
            $q_page = $extra_fields["q_page"];
            $q_mand = $extra_fields["q_mand"];
            $q_tpl = $extra_fields["q_tpl"];
            $q_isurl = $extra_fields["q_isurl"];
            $q_between = $extra_fields["q_between"];
            $q_include_search = $extra_fields["q_include_search"];
           
            $fieldname = "e_" . $q_field;
            
            $val = "";
            $array = array();
           
            if (isset($row["$fieldname"]))
            {
                $val = $row["$fieldname"];
                if ($q_type<>"t" AND $q_type<>"d")
                {
                    $array = split(",",$val);
                    $t = showItems($q_type,"e_".$q_field,$q_field,$q_size,$q_mand,$array,$q_isurl);       
                    $fArray["$fieldname"] = $t;
                   
                }
                else
                {
                    $t = showItems($q_type,"e_".$q_field,$q_field,$q_size,$q_mand,"$val",$q_isurl);       
                    $fArray["$fieldname"] = $t;
                   
                }
               
            }

        }

     
      $is_special = $row["is_special"];
      $picture = $row["picture"];
      $sold = $row["sold"];
      $notify = $row["notify"];
      $img_stored = $row["img_stored"];
      $sitedescription = substr($sitedescription, 0, 100);

           
            if (!$set_list1_color) {
                $set_list1_color = "#FFFFFF";   
            }
            if (!$set_list2_color) {
                $set_list2_color = "#ECF0F6";   
            }
            if ($color == $set_list1_color) {
                $color = $set_list2_color;
            } else {
                $color = $set_list1_color;
            }
            $count_ads++;
           
           
            $ann_titre = strtolower($sitetitle);
            $ann_titre = preg_replace("/([^a-z0-9]+)/", "-", $ann_titre);
            $ann_titre = trim($ann_titre, "-");
                       
            echo "\n";
            $fArray["CATEGORYNAME"] = $catname;

  $catname = urlencode($catname);

            //$fArray["AD_URL"] = "<a href=\"detail.php?siteid=$siteid\"><img src=\"layout_images/pointer.gif\" border=\"0\" alt='' />";
            $fArray["AD_URL"] = "<a href=\"details-annonce-".$siteid."-".$ann_titre.".html\"><img src=\"layout_images/pointer.gif\" border=\"0\" alt='' />";
            $fArray["/AD_URL"] = "</a>";
            if ($is_special) { $fArray["TITLE"] = "<b>$sitetitle</b>"; } else { $fArray["TITLE"] = $sitetitle; }
            $fArray["DATE_URL"] = "<a href=\"?catid=$catid&order=siteid&searchword=$searchword\">";
            $fArray["/DATE_URL"] = "</a>";
            $fArray["DATEADDED"] = $date_added;
            $fArray["VIEWED"] = $sitehits;
            $fArray["COLOR"] = $color;
            $fArray["REGDATE"] = $regdate;
            $fArray["GRADE"] = round($sitescore,1);
            $fArray["NUM_VOTERS"] = $sitevoters;                       
            if ($list_img AND empty($list_img_fp))
            {
                // Use real images where possible!
                //$fArray["IMAGEYESNO"] = "<a href='detail.php?siteid=$siteid'>" . getOneImage($siteid,"$sitedescription",$max_links,"") . "</a>";
                $fArray["IMAGEYESNO"] = "<a href=\"details-annonce-".$siteid."-".ann_titre.".html\">" . getOneImage($siteid,"$sitedescription",$max_links,"") . "</a>";
            }
            else
            {
                // Use default V and X icons for indication of ads
                if ($picture>0) {
                    $fArray["IMAGEYESNO"] = "<img src='layout_images/yesimage.gif' valign=\"left\" border='0 'alt='$sitedescription' />";
                }
                else     {
                    $fArray["IMAGEYESNO"] = "<img src='layout_images/noimage.gif' valign=\"left\" border='0 'alt='$sitedescription' />";
                }
            }
            $fArray["REMOVE"] = "<img src='layout_images/trash.gif' border='0' height='22' alt='$la_remove_fav' align='left'>";
            $fArray["REMOVE_URL"] = "<a href='fav.php?remove=$siteid'>";
            $fArray["/REMOVE_URL"] = "</a>";
           
            if (isset($my_items)) {
               
               

                if ($sold <> 1)                 {
                    $sold_url = "<a href='my_items.php?soldid=$siteid'>";
                    $sold_info = $la_sold;
                }    elseif ($sold == 1)    {
                    $sold_url = "<a href='my_items.php?unsoldid=$siteid'>";                   
                    $sold_info = $la_unsold;
                }
               
                               
                $fArray["ACTION"] = $la_action;   
                $fArray["LA_MODAD"] = $la_ad;   
                $fArray["MODAD_URL"] = "<a href='item.php?siteid=$siteid&amp;update_rq=1&catid_edit=$catid'>";   
                $fArray["/MODAD_URL"] = "</a>";   
                $fArray["LA_MODIMG"] = $la_images;   
                $fArray["MODIMG_URL"] = "<a href='upload_file.php?pictures_siteid=$siteid'>";   
                $fArray["/MODIMG_URL"] = "</a>";   
                $fArray["LA_SOLD"] = $sold_info;   
                $fArray["SOLD_URL"] = $sold_url;   
                $fArray["/SOLD_URL"] = "</a>";   
                $fArray["LA_DEL"] = $la_del;   
                $fArray["DEL_URL"] = " <a href='my_items.php?deleteid=$siteid'>";   
                $fArray["/DEL_URL"] = "</a>";   
                $fArray["CUSTOM"] = "</a>";   
                if ($sold)
                    $fArray["SOLD"] = "$la_sold";   
                else
                    $fArray["SOLD"] = "";   
               
                if ($notify)
                {
                    $fArray["LA_NOTIFY"] = $la_renew;   
                    $fArray["NOTIFY_URL"] = " | <a href='my_items.php?renew=$siteid'>";   
                    $fArray["/NOTIFY_URL"] = "</a>";   
                }
                else
                {
                    $fArray["LA_NOTIFY"] = "";   
                    $fArray["NOTIFY_URL"] = "";   
                    $fArray["/NOTIFY_URL"] = "";   
                }
               
               
            }
            writeTemplate($tpl . "_links",$fArray);
   
    }
   
} // num ads > 0 end
print "</table><br />";

if ($show_results AND $num_ads>0)
{
    print"<center>";
   
    $string = split("order",$sql_string);
    $sql_all = $string[0];
   
    $sql_total = mysql_query ($sql_all);
    $num_total =  mysql_num_rows($sql_total);
    //echo "<p>ALL: $sql_all ($num_total)</p>";
    if (!isset($par_list))
        $par_list = "";
    $csearch = "";   
    if (isset($_REQUEST["catid_search"]))
        $csearch = "&catid_search=" . round($_REQUEST["catid_search"]);
       
    if (isset($searchword))
        $searchword = htmlspecialchars($searchword,ENT_QUOTES);
    else
        $searchword = "";
    $link_bar = "?";
    if (!isset($_REQUEST["catid_search"]))
        $link_bar = $link_bar . "catid=$catid";
   
    $link_bar = $link_bar . "&order=$order&way=$way&do_search=$do_search&searchword=$searchword$par_list$csearch&user_siteid=$useritems";
   
    if ($offset>0)
    {
            $offset_tmp = $offset;
            $offset = $offset - $number_of_ads_per_page;
            print("<a href='$link_bar&offset=$offset'><b><img src='layout_images/arrow-back.gif' border='0' /> <u>$previous_ads $number_of_ads_per_page</u></b></a>&nbsp;");
            $offset = $offset_tmp;
    }
    else
    {
            print("<font color='gray'><b><img src='layout_images/arrow-back.gif' /> $previous_ads $number_of_ads_per_page</b></font>&nbsp;");   
    }
   
    if ($num_total > ($offset+$number_of_ads_per_page))
    {
           
            $offset = $offset + $number_of_ads_per_page;
            print("<a href='$link_bar&offset=$offset'><b><u>$next_ads $number_of_ads_per_page</u> <img src='layout_images/arrow-forw.gif' border='0' /></b></a>&nbsp;");
           
    }
    else
    {
                print("<font color='gray'><b>$next_ads $number_of_ads_per_page <img src='layout_images/arrow-forw.gif' /></b></font>&nbsp;");
    }
    print "</center>";
}
?>







<script>
function urlencode(ch) {
   ch = ch.replace(/[ ]/g,"+")
   return escape(ch)
}

chaine = urlencode(chaine)
</script>

+ -

Re: categories in HTML

Thank you very much, Christine.

It was very useful.

Hugo

+ -

Re: categories in HTML

I modified the files you said and .htacces , but when i click on an category i recibe the following error:

http://www.hostpic.biz/uploads/8a65497576.jpg

+ -

Re: categories in HTML

how can i know if it is active?

http://img124.imageshack.us/img124/2532/dibujo8su.jpg

maybe that

+ -

Re: categories in HTML

salvitor wrote:

Thank you very much, Christine.

It was very useful.

Hugo

But Christine, your detail.php and item.php don't have any modification.


http://www.annonce-gratuite-europe.com is fantastic, all urls are rewrited. Which will be the secret?.


roll

+ -

Re: categories in HTML

Hello,
In made, I sought so much, that I knew more than they files I had touched.  But good I think that with all what I gave that must function.

Christine

+ -

Re: categories in HTML

Your code only works with the mother categories.  With the subcategories and details it don't work to me.

+ -

Re: categories in HTML

Christine can you fix this???

In this picture is workin good, but if you look your site, the links are in php.

http://img384.imageshack.us/img384/6622/dibujo0or.th.jpg

Thanks.

Last edited by Revan (2006-02-22 22:04:56)

+ -

Re: categories in HTML

Hello,

My files zip

http://www.mon-annonce-gratuite.com/CLASSIFIED.zip

christine

+ -

Re: categories in HTML

Dear christine, how you any idea how can i solve a problem whit this characters

Last edited by Revan (2006-02-24 09:10:55)

+ -

Re: categories in HTML

Hello,

- I am same the problems for the accents and special. 
- And also, to have a title different for each advertisement. 

If somebody finds the solution, that will be really nice to make us divide it.

Many thanks
christine

+ -

Re: categories in HTML

Christine, please see this topic about titles:
http://www.deltascripts.com/board/viewtopic.php?id=5942

It was useful for me.

Bye

+ -

Re: categories in HTML

I had a problem, using this mod, some adds show in blank , any idea?

+ -

Re: categories in HTML

I detected the problem, if an add starts whit a number if happends.

+ -

Re: categories in HTML

Hello I board tested the scipt of Tocane but that does not function, veiled the result http://www.guide-nord-pas-calais.com/ma … de_calais/ Quelqu'un has you it been successful has the intaller without having problems? or somebody has to you it a cleaner code. Thank you

Re: categories in HTML

Hello Thus as I do not manage to find a version rewrite free and as any work deserves wages, I propose two functioning bonds PR5 for a version correctly or why not buy this version. Afflicted for my approximate English but I is useful itself of Google translate. Thank you

Re: categories in HTML

Hello world

If you need it works for category in catcol.php:

[code]$car_speciaux = array( '

+ -

Posts [ 22 ]

Pages 1

You must login or register to post a reply