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 - CountryFlag (https://vborg.vbsupport.ru/showthread.php?t=97664)

tnguy3n 10-04-2005 10:00 PM

CountryFlag
 
Site: http://www.vbviet.org
CountryFlag Mod for vb 3.5

This hack shows user's country flag in postbit, below the user name.

Original by SmartGnome, AJR, Pingu and Stasik for vb 2.2.x.


1. Go to AdminCP => Profile Fields => Add new Profile field => Single Select Menu

Title > Home Country

Description > Tell people where you're from.

Options:
[copy and paste list of countries in flags_list.txt to this option field]

Set Default: Yes, Include a First Blank Option

Editable By User: Yes

Display Page: Edit Profile

Write down your field# . i.e field6

2. Open postbit(_legacy) template,

FIND:
HTML Code:

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

BELOW, ADD:
HTML Code:

                                <if condition="$post[fieldX] != ''"><div>
                                        Country: <img src="images/flags/$post[fieldX].gif" title="$post[fieldX]" align="center">
                                </div></if>

<!-- Don't forget to change X to the field id. -->


3. Upload /flags to images/flags to your forum dir.



<!--- That's it! --->

---------------------------------------
To show countryflag in profile:


Open memberinfo template,

FIND:
HTML Code:

                                <if condition="$userinfo['usertitle']"><div class="smallfont">$userinfo[usertitle]</div></if>
BELOW, ADD:
HTML Code:

                                <if condition="$userinfo[fieldX] != ''"><div>
                                        Country: <img src="images/flags/$userinfo[fieldX].gif" title="$userinfo[fieldX]" align="center">
                                </div></if>

-------------------------------
To Show User's Countryflag in Memberlist, see this following post:
https://vborg.vbsupport.ru/showpost....9&postcount=14

Boofo 10-05-2005 09:40 PM

Where's the file?

tnguy3n 10-05-2005 09:42 PM

updating... it's been so long since I last release a hack, so I forgot all the procedures. :p

Boofo 10-05-2005 09:44 PM

Well, I for one am glad to see you releasing stuff again. ;)

Is there a way to make this work in the memberlist, too? ;)

tnguy3n 10-05-2005 09:47 PM

well, I can look into that option for you; however, I think that can't be done by template modding. Gotta code-hack or writing a plug-in for that.

Boofo 10-05-2005 09:48 PM

I'm almost sure a plug-in could handle it. ;)

I like your gender images, by the way. ;)

tnguy3n 10-05-2005 09:54 PM

Thanks.
Hey boofee-man, you're from IA, corn state? :p

Boofo 10-05-2005 09:55 PM

Quote:

Originally Posted by tnguy3n
Thanks.
Hey boofee-man, you're from IA, corn state? :p

Des Moines, to be exact. ;)

tnguy3n 10-05-2005 10:05 PM

Quote:

Originally Posted by Boofo
Des Moines, to be exact. ;)

and you're saying that Des Moines doesn't grow corn? :D lol j/k.

Boofo 10-05-2005 10:07 PM

Not in the apartment I live it, we don't. I think you have to go outside of Des Moines a few miles for that. ;)

Check your PMs. ;)

SnowBot 10-06-2005 07:44 AM

I had one almost the same as this. Thanks for your efforts :)

HC. 10-06-2005 10:59 AM

instead of country is there away to do state flags since most of my users are in the US and CA

TygerTyger 10-06-2005 11:11 AM

Just change the list of countries to a list of states, and put the state flags in the flags directory with the same names as in the state list.

tnguy3n 10-07-2005 09:43 PM

Quote:

Originally Posted by Boofo
Well, I for one am glad to see you releasing stuff again. ;)

Is there a way to make this work in the memberlist, too? ;)

okie, this add-on is written as requested by bofo.

#------------------

Addon to show countryflag in Memberlist

Open memberlist_resultbit template,

FIND:
HTML Code:

                <a href="member.php?$session[sessionurl]u=$userinfo[userid]">$userinfo[musername]</a>
BELOW, ADD:
HTML Code:

                <if condition="$userinfo[fieldX] != ''"> <img src="images/flags/$userinfo[fieldX].gif" title="$userinfo[fieldX]" align="center"></if>

TygerTyger 10-07-2005 11:31 PM

Damn, how cool are you? Thank you!

DefenceTalk 10-08-2005 01:55 AM

For some reason, I am the image URL is missing the name of the country:

http://www.defencetalk.com/forums/images/flags/.gif

In this thread...

tnguy3n 10-08-2005 02:27 AM

Quote:

Originally Posted by DefenceTalk
For some reason, I am the image URL is missing the name of the country:

http://www.defencetalk.com/forums/images/flags/.gif

In this thread...

Did you adjust $userinfo[fieldX] to your own ID?

Boofo 10-08-2005 05:36 AM

Has the memberlist add-on been added to the zip in the first post, sir? ;)

Oblivion Knight 10-08-2005 06:35 AM

Hmm.. Why exactly have you posted a plugin for the memberlist addon?

The template edits should work fine without it. ;)

Boofo 10-08-2005 06:39 AM

Quote:

Originally Posted by Oblivion Knight
Hmm.. Why exactly have you posted a plugin for the memberlist addon?

The template edits should work fine without it. ;)

Have you tried it without the plug-in?

Oblivion Knight 10-08-2005 06:43 AM

Quote:

Originally Posted by Boofo
Have you tried it without the plug-in?

No, but I use similar code for my Gender userfield in the memberlist and it works fine..

Besides which, his $showflag variable is never used?

tnguy3n 10-08-2005 09:34 AM

Actually, you're right. Plugin is unneccesary.

DefenceTalk 10-08-2005 09:45 AM

Quote:

Originally Posted by tnguy3n
Did you adjust $userinfo[fieldX] to your own ID?

Yes, I did.

Code:


<if condition="$post[field10] != ''"><div>
        Country: <img src="images/flags/$post[field10].gif" title="$post[field10]" align="center">
        </div></if>

:ermm:

tnguy3n 10-08-2005 10:00 AM

I saw the flag just fine.

exceem 10-08-2005 07:46 PM

cheers :)

vibe 10-09-2005 04:59 AM

cool dude, thanks

tuanluu 10-10-2005 09:19 PM

Options:
[copy and paste list of countries in flags_list.txt to this option field]
-----------------------------------------------------------------

I don't see this field. Am I blind are I am doing samething not right?

tnguy3n 10-10-2005 10:21 PM

copy and paste the whole content in flag_list.txt and paste into option box. ;)

tuanluu 10-10-2005 10:28 PM

thanks got it

lamilein 10-12-2005 07:37 AM

some sexy free 18x12 flag icons for you i found on the web (list of filenames included for copy & paste)

Oblivion Knight 10-12-2005 07:39 AM

Quote:

Originally Posted by lamilein
some sexy free 18x12 flag icons for you i found on the web (list of filenames included for copy & paste)

They're awesome! Thanks for sharing them.. :)

tnguy3n 10-12-2005 01:14 PM

Quote:

Originally Posted by lamilein
some sexy free 18x12 flag icons for you i found on the web (list of filenames included for copy & paste)

those are awesome. thanks for sharing it.

havefun 10-13-2005 05:08 PM

thank you. that's nice :)

& thanks lamilein for the flags

rb290 10-16-2005 06:13 AM

what do you mean change X to the field ID ?

Oblivion Knight 10-16-2005 06:24 AM

Quote:

Originally Posted by rb290
what do you mean change X to the field ID ?

After creating the custom profile field, you need to look in the Profile Field Manager for the field id (see screenshot). Replace X with this number.

Instead of creating a new profile field, I overwrote my Location field therefore my field id is 2.. Yours is likely to be 5 or 6, depending on if you've created any custom fields previously. :)

rb290 10-16-2005 06:41 AM

vBulletin Message
You did not enter the correct format for the Home Country field. Please read the field description for the expected format.

rb290 10-16-2005 06:44 AM

some help please ^
im pretty sure i did everything right
this is how my postbit legacy template looks like:

PHP Code:

                <div>
                    <
font color="#999999"><strong>$vbphrase[posts]</strong></font>: <font color="#999999"><strong>$post[posts]</strong></font>
                </
div>
                <if 
condition="$post[field5] != ''"><div>
                    
Country: <img src="images/flags/$post[field5].gif" title="$post[field5]align="center">
                </
div></if>
                    <if 
condition="$vboptions['vbookiecashon']">
                    <
br />vCash$post[vbookie_cash]
                    </if> 


rb290 10-16-2005 06:45 AM

the vbookie part was underneath the vbphrase[posts] part so I put it in between

Oblivion Knight 10-16-2005 06:55 AM

Quote:

Originally Posted by rb290
vBulletin Message
You did not enter the correct format for the Home Country field. Please read the field description for the expected format.

Where are you getting this error? In the Admin CP?

rb290 10-16-2005 06:56 AM

When I choose my country and press save, it brings up the error page


All times are GMT. The time now is 04:46 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.01331 seconds
  • Memory Usage 1,834KB
  • 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
  • (1)bbcode_code_printable
  • (6)bbcode_html_printable
  • (1)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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