Advertisement:

Author Topic: Using just a part of SMF.  (Read 15389 times)

Offline Randall

  • Semi-Newbie
  • *
  • Posts: 29
    • Tarheel East
Using just a part of SMF.
« on: May 12, 2005, 09:29:38 PM »
I'm working on a calendar for a client and really liked the SMF calendar, especially the way it's layed out in the SMFOne theme.  The client wants to have guest access, be able to moderate events before the public views them, and possibly have some registered members down the road that don't have to have their posts moderated.  No forum is wanted.

So I'm basically skipping the rest of the SMF package to just use the calendar.  The same thing can be done for other parts, or mods to the script, such as the arcade, or etc.

Here's the code changes to make index.php default  to the calendar...


Find in index.php, within function smf_main ..
Code: [Select]
{
// Action and board are both empty... BoardIndex!
if (empty($board) && empty($topic))
{
require_once($sourcedir . '/BoardIndex.php');
return 'BoardIndex';
}
// Topic is empty, and action is empty.... MessageIndex!
elseif (empty($topic))
{
require_once($sourcedir . '/MessageIndex.php');
return 'MessageIndex';
}
// Board is not empty... topic is not empty... action is empty.. Display!
else
{
require_once($sourcedir . '/Display.php');
return 'Display';
}
}


Replace with ..
Code: [Select]
{
// Action and board are both empty... Calendar!
if (empty($board) && empty($topic))
{
require_once($sourcedir . '/Calendar.php');
return 'CalendarMain';
}
// Topic is empty, and action is empty.... MessageIndex!
elseif (empty($topic))
{
require_once($sourcedir . '/MessageIndex.php');
return 'MessageIndex';
}
// Board is not empty... topic is not empty... action is empty.. Display!
else
{
require_once($sourcedir . '/Display.php');
return 'Display';
}
}

See it in action at http://www.crosscountryracers.com/smftest