Hi guys,
Am a complete and utter newbie to this drupal thing, but, I have managed to create (or hack to be more precise) a new module for 4.5 that is roughly the same as front.module...and it actually works!
I think it might be of use to other users and looked at how to upload it to here, but, it looked too complicated.
The module allows you to setup a custom front page to your drupal installation in a very simple way from within Drupal (under administer - settings you can simply paste in your HTML, FLASH or other code).
The "default" out-of-the-box setting is that it will load your default theme and the default blocks, but, you can change that do it opens as a full page on it's own..i.e. without any blocks, different layout etc. instructions on how to change that are included in the module.
It works with Drupal 4.5 and all you have to do to install it is:
a) upload it to your modules folder in ASCII and naming it front_page.module
b) Go to Administer - Modules and enable the front_page module
c) Go To Administer - User - Permissions and enable ACCESS FRONT_PAGE.
d) Go To Administer - Settings - front_page and past in your HTML.
I hope this is of use to other drupal users.
// $Id: front_page.module,v 1.0 2004/11/24 Jasonm3m Exp $
/**
* @file
* This is my first module that allows the user to set a custom front page
* to the drupal installation.
*
* This module is designed for 4.5 compatibility
*/
/**
* Implementation of hook_help().
*
* This is the explanatory text that appears in your administer - modules page
* where you switch on/off modules
*/
function front_page_help($section) {
switch ($section) {
case 'admin/modules#description':
// This description is shown in the listing at admin/modules.
return t('this module allows you to set a custom home page.');
}
}
/**
* Implementation of hook_perm().
*
* this function makes the front_page option appear in the user - permissions page
*/
function front_page_perm() {
return array('access front_page');
}
/**
* Am not too sure what this function does.
*/
function front_page_link($type, $node = 0, $main) {
if ($type == "system") {
menu("front_page", t("front"), "front_page", 0, MENU_SHOW);
}
}
/**
* this function sets the necessary paths etc. so drupal
* knows where to find the front_page
*
* in your Administer - Settings make sure default front page is set
* to front_page
*
* Please note that I have left the Title blank below so nothing appears above the
* page when it is displayed.
*/
function front_page_menu($may_cache) {
if ($may_cache) {
$items = array();
$items[] = array(
'path' => 'front_page',
'title' => t(''),
'callback' => 'front_page',
'access' => user_access('access front_page'),
'type' => MENU_SUGGESTED_ITEM);
return $items;
}
}
/**
* this function allows a user to change or paste html in the
* administer - settings area.
*
*/
function front_page_settings() {
$output = form_textarea(t("Page text"), "front_page_text", variable_get("front_page_text", ""), 60, 10, t("Paste your HTML here"));
return $output;
}
/**
* print out the page
*
* this function loads up the front page and displays it
*
* the front_page module is setup to load the default theme and
* default blocks with it. If you want to change it so it loads
* as a full page on it's own..simple replace the last line where it
* says:
* print theme('page', $output);
* with
* print $output;
*
* That will load whatever you paste into your front_page settings under
* administer-settings as a full page.
*
*/
function front_page() {
$output = variable_get("front_page_text", "drupal");
print theme('page', $output);
}
P.S. Don't forget to include the opening and closing PHP tags.