Graphical Text MOD - FINAL - Version 2.0
Version 1.2 BETA is now released
Sorry that I haven't released a new version earlier. I have now implemented cacheing into the MOD. I would be glad if some people could go an test this MOD heavily to see if the method improves the MOD.
Here is how it works:
The MOD looks if there is already a cached image file available. If not, it generates the picture and creates a new cache file from it (its name is concluded by the parameters that are comitted). If there is a file (with the same name) it will read and put out the stored file of the server.
The cached files are all stored in the "content/images" folder.
Please consider - this is only a beta version. I don't know if it works and this will probably put many many files in your "content/images" folder.
I appreciate every hint of yours.
And now I will fall into my bed because I have to return back to work in three hours. (Yes, I am the master of moaning )
Sorry that I haven't released a new version earlier. I have now implemented cacheing into the MOD. I would be glad if some people could go an test this MOD heavily to see if the method improves the MOD.
Here is how it works:
The MOD looks if there is already a cached image file available. If not, it generates the picture and creates a new cache file from it (its name is concluded by the parameters that are comitted). If there is a file (with the same name) it will read and put out the stored file of the server.
The cached files are all stored in the "content/images" folder.
Please consider - this is only a beta version. I don't know if it works and this will probably put many many files in your "content/images" folder.
I appreciate every hint of yours.
And now I will fall into my bed because I have to return back to work in three hours. (Yes, I am the master of moaning )
Sounds great.
Do you think this might be an adaquate workaround for the NS 4.75 bug. My initial thoughts would be:
Create the initial image in IE and from there on out, even for Netscape clients, the image exists on the server. Not sure how you implemented 1.2. Just a preliminary question.
And do get some rest.........
Cheers,
jsw
Do you think this might be an adaquate workaround for the NS 4.75 bug. My initial thoughts would be:
Create the initial image in IE and from there on out, even for Netscape clients, the image exists on the server. Not sure how you implemented 1.2. Just a preliminary question.
And do get some rest.........
Cheers,
jsw
Can someone explain to me what the idea of cached images is..? I don´t understand.... What is it for? why is it great? and when is it powerfull to use?Jérôme wrote: The MOD looks if there is already a cached image file available. If not, it generates the picture and creates a new cache file from it (its name is concluded by the parameters that are comitted). If there is a file (with the same name) it will read and put out the stored file of the server.
The cached files are all stored in the "content/images" folder.
http://www.studmed.dk Portal for doctors and medical students in Denmark
Hi frold,
the MOD renders the graphic each time your page is viewed. If you have heavy load on you site, it could be that your server goes down and is only rendering images instead of serving pages ...
To prevent this, each time the MOD is called via the GT tag, the rendered graphic is stored in the "cache" and the next time the page is loaded, the MOD looks into the cache, if the reqired graphic is already rendered. If so, it only loads the graphic instead of rendering it again. This is much quicker and produces less server load.
I hope I explained it correctly
cu
Achim
the MOD renders the graphic each time your page is viewed. If you have heavy load on you site, it could be that your server goes down and is only rendering images instead of serving pages ...
To prevent this, each time the MOD is called via the GT tag, the rendered graphic is stored in the "cache" and the next time the page is loaded, the MOD looks into the cache, if the reqired graphic is already rendered. If so, it only loads the graphic instead of rendering it again. This is much quicker and produces less server load.
I hope I explained it correctly
cu
Achim
ParaDroid
knquadrat edv + marketing
http://www.knquadrat.de
phpWCMS Dokumentation | Deutsch | English
knquadrat edv + marketing
http://www.knquadrat.de
phpWCMS Dokumentation | Deutsch | English
Before V1.2 Beta it was handled this way:
For every GT-Replacement Tag found in your articles, the MOD generated a new image dynamically. That means: the server must take the font, must create an image, must calculate height and width of the image, place the text in the middle of the picture and so on. And this for every replacement tag and for every user surfing your page. So, think of a quite highly frequented page which 100 pageviews per minute and 20 GT-Replacement Tags in it. That means that the server has to generate 2000 images a minute. This is a very heavy load for a processor and it gets even worse when you are on a shared host with many other website owners.
The principe of the cacheing is: look if the image file is there - if not, generate it. Otherwise: pass through the present image. This still generates a bit traffic load but not as much as the other method.
Version 1.3 will be even more enhanced (that's an idea that came to me while writing this article), so that the script even does not need to be called, and that will enable your browser to cache the image wich will decrease the load even more!
Because: at the moment it is still the script fontizer.php which has to be called with all parameters. The next step will be to check if there is a cached file before the script is called. That means that your browser will most likely never see the script called, but only the cached files.
@jsw_nz: And this will finally solve the NS 4.75 Bug - unless it is not a NS 4.x user that calls your page for the first time.
For every GT-Replacement Tag found in your articles, the MOD generated a new image dynamically. That means: the server must take the font, must create an image, must calculate height and width of the image, place the text in the middle of the picture and so on. And this for every replacement tag and for every user surfing your page. So, think of a quite highly frequented page which 100 pageviews per minute and 20 GT-Replacement Tags in it. That means that the server has to generate 2000 images a minute. This is a very heavy load for a processor and it gets even worse when you are on a shared host with many other website owners.
The principe of the cacheing is: look if the image file is there - if not, generate it. Otherwise: pass through the present image. This still generates a bit traffic load but not as much as the other method.
Version 1.3 will be even more enhanced (that's an idea that came to me while writing this article), so that the script even does not need to be called, and that will enable your browser to cache the image wich will decrease the load even more!
Because: at the moment it is still the script fontizer.php which has to be called with all parameters. The next step will be to check if there is a cached file before the script is called. That means that your browser will most likely never see the script called, but only the cached files.
@jsw_nz: And this will finally solve the NS 4.75 Bug - unless it is not a NS 4.x user that calls your page for the first time.
Thanks to you 2 (Jérôme and Paradroid)...Now I understand...
http://www.studmed.dk Portal for doctors and medical students in Denmark
Version 1.3 released
This is an important release and it is recommended for everybody to upgrade. Please follow the instructions in the upgrade script (it is not much to do).
For security reasons: overwrite the complete mod-folder with the files in the ZIP-package and then delete the files "fontizer.php" (and evtl. "font.php") from the folder "inc_module/mod_graphical_text/inc_fonts/").
Important notices
The replacement tags have slightly changed
- Backgroundcolor is not optional anymore, but mandatory, due to the fact that I changed the image output to JPEG which is more compatible to browsers. Anyway, the transparency was awful!
- You will have to create a folder "gt" in your "content/images" folder and chmod it to 777. This is the folder in which your cached images will be stored. If you want to clear the cache, delete the images within this folder.
- The file fontizer.php has been removed. This has several reasons:
1. The function is now safe against possible exploits or people who want to use your script to create dynamic pictures on their own webspace. It is not possible to call this function from the exterior.
2. The surfer will never see that there is a script in action. I have done it a way that the surfer will always see the cached images.
3. According to (2) no browser should have problems with this MOD anymore, because the browser simply does not know that there is a MOD.
Harrrr, I am myself excited about this improvements!!
Try it out and give me feedback if your server load has decreased. It should have done so massively!!
Have fun!
- Jérôme
This is an important release and it is recommended for everybody to upgrade. Please follow the instructions in the upgrade script (it is not much to do).
For security reasons: overwrite the complete mod-folder with the files in the ZIP-package and then delete the files "fontizer.php" (and evtl. "font.php") from the folder "inc_module/mod_graphical_text/inc_fonts/").
Important notices
The replacement tags have slightly changed
- Backgroundcolor is not optional anymore, but mandatory, due to the fact that I changed the image output to JPEG which is more compatible to browsers. Anyway, the transparency was awful!
- You will have to create a folder "gt" in your "content/images" folder and chmod it to 777. This is the folder in which your cached images will be stored. If you want to clear the cache, delete the images within this folder.
- The file fontizer.php has been removed. This has several reasons:
1. The function is now safe against possible exploits or people who want to use your script to create dynamic pictures on their own webspace. It is not possible to call this function from the exterior.
2. The surfer will never see that there is a script in action. I have done it a way that the surfer will always see the cached images.
3. According to (2) no browser should have problems with this MOD anymore, because the browser simply does not know that there is a MOD.
Harrrr, I am myself excited about this improvements!!
Try it out and give me feedback if your server load has decreased. It should have done so massively!!
Have fun!
- Jérôme
salut Jérôme,
what have i made or didn't?
I got this after logon into backend:
what have i made or didn't?
I got this after logon into backend:
Hmm, any hints?Parse error: parse error, unexpected T_CASE in /www/htdocs/akadoku/phpwcms.php on line 72
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3