vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Show Thread Enhancements - Country Flag (https://vborg.vbsupport.ru/showthread.php?t=89247)

tnguy3n 05-31-2004 10:00 PM

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>
BELOW ADD:

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>
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

[high]* chuanse installs :D[/high]

imported_Kentaurus 06-10-2004 06:44 PM

Quote:

Originally Posted by tnguy3n
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

Quote:

Originally Posted by cinq
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...

M1th 08-11-2004 05:50 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.

pjdaley 08-25-2004 10:39 PM

Quote:

Originally Posted by M1th
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-


HTML 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

Quote:

Originally Posted by M1th
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

Quote:

Originally Posted by RWD
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

Quote:

Originally Posted by tnguy3n
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!

DRJ 01-24-2005 04:31 AM

Great Mod!!

*Installs

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.

DRJ 01-30-2005 03:02 PM

I got it setup and also added state flags for US members. If anyone wants to check it out Click Here

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!?!?!?!?!?!


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
  • Page Generation 0.01931 seconds
  • Memory Usage 1,813KB
  • 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
  • (4)bbcode_html_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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