Портал Vveb.ws / Бесплатная CMS PHP-Fusion 7 Bogatyr / Creating your php-pages and plug-ins for PHP Fusion 7 Bogatyr / Religion of PHP-Fusion 7 Bogatyr
- use in PHP-Fusion OOP (object-oriented programming).
PHP-Fusion is based on simple functions for quickly learning PHP beginners. And not for eternal torment.
- use classes in PHP-Fusion.
We have enough different names for the functions. We just do not include those functions that we do not need.
integrated scripts, ready-made function classes, including those with OOP, for example:
- include at least php files
If any functions are not required, they do not need to be included. To make the site work faster.
- reduction of queries to the database.
In standard PHP-Fusion many database queries. I try to reduce them. This can be done in two ways:
1) Request several rows of the same type from the database at once, and then enter the data into an array. And display them on the page from a two-dimensional array.
2) Write the settings and the most frequently requested pages (categories) as a two-dimensional array into a php file. So that when a user views a site, data is taken from a file, and not from a database. And when editing pages, the cache was updated.
For writing the most frequently requested pages (categories), the CMS cache and plugins are created, and there is a special page for editing and writing plugins settings to the file in the admin panel.
- render frequently used code in separate files with functions.
And make it so that the same functions could be used by other content pages. For example: comments, ratings and other inclusions.
- use of variables and difines with clear names
similar to those already used in PHP-Fusion.
- correctly write settings in CSS
If the plugin generates a lot of CSS code, it is better to write the PHP settings in a separate CSS file.
And if a little (one or more lines), then just need to add css to the <head> function add_to_head().