change the sort order of dropdown list 'countries'

Once you've installed phpList... ask questions here!
Forum rules
Please help the volunteers to help you by supplying the version of phpList you are using, browser & version and if possible, a link to your phpList installation.

change the sort order of dropdown list 'countries'

Postby kokaneeranger » 9:12pm, Mon 27 Jan, 2014

One of my user attributes is "Country" and I use values from Table: phplist_listattr_countries. The problem is I need to add more countries, however when the user updates their info, the select dropdown displays them according to their ID and I would like it to be alphabetical. I can't seem to find the code. I apologize if this has been covered elsewhere, but I couldn't find it. Any help would be great.
kokaneeranger
phpLister
 
Posts: 7
Joined: 6:19pm, Wed 20 Nov, 2013

Re: change the sort order of dropdown list 'countries'

Postby duncanc » 12:17pm, Tue 28 Jan, 2014

There is a function that lets you re-order the list of values but that has a limit of 100 on the number of values.

You can change that by editing file admin/editattributes.php line 182.
Change the two occurrences of 100 to 300, which will allow the country list to be re-ordered
while ($row = Sql_Fetch_array($rs)) {
printf( '<div class="row-value"><span class="delete"><a href="javascript:deleteRec(\'%s\');">'.$GLOBALS['I18N']->get('delete').'</a></span>',PageURL2("editattributes","","id=$id&amp;delete=".$row["id"]));
if ($num < 100)
printf(' <input type="text" name="listorder[%d]" value="%s" size="5" class="listorder" />',$row["id"],$row["listorder"]);
printf(' %s %s </div>', $row["name"],($row["name"] == $data["default_value"]) ? '('.$GLOBALS['I18N']->get('default').')':"");
}
if ($num && $num < 100)
printf('<br /><input class="submit" type="submit" name="action" value="%s" />',$GLOBALS["I18N"]->get("Change order"));
duncanc
Moderator
 
Posts: 2440
Joined: 6:34am, Sat 08 May, 2010
Location: London

Re: change the sort order of dropdown list 'countries'

Postby kokaneeranger » 10:18pm, Tue 28 Jan, 2014

Thank you!
kokaneeranger
phpLister
 
Posts: 7
Joined: 6:19pm, Wed 20 Nov, 2013

Re: change the sort order of dropdown list 'countries'

Postby kokaneeranger » 10:27pm, Tue 28 Jan, 2014

Actually, that works for my State/Province attribute, but not the country. I only have 241 countries.
kokaneeranger
phpLister
 
Posts: 7
Joined: 6:19pm, Wed 20 Nov, 2013


Return to Questions and Problems after Installing

Who is online

Users browsing this forum: No registered users and 6 guests