What's this?
A Drupal installation profile is a file that can be used to set up a customized version of the popular free/open-source content management system Drupal. This page is for collaborative development of Indymedia drupal installation profiles. For information on how to make an installation profile see:
http://drupal.org/node/67921.
Here are some tools to help create install profiles:
http://drupal.org/project/install_profile_api
The Indymedia Alba install profile was released in March 2008 and is available for Drupal 6:
http://drupal.org/project/indymedia_alba
See it in action at
http://scotland.indymedia.org/
FilmForge, an install profile for videomaking communities, was released in August 2007 and is available for Drupal 5:
http://drupal.org/project/filmforge
Sample Profile (not functional yet!)
The following seed profile was lifted directly from that How To and needs lots of work still. A good place to start would be by looking at the page
ImcDrupalDevDrupal5 --
SashaCostanzaChock - 14 Jun 2007
<?php
/**
* The modules that are enabled when this profile is installed.
*
* @return
* An array of modules to be enabled.
*/
function indymedia_profile_modules() {
$core = array('system', 'block', 'blog', 'comment', 'contact', 'filter', 'forum', 'help', 'menu', 'node', 'page', 'path', 'profile', 'search', 'story', 'taxonomy', 'upload', 'user', 'watchdog');
$contrib = array('buddylist', 'front', 'content', 'text', 'jstools', 'location', 'location_views', 'event', 'rsvp', 'signup', 'signup conflicts', 'image', 'image_attach', 'image_gallery', 'invite', 'logintoboggan', 'og', 'og_basic', 'privatemsg', 'urlfilter', 'views', 'views_ui');
// TODO: review all the above. figure out how to deal with audio uploads, video uploads, image uploads, moderation, hiding posts, user profiles, etc.
// TODO: How to add cities module (creates block with links to all local IMCs, automatically updated every certain period of time).
// TODO: think about making editorial interface as user friendly as possible. checkboxes/dropdowns/buttons for: feature this, hide this, add to various categories, translate this, etc.
// TODO: how to deal with translation of articles ('translate this' button?)
// TODO: How to deal w/ spam requirement?
// TODO: How will this deal with image_attach, which is a contrib module inside image?
return array_merge($core, $contrib);
}
/**
* Implementation of hook_profile_details().
*
* This contains an array of profile details for display from the main selection screen.
*/
function indymedia_profile_details() {
return array(
'name' => 'Indymedia',
'description' => 'A global network of radical grassroots journalism.'
);
}
/**
* Implementation of hook_profile_final().
*
* indymedia platform installation.
*/
function indymedia_profile_final() {
// Enable user locations
variable_set('location_user', 1);
// Turn on LoginToboggan features
variable_set('login_with_mail', 1);
variable_set('email_reg_confirm', 1);
variable_set('reg_passwd_set', 1);
variable_set('toboggan_immed_login', 1);
variable_set('toboggan_role', 4);
variable_set('toboggan_hijack', 1);
// Enable Organic Group access control
variable_set('og_enabled', 1);
db_query("DELETE FROM {node_access}");
// Make post visibility selectable by author - default to Public
variable_set('og_visibility', 2);
// Omit page types from OG
variable_set('og_omitted', array('page'));
// Enable Urlfilter
db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (1, 'urlfilter', 0, 10)");
/** CONFIGURATION SETTINGS */
// Change front page to my/home
variable_set('site_frontpage', 'my/home');
// Turn on user pictures
variable_set('user_pictures', 1);
// Set default primary links
variable_set('phptemplate_secondary_links', array(
'text' => array('my home', 'my blog', 'my groups', 'my events', 'my friends'),
'link' => array('my/home', 'my/blog', 'my/groups', 'my/events', 'my/friends'),
'description' => array('', '', '', '', ''),
));
// Set welcome message for anonymous users
variable_set('front_page', 'Welcome to '. variable_get('site_name', 'Indymedia') .'!');
// Change welcome email to include validation URL
variable_set('user_mail_welcome_body', "
%username,
Thank you for registering at %site.
IMPORTANT:
For full site access, you will need to click on this link or copy and paste it in your browser:
%login_url
This will verify your account and log you into the site. In the future you will be able to log in using the username and password that you created during registration.
Your new %site membership also enables to you to login to other Drupal powered websites (e.g. <a href=\"http://www.drupal.org/\" title=\"http://www.drupal.org/\" rel=\"nofollow\">http://www.drupal.org/</a>) without registering. Just use the following Drupal ID along with the password you've chosen:
Drupal ID: %username@%uri_brief
-- %site team
");
// Remove default line break filter for the FULL HTML filter
db_query("DELETE FROM {filters} WHERE format = 3");
/** BLOCK CONFIGURATION **/
// Recommendations block - only show on my*
db_query("INSERT INTO {blocks} VALUES ('block', '1', 1, 0, 1, 0, 0, 1, 'my*', '')");
db_query("INSERT INTO {boxes} VALUES (1, 'Recommendations', '<?php\r\n /* Edit the following variables if you''d like to change the text for this block */\r\n \$groups = ''Groups in your Area'';\r\n \$events = ''Events in your area'';\r\n \$people = ''People in your area'';\r\n \$popular = ''Popular Groups'';\r\n \$new = ''New Groups'';\r\n \r\n /* Below is PHP code, only edit if you feel comfortable with PHP and the Drupal API. */\r\n global \$user;\r\n \$items = array(l(t(\$groups), ''gsearch/og''),\r\n l(t(\$events), ''gsearch/gjg_event''),\r\n l(t(\$people), ''gsearch/user''),\r\n l(t(\$popular), ''groups/popular''),\r\n l(t(\$new), ''groups/new''));\r\n \$output = theme(''gjg_menu'', \$items);\r\n print \$output;', 'Recommendations', 2)");
// My friends block - only show on my*
db_query("INSERT INTO {blocks} VALUES ('gjg', '0', 1, 0, 1, 0, 0, 1, 'my*', '')");
// Recommendations block
db_query("INSERT INTO {blocks} VALUES ('gjg', '1', 0, 0, 0, 0, 0, 0, '', '')");
// Group profile block - only show on og types
db_query("INSERT INTO {blocks} VALUES ('group_block', '0', 1, 0, 0, 0, 0, 0, '', 'og')");
// Group actions block - only show on og types
db_query("INSERT INTO {blocks} VALUES ('group_block', '1', 1, 1, 0, 0, 0, 0, '', 'og')");
// LoginToboggan login block
// NOTE: The following lines are commented out until I get LT working
//db_query("INSERT INTO {blocks} VALUES ('logintoboggan', '0', 1, 0, 0, 0, 0, 0, '', '')");
// Hide normal user login block
//db_query("UPDATE {blocks} SET status = 0 WHERE module = 'user' AND delta = 0");
// Move navigation block down
db_query("UPDATE {blocks} SET weight = 1 WHERE module = 'user' AND delta = 1");
// User actions block - show only on my* and tracker*
db_query("INSERT INTO {blocks} VALUES ('user_block', '0', 1, 0, 0, 0, 0, 1, 'my*\r\ntracker*', '')");
// User personal actions block - show only on my* and tracker*
db_query("INSERT INTO {blocks} VALUES ('user_block', '1', 1, 1, 0, 0, 0, 1, 'my*\r\ntracker*', '')");
/** DEFAULT CONTENT TYPE SETTINGS **/
// Generally, all nodes default to _not_ promoted to front page and
// attachments disabled
foreach(node_list() as $node) {
variable_set("node_options_$node", array('status'));
variable_set("upload_$node", 0);
}
// File: enable attachments
variable_set('upload_file', 1);
// GJG Event: enable events
variable_set('event_nodeapi_gjg_event', 'all');
// OG: turn off comments, enable locations
variable_set('comment_og', 0);
variable_set('location_og', 1);
variable_set('location_name_og', 1);
variable_set('location_street_og', 1);
variable_set('location_city_og', 1);
variable_set('location_province_og', 1);
variable_set('location_postal_code_og', 1);
variable_set('location_country_og', 2);
// Page: turn off comments
variable_set('comment_page', 0);
// Venue: enable locations
variable_set('location_venue', 1);
variable_set('location_name_venue', 1);
variable_set('location_street_venue', 1);
variable_set('location_city_venue', 1);
variable_set('location_province_venue', 1);
variable_set('location_postal_code_venue', 1);
variable_set('location_country_venue', 2);
/** ROLES AND PERMISSIONS **/
// TODO: create roles and permissions for admin, editorial collective member, registered user, anonymous user
// Administrator user
db_query("INSERT INTO {role} (rid, name) VALUES (3, 'admin user')");
// Pre-authorized user (for LoginToboggan)
db_query("INSERT INTO {role} (rid, name) VALUES (4, 'pre-authorized user')");
// Add user 1 to authenticated and admin roles
db_query("INSERT INTO {users_roles} VALUES (1, 2)");
db_query("INSERT INTO {users_roles} VALUES (1, 3)");
// Configure default permissions for each role
db_query("UPDATE {permission} SET perm = 'access comments, can send feedback, access content, search content, view uploaded files' WHERE rid = 1");
db_query("UPDATE {permission} SET perm = 'edit own blog, access comments, post comments, post comments without approval, can send feedback, create files, edit own files, create forum topics, edit own forum topics, create events, edit own events, create images, submit latitude/longitude, view location section, access content, create groups, access private messages, search content, report spam, create stories, edit own stories, upload files, view uploaded files, access user profiles, create venue, edit own venues' WHERE rid = 2");
db_query("INSERT INTO {permission} (rid, perm, tid) VALUES (3, 'administer blocks, edit own blog, access comments, administer comments, administer moderation, moderate comments, post comments, post comments without approval, can send feedback, create files, edit own files, administer filters, administer forums, create forum topics, edit own forum topics, create events, edit own events, administer images, create images, submit latitude/longitude, view location section, administer menu, access content, administer nodes, administer organic groups, create groups, create pages, edit own pages, administer url aliases, create url aliases, access private messages, administer search, search content, access spam, administer spam, bypass filter, report spam, create stories, edit own stories, access administration pages, administer site configuration, administer taxonomy, upload files, view uploaded files, access user profiles, administer users, create venue, edit own venues, administer watchdog', 0)");
db_query("INSERT INTO {permission} (rid, perm, tid) VALUES (4, 'access comments, post comments, can send feedback, create forum topics, create events, submit latitude/longitude, view location section, access content, search content, create stories, view uploaded files, access user profiles, create venue', 0)");
/** THEME SETUP **/
// Disable bluemarine
//db_query("UPDATE {system} SET status = 0 WHERE name = 'bluemarine'");
// Enable PHPTemplate theme engine
db_query("INSERT INTO {system} VALUES ('themes/engines/phptemplate/phptemplate.engine', 'phptemplate', 'theme_engine', '', 1, 0, 0)");
// Enable default theme
drupal_system_enable('theme', 'indymedia');
variable_set('theme_default', 'indymedia');
// Disable default logo and enter new logo path
variable_set('theme_indymedia_settings', array(
'default_logo' => 0,
'logo_path' => 'themes/indymedia/images/indymedia-header.png',
'toggle_name' => 1,
'toggle_slogan' => 0,
'toggle_mission' => 1,
'toggle_primary_links' => 1,
'toggle_secondary_links' => 1,
'toggle_node_user_picture' => 0,
'toggle_comment_user_picture' => 0,
'toggle_search' => 0,
));
}
?>
--
MarkB - 07 Jul 2008 (Added link to Indymedia Alba)