MyBB Community Forums

Full Version: RTL Text Support
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I did a plugin for the KDE Community forums to give us RTL text support for hebrew and arabic:
http://websvn.kde.org/trunk/www/sites/fo.../rtl-i18n/

This would show RTL text for the KDE-hebrew team forum: http://forum.kde.org/hebrew-f-87.html

Now I first tried to wrap {$post['message']} in template "postbit" with {$rtl1} and {$rtl2}, and I set their values to <div align="right" dir="rtl"> and </div> respectively when the hook "postbit" is run. But that didn't work, so we directly modified $post['message'] for each post (didnt modify it in the db) -- please refer to the plugin.

Now I noted that $post['message'] changes work only for thread posts and replies, but not for PMs and thread/reply previews. It is clear that $post['message'] is used for all these and adding a random text next to the variable in the templates shows up in the body of the message. Should I be looking for replacing some other variable in case of PMs and previews?
PM uses the hook postbit_pm just add it and let it run the same function as for the regular postbit.
Same for Preview; postbit_prev
And announcements; postbit_announcement

Source ./inc/functions_post.php
		case 1: // Message preview
			$plugins->run_hooks_by_ref("postbit_prev", $post);
			break;
		case 2: // Private message
			$plugins->run_hooks_by_ref("postbit_pm", $post);
			break;
		case 3: // Announcement
			$plugins->run_hooks_by_ref("postbit_announcement", $post);
			break;
		default: // Regular post
			$plugins->run_hooks_by_ref("postbit", $post);
...
And so it works Big Grin

Kudos!

Regards
Sayak Banerjee