MyBB Community Forums
Display different message to different users? - 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 Requests (https://community.mybb.com/forum-65.html)
+---- Thread: Display different message to different users? (/thread-52261.html)



Display different message to different users? - jbroger - 2009-07-02

My forum has both, english and french speaking members. I have created a front page and at the Welcome Block I want to display a message in french to the french users but if the user is an english speaking one, then I want the message to be in english. I want that so it can auto detect the users emails and display the message based on it. All my french members use a .fr email, mostly wanadoo. Can someone know if this can be done?


RE: Display different message to different users? - Chase - 2009-07-02

You could just make a duplicate of your theme that all the french users would use, and it would have the message in french. And the defualt theme would have it in English for the other users.


RE: Display different message to different users? - jbroger - 2009-07-04

I am not sure how to do that. Can you tell me please?


RE: Display different message to different users? - Matt - 2009-07-04

Should be quite simple to do this as a plugin, I'll move this to requests for you Smile


RE: Display different message to different users? - jbroger - 2009-07-04

(2009-07-04, 09:04 PM)MattRogowski Wrote: Should be quite simple to do this as a plugin, I'll move this to requests for you Smile

Can you do it please? This is very important for me. Thank you Smile


RE: Display different message to different users? - jbroger - 2009-07-07

No one knows to do this?


RE: Display different message to different users? - babjusi - 2009-07-07

Atm I don''t have much time to look at it but tomorrow I will see what I can do.
Ok broger, try this. I just tested it and it works fine.

$frenchemails = "[email protected]";
if ($frenchemails = substr($frenchemails, -3) == ".fr"{
echo "<p>Bonur bla bla french message </p>";
}else{
echo "<p>Welcome bla bla english message</p>";
}

What I did here, is that I passed the substr() function a test negative number as its second starting index argument. So it will count from the end rather than the begining of the string. I.e. It will show the french message to all your members that have submitted an email address ending in .fr and another message to all your other members who have submitted a different email address.

Atm my free time is very limited. I don''t have time to make it in a plugin. If you can''t implement it yourself, then ask someone else to do it for you. Note that you might have to pay them cos not everyone has lots of free time.


RE: Display different message to different users? - jbroger - 2009-07-08

Omg, I love you in a so non gay way. You are the man. Can you do it for me please? I would rather pay you than someone else. I will send you an email too with some other things that I want done for my forum.