I need a plugin to show every user on chatbox and online_extended near their name the country flag.
Example of Coutnry flag in online_extended -> www(dot)xtreme-jumps(dot)eu Example of Country Flags in online_extended and chatbox, too -> kz(dot)extreme(dot)net
This can be done by editing the template of the chatbox and online_extended menu (both may require actual code hacking) and including the user's location (by using I mean converting the country to it's respective flag).
This would require user's to fill in this information, which can be done by making the location field mandatory.
I may have time to do some research tomorrow evening. Please don't wait for me to give you the answers you need though as I cannot give you a set in stone time when I'll have the answers.
What you're basically going to want to do is this:
Find a location that has all the country flags you're after (Google famfamfam, there's excellent flag images there that will do perfectly, imo). Upload those to e107_files/images/flags directory (create that dir if it doesn't exist).
Now you're going to want open up the online_extended plugin (online_extended_menu.php) and locate where the user's username is displayed (I believe the variable is $oname, use your texteditors find function to locate all occurrences of $oname).
Now the real tricky part comes, IIRC the {EXTENDED} shortcode works in plugins, so getting the user's location is going to be the easy part. The hard part is making sure the value of their location matches the images flag name (eg: I'm from the USA, the image of the USA flag would need to be named usa.png, otherwise it won't display).
Moving along, let's assume the names all match up. You're going to want to define the flag of the users location and then place (let's assume you've named the variable $oflag $oflag before each $oname.
The chatbox can be done via your theme's theme.php file in a similar manner, except you won't need to define the flag as a variable, you can do something like:
That is probably confusing as hell as I pretty much just rattled that off as I thought about it, but it's a start if you want to attempt to tackle it yourself. On the plus side, if you start the process yourself you can always come here and post any errors/problems you're having and people will generally help you solve them.
I looked up the flags from famfamfam. And it appears the filenames follow the ISO 3166-1 alpha-2 country codes. Which means 90% of them are all 2 letter filenames (eg: us.png).
Also, as seen on this webpage, my location is Michigan (which is a state, not a country), so my above suggestion probably isn't going to fully work. Your best bet is to create an extended field that is required that makes the user select their two letter country code.
I may be able to do something with Chatbox II, but not right away. As septor suggested, you would need to create a 'Country' extended user field. When I write it, I can look for that extended user field, have it match the flag, or if it doesn't find the right one, use a default 'e107 flag'.
If I do it for chatbox II, it would be easy to hack the chatbox and use the same code.
I've been thinking this over and I've come to the conclusion that it wouldn't be hard to do for either core plugin, but it's going to require a lot of preparation for it to work flawlessly.
It may not be a terrible idea to throw this idea on the feature request page, as it probably wouldn't be a bad core addition and it wouldn't be terribly hard to implement (as said above).
i try with online extended menu to put this code who septor tell but nothing happen.
Because you obviously didn't read everything I have posted. I said that is how you would go about making it work, I did not say it would work flawlessly. In another post I said that due to how the location information is handled (it's open to anything, I could change my location to "Melmac", for example) it won't work with those images (or at all). You're going to have to create an extended field that utilizes the format the images are named in (read my post with the link to the flags for more info).
You have 3 possible choices:
1) Use the plugin mentioned above. 2) Learn some PHP and do the work yourself, taking what is written in this thread as a guideline. 3) Wait for someone to do it for you.