View Full Version : Show Thread Enhancements - Country Flag
tnguy3n
05-31-2004, 10:00 PM
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.
UPDATE `userfield` SET `fieldX` = 'Undisclosed';
-----------------------
Templates edit:
in postbit(_legacy)
FIND
<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon]</div>
BELOW ADD:
<if condition="$post[fieldX] != Undisclosed"><div>Country: <img src="$stylevar[imgdir_misc]/flags/$post[fieldX].gif" alt="$post[fieldX]" align="center" /> </div></if>
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
06-09-2004, 07:16 PM
* chuanse installs :D
imported_Kentaurus
06-10-2004, 06:44 PM
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
08-10-2004, 09:11 AM
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
08-11-2004, 02:19 AM
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
08-25-2004, 10:39 PM
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
08-28-2004, 11:14 AM
Change this option:
Display Page: Edit Profile
trackpads
09-03-2004, 04:47 AM
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
09-03-2004, 06:56 AM
So, all I have to do is remove that IF statement and this will work? Forgive me I am a n00b.
trackpads
09-03-2004, 11:00 AM
Yup. just use this code-
<div>Country: <img src="$stylevar[imgdir_misc]/flags/$post[fieldX].gif" alt="$post[fieldX]" align="center" /> </div>
An make sure you upload the Undisclosed.gif to the same folder as the other flags.
-Jason
mholtum
09-03-2004, 04:22 PM
Thanks I will give it a shot.
venomx
09-05-2004, 11:13 PM
What if we wanted to place this next to the username in the postbit(_legacy) or the regular postbit??
mholtum
09-06-2004, 01:42 AM
You would move it to that part of the template.
tnguy3n
09-22-2004, 12:07 AM
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.
Mellow
09-27-2004, 10:07 PM
Works great, I actually have some USA State flags and added Country and State profile fields.
Let me know if you need those flags.
RWDF1
10-14-2004, 07:33 PM
will this work with VB 3.0.3?
Cheers.
trackpads
10-14-2004, 07:54 PM
Yup
Shinobi
10-15-2004, 10:41 PM
argh, what about the 3.0.3 users??
*sniff*
peterska2
10-16-2004, 10:32 AM
It works with 3.0.3 (look up 2 posts before yours and you will notice the same question being asked) :D
RWDF1
10-17-2004, 12:08 PM
ok, I installed it, but its only showing the country name, and not the flag.
RWDF1
10-17-2004, 12:21 PM
Ok, I have sorted that problem, but where do I run the query - UPDATE `userfield` SET `fieldX` = 'Undisclosed';
Cheers.
BAGHDAD-IRAQ
10-17-2004, 07:05 PM
nice ... but not working .... sorry
tnguy3n
10-20-2004, 09:20 PM
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 #
RWDF1
10-20-2004, 09:24 PM
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
10-21-2004, 09:39 PM
Done ... thx
dknelson
10-22-2004, 12:33 AM
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
Erwin
10-22-2004, 01:25 AM
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.
limey
10-22-2004, 07:40 PM
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
10-29-2004, 06:02 PM
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
10-30-2004, 09:33 PM
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-11-2004, 02:08 PM
is it possible to put the flag in the profile page in members list?
plcguru
01-24-2005, 01:47 AM
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
01-29-2005, 09:52 PM
is it possible to put the flag in the profile page in members listalso!?!?!?!?!?!?!
imported_1yesfan
01-29-2005, 10:09 PM
I am lost, where the hell do I put this so my X goes away!!!!
UPDATE `userfield` SET `fieldX` = 'Undisclosed';
imported_1yesfan
01-30-2005, 12:12 AM
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
01-30-2005, 12:34 AM
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
01-30-2005, 05:57 PM
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
04-08-2005, 04:55 AM
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:
https://vborg.vbsupport.ru/showthread.php?p=637575#post637575
Or on my site, BattleForums.com here:
http://www.battleforums.com/showthread.php?p=1074648
SHANE-D-PAIN
05-05-2005, 04:32 PM
Works Like A Dream *Clicks Install*
eNforce
06-06-2005, 12:40 AM
I'm so lost here. How do I know what field I have to replace X with, wtf?
mholtum
06-06-2005, 01:29 PM
when you create the field you will see what numer is asigned to it.
am-fs
06-23-2005, 11:50 PM
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
KevinL
06-24-2005, 08:43 PM
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
06-25-2005, 04:08 AM
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:
<if condition="$post[fieldX] != Undisclosed">
Change it to this:
<if condition="$post[fieldX] != Undisclosed AND !empty($post[fieldX])">
Changing fieldX to whatever field you are using.
Borimikan
07-09-2005, 05:14 PM
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
07-29-2005, 09:10 PM
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.
gonon
08-04-2005, 12:53 AM
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
08-19-2005, 12:38 AM
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|
08-28-2005, 03:33 PM
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
08-28-2005, 04:53 PM
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
08-29-2005, 12:36 AM
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
09-04-2005, 02:34 PM
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
09-07-2005, 07:38 PM
*bump*
Anyone??
Andy.
Ericsson
09-11-2005, 08:43 AM
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
Funboy
03-13-2006, 10:31 AM
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.
https://vborg.vbsupport.ru/archive/index.php/t-97664.html
TheUGN.com
05-30-2006, 11:14 PM
Will this work with 3.5.4?
noRom
10-04-2006, 03:46 PM
Sry, nOOb here:
Where you say "change X to field id" what is the field ID?
noRom
10-04-2006, 04:02 PM
nm figured it out. Good work
Mecho
10-14-2006, 03:41 PM
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
Zagis
10-21-2006, 01:25 PM
Is it possible this cool mod to work on vB 3.6.2?
globalinsites
10-22-2006, 05:12 PM
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 :https://vborg.vbsupport.ru/showthread.php?p=1102140#post1102140
I haven't tried it yet though. Have you?
Mecho
10-23-2006, 02:55 PM
yep .. it works normaly in vb3.6.2
Live Demo :
www.mechodownload.com
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.