SocialEngine4 is based on the Zend Framework 1.12, and is built in an MVC (Model-View-Controller) structure. It is also built with modularity in mind.
This directory contains the majority of SocialEngine files.
See the section below on Languages
Third party PHP libraries are typically contained in here. For example, Zend Framework and CSS Scaffold both live in this directory, as does our extensions to Zend Framework (called Engine).
See the section below on Plugins
These files contain configurations that typically will not be modified after your initial installation. Things like your database username/password, cache settings, mail settings, etc are stored in here.
See the section below on Themes
Various tools that we have used during development are contained in this directory. You can mostly ignore this hodge-podge of files.
User-uploaded content is always contained in here. This directory should be both web-accessible and writable by the web server (chmod 777 recursively).
Various temporary files, such as cache files, logs, session files, etc are stored in this directory. It should not be web-accessible, but must be writable by the web server (chmod 777 recursively). We provide an ".htaccess" file to block access to this directory from the web browser, but if you are using a web server other than Apache, we recommend you configure the web server accordingly to prevent view access.
Most of SocialEngine's functionality resides here. Each module contains within it the MVC structure, where the "Model", "views", and "controllers" directories correspond to the MVC paths. Please see skeleton module "HelloWorld" for more information on this.
Each language gets its own two-letter (or 5-character with localization support) directory in this sub-directory. The language files are in multiple CSV files, though they are concatenated into one large CSV file (in no particular order, except that "custom.csv" is the last). One important point to keep in mind is that duplicate keys override previously defined keys. So, for example, if you have a key "Turtles are fast!" in both core.csv and custom.csv, since custom.csv is loaded last, the value set to "Turtles run fast!" in custom.csv will be the one used.
The CSV files have several requirements:
Untranslated variables can be contained within a translation key and translations. Variable replacement is done using the PHP function
sprintf, and so the same rules apply. When only one variable is being injected into a translation, typically "%s" is the placeholder for that variable. If multiple variables are being injected, you can use:
"%1$s", "%2$s", "%3$s"
etc to put the variables in their proper positions for your translation.
If your translation has double-quotes in it, you must use two double-quotes. So as an example, the sentence
He said "wow". would appear in a CSV files as:
He said ""wow"".
We utilize a framework called
CSS Scaffold which makes editing your community's theme a simple process. Each theme is stored in its own directory within /applications/themes/. A default theme is automatically loaded when you first install SocialEngine. Each theme contains two files: constants.css and theme.css.
At the top of constants.css, you'll find a series of global CSS settings (called "constants"). You can edit these to adjust the colors, fonts, and other styles throughout your entire community.
The other file, theme.css, contains more specific styles that are used throughout your community. Many of these styles inherit values from constants.css. If you want to override any of the default styles on your community, you can edit them here. If they aren't present in theme.css (and are being loaded from outside the theme itself), you can override them by adding new styles to the bottom of theme.css.
While the following are not necessary for modifying SocialEngine PHP, we recommend the following tools for your development environment.