Find programmers and grapic design experts at ScriptLance.com
<? DEW-CODE.COM  
Dew-Code
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Country List is no longer alphabetical (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Country List is no longer alphabetical
#144
ajmboy (User)
Fresh Boarder
Posts: 10
graphgraph
User Offline Click here to see the profile of this user
Country List is no longer alphabetical 3 Months, 2 Weeks ago Karma: 0  
I noticed that on my ADD page, the country list is no longer in alphabetical order. What would cause this? Where can I edit the country list? Can I have United States as the default?

I'm running Dew-NewPHPLinks v.2.0.1.0b SEF
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#152
ajmboy (User)
Fresh Boarder
Posts: 10
graphgraph
User Offline Click here to see the profile of this user
Re:Country List is no longer alphabetical 3 Months, 2 Weeks ago Karma: 0  
I figured out that the country list is dependent on the .gif images. They are not in alphabetical order on teh drop down (ADD Page), what controls that, or what can I check?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#154
Dewed (User)
Administrator
Posts: 164
graph
User Offline Click here to see the profile of this user
Dew-Code.com
Re:Country List is not alphabetical 3 Months, 2 Weeks ago Karma: 6  
I knew I had the answer to this in my notes, but while looking for it, I found notes regarding another common bug you likely haven't noticed yet. The default country which is set in Configuration, is not selected when adding new site.

To fix that ... Edit include/add_site.php

Locate and removed this line ...
Code:

if(!isset($Country)){ $Country = $default_country;}
Locate
Code:

echo getFlagList("../images/flags", $Country);
and replace with this
Code:

echo getFlagList("../images/flags", $spec['DefaultCountry']);
With that fixed... getting the countries alphabetized ... Locate and replace the entire getFlagList function in /include/functions.php roughly lines # 76 to 102 ...
Code:

function getFlagList($dirName, $Country){ $d = dir($dirName); while($entry = $d->read()){ ... ... .. ... $d->close(); return $html; }
Replace with this ...
Code:

function getFlagList($dirName, $Country){ $d = dir($dirName); while($entry = $d->read()){ if($entry != "." && $entry != ".." && $entry != "CVS"){ $short_entry = eregi_replace(".gif", "", $entry); $short_entry = eregi_replace("_", " ", $short_entry); $arrCountry[$short_entry] = $entry; } } asort($arrCountry); foreach ($arrCountry As $short_entry => $entry) { $html .= "<option value=\"" . $entry . "\""; if($Country == $entry){ $html .= " selected=\"selected\""; } $html .= ">" . $short_entry . "</option>\n"; } $d->close(); return $html; } }
And that should both issues
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/05/13 20:09 By Dewed.
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
#155
ajmboy (User)
Fresh Boarder
Posts: 10
graphgraph
User Offline Click here to see the profile of this user
Re:Country List is not alphabetical 3 Months, 2 Weeks ago Karma: 0  
Code:

function getFlagList($dirName, $Country){ $d = dir($dirName); while($entry = $d->read()){ if($entry != "." && $entry != ".." && $entry != "CVS"){ $short_entry = eregi_replace(".gif", "", $entry); $short_entry = eregi_replace("_", " ", $short_entry);$arrCountry[$short_entry] = $entry; } asort($arrCountry); foreach ($arrCountry as $short_entry => $entry) { $html .= "<option value=\"" . $entry . "\""; if($Country == $entry){ $html .= " selected=\"selected\""; } $html .= ">" . $short_entry . "</option>\n"; } } $d->close(); return $html; }
This is what I have in my functions.php Showing duplicate entries in the list...???
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#156
Dewed (User)
Administrator
Posts: 164
graph
User Offline Click here to see the profile of this user
Dew-Code.com
Re:Country List is no longer alphabetical 3 Months, 2 Weeks ago Karma: 6  
Right.. erase or comment out that function and replace it with the one in my previous post...
 
Report to moderator   Logged Logged  
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Newsflash

Sign up for PayPal and start accepting credit card payments instantly.
Copyright Dew-Code 2008