PDA

View Full Version : Amending country list


karim
5th of April 2004 (Mon), 10:06
Hi all, Hi Pekka.

Is there a way to insert new entries to the country list without having to manually shuffle their entry number?

k.

Pekka
5th of April 2004 (Mon), 17:45
I'm not sure I understand the question. If there is a country missing let me know by all means and I'll add it to EE updates.

Can you give me an example what you are trying to achieve?

karim
5th of April 2004 (Mon), 19:19
Hi Pekka,

What I meant was each county seems to have an sql id assigned to it.(I think it's in the install.php file). I was wondering if it was possible to add new countries without messing up the already assigned sql id...

There are at least 2 "countries" missing: Martinique and Guadeloupe. They're french overseas territories (like Tahiti, New Caledonia or La Reunion). 2 people from there have emailed me to say they couldn't find these islands in the list.

Please let me know if it's possible to extend the list.

Many thanks Pekka

Pekka
6th of April 2004 (Tue), 17:20
Yes it is possible to add countries to the list. I'll provide you a small tool soon.

MikeCaine
22nd of January 2005 (Sat), 10:52
Is it possible to add "Isle of Man" as well. We're not part of the UK nand I don't really want to have to use UK when it's going to be a gallery on the Isle of Man

MikeCaine
22nd of January 2005 (Sat), 11:10
Ah, I've changed Iran to Isle of Man using myPhpAdmin. Don't think I'll need Iran any time soon

karim
21st of January 2006 (Sat), 20:47
Yes it is possible to add countries to the list. I'll provide you a small tool soon.

Hi Pekka,

is it possible to add countries to the country list? I couldn't find New Caledonia... Can you tell me whe the file is and I'll edit it.

Thanks

Pekka
21st of January 2006 (Sat), 22:10
You need to add the country to all installed languages. Here's a tool to do that. Save this with text editor (plain text) as "add_country.php" and upload it to your input folder. Open it with your browser to use.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>EE ADD COUNTRY</title>

<style type="text/css" media="screen"> <!--
SAMP {
font-style: normal;
}
IMG {
text-decoration: none;
color: #000000;
}
SMALL {
font-family: 'MS Sans Serif',arial,helvetica,sans-serif;
font-size: 11px;
}

A {
text-decoration: none;

}

A:hover {
text-decoration: underline;
color: #007700;
}

BIG {
font-size: 18px;
font-style : normal;
font-family: arial,helvetica,sans-serif;
font-weight : bold;
}

H2 {
font-size: 19px;
font-style : normal;
font-family: arial,helvetica,sans-serif;
}

H2 A {
font-size: 19px;
font-style : normal;
font-family: arial,helvetica,sans-serif;
color: #000000;
}

P,LI,UL,FORM,TD,BLOCKQUOTE {
font-family: verdana,arial,helvetica,sans-serif;
font-size: 11px;
}

option {
font-family: verdana,arial,helvetica,sans-serif;
font-size: 11px;
background-color : #fcf7ed;
}

SELECT {
font-family: verdana,arial,helvetica,sans-serif;
font-size: 11px;
background-color : #eeeeee;
}

INPUT,TEXTAREA {
font-family: verdana,arial,helvetica,sans-serif;
font-size: 11px;
}

FORM {
margin-bottom : 0px;
margin-top : 0px;
}

BODY {
background: #ffffff;
color: #000000;
margin-left : 10px;
margin-top : 10px;
margin-right : 10px;
margin-bottom : 10px;
font-family: arial,helvetica,sans-serif;
font-size: 11px;
background-image : none;
background-position : right;
background-repeat : no-repeat;
background-attachment : fixed;
background-color : White;
}

.rover {background: #fff7e8; color: Black;}
.rover A {color: Red; }
-->
</style>



<script language="javascript">
function confirmAdd(url) {
msg = "Are you sure you want to add a new country?";
return confirm(msg);
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><br></p>

<?php

include ("toroot.php");
include ($toroot . "add/connect.php");
include ($toroot . "language.php");
if (!function_exists("ee_error")) {
function ee_error ($q,$n,$p) {
if (!$q) {
print "<table border=\"2\" cellpadding=\"10\"><tr><td bgcolor=\"#F7E99D\">";
print "<p style=\"font-family: monospace; font-size: 12px; color: #000000;\"><big>Exhibit Engine MySQL error!</big><br>ERROR FROM QUERY <span style=\"color: #990000;\">{$n}</span> in page '{$p}':<br><br><b>------------------------------<br>";
print mysql_error();
print "<br>------------------------------</b><br><br>If you encounter this error with unmodified EE source code please mail this error to EE developers with version number, detailed circumstances when it happened and preferably with a database backup dump. All reports helps improving EE to your satisfaction. Thank You.";
print "</p></td></tr></table>";
mysql_close ();
exit;
}
return;
}
}

set_magic_quotes_runtime(0);

if (!function_exists("ee_addslashes")) {
function ee_addslashes ($x) {

if ((get_magic_quotes_runtime()==0) AND (get_magic_quotes_gpc()==0)) {
$x = addslashes($x);
}
if ((get_magic_quotes_runtime()==0) AND (get_magic_quotes_gpc()==1)) {
$x = stripslashes(addslashes($x));
}
if ((get_magic_quotes_runtime()==1) AND (get_magic_quotes_gpc()==0)) {
$x = addslashes($x);
}
if ((get_magic_quotes_runtime()==1) AND (get_magic_quotes_gpc()==1)) {
}
return $x;
}
}
if (!function_exists("ee_stripslashes")) {
function ee_stripslashes ($x) {

if ((get_magic_quotes_runtime()==0) AND (get_magic_quotes_gpc()==0)) {
}
if ((get_magic_quotes_runtime()==0) AND (get_magic_quotes_gpc()==1)) {
$x = stripslashes($x);
}
if ((get_magic_quotes_runtime()==1) AND (get_magic_quotes_gpc()==0)) {
$x = stripslashes($x);
}
if ((get_magic_quotes_runtime()==1) AND (get_magic_quotes_gpc()==1)) {
$x = stripslashes($x);
}
return $x;
}
}

?>

<h3>ADD COUNTRY TO EE</h3>


<p>DATABASE: <?php print $databasename; ?>
<form action="add_country.php" method="post" name="xxx" id="xxx" >
<input type="text" name="country">
<input type="submit" name="update" value="ADD" onClick="return confirmAdd()">
</form>
<?php

if (isset($_POST["country"])) {
$country = ee_stripslashes($_POST["country"]);
$q = "`";
?>
<p><small>
<?php

print "<p><small><table width=\"80%\" border=\"2\" cellpadding=\"2\" align=\"center\">";

function ee_install ($query,$name,$report="1") {
$update = mysql_query($query);
if ($report == "1") {
ee_error ($update,$query,$name);
}
if ($update) {
print "<tr><td><b>" . $name . "</b></td><td>OK</td></tr>";
}
if (!$update) {
print "<tr><td><b>" . $name . "</b></td><td><span style=\"color: #990000;\">ALREADY EXISTS</span></td></tr>";
}

return;
}

function borg ($assimilate) {
$feeder = mysql_query(
"
$assimilate
");
if (!$feeder) {
echo("<P style=\"color: #ffbbbb\">" . mysql_error() .
"<br><b>ERROR IN QUERY: </b><br><span style=\"color: #ffccff\">" . $assimilate . "<br></span></P>");
exit();
}
print "<small> .... " . strip_tags($assimilate) . " .... [DONE]</small><br>";
}


mysql_data_seek($get_languages,0);
while ($row = mysql_fetch_array($get_languages)) {
$language = $row["ee_language_var"];

$query = "
INSERT INTO {$q}ee_country_{$language}{$q} ({$q}ee_country_name{$q})
VALUES ('{$country}')
";
ee_install ($query,"add {$country} to country table ee_country_{$language}","0");

}
?>
</tr></table>
<?php

print "<p><br><b>COUNTRY $country ADDED SUCCESSFULLY. HAVE A NICE DAY.</b></p>";

}

?>
</body>
</html>

Adrian
24th of January 2006 (Tue), 12:58
You need to add the country to all installed languages. Here's a tool to do that. Save this with text editor (plain text) as "add_country.php" and upload it to your input folder. Open it with your browser to use.


Duuuh, I can't see how you access the program.

I have saved the file as you suggested add_country.php using notepad. I've uploaded into the www.domain.com/gallery/input (http://www.domain.com/gallery/input) directory. Now what do I need to do? Sorry if I'm being obtuse.

Adrian
24th of January 2006 (Tue), 13:09
Disregard my last post please. I have resolved my problem.

Thanks Pekka!