<? DEW-CODE.COM  

Downloads

Assorted scripts  (1)
DewNewPHPLinks  (9)





Lost Password?
No account yet? Register

Dew-Code Newsfeed

Resources


 USdigitalcable.com

Dew-Code
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Country List is not alphabetical (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Country List is not 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 Years, 9 Months 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 Years, 9 Months 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 (Admin)
Admin
Posts: 603
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:Country List is not alphabetical 3 Years, 9 Months ago Karma: 9  
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 Years, 9 Months 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 (Admin)
Admin
Posts: 603
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:Country List is no longer alphabetical 3 Years, 9 Months ago Karma: 9  
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.
#782
ezagent (User)
less IS more
Junior Boarder
Posts: 22
graphgraph
User Offline Click here to see the profile of this user
Gender: Male where wireless pops. dig it. Location: Boston, MA Birthdate: 1958-01-15
Re:Country List is no longer alphabetical 3 Years ago Karma: 0  
As of today 1/24/09 the country list is alphabetical but my default country is not selected, even though it's set in the administrator.

I modified functions.php around line 135 to set replace the function generated variable $html with this:

After this...
$d->close();

Insert this...
$html = '<option value="United_States.gif" selected="selected">United States</option>';
return $html;
 
Report to moderator   Logged Logged  
 
http://www.expressDeliveryVan.com
Craigslist deliveries and mini-moves
http://www.bostonWebCrew.com
Multi-function furniture and spacemaking
  The administrator has disabled public write access.
Go to top Post Reply
get the latest posts directly to your desktop
Outsource your projects to thousands of programmers at
ScriptLance.com
Newsflash
Interested in
advertising?

This space for rent!

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