Log in

View Full Version : profile field, country, flag


khaleejy
02-05-2003, 07:00 PM
hi

im not so good in mysql, but good enough in php. so i need some help to know whats the user country to set a small flag that apear in his post, in postbit template. i want to do something looks like the following:

if ($post[field2]=="england") { $flag="EN"; }
if ($post[field2]=="germany") { $flag="GR"; }
..and so on
$flag="<img src=".$flag.".gif>";

and then but $flag in postbit template

for those who may tell me that i need to create anew table: my members are from 6 countries only. thats why i dont think that i have to create a new table to do so.

Dean C
02-06-2003, 03:24 PM
Put that in the phpinclude template or functions.php

So it would be:



/// Urls
$englandurl = "{imagesfolder}/flags/england.gif"
$germanyurl = "{imagesfolder}/flags/germany.gif"

// if statement
if ($post[field2]=="england") {
$flag = "<img src=\"$englandurl\" border=\"0\">";
} elseif { ($post[field2]=="germany")
$flag = "<img src=\"$germanyurl\" border=\"0\">";
}


Something like that :)

- miSt