KDawg08 Posted January 15, 2010 Share Posted January 15, 2010 So i got tired of manually editting the name of each city in travel.php AFTER changing the cities in settings.php through admin setup. Here are some very easy instructions to fix it so it will automatically update when you change the names of cities in settings. First: Open travel.php Second: Search for the following; <td width="100" align="left"><input name="Location" type="radio" value="1" id="location_1" <?php echo $travel_disabled_1; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_1">[b]London.[/b]</label></td> <td width="50" align="left"><?php echo "$". number_format($price[0]).",-"; ?></td> <td width="100" align="left"><input name="Location" type="radio" value="4" id="location_4" <?php echo $travel_disabled_4; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_4">[b]Paris.[/b]</label></td> <td width="50" align="left"><?php echo "$". number_format($price[3]).",-"; ?></td> <td width="100" align="left"><input name="Location" type="radio" value="7" id="location_7" <?php echo $travel_disabled_7; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_7">[b]Madrid.[/b]</label></td> <td width="50" align="left"><?php echo "$". number_format($price[6]).",-"; ?></td> </tr> <tr> <td width="100" align="left"><input name="Location" type="radio" value="2" id="location_2" <?php echo $travel_disabled_2; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_2">[b]Rome.[/b]</label></td> <td width="50" align="left"><?php echo "$". number_format($price[1]).",-"; ?></td> <td width="100" align="left"><input name="Location" type="radio" value="5" id="location_5" <?php echo $travel_disabled_5; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_5">[b]Chicago.[/b]</label></td> <td width="50" align="left"><?php echo "$". number_format($price[4]).",-"; ?></td> <td width="100" align="left" b><input name="Location" type="radio" value="8" id="location_8" <?php echo $travel_disabled_8; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_8">[b]Hong Kong.[/b]</label></td> <td width="50" align="left" b><?php echo "$". number_format($price[7]).",-"; ?></td> </tr> <tr> <td width="100" align="left"><input name="Location" type="radio" value="3" id="location_3" <?php echo $travel_disabled_3; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_3">[b]Tokyo.[/b]</label></td> <td width="50" align="left"><?php echo "$".number_format($price[2]).",-"; ?></td> <td width="100" align="left"><input name="Location" type="radio" value="6" id="location_6" <?php echo $travel_disabled_6; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_6">[b]Sydney.[/b]</label></td> <td width="50" align="left"><?php echo "$". number_format($price[5]).",-"; ?></td> <td width="100" align="left"><input name="Location" type="radio" value="9" id="location_9" <?php echo $travel_disabled_9; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_9">[b]Moscow.[/b]</label></td> <td width="50" align="left"><?php echo "$". number_format($price[8]).",-"; ?></td> And HIGHLIGHT it all. Third: Copy and paste the following (REPLACE ABOVE TEXT WITH THIS); <td width="100" align="left"><input name="Location" type="radio" value="1" id="location_1" <?php echo $travel_disabled_1; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_1">[b]<?php echo $location_array[1]; ?>[/b]</label></td> <td width="50" align="left"><?php echo "$". number_format($price[0]).",-"; ?></td> <td width="100" align="left"><input name="Location" type="radio" value="4" id="location_4" <?php echo $travel_disabled_4; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_4">[b]<?php echo $location_array[4]; ?>[/b]</label></td> <td width="50" align="left"><?php echo "$". number_format($price[3]).",-"; ?></td> <td width="100" align="left"><input name="Location" type="radio" value="7" id="location_7" <?php echo $travel_disabled_7; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_7">[b]<?php echo $location_array[7]; ?>[/b]</label></td> <td width="50" align="left"><?php echo "$". number_format($price[6]).",-"; ?></td> </tr> <tr> <td width="100" align="left"><input name="Location" type="radio" value="2" id="location_2" <?php echo $travel_disabled_2; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_2">[b]<?php echo $location_array[2]; ?>[/b]</label></td> <td width="50" align="left"><?php echo "$". number_format($price[1]).",-"; ?></td> <td width="100" align="left"><input name="Location" type="radio" value="5" id="location_5" <?php echo $travel_disabled_5; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_5">[b]<?php echo $location_array[5]; ?>[/b]</label></td> <td width="50" align="left"><?php echo "$". number_format($price[4]).",-"; ?></td> <td width="100" align="left" b><input name="Location" type="radio" value="8" id="location_8" <?php echo $travel_disabled_8; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_8">[b]<?php echo $location_array[8]; ?>[/b]</label></td> <td width="50" align="left" b><?php echo "$". number_format($price[7]).",-"; ?></td> </tr> <tr> <td width="100" align="left"><input name="Location" type="radio" value="3" id="location_3" <?php echo $travel_disabled_3; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_3">[b]<?php echo $location_array[3]; ?>[/b]</label></td> <td width="50" align="left"><?php echo "$".number_format($price[2]).",-"; ?></td> <td width="100" align="left"><input name="Location" type="radio" value="6" id="location_6" <?php echo $travel_disabled_6; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_6">[b]<?php echo $location_array[6]; ?>[/b]</label></td> <td width="50" align="left"><?php echo "$". number_format($price[5]).",-"; ?></td> <td width="100" align="left"><input name="Location" type="radio" value="9" id="location_9" <?php echo $travel_disabled_9; ?> onFocus="if(this.blur)this.blur()"/> <label for="location_9">[b]<?php echo $location_array[9]; ?>[/b]</label></td> <td width="50" align="left"><?php echo "$". number_format($price[8]).",-"; ?></td> To explain what I did more thoroughly, I'm a terrible noob with php and I've not had the time to learn alot with having a newborn etc. Here goes... I found the name of each city in travel.php for example "Hong Kong." and replaced it with <?php echo $location_array[8]; ?> The reason it says [8] is because 8 is the 8th location, AKA Hong Kong. But with this, anytime you update your cities in settings section as an admin, it will update the city name in the travel page. Makes for ease of use, and less of a hassle for you and your members. =] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.