PSM: Personal Site Manager
...a lightweight web content manager...
Support This Project  SourceForge.net Project page  CVS Source Archive
Home  |  Demo  |  Tutorial  |  Download  |  Contact: denis_dev@users.sourceforge.net

 Tutorial
1) Overview:
PSM are totally contained into one directory that you must to copy into your htdocs directory.
this is the actual tree:

          +---psm/              :directory of psm module
              +---datastore/    :contains the content and file upload data
                 +---contents/ :contains the content data
                 +---files/    :contains the file uploaded (for example images)
              +---htmlArea/     :the Javascript WYSIWYG editor
          

2) Installation:
- copy the psm directory into your htdocs directory
- configure the file psm/config.php with your preferred values

3) Developing:
PSM is very simple to integrate in any php site. You can build a site from scrach, using PSM or you can integrate PSM into an existing php site.
For do this you must import psm_lib.php in every page where you want to use PSM.

  • For displaying the admin bar you must place the admin_bar() php function in the page like this:
  • 
              <?echo admin_bar();?>
              
    This code display the admin bar when logged in as administrator or none otherwise.

  • For displaying a content you must call the content(name) function with a name for the content passed as parameter like this:
  • 
              <?echo content("content_name");?>
              
    This code display the content and the editor bar when logged in as administrator or the content for everywhere users.

  • A basic php script as example:
  • 
              <!-- import psm library -->
              <?include_once("psm/psm_lib.php");?>
              
              <html>
              <head>
              <title>Psm Demo</title>
              </head>
              <body>
              
              <!-- call admin bar (visible only if admin is logged in) -->
              <?echo admin_bar();?>
              
              <table border=1 width=100% height=100%>
              <tr>
                <td valign=top>
                
                  <!-- display content with name 'content_1' -->
                  <!-- (edit link is visible only if admin is logged in) -->
                  <?echo content("content_1");?>
                
                </td>
                <td valign=top>
                
                  <!-- display content with name 'content_2' -->
                  <!-- (edit link is visible only if admin is logged in) -->
                  <?echo content("content_2");?>
                
                </td>
                <td valign=top>
                
                  <!-- display content with name 'content_3' -->
                  <!-- (edit link is visible only if admin is logged in) -->
                  <?echo content("content_3");?>
                
                </td>
              </tr>
              </table>
              
              </body>
              </html>