cchost
[ class tree: cchost ] [ index: cchost ] [ all elements ]
Prev
ccHost Administrators Guide
Next
Customizing User Interface
Basics

Basics

This documenation refers to ccHost 4.5. There are serious changes coming in 5.0 Make sure to keep tabs at the ccHost Wiki

Table of Contents

Understanding ccHost URLs

Understanding how URLs work in ccHost is a very important concept that you should understand before doing anything else.

URL Parts

ccHost URLs are composed of four main parts:

  1. Root URL of installation

    This is the URL address of where index.php lives. For example: http://example.com, or http://example.com/cchost

  2. Virtual Root

    Don't worry if you don't know what a 'ccHost virtual root' is, we'll get to it here but for now assume it's the word media.

  3. Command

    This part of the URL maps to an internal command in ccHost. This can be anything from a request for a submit form, a feed, a record listing, etc. Examples are people which shows a listing of the latest registered users who have uploaded or files which lists the latest uploads.

  4. Parameters

    Many if not most commands accept and even require parameters. For example, adding a specific user's name to the people command will display the user's main page, e.g. people/rejon

You should refer to the ccHost Command Reference for a listing of all available commands.

If you have enabled 'pretty URLs' in your installation then all the elements are strung together into one URL:

http://example.com/media/people/rejon

If not, then everything starting from the virtual root is prepended the following way:

http://example.com?ccm=/media/people/rejon

URLs in Menus and Navigator Tabs

In general when asked for an URL for menus or navigator tabs, all you enter is the command and parameters. The system will assume you want the command to execute in the current virtual root and already knows if your site uses pretty URLs or not. In fact you can change your installation to use pretty URLs later and all these menu items will continue to work.

If you enter a fully qualified URL (anything that starts with http://) the menu and tab systems will redirect the browser to that url, no matter what the rest of the address it. If the action URL does not start with http:// then the system will assume this is a ccHost command with parameters and attempt to execute it as outlined above.


URLs in XHTML Templates

It is very important that you use ${home-url} variable as a prefix to commands (more about home-url) in URLs when working in template files:

You can <a href="{$home-url}submit">submit files</a> to our site...

The URL in the href attribute will auto-magically expand to something like:

http://yourserver.com/cchost?ccm=/myvroot/submit

Don't put a trailing forward slash after the ${home-url} but if you need a parameter then put one between the command and the parameter

Go to <a href="{$home-url}people/{user_name}">your home page</a> now

Forcing Virtual Roots

There may come a time where you want a menu item like Register or a navigator tab like Home to go to a specific virtual root like media. In that case you will want to specify the full URL in the menu item or tab, like http://root-installation.com?ccm=/media/register. That way no matter what virtual root the user is in, they will be taken to the main register screen or in the case of a 'Home' tab simply http://root-installation.

If you change your site to use pretty URLs at some point these URLs will continue work, they just won't be, well, pretty. At that point you can edit these menu items to the pretty versions without the ?ccm=.

If you use pretty URLs in your menus and disable pretty URLs in the system, then those menu items are essentially broken.


URLs in This Document

In this documentation when asked to browse to a location, it will only say the command and parameters and assume you will prepend the proper parts that apply to your installation and virtual root configuration. For example, if you see a request like "browse to admin/menu/killcache" that you are expected to enter the following into your browser's address bar:

http://example.com?ccm=/media/login  (with pretty URLs OFF)
http://example.com/media/login (with pretty URLs ON)

Note the addition of the virtual root media in both cases. If you are reading this, it is probably because you forgot to add that.

In some cases you may be asked to add a query, as in 'browse to command?query=foo'.

This would expand to:

http://example.com/media/command?query=foo (pretty URLs ON)
http://example.com?cmd=/media/command&query=foo (pretty URLs OFF)

Note how the question mark became an ampersand in the non-pretty URL version.

Most of the requests to browse to a command assume you are currently logged in with administrative rights.


Terminology: "tag" vs. "tag" vs. "tag"

It is worth noting as quickly as possible that there are three different meanings of the word tag used when administering a ccHost installation. All three are conventions of the subsystems we use and we felt it was better to use context as a disambiguator rather than inventing terms for processes everybody knows as 'tagging' -- albeit with different purposes.

  • HTML Template Tags

    XHTML pages are made up of tags. ccHost generates the XHTML using XML scripts that contain specialized template tags. You use these tags when customizing XHTML pages.

  • MP3/ID3 Tags

    The title, author and other meta data associated with an ID3 compliant media file (like MP3s) are embedded directly into the media via ID3 tags.

  • 'Folksonomy' Tags

    These kinds of tags are used to create categories of uploads. There is a menu item Browse Tags so visitors to your site can quickly identify categories of uploads at your site.

    Just to confuse things even further there are three types of folksonomy tags:

    1. User tags: The uploader assigns these tags during the upload process and can edit them through the Edit link on the upload's main page.
    2. System tags: These are tags controlled internally by the system, usually by file verifiers and have to do with the internal data formats (e.g. 'stereo', 'image', etc.). Neither users or admins can edit these tags directly.
    3. Admin tags: These are tags that controlled by the admin through the use of the Manage Site/Submit Forms and Global Settings/Tags settings pages and on individual uploads through the Admin link on the upload's main page. Users can not edit these tags.
  • Super Admins

    The main access levels are Everyone, Registered Users and Administrators.

    The potentially confusing thing is that both internal commands and user interface elements (like menu items and navigator tabs) have security clearances but they have very different effects:

    Setting a security level on a menu or tab item does not restrict functionality, it only affects the visibility of the menu or tab item.

    In other words, you may have a menu item that invokes the editorial/picks command and mark the menu item as Administrators Only but that will only hide the menu item from everyone but Administrators, it would not prevent someone from entering that command into their browser directly and seeing the results of the command because that command happens to be registered integrally for Everyone.

    In order to change the access to the actual command use admin/access command.

    Also note that the access permissions on commands only determine whether the code for that command is initially invoked. The code itself may determine even stricter criteria for the command.

    In other words, a command might be marked as for Registered users only (e.g. editorial/submit/{upload_id}) but the code that implements that command may have further restrictions (only allows 'editors' to do the actual submit).

    There is also an implied 'ownership' built into the code for upload and user records. That means a command marked Registered users only like files/delete/{upload_id} is further restricted by who 'owns' the upload, that is: who uploaded the thing.

    From Global Settings you can assign a small group of users 'super access' which overrides normal admin privileges.

    You can use the admin/access command to determine which commands in the system are restricted to this group and this group only.

    Where ccHost Looks for Files

    Starting in ccHost version 3.1 admins have full control over where ccHost looks for files and writes logs and temporary files during the course of building a page.

    If you installed 3.1 or later, the installation program created a directory structure with a name you specified under your root installation that you should, but are not obliged to, use for your customizing your site.

    If you installed before 3.1 we recommend you setup a similar structure, but again, you don't have to if you have another system that works for you.

    The Global Settings/Paths configuration screen gives you full control of where and how ccHost looks for files.

    Directories Explained

    The following tables explains both the system and admin directories. These are here for reference in relation to the Global Settings/Paths configuration screen.

    ccadmin Installation directory. ccHost will not run until you rename this directory.
    ccextras ccHost Developers use this directory to add features to ccHost.

    ccHost will always look in this directory first, before looking in any of the 'Plugins Path' directories and load any file with a .php extension. You can not change this behavior.

    ccfiles The default directory used by the viewfile (a.k.a. docs) command. You can replace this functionality by editing the 'viewfile Path' field.
    ccimages ccHost security confirmation and other internal modules that need images use these files. These are also where skins look for common images. You put your custom images into a directory based off one of the directories in the 'Skins Path' field.
    cclib The main code directory. You should never touch the contents unless specifically told to do so by ccHost developers.
    cctemplates Directory for factory skins. The skin architecture is such that you should not have to make any edits to existing files. Doing so will cause problems when you update ccHost. Your skins should be based off one of the directories in the 'Skins Path' field.
    contests Created by ccHost the first time a contest is created. It holds all contest sources and entries partitioned by contest name and then by user below that. Having this structure makes it easy locate all the entries in a contest once the entry period has closed.
    locale Internationalization files.
    people Created by ccHost the first time someone uploads a file. It holds all non-contest related user content and is divided by user's login name.
    my_files Created by the ccHost install program. You use this directory for all customizations to your site.

    The actual name of this directory depends on what you named it during the install process.

    my_files/cc-error-msg.txt This is a file used by the system when a fatal error has occurred to display a message to the user visiting your site. Edit this file (HTML allowed) to change the message seen by users when this happens or direct the system to another file in the 'System Error Message' field.
    my_files/disabled-msg.txt This is a file used by the system when the admin has disabled the site. Edit this file (HTML allowed) to change the message seen by users when this happens or direct the system to another file in the 'Site Disabled Message' field.
    my_files/lib ccHost will look in this directory for extra modules to load. Any file with a .php extension will be loaded and parsed to be very careful what files go in there. You change where ccHost looks for these files or add additional directories using the 'Plugin Path's field.
    my_files/skins ccHost will look in this directory for resolve all HTML template searches, including the main skin page and sidebar.xml. You change where ccHost looks for these files or add additional directories using the 'Skins' field.

    When calling for template from within another template, the system will look at the 'current' directory -- that is: the directory of the calling template -- before looking at any of the 'Skins' paths.

    my_files/temp ccHost use this directory temporary files. It is always safe to delete any files here as the system will re-create them if needed.
    my_files/viewfile ccHost will look in this directory for files appened to the 'viewfile' (a.k.a. 'docs') command. For example: docs/home. You change where ccHost looks for these files or add additional directories using the 'viewfile Command' field. Also note that the .xml extension is optional in the command.
    cc-config-db.php This is a file in your root installation created by ccHost installer and specifies your installation's database access. ccHost will not run without the presence of this file and will not operate properly if the data inside does not match your server's database access configuration.
    cc-includes.php, cc-non-ui.php, cc-inc-extras.php These are important system files, do not touch these as they are essential to running your site.
    cc-custom.php These are helper routines used by the sidebar content. See Sidebar Content. You should not touch this file. If you wish to have custom versions of this, you should include a new .php source in one of the directories in the 'Plugin Paths' field.

    The following table describes non-essential files and directories that come with the installation package but are not used by ccHost to operate your installation.

    cctools This directory has been deprecated and will be removed in future releases.
    AUTHORS, COPYING, HACKING, LICENSE.TXT, NEWS, POTS, README, VERSION ChangeLog These are all informational files, standard that comes with open source projects. ccHost never actually looks at these files.
    bin, cchost.spec, Makefile, Makefile.include, Makefile.language Utility files and directory used by ccHost developers for helping with low level maintenance. ccHost has no dependency on these files and directory and they are not needed for normal ccHost web site operation.

    Prev Up Next
    ccHost Administrators Guide ccHost Administrators Guide Customizing User Interface

    Documentation generated on Sat, 17 Nov 2007 01:02:59 +0000 by phpDocumentor 1.3.0RC4