Jump to content

Generated url dont work


take

Recommended Posts

i need some help here, on my web site http://www.classifiedslive.co.uk/index.php when click on city name on left side of site i get error page.Everything is worked fine til i copy whole page on my comp. and after i get back on ftp, till then this dont work.

Also i try to copy whole site in other dir http://www.classifiedslive.co.uk/class/  here i get error page and when i click on some category or subcategory (this is just copy of site in main dir) i dont know why is this happend.

Please help me if you know what evoke this error pages.

here some code from city.inc.php

 

<table width="100%" align="left">

  <tr><td valign="top">

<?php

 

// Show city list

 

if($location_sort)

{

$sort1 = "ORDER BY countryname";

$sort2 = "ORDER BY cityname";

}

else

{

$sort1 = "ORDER BY c.pos";

$sort2 = "ORDER BY ct.pos";

}

 

if ($show_region_adcount || $show_city_adcount)

{

// First get ads per city and country

$country_adcounts = array();

$city_adcounts = array();

$sql = "SELECT ct.cityid, c.countryid, COUNT(*) as adcnt

FROM $t_ads a

INNER JOIN $t_cities ct ON ct.cityid = a.cityid AND ($visibility_condn)

INNER JOIN $t_countries c ON ct.countryid = c.countryid

WHERE ct.enabled = '1' AND c.enabled = '1'

GROUP BY ct.cityid";

 

$res = mysql_query($sql) or die(mysql_error().$sql);

 

while($row=mysql_fetch_array($res))

{

$country_adcounts[$row['countryid']] += $row['adcnt'];

$city_adcounts[$row['cityid']] += $row['adcnt'];

}

}

 

$sql = "SELECT * FROM $t_countries c INNER JOIN $t_cities ct ON c.countryid = ct.countryid AND ct.enabled = '1' WHERE c.enabled = '1' GROUP BY c.countryid $sort1";

$resc = mysql_query($sql);

 

$country_count = mysql_num_rows($resc);

//$split_at = ($country_count%3?((int)($country_count/3))+2:($country_count/3)+1);

$percol = floor($country_count/$location_cols);

$percolA = array();

for($i=1;$i<=$location_cols;$i++) $percolA[$i]=$percol+($i<=$country_count%$location_cols?1:0);

 

$i = 0; $j = 0;

$col = 1;

while($country = mysql_fetch_array($resc))

{

if($sef_urls) $country_url = "{$vbasedir}-$country[countryid]_" . RemoveBadURLChars($country['countryname']) . "/";

else $country_url = "?cityid=-$country[countryid]&lang=$xlang";

 

?>

 

 

<div class="citylist_country1"><a href="<?php echo $country_url; ?>" ><?php echo $country['countryname']; ?> <?php if($show_region_adcount) echo "(".(0+$country_adcounts[$country['countryid']]).")"; ?></a><br></div>

 

 

<?php

 

if($country['countryid'] == $xcountryid || !$expand_current_region_only)

{

 

$sql = "SELECT * FROM $t_cities ct WHERE countryid = $country[countryid] AND enabled = '1' $sort2";

$resct = mysql_query($sql);

 

while($city=mysql_fetch_array($resct))

{

if($sef_urls) $city_url = "{$vbasedir}$city[cityid]_" . RemoveBadURLChars($city['cityname']) . "/";

else $city_url = "?cityid=$city[cityid]&lang=$xlang";

 

?>

 

<div class="citylist_country2"><a href="<?php echo $city_url; ?>" citylist_country1><?php echo $city['cityname']; ?> <?php if($show_city_adcount) echo "(".(0+$city_adcounts[$city['cityid']]).")"; ?></a><br></div>

 

<?php

 

}

}

 

?>

 

 

<?php

 

$i++; $j++;

//if($i%$split_at == 0) echo "</td><td valign=\"top\">";

if ($j%$percolA[$col]==0 && $i<$country_count) { echo "</td><td valign=\"top\">"; $col++; $j=0; }

 

}

 

?>

 

</td></tr>

</table>

 

and some code from index.php

 

<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">

<tr><td width="100% align="center">

<table width="978" border="0" cellspacing="0" cellpadding="0" align="center">

  <tr>

    <td colspan="3" bgcolor="white">

      <?php include("header.inc.php"); ?>    </td>

  </tr>

  <tr>

    <?php

if ($xview == "main" || $show_sidebar_always)

{

?>

    <td width="200px" id="sidebar_left" valign="top" align="center">

      <?php

if($xview != "post" && $xview != "postimg")

{

}?>

<div id="textwellorg"><?php include("subscribe.php"); ?></div>

<div style="clear:both;">

      <?php

if($xview != "post" && $xview != "postimg")

{

?>

<div class="citylist_country">

  <?php include("cities.inc.php"); ?>

  </div>

    </div>

<?php }?>

      <?php if($show_cats_in_sidebar && !($xview == "main" || $xpostmode)) { ?>

      <table class="sidebox" cellspacing="0" align="center">

        <tr>

          <th class="head"><?php echo $lang['CATEGORIES']; ?></th>

        </tr>

        <tr>

          <td><?php include("cats.inc.php"); ?></td>

        </tr>

      </table>

      <br>

      <?php }

if ($enable_calendar && !$xpostmode)

{

  ?>

      <br>

      <br>

      <?php

 

}

 

?>

      <?php

 

if ($enable_images && ($xview == "main" || $xsection == "imgs"))

 

{

 

$sql = "SELECT COUNT(*) as imgcnt

 

FROM $t_imgs a

 

INNER JOIN $t_cities ct ON a.cityid = ct.cityid

 

WHERE $visibility_condn AND ct.enabled = '1'

 

$loc_condn_img";

 

list($imgcnt) = @mysql_fetch_array(mysql_query($sql));

 

 

 

?>

Link to comment
Share on other sites

Hmm, I try to trun off my cookies but still get error page.Sory but i dont know what is most relevant in this code.I put whole page cities.inc.php and part of index.php where is include("cities.inc.php").

I dont understund way this scrypt (site) dont work whan i make copy in new dir on ftp like http://www.classifiedslive.co.uk/class/

but when is in http://www.classifiedslive.co.uk it works fine , but cities on left side still dont work.

 

When click on some city or region i get only page refrash, but it need to show ads from that city or region.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.