Do It Yourself CMS » Blog » DiY-CMS tutorials


Learning the structure of DiY-CMS folders and file - Part 3

  By: admin   tags Date Added: Tuesday 09-11-2010 05:25 am

This is the third post that is directed to the developers more than the end user. In this post I will talk about the files in the “includes” folder in the root DiY-CMS directory. Knowing the task of each file will assist the developer to understand the architecture of DiY-CMS and data flow as well.




Includes folder contains the files responsible for the main tasks to run DiY-CMS and control the different aspect of the CMS.

Here is the list of folders and files:
PHPMailer folder: This folder contains the folders and file of popular mail program PHPMailer. It is the standard program in DiY-CMS to send emails for notifications or other uses.

bbcode.class.php: This file contains the class that handles bbcode format.

blocks.class.php: This file handles the arrangement of blocks (menus) in DiY-CMS view.

date_conversion.class.php: handles date conversion in DiY-CMS. It converts Gregorian date to Hijri (Islamic lunar) date and vice-versa.

email.class.php: This class utilises the functions of PHPMailer and group in one class to ease its use.

files.class.php: This class handles files read and write functions.

form.class.php: This file contains the functions needed to produce a form with different fields, such as creating an input field or textarea.

general.functions.php: This file contains general functions like functions handling page header, page footer, errors or message display.

hooks.functions.php: This file handles hooks management in DiY-CMS. You can use it to place a hook in a certain place in the module or plug-in you develop. Alternatively, you can use it to hook your functions to the built-in hooks in DiY-CMS. (I will explain how hooks work in detail in a future post).

keyword_generator.class.php: This class is used to generate keyword on the fly for posts in DiY-CMS. It increases posts’ friendliness to search-engine.

login.class.php: This file controls users’ authentication in DiY-CMS.

module.class.php: This file is responsible for module management. It checks for module’s status, loads its templates, load its settings and run the module.

mysql.class.php: This file contains the necessary functions that manage database connection, querying, database error handling.

plugins.class.php: This file handles plug-in management. It loads all the active plug-ins, load settings, load permissions and then run plug-ins.

post.functions.php: This file contains post-related functions. They include post sanitisation, preventing sql injections, check required fields and other functions.

protection.php: This file mainly prevents XSS attacks on DiY-CMS.

session.class.php: This class handles sessions.

spam.class.php: This class prevent post spamming in DiY-CMS, by checking IP address and time intervals between two consecutive posts of the same user.

templae.class.php: This class handles theme-related task. It check for the theme selected, load its templates, process their content and then output the page.

upload.class.php: This class handles file uplads in DiY-CMS. It can handle adding or editing multiple files at the same time.

I hope you liked this post, and looking forward to hear your comments and suggestions.


Tags: DiY-CMS-structure More details

Learning the structure of DiY-CMS folders and file - Part 2

  By: admin   tags Date Added: Sunday 31-10-2010 02:25 pm

In last post I explained the task that each file in the root directory handles. In this post, I will keep on explaining the rest of folders in the root directory.



Admin folder: This folder contains the folders and files that are responsible for the administration part of DiY-CMS. It contains four folders and a number of files.

admin_classes folder: contains files essential PHP classes to run the administration area.

admin_lang folder: contains the language file for the UI of the administration panel.

admin_sections folder: contains the folders responsible for the different administration sections (the menus to the left of the administration panel) , such as managing modules, themes .. etc.

admin_skin folder: contains the skin or themes for the administration panel.

conf.php: contains the values required for database connection, folders location, site administration contact details and some other values.

index.php: runs the main view of the DiY-CMS admin panel.

global.php: Global file for DiY-CMS panel area, it must be included in all files in the admin area.
sections.php: Manages sections view and management in the admin panel.


Blocks folder: This folder includes all the blocks (or menus) designed for DiY-CMS.

Html folder: Contains files required the included WYSIWYG editor in DiY-CMS.

Images folder: Includes images that used are used globally across DiY-CMS.

Includes folder: contains the necessary PHP classes to run DiY-CMS such as database connection, themes management, module control and other functionality. (I will explain the tasks that each files handle in a future tutorial).

Install folder: This folder is responsible for running the installation wizard when using DiY-CMS for the first time at your server. If installation is complete the folder name will be changed for security reasons.

Lang folder: Contains the languages files for DiY-CMS interface.

Modules folder: Contains modules folders.

Plugins folder: Contains DiY-CMS plug-ins folders and files.

Themes folder: Contains DiY-CMS themes.

Upload folder: This folder is used for file upload. It should be the only place for file upload. This will make data transfer or upgrade easier for the end-user.

Please let me know if there are any part of this tutorial needs to be further explained.


Tags: DiY-CMS-structure More details

Learning the structure of DiY-CMS folders and file - Part 1

  By: admin   tags Date Added: Wednesday 20-10-2010 06:13 am

When I created DiY-CMS I made number of tutorials explaining how to manage and use DiY-CMS. Those tutorials were tailored the general user of CMS, a user who has no or little programming knowledge. Since that series of tutorials is complete, I will be starting another series; a one that is made specifically for developers who whish to develop DiY-CMS to create modules or plug-ins for DiY-CMS, or modify in any way they wish. In basic, this tutorials series is mainly for developers with sound programming language knowledge.

I will start explaining the general structure of folders and files of DiY-CMS. Then I will write number of tutorials detailing the best way to program a plug-in. I will then explain how to program a module and the best practices that one should use for programming.

In this tutorial I will start with the first part of explain the folders and files structure of DiY-CMS. I will explore the folders one by one and explain the files they contain and their main functions.

Once you download DiY-CMS and extract the zipped file, your will find a structure similar to this:



In the first part I will explain what each file in the root folder does then I will explain the function of the rest of the folders and files in the second part.

.htaccess: contains information about url re-write.

control.php: provides a user interface to manage modules from one place.

filemanager.php: renders image files, particularly avatar, thumb images and can be used to render any kind of image.

global.php: This file is a global file, meaning that it must be included in all files of DiY-CMS. It manages the inclusion of the necessary files to run DiY-CMS, such as files responsible for database connection, theme selection or user authorisation. By default all modules have this file included, so you do not have to include it in any module file you would like to program.

index.php: this the index file of DiY-CMS. It displays the first page of DiY-CMS to the user.
licence.txt : the licence of DiY-CMS. Since DiY-CMS is an open-source program, (GNU GENERAL PUBLIC LICENSE) GPL licence is used.

mod.php: this file manage DiY-CMS modules display. It is responsible for reading the general layout of any opened module.

online.php: retrieve the number of people online and their location in the DiY-CMS.

robots.txt: communicates with search engine crawlers and tells them which part of DiY-CMS to access and not to access.

In the second part of this tutorial I will explore the contents of admin folder.


Tags: file-structure, diy-cms More details

Admin area tutorials: user groups and smile

  By: admin   tags Date Added: Monday 03-05-2010 06:30 pm

Hi
Today I have few updates that I would like to talk about which I have been working on them in the last month or so.

First, website design is completely changed. Thanks to subswiss owner the design is tableless (something that I wanted to do number of times but was not able to due to my little design experience).

Second, I have add two video tutorials to my youtube channel. The first one is about user groups management in the Admin Area of DiY-CMS, and the second explains the usage and the administration of smiles in DiY-CMS admin area.

Here are the tutorials:










Second part:









Tags: diycms, tutorials, video, user-groups, smiles More details

Admin area tutoirals: Themes managemnt

  By: admin   tags Date Added: Wednesday 21-04-2010 06:13 am

Hi
I have added another tutorial in my youtube channel on how to manage themes in DiY-CMS (add, edit, delete, export and import themes).

The tutorials is divided into two parts since you tube does not allow for more than 10 minutes (sometimes 10.30 min) to be uploaded.

First part:










Second part:










I have recoded this video using 1600x1200 resolution which is HD, yet youtube for some reasons shows only 720 as the maximum resolution. In any case it is still High Definition.

Please post any feedback regards these tutorials to help me improve them.


Tags: diycms, tutorials, video, themes More details