Hi all!
My name is Victor and I want to share with you my first plugin for Question2Answer.
First of all, please note that I'm new here and I have no any experience with Question2Answer. This is why, is not excluded that my opinion may be faulty or contains incorrect thoughts.
So, as you know, to display avatars, Q2A process them using PHP and MySQL. Thus, when a user open a page where are listed some avatars, for every avatar, Q2A will send a SQL query to database and will use the PHP GD to draw the image. And, it doesn’t matter — whether you use QA_BLOBS_DIRECTORY or not.
Personally, I don’t like this behavior because the filesystem handles static files much better and using it, the speed and performance would be much higher. This is why I developed a plugin which fix image URLs by pointing directly to the file on the server, rather than to a PHP script. For example, instead of generating image by:
/?qa=image&qa_blobid=9183935690084324968&qa_size=50
Will be loaded directly from:
/uploads_path/918/9183935690084324968.jpeg
To install this plugin:
-
Download and extract filesystem-avatar.zip to the ./qa-plugin/ directory
-
In ./qa-config.php set up QA_BLOBS_DIRECTORY constant
For more information about QA_BLOBS_DIRECTORY, see http://www.question2answer.org/qa/24390. If you have any suggestions or questions — ask them. Also, I’m waiting for more experienced developers who can tell me if I correctly developed the plugin and if my thoughts are correct.