MyBB Community Forums

Full Version: Country Flag in Postbit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Zaher1988 has totally changed the code and now it works perfect. Thanx Zaher soon he will release a plugin for it here is the code

Quote:1. Go to AdminCP => Custom Profile Fields => Add new Profile field

Name > Your Country

Description > An information where you're from.

Maximum Length : 0

Field Length :0

Display Order : You give the number


Field Type : Sellect Box

Selectable Options : copy paste the list in the country list.txt

Leave the rest as is;




Unzip flags.zip und upload the directory to your /images folder


Quote:open ./functions_post.php

find

if($post['avatar'] != "" && $mybb->user['showavatars'] != "no")

above it add

if ($post[fid4] != '') 
		{
		eval("\$country = \"".$templates->get("postbit_country")."\";");
		}

note that fid4 should be replace with ur correspondence one! fid5 6 whatever

now in the template manager

add a new template called postbit_country
add this code

<div>Country: <img src="images/flags/$post[fid4].gif" title="$post[fid4]" align="center"></div>

then in postbit template find

$post[userregdate] 

below it add

$country <br> 

Goto your User CP and Edit Profile


[attachment=1887]

[attachment=1886]

You can see it here http://www.amatorbalikci.net/showthread....193#pid193
also this doesnt work for me. The image doesnt show.
Here you have point out your path

Country: <img src="images/flags/$post[fidX].gif" title="$post[fidX]" align="center">

Maybe your path is forum/images/flags
Could we check to make sure the GIF exists before outputting the img tag? Also, the alt attribute is required under HTML 4 and XHTML and highly recommended for earlier versions.
If anyone installs please send your comments
i installed it works 100%
I was unable to get the flag graphic to show. Here's the path for my flag images: /videogameempire.net/MessageBoard/images/flags/flags/.

Code from Postbit template:
<if condition="$post[fid14] != ''"><div>
Country: <img src="/videogameempire.net/MessageBoard/images/flags/flags/$post[fid14].gif" title="$post[fid14]" align="center">
</div></if>

Basically after all that I get this:
Quote:Country:

Sad

You should make this into a plugin and then release it on the mods site. Very good job
RaptorMoonX Wrote:I was unable to get the flag graphic to show. Here's the path for my flag images: /videogameempire.net/MessageBoard/images/flags/flags/.

Code from Postbit template:
<if condition="$post[fid14] != ''"><div>
Country: <img src="/videogameempire.net/MessageBoard/images/flags/flags/$post[fid14].gif" title="$post[fid14]" align="center">
</div></if>

Basically after all that I get this:
Quote:Country:

Sad

Did you choose the country from your profile field.

http://www.videogameempire.net/MessageBo...on=profile

and you don't need to put /videogameempire.net/ to the path only the directories

<if condition="$post[fid14] != ''"><div>
Country: <img src="MessageBoard/images/flags/flags/$post[fid14].gif" title="$post[fid14]" align="center">
</div></if>
Tikitiki Wrote:You should make this into a plugin and then release it on the mods site. Very good job

I don't have that much knowledge. If someone can make it as plugin people can use it more easy.
Pages: 1 2