* CHeMS Frequently Asked Questions

Please, help me to correct this FAQs. I tried to write
english as better as possible but it's not enough, i know.

A: What's CHeMS anyway? Why do should i use it?
Q: CHeMS is just my way to write a website with an integrated blog in it.
   It's easy to use, to setting up and to extend. Since it's fully editable
   and customizable through the source code, you have all of the power a
   programmer have while writing its own application from scratch. In
   addition to thise, CHeMS provide a simple and robust "core" to accomplish
   this task without have to deal with the layout or the internal design
   of the application. This allow you to public an entire application in a
   few minutes, like any other "real" CMS does, enable the users to easily
   stay compliant with the XHTML and CSS W3C standards. Since CHeMS is free
   (as in freedom) software, you can contribute to extend, improve and make
   it better.

A: How the CHeMS versioning works?
Q: An hexadecimal notation is used in order to mark the CHeMS releases. In
   an hex number there are three place where to store version informations:
   major number goes befor the 'x' and minor numbers goes after the 'x'. So,
   0x01 means major 0 and minor 01. Bugfixes releases are released by using
   the previous release hex number followed by an underscore and the ID (in
   a decimal form) of the bugfix release, e.g., 0x01_1 means the first bugfix
   release of the 0x01 version. That's all.

Q: How can i extend the main section to the whole left/right area when
   disable all menu blocks from a side?
A: By editing the CSS (themes/THEME_NAME/THEME_NAME.css) and changing the
   margin size for the side as described into the CSS comment. You should
   change the value from 150px to 0px (or some other value you like). See
   the "#main_page_body" section or your theme's CSS.

   NOTE: here is assumed that your theme is based on the "core" CHeMS
         meta-theme. See the documentation to learn more.

Q: Does exists a feature which allow to enable some mode like ``Maintenance''
   or ``On vacation''?
A: No, this feature is not needed at all. You can leave only one page
   available by configuring CHeMS as follow:

   1. Create a new page at the top of all others (this mean the page will
      have ID 1)
   2. Set the BASEMOD to "pages_mgr" (this will show the first page by
   3. Disable the navigation bar(s) and the menubar(s) by setting both
      NAVBAR and MENUBAR to "none"

   If you want to expand the main section since you haven't the menubar(s)
   anymore, see the question above.

   NOTE: if your theme have the FORCE_RMENU or FORCE_LMENU enabled you *need*
         to disable it in order to remove the menubar(s).

A: Why sometimes i get an XML Parsing Error? How can i solve the problem?
Q: You are probably using an XML special character. CHeMS use the XML
   well-formed standard (XHTML) with UTF-8 charset. This mean that some words
   are reserved and need to be converted into the respective HTML codes in
   order to be included in a page. The most common special characters and
   their codes are the follow:

   &	&
   <	&lt;
   >	&gt;
   "	&quot;
   '	&apos;

   To solve the problem just replace the special character or symbol with its
   HTML code. If you need to use the "real" character into an HTML tag (as
   <a> or <img>) just escape it by putting a slash ('/') before it, as in the
   follow example:

      <a href='some_url'><img
         src='some_path' alt=\"It's a CHeMS FAQ.\" /></a>

   This way the single quote of -It's- don't cause any problem.

   See also the FAQ about the '$' character (below). Read more about (X)HTML
   and PHP in order to be able to deal with all possible situations.

   If this occurred before you changed anything then please, submit a bug
   report describing where and how to reproduce the problem.

A: I fixed the problem about the previous question but i wondering why CHeMS
   don't handle the special characters and symbols in order to avoid error as
   that described above!?
Q: CHeMS is NOT a Content Management System (CMS). Its goal is to help the
   user to write their own applications leaving the freedom to deal with it,
   not to manage the application for them. CHeMS leaves the user free to do
   whathever he wants, also to do wrong things.

A: Why IE won't open my pages but try to save the file instead?
Q: Because IE6 (and maybe later versions) doesn't handle the xhtml/xml
   applications content type while CHeMS is XHTML-1.1 compliant. See the next
   FAQ for a possible workaround.

A: Can i make CHeMS work with Microsoft Internet Explorer? (solution)
Q: If you want to be XHTML-1.1 compliant then a workaround is needed. See the
   next FAQ for informations. Alternatively, you can switch your CHeMS to the
   XHTML-1.0 Strict DTD (or other at your taste) by uncommenting the $doctype
   variable in main.php. A comment has been provided in order to easily
   localize the relevant code. Look for "doctype" in main.php. In any case
   (solution or workaround - see next FAQ) IE will *not* render CHeMS as it
   is due to a wrong implementation of the IE HTML rendering engine.

A: Can i make CHeMS work with Microsoft Internet Explorer? (workaround)
Q: NOTE: this FAQ has been superseded by the previous one.
   Sure, but you'll get a lot of problems and the pages may not (and will) be
   shown correct. By the way, freedom is also to use your propretary web
   browser to navigate between free software page. Edit the "src/main.php"
   file and put the following line just before the header() call:

      // Don't send the header to Microsoft Internet Explorer
      if(!strstr($_SERVER["HTTP_USER_AGENT"], "MSIE"))

   This way your pages still are XHTML 1.1 compliant for all the browsers
   except for IE (and the XHTML validation will pass).  You can now open your
   new IE-compliant non-standard weird blog/site with your proprietary web

A: Why don't provide an option which allow the users to disable the header(),
   avoid so asking the previous question?
Q: Because CHeMS is written for simplicity, not weirdness. I supports
   standard and "any browser". If some browser doesn't support one or more
   standards it isn't my problem.

Q: Why don't include the date and time format operator into the default list?
A: These kind of operators are not needed at all since it's possible to use
   the date() PHP function directly from the config.php file, as in the
   following example:
      define("CHEMS_FOOTER", "
         This is an example footer.<br />
         Date and time: ".date("F d Y - h:ia").".

A: Can i include a current value for an option in the formats operators list?
   How can i do it?
Q: Yes, you can use the cloned classes $_conf, $_theme and $_request to
   retrieve informations about (respectively) configuration (current. not as
   in "config.php"), theme and the current request. Example:

      $_theme->css		// StyleSheets
      $_conf->chems_theme	// Theme's name
      $_request->pages_total	// Total pages

   See the "src/classes.php" file for more informations.

A: Why the '$' character or the strings like "$string" are not shown?
Q: As you should already know the '$' character is reserved from the PHP
   variables. If you don't want to print a variable value but, rather, a
   variable name or any string containing the '$' (or just a single '$')
   character, put a backslash ('\') before any dollar by "escaping" it in
   order to be ignored from the PHP interpreter. A brief example:

      This show the value of the variable "$varname"

      This show the string "$varname"

      This don't show nothing

      This show "$var$name"

A: Why don't allow the users to choose what values of the comments form are
   mandatory or what not? Can't you easily provide few options?
Q: I could but it's not compliant with the CHeMS philosophy. The users
   shouldn't be forced to insert or not their personal informations. The web
   applications have to manage informations in order to provide them to the
   users, expecially for blog-like site, not manage the personal users
   informations in order to provide the to the application's owner or
   visitors. If you don't like this, feel free to write your own module
   and/or your own CHMS.

A: Is there a way to allow (X)HTML tags in the comments body?
Q: Not without edit "comments" module source code. Allowing (X)HTML tags
   there there is no way to guarantee that CHeMS will remains XHTML 1.1
   compliant, this why all tags are stripped.

A: How can i set the locales informations? Can i do the work without "hack"
   the CHeMS core?
Q: Just use the setlocale() PHP function into the "src/config.php" file by
   putting at the beginning of file something like this:

       * Setting the CHeMS locales (aka localization)
      setlocale("LC_MESSAGES", "it_IT");
      [ .. ]

   and so on. Read your system manual and the PHP documentation to learn more
   about configuring CHeMS on your operating system.

A: Why i can't get the file content into my web browser which instead ask me
   where to save the file?
Q: If the file content is not pure text then it's you shouldn't be able to
   read it inside your web browser. In any case you need to add the
   "text/plain" MIME type as default one in your web server configuration
   file. This is have nothing to do with CHeMS.

A: Why i can't get the current object (post/page) ID while i'm still able to
   get other informations as the title, the body, etc.?
Q: Because your way is wrong. The insert() function ignore the ID at all, so
   there is no way to get the ID by querying the objects list ($POST or
   $PAGE). But think about, you always have the ID of an object without need
   to read it somewhere in the objects list. E.g., if you have a loop like

      for($i = 1; $objs[$i]; $i++) // Traverse the objects

   you don't need to get the ID from $objs[$i]['id'] since the $i variable
   already contains the ID you are looking for. In other cases you may
   observes similar behaviour. Just think about your code.

A: How can i add top and back link somewhere in all my pages?
Q: It's quite easy, though you'll have to use a JavaScript routine to
   accomplish the second task. What you have to do is the following:

      . Create a new instance of the freehands module called, say,
        "navbutt", by callyng modload() in config.php this way:

	   /* Navigations buttons */
           modload("freehands", "left", "all", array(
              "instance" => "navbutt"

      . Add something like the following into the MOD_FREEHANDS_BODY_NAVBUTT:
	   [<a href='javascript:history.back()'>back</a> |
	    <a href='#chems_title'>top</a> ]

      . Leave the MOD_FREEHANDS_TITLE_NAVBUTT empty (set as "")
   You can customize it as you like.

Hope this helps.