Okie I've done a search with the help of valiant I've found a similar integration but its just that the gallery version is 1.4.1 or 1.4.3. Some of the codes are pretty much different thus I was unable to locate or try to play around. I'll post it up on the next thread.
Posts: 24
Posts: 24
The problem rises from below. I cannot locate the files and I believe the method is totally different thus I can't find a place to insert the global $ibforum;
Posts: 32509
Is this thread about G1.x or porting the integration to G2?
And all G1.x integration code won't help much when integrating G2, it's a whole different story.
Well, at least you could copy the invision part of the G1.x integration for the G2 integration.
Posts: 24
Once again, this is another stumbling block for me. I hope someone can point me somewhere to try or help with this.
Open <gallery dir>/init.php Find: <? // Hack prevention. $sensitiveList = array("gallery", "GALLERY_BASEDIR"); foreach ($sensitiveList as $sensitive) { if (!empty($HTTP_GET_VARS[$sensitive]) || !empty($HTTP_POST_VARS[$sensitive]) || !empty($HTTP_COOKIE_VARS[$sensitive]) || !empty($HTTP_POST_FILES[$sensitive])) { print "Security violation\n"; exit; } } ?> Add Below: <? // START - Invision Embedding $GALLERY_EMBEDDED_INSIDE = "invisionboard"; $GALLERY_EMBEDDED_INSIDE_TYPE = "invisionboard"; $root_path = "../"; //EDIT:: Set to the path of your Forums Directory. class Debug { function startTimer() { global $starttime; $mtime = microtime (); $mtime = explode (' ', $mtime); $mtime = $mtime[1] + $mtime[0]; $starttime = $mtime; } function endTimer() { global $starttime; $mtime = microtime (); $mtime = explode (' ', $mtime); $mtime = $mtime[1] + $mtime[0]; $endtime = $mtime; $totaltime = round (($endtime - $starttime), 5); return $totaltime; } } class info { var $member = array(); var $input = array(); var $session_id = ""; var $base_url = ""; var $vars = ""; var $skin_id = "s1"; // Skin Dir name var $skin_rid = "1"; // Real skin id (numerical only) var $lang_id = "fr"; var $skin = ""; var $lang = ""; var $server_load = 0; var $version = "v1.0.1"; var $lastclick = ""; var $location = ""; function info() { global $sess, $std, $DB, $root_path, $INFO; $this->vars = &$INFO; $this->vars['TEAM_ICON_URL'] = $INFO['html_url'] . '/team_icons'; $this->vars['AVATARS_URL'] = $INFO['html_url'] . '/avatars'; $this->vars['EMOTICONS_URL'] = $INFO['html_url'] . '/emoticons'; $this->vars['mime_img'] = $INFO['html_url'] . '/mime_types'; } } //-------------------------------- // Import $INFO, now! //-------------------------------- require $root_path."/forum/conf_global.php"; //-------------------------------- // The clocks a' tickin' //-------------------------------- $Debug = new Debug; $Debug->startTimer(); //-------------------------------- // Require our global functions //-------------------------------- require $root_path."/forum/sources/functions.php"; $std = new FUNC; $print = new display(); $sess = new session(); //-------------------------------- // Load the DB driver and such //-------------------------------- $INFO['sql_driver'] = !$INFO['sql_driver'] ? 'mySQL' : $INFO['sql_driver']; $to_require = $root_path."/forum/sources/Drivers/".$INFO['sql_driver'].".php"; require ($to_require); $DB = new db_driver; $DB->obj['sql_database'] = $INFO['sql_database']; $DB->obj['sql_user'] = $INFO['sql_user']; $DB->obj['sql_pass'] = $INFO['sql_pass']; $DB->obj['sql_host'] = $INFO['sql_host']; $DB->obj['sql_tbl_prefix'] = $INFO['sql_tbl_prefix']; // Get a DB connection $DB->connect(); //-------------------------------- // Wrap it all up in a nice easy to // transport super class //-------------------------------- $ibforums = new info(); //-------------------------------- // Set up our vars //-------------------------------- $ibforums->vars['tmpl_dir'] = "../templates/"; $ibforums->input = $std->parse_incoming(); $ibforums->member = $sess->authorise(); $ibforums->skin = $std->load_skin(); $ibforums->lastclick = $sess->last_click; $ibforums->location = $sess->location; $ibforums->session_id = $sess->session_id; if ($ibforums->member['id'] and ( $std->my_getcookie('hide_sess') ) ) { $ibforums->session_id = ""; } $ibforums->base_url = $ibforums->vars['board_url'].'/index.'.$ibforums->vars['php_ext'].'?s='.$ibforums->session_id; $ibforums->skin_rid = $ibforums->skin['set_id']; $ibforums->skin_id = 's'.$ibforums->skin['set_id']; $ibforums->vars['img_url'] = 'style_images/' . $ibforums->skin['set_id']; //-------------------------------- // Set up our language choice //-------------------------------- $ibforums->lang_id = $ibforums->member['language'] ? $ibforums->member['language'] : 'en'; if ( ($ibforums->lang_id != 'en') and (! is_dir( $root_path."lang/".$ibforums->lang_id ) ) ) { $ibforums->lang_id = 'en'; } require $root_path."/forum/lang/".$ibforums->lang_id."/lang_global.php"; $ibforums->lang = $lang; unset($lang); //-------------------------------- require $root_path."/forum/Skin/".$ibforums->skin_id."/skin_global.php"; $skin_universal = new skin_global(); // *************************************** // END - Invision Embedding ?> Find: (around line +/- 312) if (isset($GALLERY_EMBEDDED_INSIDE)) { /* Okay, we are embedded */ switch($GALLERY_EMBEDDED_INSIDE_TYPE) { Add Below: // START - Invision Embedding case 'invisionboard': include($GALLERY_BASEDIR . "classes/Database.php"); include($GALLERY_BASEDIR . "classes/database/mysql/Database.php"); include($GALLERY_BASEDIR . "classes/invisionboard/UserDB.php"); include($GALLERY_BASEDIR . "classes/invisionboard/User.php"); $gallery->database{$INFO['sql_database']} = new MySQL_Database( $INFO['sql_host'], $INFO['sql_user'], $INFO['sql_pass'], $INFO['sql_database']); $gallery->database{$INFO['sql_database']}->$INFO['sql_tbl_prefix']; /* Load our user database (and user object) */ $gallery->userDB = new Gallery_UserDB; $gallery->session->username = $ibforums->member['name']; $gallery->user = $gallery->userDB->getUserByUsername($gallery->session->username); if ($gallery->session->username) { // -- load user object by specifying userid instead of username $gallery->user = $gallery->userDB->getUserByUid($ibforums->member['id']); } break; // END - Invision Embedding ?> Save your changesPosts: 32509
perhaps you've missed my answer (scroll up).
what is this about?