PDA

View Full Version : Add-On Releases - Country Flags - Postbit & Postbit_Legacy. vB 3.8.X


Welshy2008
03-21-2010, 10:00 PM
After receiving many PMs for me to do my version of this mod, I have obliged.

Original Credit for the Mod goes to Cobro (https://vborg.vbsupport.ru/member.php?u=168975).

If you use this Mod, Please click "Installed" and rate the Mod fairly. :)

This Mod is available for vb4.0.X here:

https://vborg.vbsupport.ru/showthread.php?p=2008102#post2008102



Description:

This Add on, gives a selection of Countries that your Member (New or Existing) can choose from in a 'Drop-Down Menu'. The Country he/she selects, will be displayed as a Flag in their Postbit.


Instructions:

Firstly ?Upload? ALL the Flag GIF pics to your forum root /images/buttons/flags folder.

IE: yourforumaddress.com/forum/images/buttons/flags

Please Note: Due to the flags folder being too large to upload as one - I have been forced to upload it as "flags1", "flags2" and "flags3" - Please ensure that you add a new folder to "images/buttons/" and name it "flags". Please copy the contents of ALL THREE (3) flags folders in the attachment below to the new 'flags' folder that you have just made. (DO NOT place them as 3 seperate folders!"


Then in your Admin Control Panel (ACP), please do the following:
ACP -> User Profile Fields -> Add New User Profile Field ->Profile Field Type -> Single-Selection Menu (select ?Single-Selection Menu? from the Drop-Down Menu) -> Please enter the following into the following fields (REMEMBER to make a note of the FieldID, because you will need to replace ALL the X?s in [fieldX] with it!!!
(Please see 'FieldID.jpg' attachment below).

Add New User Profile Field Single-Selection Menu:

Title = Country Flag
Description = Add your country flag to your profile:
Profile Field Category = (Uncategorized)
Options = Copy & Paste the Whole contents of the file attached below (OPTIONS)
Set Default = None
Display Order = You Select this (dependant on how many you already have)
Field Required = yes, at registration and profile updating
Field Editable by User = Yes
Private Field = No
Field Searchable on Members List = No
Show on Members List = Yes


Optional Input:

Allow user to input their own value for this option = No
Max length of allowed user input = 100
Field Length = 25
Regular Expression = Leave this Blank


Display Page:

Which page displays this option? = Edit Your Details

** SAVE **


Then, In your Admin Control Panel (ACP)...


For Postbit:


ACP -> Styles & Templates -> Style Manager -> <<>> -> Postbit Templates -> postbit


FIND:


<if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
<if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>
$template_hook[postbit_userinfo_left]


ADD BELOW:


<!-- Wy Country Flags Start -->
<if condition="$post['fieldX']">
Country: <img src="http://www.Yourforum.com/images/buttons/flags/$post[fieldX].GIF" alt="$post[username]'s Flag is: $post[fieldX]" border="" />
</if>
<!--// Wy Country Flags End -->


For Posbit_Legacy:


ACP -> Styles & Templates -> Style Manager -> <<>> -> Postbit Templates -> posbit_legacy...


FIND:


<if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</if>
<if condition="$post['rank']"><div class="smallfont">$post[rank]</div></if>
$template_hook[postbit_userinfo_left]


ADD BELOW:


<!-- Wy Country Flags Start -->
<if condition="$post['fieldX']">
Country: <img src="http://www.Yourforum.com/images/buttons/flags/$post[fieldX].GIF" alt="$post[username]'s Flag is: $post[fieldX]" border="" />
</if>
<!--// Wy Country Flags End -->


BOTH of the codes above will give you the Username and the Name of the actual Users Country Flag on mouseover.


TIP: (If you find that you get the box with a "red x" like this http://www.sbhple.com/images/sample.png, instead of seeing your image whilst using Option 1, Above - This means that the route to your images is wrong.


** Replace the ?X? with your FieldID number **
** Replace the ?Red Text? with Your Forum Address **

** SAVE Template **





And that's it - Enjoy!


Please do not forget to click "Install"

Super-six
03-22-2010, 08:28 PM
Excellente ! :D

We'll be installing this one.
BTW...thanks for the personal customer service also.

Welshy2008
03-22-2010, 08:42 PM
Excellente ! :D

We'll be installing this one.
BTW...thanks for the personal customer service also.


You're Welcome, Let us know here, how you get on with it on 3.8.5.

ShawneyJ
03-22-2010, 10:57 PM
Excellent. i already have this on my forum, but its good to see finally a addon using the animated flags. ;)

MichaelDance
03-23-2010, 06:01 PM
TY you know our problem with flags before, could i use mine which i did for you on vb4.0 or are they fixed on this one??

Welshy2008
03-23-2010, 07:47 PM
Problem?

These are all .GIF(s), But you are able to use your own if you so wish. :)

as7apcool
03-23-2010, 07:54 PM
thanks 4 this .. really good

cheech47
03-24-2010, 03:04 PM
Is there anyway to get these flags to work in who's online?

Thanks

matthewhotdude
03-24-2010, 07:17 PM
installed as instructions, People are able to choose the flags, but nothing shows up in the postbit. It's showing up as a red X

When I right click the red X it's linking to the flags like this http://www.chattaboxforums.com/images/buttons/flags/.GIF

Why??

ghostpt
03-24-2010, 07:45 PM
installed as instructions, People are able to choose the flags, but nothing shows up in the postbit. It's showing up as a red X

When I right click the red X it's linking to the flags like this http://www.chattaboxforums.com/images/buttons/flags/.GIF

Why??

When you add User Profile Field check the ID of the field. Eg: If the field is field10, replace the X with 10.

Country: <img src="http://www.Yourforum.com/images/buttons/flags/$post[field10].GIF" alt="$post[username]'s Flag is: $post[field10]" border="" />

matthewhotdude
03-24-2010, 07:52 PM
When you add User Profile Field check the ID of the field. Eg: If the field is field10, replace the X with 10.

Country: <img src="http://www.Yourforum.com/images/buttons/flags/$post[field10].GIF" alt="$post[username]'s Flag is: $post[field10]" border="" />

Yes sorted thanks, didnt notice there were 2 X's that needed changing in each edit

Black Tiger
03-24-2010, 11:27 PM
I think I had this installed maybe in 2.x or another 3.x version. I've got a whole /flags directory in my vbulletin.:)
I think I'm going to try this mod too.

Welshy2008
03-25-2010, 09:03 AM
Matthew,

There are Three (3) X's to replace, Mate. ;)

<!-- Wy Country Flags Start -->
<if condition="$post['fieldX']">
Country: <img src="http://www.Yourforum.com/images/buttons/flags/$post[fieldX].GIF" alt="$post[username]'s Flag is: $post[fieldX]" border="" />
</if>
<!--// Wy Country Flags End -->


You have missed out the code that is in Bold Green.


That gives the name of the country flag that that user has chosen, when you hover the mouse over their flag.

matthewhotdude
03-25-2010, 09:12 AM
ahh thanks welshy :)

Welshy2008
03-25-2010, 09:32 AM
That's it mate, It working great now.


Can you go into your flags folder and rename the UK flag from "UK.gif" to "UK.GIF"?


That Flag will then work too. ;)

Welshy2008
03-25-2010, 09:36 AM
Attached is a UK.GIF for those who have already installed this.

For those who haven't, I have added it to the original folder in the OP.

matthewhotdude
03-25-2010, 09:53 AM
Thanks, Wondered why that didnt work

killerkraft
03-25-2010, 01:34 PM
Thank's mate.

Works like a charm.

Welshy2008
03-25-2010, 01:35 PM
Thank's mate.

Works like a charm.



You're Welcome.

Aztlan
03-26-2010, 05:33 PM
Good plugin :)

a question,
is there a way to return to normal, without any flag?

once users have selected a flag, they can't return to normal since the software is saying a flag is required..

Welshy2008
03-26-2010, 06:32 PM
Good plugin :)

a question,
is there a way to return to normal, without any flag?

once users have selected a flag, they can't return to normal since the software is saying a flag is required..


I trust you mean that you don't want the "Flag" to be compulsory?


If so, Go into and edit the "Field Required" part of your custom profile field, that you set up.

Aztlan
03-26-2010, 09:15 PM
I tried that
but if I choose any of the "No" options, the country drop down menu disappears completely
and the other "yes, always" option is the same as "yes, at registration and profile updating" in which a flag is required, so the user will always be stuck with a flag,

I thought of a workaround, creating a transparent flag image, and adding an option of "None" to the list

and it works

Welshy2008
03-26-2010, 10:04 PM
I thought of a workaround, creating a transparent flag image, and adding an option of "None" to the list

and it works



But the Text and flag will still show.


If you go to your Country Flags "User profile field" -> and under "Set Default" - select the "Yes, including a first blank option" from the dropdown menu -> click "Save".


What this will do is, your members that do not wish to have/display their country flag, all they need to do is to select the "Blank Option" at the top of the dropdown menu, and nothing at all will show. Not even text.

Let me know how you get on, Mate.

:)

Aztlan
03-27-2010, 12:17 AM
I did that
still same thing, if I select the blank option in the usercp, and then click save, it tells me a flag is required.

what I did is slightly modify the code for the postbit, just deleting the "Country:" portion
doing that only shows the flag

so with the transparent flag image, nothing will show when the user selects "None" option, Like if nothing was there

I attached the transparent image for those interested (you will notice nothing is there lol, but is there.. :) )

1) add "None" to the country list (preferably at the top of the list)
2) add the image to the folder where you have the rest of the flag images
3) this will work best if you delete the "Country:" portion in the code

anyway, thanks again for the mod, members of my forum liked the idea :)

Welshy2008
03-27-2010, 09:40 AM
I see,

Perhaps you can't change it for some bizarre reason, once you have set it up from the start, as a required field.

In fact, I remember something along these lines with mine.

Why not try again, by deleting the "Custome profile field" and redoing it from the start, with a not required field? But remember to change the "FieldID" as this will now be different.

Let me know how you get on, if you do it, please?

Aztlan
03-28-2010, 03:01 AM
I tried that, same thing.. I am just going to stay with the workaround I mentioned above
thanks though

Hellmaster
03-30-2010, 06:02 AM
How to add the FLAG.gif to the profile (tab=aboutme)? It only shows as text...

Welshy2008
04-01-2010, 12:38 PM
How to add the FLAG.gif to the profile (tab=aboutme)? It only shows as text...

Yes, Unfortunately.

matthewhotdude
04-12-2010, 02:11 PM
wheres the Vatican flag?

Welshy2008
04-12-2010, 04:47 PM
wheres the Vatican flag?



Attached is the "Vatican" flag.

matthewhotdude
04-12-2010, 05:16 PM
Cheers, you might want to rename it Vatican.GIF

Welshy2008
04-12-2010, 06:05 PM
It is. Or at least, it is for me. ?

matthewhotdude
04-12-2010, 06:12 PM
Na its Vatican.gif

the GIF needs to be capitalized for it to work

Welshy2008
04-12-2010, 06:41 PM
Na its Vatican.gif

the GIF needs to be capitalized for it to work


I know that Mat.

It IS .GIF on my end?!

I am sure you are able to change it from .gif to .GIF?

And I will change it to .GIF when I add it to the folder in my OP.

matthewhotdude
04-12-2010, 06:51 PM
Yea yea I was just letting other people know, if they wanted to use it

Nephalim
04-28-2010, 05:59 PM
cool, but my flags do not show. only text >>Country: Member's Flag is: United States

Welshy2008
04-28-2010, 06:45 PM
cool, but my flags do not show. only text >>Country: Member's Flag is: United States


Sounds like the location of your flags folder is incorrect.

PM me your Forum address and I will take a look. (Don't need any personal log in details).

djxpire3
04-30-2010, 09:14 PM
Hi mate, Switzerland.GIF is missing from your part2 archive....

Welshy2008
04-30-2010, 11:07 PM
Hi mate, Switzerland.GIF is missing from your part2 archive....

Sorry DJ.

Please see attachment.

djxpire3
05-07-2010, 04:24 AM
Thanks! :D

ljd290
05-15-2010, 11:33 PM
Thanks very much. Easy to set up and looks good:D

lol hoping the staff agree:rolleyes:

Gamelobby
05-28-2010, 04:32 AM
I'd like to use it for N. America.. (US States & Canada)
Anyway to use this for State Flags.? (or is there another mod.?)

Welshy2008
05-28-2010, 09:03 AM
I'd like to use it for N. America.. (US States & Canada)
Anyway to use this for State Flags.? (or is there another mod.?)


On the flags list (IE UK.GIF, US.GIF) just replace them with the flag names that you want to use, and match those names to the actual flags that you want to use.

Let me know how you get on.

PhillyTom
05-30-2010, 03:01 PM
I installed it with no problem at all. Nice, clear instructions. I made my own flag set because I want my forum users to be able to request custom flags (historical or subnational flags). I also changed things so that the flag shows on the right side of postbit below the rep power.

ljd290
06-13-2010, 08:01 PM
cool, but my flags do not show. only text >>Country: Member's Flag is: United States

We have this problem but with only one flag(falklands). Its present in the right folder
Heres a link to a thread that the member who has the text has posted.

http://www.plecoplanet.com/forum/showthread.php?t=5144

goshalim
07-03-2010, 04:57 AM
On the 3.8.1 there is no Option field to copy paste the option.txt.

Please advice what to do

Welshy2008
07-03-2010, 09:44 AM
On the 3.8.1 there is no Option field to copy paste the option.txt.

Please advice what to do

Upgrage?

goshalim
07-03-2010, 12:59 PM
What if i dont want ot upgreat , there is no chance to make it work with 3.8.1 ?

Also when i tried the path ="http://www.Yourforum.com/images/buttons/flags/
its gets this

Forbidden
You don't have permission to access /up/forum/images/buttons/flags/ on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request

Welshy2008
07-03-2010, 01:45 PM
Can you post or PM me the URL to your forum? I don't have a 3.8.1 to test in on, sorry.

goshalim
07-04-2010, 06:23 PM
Found the mistake. Because on 3.8.1 there is not fielf for options, if you write wrong the name of the country or with small letters and not just like the list then you get an x .

Welshy2008
07-05-2010, 06:31 AM
That's right. You have to start with a capital letter the .GIF has to be in capitals too.

But, Thank You for updating us on your situation.

goshalim
07-05-2010, 07:03 AM
You are welcome but they should found a solution for the optio list.
User that are using 3.8.1 version they will have a problem.

Because there are a lot of ways how to write a name ......correct ?

imedic
07-14-2010, 09:11 PM
Works like a charm, thanks man :)

Nephalim
08-16-2010, 03:43 AM
hi how do you get this to work with blog? I keep getting errors when we post a blog. vb 3.8.4

cheech47
10-13-2010, 07:55 PM
Hi

Just to let you know the Cambodia flag is missing

Cheers

soroush
10-21-2010, 07:25 PM
Hi,
Many of my forum users are from Iraq and Iraq's flag get changed recently; how could I find an updated one with same motion as in the current one?

ljd290
12-20-2010, 08:43 PM
Hi
Any chance of a Columbia flag please?

Diablo-Sat
01-02-2011, 08:07 AM
thanks for this, only prob i had was when i finished the flag was under my name not under my stats but its ok

Fluke667
11-28-2011, 04:26 PM
Can i use the Flags Display in Whos Online ?

vwdforum
12-02-2011, 07:50 AM
any chance of a Switzerland flag please?

Welshy2008
12-02-2011, 11:59 AM
Hi
Any chance of a Columbia flag please?

Sorry for the annual delay - as I didn't get a notification e-mail about this.

If you still need it, I have attached the requested "Columbia" flag below.

any chance of a Switzerland flag please?

No problem, but you will have to click "Installed" first.

vwdforum
12-05-2011, 05:54 PM
Hi, marked as installed, can I request switerland one please? thanks Mally

Welshy2008
12-06-2011, 08:20 AM
Hi, marked as installed, can I request switerland one please? thanks Mally

Thank You. It's attached.

rockerzteam
08-13-2012, 05:33 PM
Any chance I could get help on removing the country text and centering the flag image and change the location to the bottom