vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Miscellaneous Images (https://vborg.vbsupport.ru/forumdisplay.php?f=125)
-   -   Profile Enhancements - Country Flag Gif's (https://vborg.vbsupport.ru/showthread.php?t=180741)

MadK 05-28-2008 05:57 PM

Thank you, very nice flags! :)

ammoskumar 05-28-2008 06:14 PM

Quote:

Originally Posted by megabyte366 (Post 1534153)
I took flag's and applied to this code and it works.


Flags Install File - Country Only

1. Create Flags Profile Fields:

Go to AdminCP > Profile Fields > Add new Profile field > Single Select Menu
Title - Country Flag
Description - Select your Country Flag
Options - [copy and paste list of countries in country_flags_list.txt to this option field]
Set Default: None
Editable By User: Yes
Display Page: Edit Profile

Write down your field number, ie field8


2. Edit the postbit_legacy template:

Go to AdminCP > Styles & Templates > Style Manager
In your template list on the right select Edit Templates from the dropdown menu of the desired template
Double click Postbit Templates
Double click postbit_legacy

FIND:

<div>
$vbphrase[posts]: $post[posts]
</div>

BELOW, ADD:

<!-- / flags start -->
<div>
<if condition="$post[fieldX]"><img src="images/flags/$post[fieldX].gif"></if>
</div>
<!-- / flags end -->


Change X to the field id for your country flag.
ie, if your country flag is field8 the code will look like this:
<!-- / flags start -->
<div>
<if condition="$post[field8]"><img src="images/flags/$post[field8].gif"></if>
</div>
<!-- / flags end -->


3. Upload the folder flags to the images directory of your forum.

hey brother any demo on this i follow ur instruction but its not showing on postbit legacy??

plz help me on this..

Kaleem 05-28-2008 06:18 PM

Quote:

Originally Posted by ammoskumar (Post 1534298)
hey brother any demo on this i follow ur instruction but its not showing on postbit legacy??

plz help me on this..

Try both post_bit and postbit_legacy.

Soup^Dragon 05-28-2008 06:19 PM

will only work if you are using postbit legacy, try the same in the postbit template

ammoskumar 05-28-2008 06:51 PM

k ill do right now...

ammoskumar 05-28-2008 06:55 PM

Quote:

Originally Posted by LightInClouds (Post 1534303)
Try both post_bit and postbit_legacy.

i tried both and still not coming up.... i have flags folder under the images....
do i have to rename the flag name or anything??

i want to show that flags images in the user postbit....

plz help thank you so much...

macc 05-28-2008 07:02 PM

Hello!

something is wrong with file name (extension) GIF --- should be gif and how and where implement that code " {title}: <img src="./style_images/flag/flag_{key}.GIF" /> "

also must change all filenames to flags ... to countryname.gif

reg

macc

can some fix that and make wright code to put in postbit and postbit_legacy?

ammoskumar 05-28-2008 07:05 PM

No problem i found it you have to rename the name flag_in.gif to india.gif

thanx a lot LightInClouds & Soup^Dragon

it came now up... :)

stardotstar 05-28-2008 11:43 PM

I am new at modding vB - first one actually - and I had this mod on phpBB so I have added it according to the user profile custom field addition and then linking to the flag name in postbit_legacy - and this does indeed work if the file is renamed from the list provided ie:
flag_au.GIF --> Australia.GIF works but that requires renaming all the flags according to the names in the list whilst the original bundle already provides a translation key:
...
au=Australia
...
in phpBB this is done using a language key where anything called for as 'au' shows up as 'Australia'; then the menu list would be the list of keys
...
au
...
which is an easier job to edit than the actual file names - including the fact that there are spaces and capitalisation in the file names and also some exceptions to the two letter country code etc...

There must be some simple code that would allow the supplied list to be used in both the dropdown and the image file translation without a lot of editing?

Language key:
at=Austria
au=Australia
aw=Aruba
ax=Aaland

Drop down menu is then set up as

at
au
aw
ax

but displays to users as

Austria
Australia
Aruba
Aaland

and when one is selected by the language key in the profile it translates to:

flag_at.GIF
flag_au.GIF
flag_aw.GIF
flag_ax.GIF

or

flag_$post[fieldX].GIF

Sort of thinking out loud since I don't even know if this is where such a question should be asked...

sweetguy2004 05-29-2008 08:03 PM

Sort of thinking out loud since I don't even know if this is where such a question should be asked...

LOL


All times are GMT. The time now is 09:50 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02258 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete