EasyDoesIt -- An easy publication system based on PHP ----------------------------------------------------- What is EasyDoesIt? ------------------- EasyDoesIt is a micro web site framework using PHP. It requieres no database in order to work, since it uses plain text files instead. It has been conceived with maximum simplicity in mind. The aim of this software is to provide developers of simple web sites with an organizational structure and basic files so that they have no need to re-invent the wheel with every new web site. A developer used to EasyDoesIt knows where to find every element of the web site at first sight, so the maintenance of the web site benefits from normalization. EasyDoesIt provides the developer with: - A simple parsing engine for all pages. - A multi-template system. - A uniform way for naming all pages in a web site. - A set of common PHP variables which can be accessed for convenience at any point of the page or template code. - A basic customization for every page, based on proprietary tags, including page title, page keywords, page description and page alternative template. - A structure of folders in which to organize web pages, images, templates and a single configuration file. - A way to include custom variables and functions. - A simple form processing script. EasyDoesIt is intended for developers willing to use the following technologies: - HTML - CSS - Javascript/Ajax - PHP EasyDoesIt is known to nicely coexist with the following services/technologies: - Flash - Flickr - Google AdSense - Google Analytics - Google Maps - Paypal - Piwik - Simplepie - Slideshare - Youtube Besides, it should work just fine with any other service based on embedding HTML or Javascript code in your pages, like Twitter or Facebook widgets. What EasyDoesIt is not ---------------------- - It is not a full CMS (Content Managemente System). You can not modify the content or aspect of your web site on-line. - It is not a blog software. - It is not a software designed to create big web sites, with hundreds of pages. - It is not a way to publish content via RSS. - It is not a HTML editor. - It is not a file manager. License ------- EasyDoesIt is released under the GPL version 3 public license. See LICENSE.txt file to know more about the terms of use. Disclaimer ---------- EasyDoesIt is open software, free, and distributed as-is. No responsibility is taken by the developers of the software for its use or performance. By installing and using it you are acting under your own reposibility and accepting the terms of use. The developers of EasyDoesIt do not provide support for the software. Installation ------------ NOTE: From here on, we will use the notation '~' to indicate the main folder of your EasyDoesIt installation. Unzip the distribution file to your local disk. Rename the following folder: - '~/__img to' '~/img' - '~/__local' to '~/local' - '~/__pages' to '~/pages' - '~/__templates' to '~/templates' Edit '~/local/config.inc' (and optionaly '~/local/local.inc') to customize your web site. Both are regular PHP files to be included during the rendering of every web page. Upload all the files and folders to your hosting account. You are done. Configuration ------------- Use '~/includes/config.inc' to configure the parameters of your website. It is a regular PHP file. Use '~/includes/local.inc' to add or overwrite any variable or add PHP code before the loading of the page. The reason after 'local.inc' is to keep 'config.inc' as clean as posible so that the maintenance of your website is be easier. It is also a regular PHP file. Using templates --------------- Any EasyDoesIt template is composed by two files, ending by '_pre.inc' and '_post.inc' which can be located at the '~/templates' folder. The default template has no name, so the two files of the default template are preciselly '_pre.inc' and '_post.inc'. The rationale of the anatomy of an EasyDoesIt template is that there is always a main body of content which is surrounded by additional elements of the page. The content of the main body will be included in a page file (which will be searched at the 'pages' folder), while every code which has to be included before the main body can be found at '_pre.inc' and every code after the main body at '_post.inc'. That is: the whole page is composed by: '_pre.inc' + 'page.inc' + '_post.inc'. Other 'include' files can contain the header, footer, navigation menu, sidebars, statistics code, etc., depending on the interest of the developer. Using an alternate template --------------------------- You can also use alternate templates for single pages. If a page includes inside its text the tag '', then EasyDoesIt will look for '~/templates/template_name_pre.inc' and '~/templates/template_name_post.inc' while composing the page, instead of the default '~/templates/_pre.inc' and '~/templates/_post.inc'. For instance, if you plan to have a different template for your home page, you can include '' inside '~/pages/home.inc' and EasyDoesIt will look for '~/templates/home_pre.inc' + '~/pages/home.inc' + '~/templates/home_post.inc' for the output. Custom title and metatags ------------------------- The following custom tags are searched for and understood by EasyDoesIt in every parsed page. This allows you to overwrite the default page title, page description and page keywords, which should have been defined at the 'config.inc' file. - - - If you omit these tags in a page, the page, if the corresponding file is found, is still rendered using default values provided at 'config.inc'. Although these tags could be at any point of the page, we recommend to keep them at the top, so that metainformation is more easily readable by the developer. Predefined variables -------------------- EasyDoesIt automatically generates the following PHP variables: $_site_name Website name $_site_motto Website motto $_site_title Default page title, according to config.inc / Custom page title $_site_description Website Description field / Custom page Description field (meta) $_site_keywords Website Keyword field / Custom page Keyword field (meta) $_site_timezone Website Time Zone $_software_name Software name $_software_version Software version $_admin_email Webmaster's email address $_date Day, month and year, according to format at config.inc $_time Hour, minute, second, according to format at config.inc $_date_time Composed date and time, according to format at config.inc $_month Current month, as a string. Ex.: 'January' $_day Current day, as a string. Ex.: 'Monday' $_this_year Current year $_epoch Current Unix epoch $_referer Referring URL $_host Name of the host requested at the URL $_remote_address IP address of the client $_user_agent Browser identification string $_query_string GET variables of the current request $_template Name of the template used to render the page You can use those variables at any point in your code (template, page content, text block) simply by using a common PHP call: , without the need to include any more code. There is an exception to the previous rule: you can not use the variables inside the custom metatags. Contents -------- Textual contents are usually located at the '~/pages' folder. They can be pages, but also text blocks --areas of text used by other pages or by templates, like text boxes in a sidebar--. We suggest as a best practice to name text block files with a preceding '_' character to make their location easy. If you keep your pages and text blocks in the same folder, you will also make your site maintenace easier, not having to change folders to update different types of contents. It is also posible to include PHP and Javascript code on every page or text block. We recommend to keep images at the '~/img' folder. You can also create as many folders as needed, always keeping the folder structure specified at the distribution. For example you can create a '~/pdf' folder if you need to include PDF files linked for download. Accessing the contents ---------------------- Every page of the site is rendered after looking for the content of the URL variable 'p'. The rendering engine (namely the 'index.php' script) looks for a file with the name 'p.inc' inside the '~/pages' folder. For example, if you call http://website.com/?p=about, EasyDoesIt looks for file '~/pages/about.inc'. If you keep the '.htaccess' provided with the distribution files, you will be also able to access the content without parameters, that is, you can access the same content both as 'http://website.com/about' and 'http://website.com/?p=about'. Failling to provide the name of a page at the URL (the 'p' variable) will result on EasyDoesIt rendering the default page (i.e. home page) which is specified at '~/includes/config.inc'. This will happen every time you type the plain domain name as your URL. You can also create folders inside '~/pages' where you can keep more pages, à la category folders, and call those contents also using the 'p' URL variable, using a comma (',') as separator. Example: calling http://website.com/?p=legal,web-site-use will cause EasyDoesIt to look for file '~/pages/legal/web-site-use.inc' for rendering the page. If EasyDoesIt is unable to find the page you requested, it will render the content of '~/pages/404.inc', which is also provided with the distribution for convenience. You can modify this file as it suits you better. Updating contents ----------------- If you keep all your images under '~/img' and all your pages and text blocks under '~/pages', you will find the updating of your contents much more convenient. To add new pages you just need to create a text file containing HTML, Javascript, PHP at the '~/pages' folder and upload it to your web server. Then you only need to create links to your new page where appropriate and the new page will be automatically accessible for your visitor using the URL schema explained above. Let's say the new page is named 'Products'. You create a file '~/pages/products.inc', containing:

Products

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

[...] After uploading this file to your web server you can access it by typing: http://website.com/?p=products Remember to upload all needed images and other files (for example if you are linking to PDF files, you can find useful to create a '~/pdf' folder) so that you don't get broken links. Searching --------- Being a tool for developing simple web sites, EasyDoesIt does not provide an internal search engine. You can overcome this limitation by including a search form which will use Google search, limiting the results to your web site:
Please refer to Google API to customize the results of your search form. Other search engines can provide similar functionality. Please refer to their help pages if you want to search your site with a different one. Forms ----- The distribution includes a form processing script, 'send.php', which provides with the functionality of sending the results of web forms to the administrative email address configured at '~/config.inc'. You can check '~/pages/contact.inc' to see an example of email form. Please notice that you may want to include the following hidden fields in order to make the form processor to work optimally: The variable 'referer' passes the value of the preceeding page from which the user has come to the contact page. This can be useful to determine which of your pages are producing more leads. The variable 'xsubject' contains the value of the Subject line of the message that will be sent to the administrative email address. The variable 'xedit' containst the value of the page (i.e., the 'p' variable) of the exit page, which will be rendered after the sending of the form. Any other form variables will be added to the message sent to the administrative email address with their own names. The form processor also provides with the functionality of basic filtering some regular spam and prevents the processor to be used from outside your web site. The message resulting from the form submission will also carry information about the IP of the sender, referer page, user agent and a link to a publicly available IP information service. Creating a new template ----------------------- As stated before, an EasyDoesIt web page consists of a pre-template file, a content file and a post-template file. If you are developing your own template, the easiest way to go is creating the web page as a regular HTML file and, after you are happy with the result, splitting the HTML file into two separate '.inc' files, '_pre.inc' and '_post.inc' containing the code before and after the main body of content, and copy them to your '~/templates' folder. This will give you the default template for your site. As easy as that. Consider browsing the sample templates at '~/templates' to see how they work. If you want to create an alternate template for a particular page (for example the home page), you have to do exactly the same procedure, but you have to name the template files with a different name, which you will use later to declare the template of this regular page: '~/templates/home_pre.inc' and '~/templates/home_post.inc'. After that you declare the template inside the code of the page ('~/pages/home.inc') as: . Since the metainformation, including the CSS file to be used to render the page, is included inside your template (the '_pre' part), every one of them can use a different CSS file. Upgrading EasyDoesIt -------------------- EasyDoesIt does not provide an automatic upgrading procedure, but upgrading is quite easy and straightforward. First things first: backup all your current data. Unzip the new version of EasyDoesIt in your local hard drive. Unzipping on top of your current intallation will not hurt your customization since folder containing customization elements (img, local, pages, templates) are originally renamed with a '__' prefix which avoids overwritting. By unzipping the distribution files you will overwrite: - All the files included at the root folder of your installation, namely index.php and send.php at the moment. - All files inside the '~/includes' folder. Besides, you need to check '~/local/config.inc' to check if the configuration file has changed in the new version. If so, adapt the contents of the file to match your installation and customize as needed. Upload you new version to your hosting account and check that the site is working fine. Bob's your uncle! Feature requests ---------------- This is open source software, so you can fork it according to license terms and make it progress as you need. The development team is not accepting feature requests at this time since we can not commit to maintain regular development cycles. Sorry for that. Despite the above said, we will release new versions of the software as the need to improve it arises. If you want to share with us some of your developments or you have forked the software, please let us know. Perhaps we can include some of your improvements too (fully credited, of course)! Credits ------- EasyDoesIt is an open source project by Tarsis.net SL, a Spanish Internet consultancy firm. Visit us at http://www.tarsis.eu (English) or http://www.tarsis.net (Spanish). Find us ------- Web: http://www.tarsis.eu/easydoesit/ Email: lazybadger@tarsis.eu Twitter: @lazybadgerteam