MyBB Community Forums

Full Version: Zaher's Flags in the post bit!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well, since we don't know when Zaher will come back, is anyone willing to take a look at his flags in post bit plug in, to see what needs to be changed for version 1.2? I really like this plug in and miss it! Sad

I can paste the code, if anyone is willing to let me know what needs to be changed!
OK, I've been trying to update this myself. Got it half working, but the images won't pull. Can anyone good at 1.2 coding look at tell me what's wrong with this part?

function country()
{	
	global $db, $mybb, $templates, $country, $post;
	$query = $db->query("select * FROM ".TABLE_PREFIX."profilefields WHERE name='User Country'");
	$ffid = $db->fetch_array($query);
	$fid = $ffid['fid'];
	
	if ($mybb->settings['field'] == '') 
	{
	$source = "fid".$fid;
		if ($post[$source] != '') 
		{
		$post['country'] = "<!-- Start: country --><br><div>Country: <img src=\"images/flags/$post[$source].gif\" title=\"$post[$source]\" align=\"center\"></div><!-- End: lsop -->";
		}
	} else {
		$source = "fid".$mybb->settings['field'];
		if ($post[$source] != '') 
		{
		$post['country'] = "<!-- Start: country --><br><div>Country: <img src=\"images/flags/$post[$source].gif\" title=\"$post[$source]\" align=\"center\"></div><!-- End: lsop -->";
		}
	}	
}
What do you mean the images won't pull? Does it show the image in the source, but the image doesn't show up? If so what does it show as the url of the image.
There is an easier way to do this without a function addition.

Set a profile dropdown selection with all the countries.  You might want to get an sql query to insert them.

Next edit the postbit template.

Add this

<img src="images/flags/$post[fidX].gif" /><br />

Make fidX the id number in the profile for the country field.  Make sure in the dropdown that the parameters for the country name match exactly the flag image name (case sensative too) and they are all either gif or jpg.

This should work easily without a new function.

Alrught I went ahead and created a mod for this.  I will start a new thread for it.

http://community.mybboard.net/showthread.php?tid=12389
Thanks, Labrocca!  Big Grin

Quote:What do you mean the images won't pull? Does it show the image in the source, but the image doesn't show up? If so what does it show as the url of the image.
Nothing is there, not even a red x, which is why I must have something still wrong in the code! I must be close though, since the revised mod does everything but pull the image! Big Grin At least it's working with Labrocca's modification...now, if I could incorporate that into the mod, it would be complete! Oh well, so long as it works! I'm so glad to have my flags back! LOL