coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 (BBS) Integration / Bridging => Topic started by: trackie on October 31, 2005, 09:21:12 PM

Title: SMF 1.0.5 bridge
Post by: trackie on October 31, 2005, 09:21:12 PM
Hi,

I tried to bridge CPG and SMF 1.0.5 and this is the result I get: Who can help me out, I'am lost at this point.

Notice: Undefined offset: 7 in /mnt/storage2/t/tr/trackie.nl/html/CPG_Gallery/bridge/smf.inc.php on line 75

Notice: Undefined offset: 7 in /mnt/storage2/t/tr/trackie.nl/html/CPG_Gallery/bridge/smf.inc.php on line 79

Warning: main(): open_basedir restriction in effect. File(/Settings.php) is not within the allowed path(s): (.) in /mnt/storage2/t/tr/trackie.nl/html/CPG_Gallery/bridge/smf.inc.php on line 79

Warning: main(/Settings.php): failed to open stream: Operation not permitted in /mnt/storage2/t/tr/trackie.nl/html/CPG_Gallery/bridge/smf.inc.php on line 79

Fatal error: main(): Failed opening required '/Settings.php' (include_path='.:/usr/apache/lib/php') in /mnt/storage2/t/tr/trackie.nl/html/CPG_Gallery/bridge/smf.inc.php on line 79

These are the lines in smf.inc.php (I included the line numbers)

63 // ------------------------------------------------------------------------- //
64 // Nothing to edit below this line
65 // ------------------------------------------------------------------------- //
66
67 // Otherwise, try to autodetect SMF path if not set:
68 if (substr($path, -1) == '/')
69         $path = substr($path, 0, -1);
70
71 $possible_paths = array($path, '..', '../forum', '../forums',
72 '../community', '../yabbse', '../smf');
73
74 $correct = 0;
75 while (!file_exists($possible_paths[$correct] . '/Settings.php') &&
76 count($possible_paths) > $correct)
77         $correct++;
78
80         require_once('../forum/smf_api.php');
81
82 smf_authenticateUser();
83 smf_loadSession();
84 smf_logOnline('coppermine');
85       
86 require_once($possible_paths[$correct] . '/Settings.php');
87
88 define ('SMF', 1);

My host is running PHP in safe mode!

Hope to hear from you.

Cheers,

Alfred
Title: Re: SMF 1.0.5 bridge
Post by: Nibbler on October 31, 2005, 09:26:32 PM
You specified the path wrong.


// Set this to the location of your Settings file:
$path = '../smf';
Title: Re: SMF 1.0.5 bridge
Post by: trackie on October 31, 2005, 09:52:07 PM
I do not use the ./smf directory, I placed all my files in the ./forum directory.

Title: Re: SMF 1.0.5 bridge
Post by: Nibbler on October 31, 2005, 09:55:08 PM
Right, so change it :)


// Set this to the location of your Settings file:
$path = '../forum';


That's the only part of the file you need to change.
Title: Re: SMF 1.0.5 bridge
Post by: trackie on October 31, 2005, 09:57:41 PM
I also get an error message about my host name.

I use an IP-address and not a specific name. When I fill in the IP-address of my MYSQL host I get an error saying:

Parse error: parse error, unexpected T_DNUMBER in /mnt/storage2/t/tr/trackie.nl/html/CPG_Gallery/bridge/smf.inc.php on line 95

89 // other includes
90 cm_include_smf_funcs("$sourcedir/Load.php", array("cache_get_data", "reloadSettings", "md5_hmac", "loadUserSettings"));
91 cm_include_smf_funcs("$sourcedir/Subs.php", array("updateMemberData", "updateStats", "updateSettings"));
92
93 // database configuration
94 define('SMF_DB_NAME', ********); // The name of the database used by the board
95 define('SMF_DB_HOST', 172.16.110.131); // The name of the database server
96 define('SMF_DB_USERNAME', ********); // The username to use to connect to the database
97 define('SMF_DB_PASSWORD', ********); // The password to use to connect to the database
98
99 // The web path to your SMF Board directory
100 define('SMF_WEB_PATH', "$/forum/");
101
102 // The Name of the Cookie used for SMF logon
103 define('SMF_COOKIE_NAME', SMFCookie10);
104
105 // Prefix for the database tables
106 define('SMF_TABLE_PREFIX', smf_); // Table Prefix
Title: Re: SMF 1.0.5 bridge
Post by: Nibbler on October 31, 2005, 10:01:02 PM
As I said before, the path is the only part of the file you need to change. Leave the rest alone.
Title: Re: SMF 1.0.5 bridge
Post by: trackie on October 31, 2005, 10:22:35 PM
Thnxs,

I extracted the smf.inc.php file from the original zip package. I did no adjustmenst or what so ever, But.... the same error message:

Notice: Undefined offset: 7 in /mnt/storage2/t/tr/trackie.nl/html/CPG_Gallery/bridge/smf.inc.php on line 75

Notice: Undefined offset: 7 in /mnt/storage2/t/tr/trackie.nl/html/CPG_Gallery/bridge/smf.inc.php on line 79

Warning: main(): open_basedir restriction in effect. File(/Settings.php) is not within the allowed path(s): (.) in /mnt/storage2/t/tr/trackie.nl/html/CPG_Gallery/bridge/smf.inc.php on line 79

Warning: main(/Settings.php): failed to open stream: Operation not permitted in /mnt/storage2/t/tr/trackie.nl/html/CPG_Gallery/bridge/smf.inc.php on line 79

Fatal error: main(): Failed opening required '/Settings.php' (include_path='.:/usr/apache/lib/php') in /mnt/storage2/t/tr/trackie.nl/html/CPG_Gallery/bridge/smf.inc.php on line 79


My hosting provider is running PHP in safe mode and some features are disabled/excluded. Has this something to do with it?
Title: Re: SMF 1.0.5 bridge
Post by: Nibbler on October 31, 2005, 10:31:38 PM
It means you still haven't set the path correctly. What's your directory layout ? Post links to your coppermine gallery and smf forum and what you have set for the path currently.
Title: Re: SMF 1.0.5 bridge
Post by: trackie on October 31, 2005, 10:37:16 PM
the forum is installed in

www.trackie.nl/forum

/html/forum

the gallery is installed in:

www.trackie.nl/CPG_Gallery

/html/CPG_Gallery


This is the path in the smf.inc.php file

// Set this to the location of your Settings file:
$path = '../smf';
Title: Re: SMF 1.0.5 bridge
Post by: Nibbler on October 31, 2005, 10:53:13 PM
Right, so change this:

$path = '../smf';

to this

$path = '../forum';
Title: Re: SMF 1.0.5 bridge
Post by: trackie on October 31, 2005, 10:56:35 PM
Done!

No result. Error message stays.
Title: Re: SMF 1.0.5 bridge
Post by: trackie on November 01, 2005, 02:12:51 PM
The error message is hosting provider related.

Ladot/Active 24 is running PHP in safe mode and therefor some PHP functions are not allowed/available. I tried putting Settings.pl from my forum directory in the bridge directory to bypass the file location problem.

But my PHP knowledge is very basic so I am not able to change the smf.inc.php file so it will work properly. Is there someone who can rewrite the bridge file, so it will work in PHP safemode?


These are the error message I get:

Notice: Undefined offset: 7 in /mnt/storage2/t/tr/trackie.nl/html/CPG_Gallery/bridge/smf.inc.php on line 75

Notice: Undefined offset: 7 in /mnt/storage2/t/tr/trackie.nl/html/CPG_Gallery/bridge/smf.inc.php on line 79

Warning: main(): open_basedir restriction in effect. File(/Settings.php) is not within the allowed path(s): (.) in /mnt/storage2/t/tr/trackie.nl/html/CPG_Gallery/bridge/smf.inc.php on line 79

Warning: main(/Settings.php): failed to open stream: Operation not permitted in /mnt/storage2/t/tr/trackie.nl/html/CPG_Gallery/bridge/smf.inc.php on line 79

Fatal error: main(): Failed opening required '/Settings.php' (include_path='.:/usr/apache/lib/php') in /mnt/storage2/t/tr/trackie.nl/html/CPG_Gallery/bridge/smf.inc.php on line 79


There are no flaws in the script and it should work properly.