Home arrow Forum
Mambo SMF Bridge problem
  Welcome, Guest. Please login or register.
January 08, 2009, 06:10:10 PM
Home New Posts Search Calendar


Login with username, password and session length
Forum  |  MamboHacks.com  |  Mambo-SMF Forum 1.3.0 Support  |  Topic: Mambo SMF Bridge problem « previous next »
Pages: [1] Go Down Print
Author Topic: Mambo SMF Bridge problem  (Read 4838 times)
Stuart Hunter
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 4


View Profile
Mambo SMF Bridge problem
« on: April 28, 2005, 06:38:18 PM »

I installes the Mambo Smf Bridge and it works OK. The problem that we are having is that when we open SMF forum from Mambo we get the following error message at the top of the forum section.

Notice: Constant SMF already defined in C:\Program Files\Apache Group\Apache2\htdocs\taxhunter\smf\index.php on line 38

The index.php file follows, it would be great if someone could let me know what is causing the problem and how to fix it.

<?php
/******************************************************************************
* index.php                                                                   *
*******************************************************************************
* SMF: Simple Machines Forum                                                  *
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com)                *
* =========================================================================== *
* Software Version:           SMF 1.0.3                                       *
* Software by:                Simple Machines (http://www.simplemachines.org) *
* Copyright 2001-2005 by:     Lewis Media (http://www.lewismedia.com)         *
* Support, News, Updates at:  http://www.simplemachines.org                   *
*******************************************************************************
* This program is free software; you may redistribute it and/or modify it     *
* under the terms of the provided license as published by Lewis Media.        *
*                                                                             *
* This program is distributed in the hope that it is and will be useful,      *
* but WITHOUT ANY WARRANTIES; without even any implied warranty of            *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                        *
*                                                                             *
* See the "license.txt" file for details of the Simple Machines license.      *
* The latest version can always be found at http://www.simplemachines.org.    *
******************************************************************************/

/*   This, as you have probably guessed, is the crux on which SMF functions.
   Everything should start here, so all the setup and security is done
   properly.  The most interesting part of this file is the action array in
   the smf_main() function.  It is formatted as so:

      'action-in-url' => array('Source-File.php', 'FunctionToCall'),

   Then, you can access the FunctionToCall() function from Source-File.php
   with the URL index.php?action=action-in-url.  Relatively simple, no?
*/

$forum_version = 'SMF 1.0.3';

// Get everything started up...
define('SMF', 1);
@set_magic_quotes_runtime(0);
error_reporting(E_ALL);
$time_start = microtime();

// Load the settings...
require_once(dirname(__FILE__) . '/Settings.php');

// Just in case something happens to Settings.php, let's try to at least load an error screen.
if (!isset($sourcedir))
   $sourcedir = dirname(__FILE__) . '/Sources';

// And important includes.
require_once($sourcedir . '/QueryString.php');
require_once($sourcedir . '/Subs.php');
require_once($sourcedir . '/Errors.php');
require_once($sourcedir . '/Load.php');
require_once($sourcedir . '/Security.php');

// If $maintenance is set specifically to 2, then we're upgrading or something.
if ($maintenance == 2)
   db_fatal_error();

// Connect to the MySQL database.
if (empty($db_persist))
   $db_connection = @mysql_connect($db_server, $db_user, $db_passwd);
else
   $db_connection = @mysql_pconnect($db_server, $db_user, $db_passwd);

// Show an error if the connection couldn't be made.
if (!$db_connection || !@mysql_select_db($db_name, $db_connection))
   db_fatal_error();

// Load the settings from the settings table, and perform operations like optimizing.
reloadSettings();
// Clean the request variables, add slashes, etc.
cleanRequest();
$context = array();

// Determine if this is should be using WAP, WAP2, or imode.
//mambohacks.com
if (!defined('WIRELESS')) define('WIRELESS', isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode']));

// Some settings and headers are different for wireless protocols.
if (WIRELESS)
{
   define('WIRELESS_PROTOCOL', isset($_REQUEST['wap']) ? 'wap' : (isset($_REQUEST['wap2']) ? 'wap2' : (isset($_REQUEST['imode']) ? 'imode' : '')));

   // Some cellphones can't handle output compression...
   $modSettings['enableCompressedOutput'] = '0';
   $modSettings['defaultMaxMessages'] = 5;
   $modSettings['defaultMaxTopics'] = 9;

   // Wireless protocol header.
   if (WIRELESS_PROTOCOL == 'wap')
      header('Content-Type: text/vnd.wap.wml');
}

// Check if compressed output is enabled, supported, and not already being done.
if (!empty($modSettings['enableCompressedOutput']) && !headers_sent() && ob_get_length() == 0)
{
   // If zlib is being used, turn off output compression.
   //mambohacks.com
   if (@ini_get('zlib.output_compression') == '1' || @ini_get('output_handler') == 'ob_gzhandler' || defined( '_VALID_MOS' ))
      $modSettings['enableCompressedOutput'] = '0';
   else
      ob_start('ob_gzhandler');
}
// This makes it so headers can be sent!
if (empty($modSettings['enableCompressedOutput']))
   ob_start();

// Register an error handler.
set_error_handler('error_handler');

// Start the session. (assuming it hasn't already been.)
loadSession();

// There's a strange bug in PHP 4.1.2 which makes $_SESSION not work unless you do this...
if (@version_compare(PHP_VERSION, '4.2.0') == -1)
   $HTTP_SESSION_VARS['php_412_bugfix'] = true;

// What function shall we execute? (done like this for memory's sake.)
call_user_func(smf_main());

// Call obExit specially; we're coming from the main area Wink.
obExit(null, null, true);

// The main controlling function.
function smf_main()
{
   global $modSettings, $settings, $user_info, $board, $topic, $maintenance, $sourcedir;

   // Load the user's cookie (or set as guest) and load their settings.
   loadUserSettings();

   // Load the current board's information.
   loadBoard();

   // Load the current theme.  (note that ?theme=1 will also work, may be used for guest theming.)
   loadTheme();

   // Check if the user should be disallowed access.
   is_not_banned();

   // Load the current user's permissions.
   loadPermissions();

   // Do some logging if this is not an attachment/avatar or the setting of an option.
   if (empty($_REQUEST['action']) || !in_array($_REQUEST['action'], array('dlattach', 'jsoption')))
   {
      // Log this user as online.
      writeLog();

      // Track forum statistics and hits...?
      if (!empty($modSettings['hitStats']))
         trackStats(array('hits' => '+'));
   }

   // Is the forum in maintenance mode? (doesn't apply to administrators.)
   if (!empty($maintenance) && !allowedTo('admin_forum'))
   {
      // You can only login.... otherwise, you're getting the "maintenance mode" display.
      if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'login2')
      {
         require_once($sourcedir . '/LogInOut.php');
         return 'Login2';
      }
      // Don't even try it, sonny.
      else
      {
         require_once($sourcedir . '/Subs-Auth.php');
         return 'InMaintenance';
      }
   }
   // If guest access is off, a guest can only do one of the very few following actions.
   elseif (empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], array('login', 'login2', 'register', 'register2', 'reminder', 'activate', 'help', '.xml'))))
   {
      require_once($sourcedir . '/Subs-Auth.php');
      return 'KickGuest';
   }
   elseif (empty($_REQUEST['action']))
   {
      // 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';
      }
   }

   // Here's the monstrous $_REQUEST['action'] array - $_REQUEST['action'] => array($file, $function).
   $actionArray = array(
      'activate' => array('Register.php', 'Activate'),
      'admin' => array('Admin.php', 'Admin'),
      'announce' => array('Post.php', 'AnnounceTopic'),
      'ban' => array('ManageMembers.php', 'Ban'),
      'boardrecount' => array('Admin.php', 'AdminBoardRecount'),
      'calendar' => array('Calendar.php', 'CalendarMain'),
      'collapse' => array('Subs-Boards.php', 'CollapseCategory'),
      'deletemsg' => array('RemoveTopic.php', 'DeleteMessage'),
      'detailedversion' => array('Admin.php', 'VersionDetail'),
      'display' => array('Display.php', 'Display'),
      'dlattach' => array('Display.php', 'Download'),
      'dumpdb' => array('DumpDatabase.php', 'DumpDatabase2'),
      'editagreement' => array('Admin.php', 'EditAgreement'),
      'editnews' => array('Admin.php', 'EditNews'),
      'editpoll' => array('Poll.php', 'EditPoll'),
      'editpoll2' => array('Poll.php', 'EditPoll2'),
      'findmember' => array('Subs-Auth.php', 'JSMembers'),
      'help' => array('Help.php', 'ShowHelp'),
      'helpadmin' => array('Help.php', 'ShowAdminHelp'),
      'im' => array('InstantMessage.php', 'MessageMain'),
      'jsoption' => array('Themes.php', 'SetJavaScript'),
      'lock' => array('LockTopic.php', 'LockTopic'),
      'lockVoting' => array('Poll.php', 'LockVoting'),
      'login' => array('LogInOut.php', 'Login'),
      'login2' => array('LogInOut.php', 'Login2'),
      'logout' => array('LogInOut.php', 'Logout'),
      'mailing' => array('ManageMembers.php', 'MailingList'),
      'maintain' => array('Admin.php', 'Maintenance'),
      'manageattachments' => array('ManageAttachments.php', 'ManageAttachments'),
      'manageboards' => array('ManageBoards.php', 'ManageBoards'),
      'markasread' => array('Subs-Boards.php', 'MarkRead'),
      'membergroups' => array('ManageMembers.php', 'ModifyMembergroups'),
      'mergetopics' => array('SplitTopics.php', 'MergeTopics'),
      'mlist' => array('Memberlist.php', 'Memberlist'),
      'modifycat' => array('ManageBoards.php', 'ModifyCat'),
      'modifykarma' => array('Karma.php', 'ModifyKarma'),
      'modifyModSettings' => array('ModSettings.php', 'ModifyModSettings'),
      'modifyModSettings2' => array('ModSettings.php', 'ModifyModSettings2'),
      'modlog' => array('Modlog.php', 'ViewModlog'),
      'modlog2' => array('Modlog.php', 'ViewModlog2'),
      'modsettings' => array('Admin.php', 'ModifySettings'),
      'modsettings2' => array('Admin.php', 'ModifySettings2'),
      'movetopic' => array('MoveTopic.php', 'MoveTopic'),
      'movetopic2' => array('MoveTopic.php', 'MoveTopic2'),
      'notify' => array('Notify.php', 'Notify'),
      'notifyboard' => array('Notify.php', 'BoardNotify'),
      'optimizetables' => array('Admin.php', 'OptimizeTables'),
      'packageget' => array('PackageGet.php', 'PackageGet'),
      'packages' => array('Packages.php', 'Packages'),
      'permissions' => array('ManagePermissions.php', 'ModifyPermissions'),
      'pgadd' => array('PackageGet.php', 'PackageServerAdd'),
      'pgremove' => array('PackageGet.php', 'PackageServerRemove'),
      'pgbrowse' => array('PackageGet.php', 'PackageGBrowse'),
      'pgdownload' => array('PackageGet.php', 'PackageDownload'),
      'pgupload' => array('PackageGet.php', 'PackageUpload'),
      'pm' => array('InstantMessage.php', 'MessageMain'),
      'post' => array('Post.php', 'Post'),
      'post2' => array('Post.php', 'Post2'),
      'printpage' => array('Printpage.php', 'PrintTopic'),
      'profile' => array('Profile.php', 'ModifyProfile'),
      'profile2' => array('Profile.php', 'ModifyProfile2'),
      'quotefast' => array('Post.php', 'QuoteFast'),
      'quickmod' => array('Subs-Boards.php', 'QuickModeration'),
      'quickmod2' => array('Subs-Boards.php', 'QuickModeration2'),
      'recent' => array('Recent.php', 'RecentPosts'),
      'regcenter' => array('Register.php', 'RegCenter'),
      'register' => array('Register.php', 'Register'),
      'register2' => array('Register.php', 'Register2'),
      'reminder' => array('Reminder.php', 'RemindMe'),
      'removetopic2' => array('RemoveTopic.php', 'RemoveTopic2'),
      'removeoldtopics2' => array('RemoveTopic.php', 'RemoveOldTopics2'),
      'removepoll' => array('Poll.php', 'RemovePoll'),
      'repairboards' => array('RepairBoards.php', 'RepairBoards'),
      'reporttm' => array('SendTopic.php', 'ReportToModerator'),
      'search' => array('Search.php', 'PlushSearch1'),
      'search2' => array('Search.php', 'PlushSearch2'),
      'sendtopic' => array('SendTopic.php', 'SendTopic'),
      'setcensor' => array('Admin.php', 'SetCensor'),
      'setcensor2' => array('Admin.php', 'SetCensor2'),
      'setreserve' => array('ManageMembers.php', 'SetReserve'),
      'setreserve2' => array('ManageMembers.php', 'SetReserve2'),
      'smileys' => array('ManageSmileys.php', 'ManageSmileys'),
      'spellcheck' => array('Subs-Post.php', 'SpellCheck'),
      'splittopics' => array('SplitTopics.php', 'SplitTopics'),
      'stats' => array('Stats.php', 'DisplayStats'),
      'sticky' => array('LockTopic.php', 'Sticky'),
      'theme' => array('Themes.php', 'ThemesMain'),
      'trackip' => array('ManageMembers.php', 'trackIP'),
      'about:mozilla' => array('Karma.php', 'BookOfUnknown'),
      'about:unknown' => array('Karma.php', 'BookOfUnknown'),
      'unread' => array('Recent.php', 'UnreadTopics'),
      'unreadreplies' => array('Recent.php', 'UnreadTopics'),
      'viewErrorLog' => array('Errors.php', 'ViewErrorLog'),
      'viewmembers' => array('ManageMembers.php', 'ViewMembers'),
      'viewprofile' => array('Profile.php', 'ModifyProfile'),
      'vote' => array('Poll.php', 'Vote'),
      'viewquery' => array('ViewQuery.php', 'ViewQuery'),
      'who' => array('Who.php', 'Who'),
      '.xml' => array('News.php', 'ShowXmlFeed'),
   );

   // Get the function and file to include - if it's not there, do the board index.
   if (!isset($_REQUEST['action']) || !isset($actionArray[$_REQUEST['action']]))
   {
      // Catch the action with the theme?
      if (!empty($settings['catch_action']))
      {
         require_once($sourcedir . '/Themes.php');
         return 'WrapAction';
      }

      // Fall through to the board index then...
      require_once($sourcedir . '/BoardIndex.php');
      return 'BoardIndex';
   }

   // Otherwise, it was set - so let's go to that action.
   require_once($sourcedir . '/' . $actionArray[$_REQUEST['action']][0]);
   return $actionArray[$_REQUEST['action']][1];
}

?>
Logged
cowboy
Administrator
Hero Member
*****

Karma: +30/-0
Offline Offline

Posts: 663



View Profile WWW
Re: Mambo SMF Bridge problem
« Reply #1 on: April 29, 2005, 06:43:06 PM »

Stuart,

The problem would not come from that file. Did you upgrade from a previous version? What version did you install. And can you tell me your mambo and smf version.
Logged
Stuart Hunter
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 4


View Profile
Re: Mambo SMF Bridge problem
« Reply #2 on: May 01, 2005, 02:26:01 AM »

I have installed smf 1.0.3 and mambo 4.5.2
Apache 2.0.52 on WinXO Pro and PHP 5.0.2

I tried to install the previous version of the mambo-smf bridge but could not get it working. It was uninstalled, the old smf forum board wad deleted and 1.0.3 was a new install. Some of the files from the old install could remain on the mambo side.

Look forward to any suggestions that you are able to make

Stuart
« Last Edit: May 08, 2005, 09:43:49 PM by Stuart Hunter » Logged
Stuart Hunter
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 4


View Profile
Re: Mambo SMF Bridge problem
« Reply #3 on: May 08, 2005, 09:44:49 PM »

Installed Mambo SMF Bridge 1.3.1 and the same error occurs
Logged
Stuart Hunter
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 4


View Profile
Re: Mambo SMF Bridge problem
« Reply #4 on: May 10, 2005, 09:51:28 PM »

Installed 1.3.1.1 and the previous problem seemed to be corrected.

In the Mambo-SMF Forum Configuration screen at the "Registration Module to use" I am now getting the following error message;

Notice: Use of undefined constant mambo - assumed 'mambo' in C:\Program Files\Apache Group\Apache2\htdocs\taxhunter\administrator\components\com_smf\admin.smf.php on line 224
>Mambo  Notice: Use of undefined constant cb - assumed 'cb' in C:\Program Files\Apache Group\Apache2\htdocs\taxhunter\administrator\components\com_smf\admin.smf.php on line 225
checked="checked">CB   

I am using the community board CB Login 4.5.2, this seemed to work without incident previously.
The board seems to be working OK, the errors do not seem to effect the boards operations.

Stuart
Logged
Ray
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 6


View Profile
Re: Mambo SMF Bridge problem
« Reply #5 on: May 14, 2005, 01:05:02 PM »

I have the identical problem, except when I applied the 1.3.1.1 fix, the "Constant SMF already exists...on line 38" error did not go away.  I also have the admin error when I go into the mambo-smf config:
   
Notice: Use of undefined constant mambo - assumed 'mambo' in C:\Documents and Settings\rdelacruz\My Documents\Web\rgvoffroad\healthcaretechies\administrator\components\com_smf\admin.smf.php on line 224
>Mambo

Notice: Use of undefined constant cb - assumed 'cb' in C:\Documents and Settings\rdelacruz\My Documents\Web\rgvoffroad\healthcaretechies\administrator\components\com_smf\admin.smf.php on line 225
>CB

I've had trouble with the SMF-mambo integration 1.3.1 toolkit.  Both
Mambo and SMF work fine independently; however, the integration module
always returns the following error when I access the Mambo home page after integration steps are complete:

Notice: Constant SMF already defined in C:\Documents and
Settings\rdelacruz\My Documents\Web\rgvoffroad\healthcaretechies\forum\index.php on line 38

Here are the steps I've done:
  (WinXP SP2, MySQL 4.0.16-max-nt, PHP 4.3.4.4, Apache 2.0.48)
1. Mambo 4.5.2 (with 4.5.2.1 patch)new install
2. SMF 1.0.3 new install (same database as mambo)
3. Install mambo-smf component from Mambo Admin
4. Install SMF-Mambo int package from SMF Admin
5. Configure Mambo component
   a. corrected path, then save
   b. 4 checklist items=installed,installed,done,done
6. Load mambo home page, above error appears.  Can you tell me how to
correct this error regarding the "Constant SMF"?

I have completely deleted all SMF and Mambo files, as well as the database and reinstalled at least five times; however, I always end up with the same error.  Any help would be greatly appreciated.

One difference I have is that I have not installed any CB or other login compoents or modules, since I thought the Mambo-SMF bridge used the native login process.
« Last Edit: May 14, 2005, 11:57:17 PM by Ray » Logged
k
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 1


View Profile
Re: Mambo SMF Bridge problem
« Reply #6 on: May 15, 2005, 08:13:20 PM »

I seemed to have the same problem as described in this topic and others as well.

When I imported the SMF tables my Mambo database, then changed the SMF Settings.php file to point to the new database, I forgot to change the password. 

Strangely enough, even though SMF could not log in, it seem to affect other parts of my site as well, such as Gallery, and some of the front page items.

Anyway -- the fix make sure SMF was using the correct password to login to the Mambo database.

Hope this helps ...

- k -
Logged
Pages: [1] Go Up Print 
Forum  |  MamboHacks.com  |  Mambo-SMF Forum 1.3.0 Support  |  Topic: Mambo SMF Bridge problem « previous next »
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Forum | Powered by SMF 1.0.5 & Mambo-SMF.
© 2001-2005, Lewis Media. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!
None of the text or images in this public website may be copied without the expressed written consent of the authors.
Copyright 2005 by MamboHacks.com. Powered by Mambo. All rights reserved.
TERMS OF USE