Posted by Kentor on 12/19/06 12:53
Hello, I'm in the following situation.. and i was wondering if anybody
had any idea on how to solve this problem:
I run a website for people to search/post apartments and vacation
rentals... I'm hoping to make my website worldwide as soon as possible
but adding new areas requires a really long time and making changes to
any of these areas is a real pain as well... I guess I chose the wrong
way to do it when I started and I really need to come to a solution if
I want things to go faster... The thing is, I have a bunch of switches
all over the website in a few files... about 15 files in total... so
everytime I add a new area, i need to modify 15 files... I would have
created one file and then just included it in all of those but the
switches are all different...
here are a few examples:
1.
<input type=\"checkbox\" name=\"1\" /> Abitibi-Temiscamingue<br />
<input type=\"checkbox\" name=\"2\" /> Bas-Saint-Laurent<br />
<input type=\"checkbox\" name=\"3\" /> Eastern Townships<br />
<input type=\"checkbox\" name=\"4\" /> Centre du Quebec<br />
<input type=\"checkbox\" name=\"5\" /> Charlevoix<br />
2.
case 1: $locationOut = "Abitibi-Temiscamingue"; break;
case 2: $locationOut = "Bas-Saint-Laurent"; break;
case 3: $locationOut = "Eastern Townships"; break;
case 4: $locationOut = "Centre du Quebec"; break;
case 5: $locationOut = "Charlevoix"; break;
3.
<option value=\"0\" $selectednhood0> Choose region</option>
<option value=\"1\" $selectednhood1> Abitibi-Temiscamingue</option>
<option value=\"2\" $selectednhood2> Bas-Saint-Laurent</option>
<option value=\"3\" $selectednhood3> Eastern Townships</option>
<option value=\"4\" $selectednhood4> Centre du Quebec</option>
<option value=\"5\" $selectednhood5> Charlevoix</option>
4.
<option value=\"0\""; if($editpostObjectExists) { $allnhoods .=
$editposObject -> getselectedHood(0); } $allnhoods.="> Choose
region</option>
<option value=\"1\""; if($editpostObjectExists) { $allnhoods .=
$editposObject -> getselectedHood(1); } $allnhoods.=">
Abitibi-Temiscamingue</option>
<option value=\"2\""; if($editpostObjectExists) { $allnhoods .=
$editposObject -> getselectedHood(2); } $allnhoods.=">
Bas-Saint-Laurent</option>
<option value=\"3\""; if($editpostObjectExists) { $allnhoods .=
$editposObject -> getselectedHood(3); } $allnhoods.="> Eastern
Townships</option>
<option value=\"4\""; if($editpostObjectExists) { $allnhoods .=
$editposObject -> getselectedHood(4); } $allnhoods.="> Centre du
Quebec</option>
5.
<option value=\"0\""; if($postObjectExists) { $allnhoods .=
$posObject -> getselectedHood(0); } $allnhoods.="> Choose
region</option>
<option value=\"1\""; if($postObjectExists) { $allnhoods .=
$posObject -> getselectedHood(1); } $allnhoods.=">
Abitibi-Temiscamingue</option>
<option value=\"2\""; if($postObjectExists) { $allnhoods .=
$posObject -> getselectedHood(2); } $allnhoods.=">
Bas-Saint-Laurent</option>
<option value=\"3\""; if($postObjectExists) { $allnhoods .=
$posObject -> getselectedHood(3); } $allnhoods.="> Eastern
Townships</option>
<option value=\"4\""; if($postObjectExists) { $allnhoods .=
$posObject -> getselectedHood(4); } $allnhoods.="> Centre du
Quebec</option>
<option value=\"5\""; if($postObjectExists) { $allnhoods .=
$posObject -> getselectedHood(5); } $allnhoods.="> Charlevoix</option>
and so on.... anybody got any idea how I could do this by using only
one list for all the files.... or something like that =/
[Back to original message]
|