![]() |
Country Flag
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. HTML Code:
UPDATE `userfield` SET `fieldX` = 'Undisclosed'; Templates edit: in postbit(_legacy) FIND HTML Code:
<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon]</div> HTML Code:
<if condition="$post[fieldX] != Undisclosed"><div>Country: <img src="$stylevar[imgdir_misc]/flags/$post[fieldX].gif" alt="$post[fieldX]" align="center" /> </div></if> 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> |
[high]* chuanse installs :D[/high]
|
Quote:
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. |
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 ? |
Quote:
|
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. |
Quote:
|
Change this option:
Display Page: Edit Profile |
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 |
So, all I have to do is remove that IF statement and this will work? Forgive me I am a n00b.
|
Yup. just use this code-
HTML Code:
<div>Country: <img src="$stylevar[imgdir_misc]/flags/$post[fieldX].gif" alt="$post[fieldX]" align="center" /> </div> -Jason |
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??
|
You would move it to that part of the template.
|
Quote:
|
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. |
Yup
|
argh, what about the 3.0.3 users??
*sniff* |
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. |
nice ... but not working .... sorry
|
Quote:
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?
|
Done ... thx
|
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 |
Quote:
|
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. |
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 |
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. |
is it possible to put the flag in the profile page in members list?
|
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! |
Great Mod!!
*Installs |
is it possible to put the flag in the profile page in members listalso!?!?!?!?!?!?!
|
I am lost, where the hell do I put this so my X goes away!!!!
UPDATE `userfield` SET `fieldX` = 'Undisclosed'; |
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
|
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
|
How can this hack be changed to allow folks to just LEAVE the field blank if they do not want a flag at all!?!?!?!?!?!
|
All times are GMT. The time now is 04:49 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|