SiteBuilder 2 - Etusivu - Havas Worldwide Helsinki

Download Report

Transcript SiteBuilder 2 - Etusivu - Havas Worldwide Helsinki

SiteBuilder 2
Introduction
www.profides.fi
Used Technology
• Originally developed with
• PHP 4
• MySQL
• Apache
• Basically the only main requirement with current
version is PHP 4 or PHP 5
• Tested only with MySQL, but supports also
Oracle 8, Interbase / FireBird, PostgreSQL,
SQLite and MS-SQL
• Some SQL commands might be needed to be
changed little
Julkinen
20.7.2015
2
Main Features
• Database abstraction layer with ezSQL
• Proprietary template engine
• WYSIWYG content editor
• HTMLArea
• User administration
• Module support
• Language support
Julkinen
20.7.2015
3
Further Development
• New features can be added by simple module
support
• Modules have to be programmed in PHP
• Existing modules:
•
•
•
•
•
•
Julkinen
Product catalog & shopping cart
Newsletter
Gallery
Seminar registration
Calendar
Resource reservation
20.7.2015
4
File Hierarchy
/documents/
Files manageable through administrative interface. For example PDFdocuments, content images, other downloadable, but changing material
/images/
Static images used in the html templates.
/html/
Html templates used in the template engine.
/htmlarea/
HtmlArea files.
/php/
All function libraries, modules and other php files needed by index.php
/styles/
Needed stylesheets.
/sql/
Required sql to create needed tables. Contains default site, which we’ll go
through.
Julkinen
20.7.2015
5
Template Naming Scheme
• Templates under /html/ folder
• Admin interface templates start with admin_
(admin_filename.html)
• Language specific templates under
• /html/en/
• /html/se/ folders
• Public files starting with public_
(public_filename.html). This is new naming
scheme and not used in most of older sites.
Julkinen
20.7.2015
6
Template structure
• Templates totally normal html files
• Paths relative to root directory of site (if you want
to test functionality or edit in DreamWeaver with
visible images move images, styles and
javascript folders temporiralily under /html/
folder)
• Dynamic parts defined by custom object tags
• $output->title
• $output->content
• etc.
Julkinen
20.7.2015
7
Template Wrapping
• More complex dynamic parts can be achieved
by wrapping templates
• For example the default three level navigation is
achieved with wrapping
• Wrapping can be used also for other purposes
• Display items in dynamic module lists
• Display customized parts in the layout
Julkinen
20.7.2015
8
Template Wrapping Example
• Main layout template (public_template.html)
• 1st level navigation item (public_1st_navi.html)
• 1st level navigation item (public_1st_navi.html)
• 2nd level navigation item (public_2nd_navi.html)
• 3rd level navigation item (public_3rd_navi.html)
• 2nd level navigation item (public_2nd_navi.html)
• 1st level navigation item (public_1st_navi.html)
• Basically each navigation level has their own
Template Wrapper files
Julkinen
20.7.2015
9
Database Structure
• Database structure is very simple and in problem
situations easily fixed with PhpMyAdmin
• Four main tables
• Preview – contains unpublished preview versions of the content
pages
• Pages – contains public versions of the content pages
• Adminusers – contains administrative user’s data
• Adminrights – contains rights for individual admin users on any
single page
• Modules might use extra tables, but tables mentioned
above are the only main tables of the SiteBuilder
• Database backups should be automatized! Once in day
preferred!
Julkinen
20.7.2015
10
Configuration
• Configuration is completely made in the
config.php located in the php directory
•
•
•
•
•
•
•
Julkinen
Database connectivity
Site root URL
Document, template and styles folder paths
Allowed, uploadable document types
Feedback email parameters
Any module specific parameters
Required includes in correct order
20.7.2015
11
SiteBuilder Core Files
• The core of each SiteBuilder installation is it’s
index.php file in the root directory
• Printing functionality is achieved by print.php file,
which is a cleaned version of index.php and
using very simple template without navigation
• Administrative interface is launched from
cadmin.php
Julkinen
20.7.2015
12
Site Creation Process with SiteBuilder 2
• Create database
• Create needed tables from example SQLs in
/sql/ folder
• Edit configuration file
• Copy files to server
• Change directory rights
• Launch site / administrative tool
• Start modifying template and content!
Julkinen
20.7.2015
13
Database Creation
• Preferrably use PhpMyAdmin to create database
• Run SQL that creates needed table structures
and inserts administrative superuser in the users
table
• Preferably use the default site as it provides you
with skeleton for the new site
• Most of the pages don’t need to be created from
scratch, just modify existing ones
Julkinen
20.7.2015
14
Edit Configuration File
• Database connection
• $DBNAME = ''; /* Database name */
• $DBHOST = 'localhost'; /* MySQL Server host name
*/
• $DBUSER = ''; /* Database username */
• $DBPASSWD = ''; /* Database password */
• Site root URL
• $SITE_ROOT =
'http://'.$_SERVER['SERVER_NAME'].'/sitebuilder2';
/* Siteroot */
Julkinen
20.7.2015
15
Copy Files and Verify Directory Rights
• Copy whole SiteBuilder 2 folder into the
webserver
• Verify that $SITE_ROOT is set accordingly
• Write rights needed for /documents/ directory so
that file uploads through administrative interface
are possible
Julkinen
20.7.2015
16
Test Installation
• Go to according URL on your webserver and
see if the installation is working
• If everything is ok, launch administrative
interface using default admin account (admin /
nimda)
• Feel free to start modifying content and
template!
Julkinen
20.7.2015
17