View Full Version : Country Flag
tnguy3n
01 Jun 2004, 22:56
Well, i looked all over the forums but couldn't find this countryflag mod; however, i found it on vb.org instead. I wonder why did awesome hack ain't officially released here for vb members. :)
All credits go to SmartGnome for orginal hack and AJR, Pingu and Stasik who made the hack for vb 2.2.x.
Go to AdminCP > Profile Fields > Add new Profile field > Single Select Menu >
Title > Country
Description > This shows your country flag in postbit.
Options: copy and paste list of country in flag_list.txt to this option field
Default Option: Yes, but not blank
Display Page: Thread Viewing
-----------------------
Optional:
Run this following query to set Undisclosed as default for all users or it would displays images as X's.
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
-----------------------
Templates edit:
in postbit(_legacy)
FIND
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
BELOW ADD:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Change X to the field id.
Upload /flags to /images/misc/flags of your forum dir
Note:
Image: <if condition="$post[fieldX] != Undisclosed"><div>Country: <img src="$stylevar[imgdir_misc]/flags/$post[fieldX].gif" alt="$post[fieldX]" align="center" /> </div></if>
Text: <if condition="$post[fieldX] != Undisclosed"><div>Country: $post[fieldX]</div></if>
imported_chuanse
09 Jun 2004, 20:16
/me installs :D
imported_Kentaurus
10 Jun 2004, 19:44
Well, i looked all over the forums but couldn't find this countryflag mod; however, i found it on vb.org instead. [...] Nice mod, installed.
For the people with spanish forums, I have modified the flags_list file to reflect the Spanish name of the countries and the images for that. I attach the flag_list and the images if you want it to be in spanish.
imported_cinq
10 Aug 2004, 10:11
Just what I was looking for ! thanks ! :D
A question though, is it a must to set Display Page: Thread Viewing. Can it be on Edit Profile instead ?
pjdaley
11 Aug 2004, 03:19
Just what I was looking for ! thanks ! :D
A question though, is it a must to set Display Page: Thread Viewing. Can it be on Edit Profile instead ?
same hre, some of my members are going crazy, looking for it...
cinq, could put it anywhere you want.
as for running the UPDATE `userfield` SET `fieldX` = 'Undisclosed'; query. It's unnecessary, IMO. You could have an empty field in the first line and set it as default. Then using <if condition="$post[fieldX]"> flag code here </if> would give what you want.
pjdaley
25 Aug 2004, 23:39
cinq, could put it anywhere you want.
as for running the UPDATE `userfield` SET `fieldX` = 'Undisclosed'; query. It's unnecessary, IMO. You could have an empty field in the first line and set it as default. Then using <if condition="$post[fieldX]"> flag code here </if> would give what you want.
ok, but what would i do to put it on the Edit Profile area?
mholtum
28 Aug 2004, 12:14
Change this option:
Display Page: Edit Profile
trackpads
03 Sep 2004, 05:47
I went al litte further and created a gif called "Undisclosed.gif" and placed it in the flags folder on the server. I then removed the IF statement from the postbit so that it would show the undisclosed gif file as the default. The undisclosed gif is basically a small image reminding the user to update their profile :-)
Here you go-
http://www.trackpads.com/forum/showthread.php?t=135642
mholtum
03 Sep 2004, 07:56
So, all I have to do is remove that IF statement and this will work? Forgive me I am a n00b.
trackpads
03 Sep 2004, 12:00
Yup. just use this code-
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
An make sure you upload the Undisclosed.gif to the same folder as the other flags.
-Jason
mholtum
03 Sep 2004, 17:22
Thanks I will give it a shot.
What if we wanted to place this next to the username in the postbit(_legacy) or the regular postbit??
mholtum
06 Sep 2004, 02:42
You would move it to that part of the template.
tnguy3n
22 Sep 2004, 01:07
cinq, could put it anywhere you want.
as for running the UPDATE `userfield` SET `fieldX` = 'Undisclosed'; query. It's unnecessary, IMO. You could have an empty field in the first line and set it as default. Then using <if condition="$post[fieldX]"> flag code here </if> would give what you want.
well, it's optional to set all gender field in the table to Undisclosed, but if you don't run that query, it gonna show a big X on the image.
Works great, I actually have some USA State flags and added Country and State profile fields.
Let me know if you need those flags.
will this work with VB 3.0.3?
Cheers.
trackpads
14 Oct 2004, 20:54
Yup
Shinobi
15 Oct 2004, 23:41
argh, what about the 3.0.3 users??
*sniff*
peterska2
16 Oct 2004, 11:32
It works with 3.0.3 (look up 2 posts before yours and you will notice the same question being asked) :D
ok, I installed it, but its only showing the country name, and not the flag.
Ok, I have sorted that problem, but where do I run the query - UPDATE `userfield` SET `fieldX` = 'Undisclosed';
Cheers.
BAGHDAD-IRAQ
17 Oct 2004, 20:05
nice ... but not working .... sorry
tnguy3n
20 Oct 2004, 22:20
Ok, I have sorted that problem, but where do I run the query - UPDATE `userfield` SET `fieldX` = 'Undisclosed';
Cheers.
either in your Admin CP or phpMyAdmin.
make sure to change X to your field #
Where abouts in my admin CP, I dont understand this run query, the admin CP is a big section, where do I put that code?
BAGHDAD-IRAQ
21 Oct 2004, 22:39
Done ... thx
dknelson
22 Oct 2004, 01:33
Can somebody please give me a hand with this. It's only showing the text name of the country and not the flag. Any suggestions?
Don
well, it's optional to set all gender field in the table to Undisclosed, but if you don't run that query, it gonna show a big X on the image.
Just use conditionals to not show anything if the userfield is empty.
Might be a good idea to add a jump bar in the profile field for country. Because if you type for instance: USA, the graphic shows up broken. You need to type United States for the graphic to show.
Or a link to a popup template that lists: Acceptable Country Names.
Metropolitan
29 Oct 2004, 19:02
Is it possible to set the country flag entry at the bottom of the postbit? Now i have the symbols for IP, Reputation etc at the bottum, but not the country flag :eek:
btw: is it possible to change the font size of "CountrY" i think it´s a lil bit to big :s
peterska2
30 Oct 2004, 22:33
Fin the section of your postbit_legacy template that does the ip functions (should be $post[iplogged] ) then add the postbit section of the code on a new line directly below there instead of where it states it wants it.
To make the text country smaller use class="smallfont" either within the existing <div> <font> or whatever other tags it has around it. This will then make it set to the smallfont value in your main CSS.
BAGHDAD-IRAQ
11 Nov 2004, 15:08
is it possible to put the flag in the profile page in members list?
plcguru
24 Jan 2005, 02:47
Hi,
I have upgraded from Vb2.x to 3.x The original users country is in the user table. This mod puts it in the userfield table. How do I import the old users country data into the userfield table so everyone doesn't have to choose their country again?
Thanks!
imported_1yesfan
29 Jan 2005, 22:52
is it possible to put the flag in the profile page in members listalso!?!?!?!?!?!?!
imported_1yesfan
29 Jan 2005, 23:09
I am lost, where the hell do I put this so my X goes away!!!!
UPDATE `userfield` SET `fieldX` = 'Undisclosed';
imported_1yesfan
30 Jan 2005, 01:12
OK, I got the query thing done and it working in some of my skins. Skins that I have downloaded to my server, it does not work in those, I am getting the red x's. it does work in the skins that I set up myself from the Admin cpanel, anything I downlaoded to my panel, no go! Any idea??? I have double checked all my code. I am running 3.0.3
imported_1yesfan
30 Jan 2005, 01:34
i got it. image path on the dwnld skins is diff. upload plags to right place and all ok.
I got it setup and also added state flags for US members. If anyone wants to check it out Click Here (http://www.vbaexpress.com/forum/showthread.php?p=14323#post14323)
imported_1yesfan
30 Jan 2005, 18:57
How can this hack be changed to allow folks to just LEAVE the field blank if they do not want a flag at all!?!?!?!?!?!
Just add None to the field list. Then check for that in the template.
<if condition="$post[fieldx]&&$post[fieldx]<>None">
Do something
</if>
coRtALoS
08 Apr 2005, 05:55
I'd like to share a small modification I've made to this hack which I've found my members really enjoy.
This addon will allow members to display their US State, or Canadian Provincial flags ONLY if they have the United States or Canada selected as their Country.
In addition, if they pick a country that is part of the European Union, it will automatically display the EU flag next to it as well.
I've attached an installer and all necissary files to get it working with the Country hack.
It's a very small addon, and only took me about 5 mins (tops) to get to work once the Country Flag hack was installed.
If you require any technical assistance with this hack, as I am posting this thread on both vBulletin.org (http://www.vbulletin.org), and vBulletinTemplates.com (http://www.vbulletintemplates.com), I will provide technical support for this addon only on my own forums located here:
http://www.battleforums.com/forumdisplay.php?f=288
I also welcome anyone PMing me on my forums as I check my PM box more often than my cellphone voicemail. Please do not PM me here however, as I am not nearly as active on this account.
Enjoy!
~coRtALoS
BattleForums.com, StarCraftForums.com, WarCraftForums.com, DiabloForums.com, and BattleNetwork.com (http://www.battleforums.com) Administrator
----EDIT----
Apparently this site is having difficulty hosting my attachments. You can download them either at vBulletin.org in my post here:
http://www.vbulletin.org/forum/showthread.php?p=637575#post637575
Or on my site, BattleForums.com here:
http://www.battleforums.com/showthread.php?p=1074648
SHANE-D-PAIN
05 May 2005, 17:32
Works Like A Dream *Clicks Install*
eNforce
06 Jun 2005, 01:40
I'm so lost here. How do I know what field I have to replace X with, wtf?
mholtum
06 Jun 2005, 14:29
when you create the field you will see what numer is asigned to it.
I installed this on Vb 3.0.7, works it seems but i have a ?
i have removed a few members and they show as guest now, it there away to remove the red x from there country?
thank
I installed this on Vb 3.0.7, works it seems but i have a ?
i have removed a few members and they show as guest now, it there away to remove the red x from there country?
thank
You could probably go into your phpMyAdmin and edit each user in that field (8) to 'undisclosed'.
Im sure there is an easier way though...
Link14716
25 Jun 2005, 05:08
I installed this on Vb 3.0.7, works it seems but i have a ?
i have removed a few members and they show as guest now, it there away to remove the red x from there country?
thank
Find this:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Change it to this:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Changing fieldX to whatever field you are using.
Borimikan
09 Jul 2005, 18:14
i just installed this hack,
and it is only displaying country flag name instead country flag image,..
what should i do to fix this?
THANKS IN ADVANCED
coRtALoS
29 Jul 2005, 22:10
Have you uploaded the images to the correct directory? All of the <img> tags have alts, so it sounds like your code is right, but it's not finding the images.
ok guys i installed this hack works perfect in default skin but what about extra skins
i imported the postbit template to other skin but all i get is country: no image i know other skins use different image paths but where do i find it ?thanks btw thanks to the coder for great hack
o0Hubba0o
19 Aug 2005, 01:38
Have you uploaded the images to the correct directory? All of the <img> tags have alts, so it sounds like your code is right, but it's not finding the images.
Having same problem: forums/images/flags <---all flag images in there, they're not showing up though.
According to the directions though (Upload /flags to /images/misc/flags of your forum dir) that says you need to upload the flags folder to another folder named flags so it would be forums/images/misc/flags/flags <---all images there, but that doesn't make sense to have two folders.
If it's supposed to be one folder the directions should read: Upload /flags to /images/misc/ of your forum dir
Hi
Does anyone know if this hack is compatible with 3.5 RC2?
Joy :)
|Jordan|
28 Aug 2005, 16:33
3.0.X Hacks aren't compatible with 3.5 hacks.
They would have to be completely recoded. 3.5 introduced new code changes everywhere.
Hi
Thank you for replying :)
I installed the hack just after posting on here and I didn't have any problems at all. Seems like it still works okay.
Joy :)
Metropolitan
28 Aug 2005, 17:53
You mean that this hack also works for 3.5.0 RC2?
Yes the "Flag" hack works for me and I've just upgraded to 3.5 RC2 :)
Metropolitan
29 Aug 2005, 01:36
I tried it too, vut i have a lil problem. I´m Using the "STeel Blue" Style as Default Style, and when i´m installing the hack, i can only see a red cross in my postbit_legacy :s
andysv1k
04 Sep 2005, 15:34
Ive been trying for ages to get this hack working on 3.07
read all the threads i can find on it, but still no joy.
in the memberlist, the Country field is displayed, although it only shows text, no images.
when viewing forums, i get nothing displayed at all. Im asuming the flag image should be displayed on every post, in the middle of the header of the post, where all the other user info is ???
ive tried all sort of little changes to get it happening but nowt yet. I suspect its unable to locate the images, but they are uploaded as per the instructions, the filepath to the flag images would be forum/images/misc/flags/*****.gif
any help please???
Andy.
andysv1k
07 Sep 2005, 20:38
*bump*
Anyone??
Andy.
Ericsson
11 Sep 2005, 09:43
I installed it on 3.0.9 but the flags wont show up, how can I fix that?
Thanks
Heres an example: http://www.retrotutorials.com/forum/showthread.php?t=30
Hi guys,
Sorry to sound thick here but where is postbit(_legacy) within Version 3.5.4 as I can only find class_postbit.php & class_postbit_alt.php templates.
Also when looking for
<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon]</div>
all I can find is the updated version
<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>
within vbulletin-style.xml which was my old install folder?
I know things have changed since this post first started so can this be installed on a fresh install of 3.5 or only as an upgrade to 3.5..
Many thanks
OPPS
Sorry Guys had two post open at the same time this should have been within this thread. SORRY.
http://www.vbulletin.org/forum/archive/index.php/t-97664.html
TheUGN.com
31 May 2006, 00:14
Will this work with 3.5.4?
Sry, nOOb here:
Where you say "change X to field id" what is the field ID?
nm figured it out. Good work
hi ,, tnx for this great hack ..
I Installed it but the " Country : " for some users shows up for some not !!! and Flags for some shows up for some Not !! and most of theflags that shows up are USA' Flag !!
plz have alook at the attachment pic to see what i mean , Tnx
Is it possible this cool mod to work on vB 3.6.2?
globalinsites
22 Oct 2006, 18:12
Is it possible this cool mod to work on vB 3.6.2?
I was wondering about that too. Someone just told me that it normally works fine with 3.6.2 :http://www.vbulletin.org/forum/showthread.php?p=1102140#post1102140
I haven't tried it yet though. Have you?
yep .. it works normaly in vb3.6.2
Live Demo :
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
vBulletin® v3.6.12, Copyright ©2000-2013, Jelsoft Enterprises Ltd.