[Code Modification] 244 Countries Flags with Wiki Links in Postbit - Printable Version +- MyBB Community Forums (https://community.mybb.com) +-- Forum: Extensions (https://community.mybb.com/forum-201.html) +--- Forum: Plugins (https://community.mybb.com/forum-73.html) +---- Forum: Plugin Releases (https://community.mybb.com/forum-102.html) +---- Thread: [Code Modification] 244 Countries Flags with Wiki Links in Postbit (/thread-87947.html) |
[Code Modification] 244 Countries Flags with Wiki Links in Postbit - pinguy - 2011-02-07 I was looking for away to have peoples flags show up in their post bits (if they wanted to, didn't want to use a IP based system and force it on users). After looking around it seems like everyone is charging for this feature, what I think is a bit wrong. So I decided to do my own but make it better than anything on offer and share it for free. My little way of saying thank you for all the free great plugins people have made for MyBB. This has every know country and there flag. For an example for the UK it has flags for England, Scotland, Wales, Northern Ireland and United Kingdom. Also the flag plugins people are charging for the images are pretty poor. Here is a couple of examples of the flags in this pack. To install this download the attached flags.zip and extract it somewhere easy to find. Then: 1. Upload the flags folder to root/images so the flag icons are in root/images/flags 2. In admincp create a new Custom Profile Field. (ACP > Configuration > Custom Profile Fields > Add New Profile Field)
3. Edit your Post Bit Template with the instructions below (ACP > Templates & Style > Templates > "Theme in use" > Post Bit Templates > postbit or postbit_classic) Find
Place this bit of code next to it with a space between it (change the X of fidX to your custom profile ID for the country flag i.e fid4 instead of fidX)
You should now be all set. If you don't want to use the Wiki links just remove that part from the PHP/HTML code. Copy from <img to just show the flags without the wiki link. The Wiki link is completely optional and does not effect the showing of the flags. I have no clue how to make plugins for MyBB so if someone wants to turn this into a plugin so people can easily install it please feel free to do so. All I ask for is for you to place a link in the description of the plugin to this thread. Demo: http://forum.pinguyos.com EDIT# To add the flags to user profiles Edit your Member Templates with the instructions below (ACP > Templates & Style > Templates > "Theme in use" > Member Templates > member_profile) Find
Place this bit of code next to it with a space between it (change the X of fidX to your custom profile ID for the country flag i.e fid4 instead of fidX)
To add the flags to memberlist page Edit your Member Templates with the instructions below (ACP > Templates & Style > Templates > "Theme in use" > Member List Templates > memberlist_user) Find
Place this bit of code next to it with a space between it (change the X of fidX to your custom profile ID for the country flag i.e fid4 instead of fidX)
RE: 244 Countries Flags with Wiki Links in Postbit - Murloc - 2011-02-07 Awesome plugin Pinguy. I'm a fan of your distro Keep up the good job. RE: 244 Countries Flags with Wiki Links in Postbit - Lo. - 2011-02-08 Pinguy you have to submit it to the mods site first :p RE: 244 Countries Flags with Wiki Links in Postbit - Sammyed - 2011-02-12 Wow! This could go also @profile page and memberlist page! Hats off Pinguy Edited: I was able to do it in the memberlist page but, I´m having problems at profile page LOL. What would be the variable there?, I tried $memprofile but I´m able to see it myself, but for the rest of the users it shows X´s RE: 244 Countries Flags with Wiki Links in Postbit - FBI - 2011-02-13 nice code, suitable for international forum RE: 244 Countries Flags with Wiki Links in Postbit - pinguy - 2011-02-13 (2011-02-12, 05:55 PM)Sammyed Wrote: Wow! This could go also @profile page and memberlist page! If it is showing the X its because you forgot to remove the X and add the ID number for the fid RE: 244 Countries Flags with Wiki Links in Postbit - Sammyed - 2011-02-13 (2011-02-13, 12:57 AM)pinguy Wrote: If it is showing the X its because you forgot to remove the X and add the ID number for the fid LMAO I wish I did that. But no, what I did @ postbit template was: Quote:<strong><span class="largetext">{$post['profilelink']}</span></strong> <img src="images/flags/{$post['fid10']}.png" ALIGN=ABSMIDDLE></img> Works good. What I did for memberlist page @ memberlist_user template was: Quote:<td class="{$alt_bg}">{$user['profilelink']} <img src="images/flags/{$user['fid10']}.png" ALIGN=ABSMIDDLE></img><br /> Works good Now as for profile page @ member_profile template: Quote:<span class="largetext"><strong>{$formattedname}</strong> <img src="images/flags/{$memprofile['fid10']}.png" ALIGN=ABSMIDDLE></img><br /></span><br /> A red X right after the forum member. , and when I get the properties to that red X image it says: "/images/flags/.png". If the variable, in this case, is not $memprofile .Then what I should try with?. I already tried with $user, $profilefield, and some others LOL with no luck. Thanks for replying Pinguy. Cheers. RE: 244 Countries Flags with Wiki Links in Postbit - Dragonzsoul - 2011-02-14 thank you so much share information news cool nice! RE: 244 Countries Flags with Wiki Links in Postbit - bigoliver - 2011-03-18 Hi, I have this working, well sort of... I set my flag in the control panel and it displays my flag, all good. The problem is that my members that have not set a flag or Undisclosed get a broken image next to them, I have nearly 500 members so can't go through them all. Is there a way to set all users automatically to Undisclosed unless they have selected otherwise. I will have to remove this until it can be fixed. Thanks, Oliver RE: 244 Countries Flags with Wiki Links in Postbit - Alan S. - 2011-03-18 (2011-02-13, 02:32 AM)Sammyed Wrote: If the variable, in this case, is not $memprofile .Then what I should try with?. I already tried with $user, $profilefield, and some others LOL with no luck. {$userfields['fidX']} (2011-03-18, 07:46 PM)bigoliver Wrote: ...set all users automatically to Undisclosed unless they have selected otherwise. Run this in phpMyAdmin, replacing X with the actual custom field ID:
|