Cchost/admin/config customize

From Creative Commons
Revision as of 17:34, 3 November 2008 by Fourstones (talk | contribs) (New page: Category:ccHost Category:ccMixter Category:Developer Category:Software Category:Technology {{lowercase}} This page describes some of the customizations that can be don...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


This page describes some of the customizations that can be done in your ccHost installation by creating some custom configuration files. For all these operations you will need a plain text editor and write permissions to your <local_files> area of the installation.

Strings

This section covers how to do 'straight' string substitution for forms, headings or prompts. That means a simple replace of text: every time you see 'foo' you want to replace it 'bar.' If you want to do more elaborate, dynamic substitutions that will require some real PHP programming.

Place the following file into <local_files>/skins/strings/my_string_set.php

<?
/*
   [meta]
      type = string_profile
      desc = _('My Custom String Set')
   [/meta]
*/

 include('ccskins/shared/strings/all_media.php');

 /* Your custom strings go below here */

 /* Your custom strings go above here */
 ?>

The strings in the system are all mapped to a key that starts with the str_ prefix. If you search through the strings in ccskins/shared/strings/all_media.php and find the string you want to replace, simply copy that line to your string set file and replace the text to the right of the equal sign (=).

Let's say you want you want to replace every occurrence of the word artist with the word teacher. You would search for all instances of the word artist in ccskins/shared/strings/all_media.php to find these:

 $GLOBALS['str_artist']               = _('Artist');
 $GLOBALS['str_artists']              = _('Artists');
 $GLOBALS['str_contact_artist']       = _('contact this artist');
 $GLOBALS['str_feat_list_any_collob'] = _('List any colloborating artists);
 $GLOBALS['str_filter_artist']        = _('Artist');
 $GLOBALS['str_hidi_author']          = _('Artist');
 $GLOBALS['str_remix_artist']         = _('Artist');
 $GLOBALS['str_pool_filter']          = _('Sample pool artists');
 $GLOBALS['str_stats_artist']         = _('Aritst');

You would copy all of those and put those into your string set file and then edit occurrences of artist on the right side of the equal sign and replace those. So your file would end up looking like:

<?
/*
   [meta]
      type = string_profile
      desc = _('My Custom String Set')
   [/meta]
*/
 
 include('ccskins/shared/strings/all_media.php');

 /* Your custom strings go below here */

 $GLOBALS['str_artist']               = _('Teacher');
 $GLOBALS['str_artists']              = _('Teachers');
 $GLOBALS['str_contact_artist']       = _('contact this teacher');
 $GLOBALS['str_feat_list_any_collob'] = _('List any colloborating teachers');
 $GLOBALS['str_filter_artist']        = _('Teacher');
 $GLOBALS['str_hidi_author']          = _('Teacher');
 $GLOBALS['str_remix_artist']         = _('Teacher');
 $GLOBALS['str_pool_filter']          = _('Sample pool teachers');
 $GLOBALS['str_stats_artist']         = _('Teacher');

 /* Your custom strings go above here */
 ?>

Again, note that the artist on the left side of the equal sign still say artist - this is correct.

As a final step, in your ccHost installation browser to <your_installation_root>/admin/skins/settings and under String Profile select My Custom String Set.

Colors

You can create a custom color set by following these instructions.

  1. Copy ccskins/shared/colors/color_mono.php to <local_files>/skins/colors/my_colors.php
  2. Open your copy in a text editor and replace the text near the top in the 'desc' field (Monochrome) with 'My Color Scheme'
  3. Edit all the six digit hash numbers (e.g. #FF00EE) and replace them with the colors that you prefer to see and save the file
  4. In your browser, browse to <your_installation_root>/admin/colors and select 'My Color Scheme'

You should see the differences the next time you refresh your browser. (You may have to clear your browser's cache to get the full effect.)

Sidebar extras

You can create your own "sidebar extras" with a few lines of HTML code. They can even be dynamic with a little query API knowledge.

Your ccHost 5 installation has already put an example of one of these into <local_files>/skins/extras/extras_links.tpl. To create more of your own extras and enable them follow these instructions:

  1. Copy <local_files>/skins/extras/extras_links.tpl to another file in that same directory like my_other_extra.tpl
  2. Change the text in the desc at the top to something like: _('My other extra')
  3. Replace the contents of the unordered list (<ul> tag) with your custom content
  4. Browse to <your_installation_root>/admin/extras and drag the box that says 'My other extra' to the sidebar extras area

For some examples of what's possible check out the files in ccskins/shared/extras.