Page 1 of 2

trying to add forum (style a forum or session)

Posted: Mon Feb 07, 2011 3:02 am
by axel
hi,

first post seems this is the best place to get abit of help :-)

anyway i am wanting to add a forum to my store.

so i have created a new page like http://xxx.com/forum.php looks like this

include(dirname(__FILE__)."/init.php");
$GLOBALS['ISC_CLASS_ORDER'] = GetClass('ISC_forum');
$GLOBALS['ISC_CLASS_ORDER']->HandlePage();

and added this to the init.php

),
"sitemap" => array(
"class" => "class.forum.php",
"name" => "ISC_FORUM",
"global" => "ISC_CLASS_FORUM"


i then made a class.forum.php in the includes/classes
looks like this (i think i am lost here now)

<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './phpbb3/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
?>

now basically it gives an error

Fatal error: Cannot redeclare redirect() (previously declared in xxx\lib\general.php:3505) in xxx\phpBB3\includes\functions.php on line 2473

those lines are
3505: function redirect($url, $status = 303)

2473:
// Behave as per HTTP/1.1 spec for others
header('Location: ' . $url);
exit;
}

do you think this will work somehow or is there another better way to get a forum into my site..
at this point i don't mind duel log ins, the store will be email and the forum screen names.?

hope you can help :D
thanx,

Axel.

Re: trying to add forum (style a forum or session)

Posted: Mon Feb 07, 2011 9:53 am
by Tony Barnes
I think that ISC sandboxes php to just its own files, or something like that? php includes used to work on earlier versions, but got nerfed for 'security' reasons.

I've never managed to get anything to integrate, did a wordpress blog on a couple, just ended up styling the blog like the rest of the site.

Re: trying to add forum (style a forum or session)

Posted: Mon Feb 07, 2011 11:09 am
by axel
meh so its kinda a mission then >< maybe ill have to just style it then what a pity.

i was plying with the lines that were giving errors and
what i did find was it tries to load phpbb and it has a template clash so i don't know if i am on the right path or just walking into walls :?
so maybe i need to mod isc template to work on phpbb.. ouch my head is starting to hurt >< hehehe

Re: trying to add forum (style a forum or session)

Posted: Mon Feb 07, 2011 2:25 pm
by Tony Barnes
Personally I'd just make the BB look like your ISC cart - you probably wouldn't want to have any 'live' panels from the cart in your forum anyway, as they would get in the way of forum stuff.

Will save you a lot of time!!!

Re: trying to add forum (style a forum or session)

Posted: Mon Feb 07, 2011 4:12 pm
by axel
yes I think I am gonna move onto doing that now, tho full integration would be awesome so customers wouldn't have to sign up twice hmmm, 8-)
i don't think I know enough about sql to start that...

Thank you for the reply's will post back what i decide. :-)


Axel.

Re: trying to add forum (style a forum or session)

Posted: Mon Feb 07, 2011 5:23 pm
by Tony Barnes
Ah, so you're thinking from a sign in point of view... sorry, didn't think of that.

You could perhaps hi-jack the cookie that ISC uses?

Re: trying to add forum (style a forum or session)

Posted: Mon Feb 07, 2011 5:58 pm
by axel
hmmmm that sounds interesting ... no clue how to do that >< could you point me in the right direction :mrgreen:

Re: trying to add forum (style a forum or session)

Posted: Mon Feb 07, 2011 6:34 pm
by Tony Barnes
Haha - jolly good question!!

You'd have to go through the ISC code, find out how it declares/stores the cookies, and hack it into the BB code. Probably not very quick and or easy...

Alternatively, you could try and lock into the customer account functions, to create a BB user on the back of the ISC code... again, not pretty.

Hmmmmm, ah, this may be good, you could set the BB to look at the ISC database for login credentials for customers - you'd need to copy across the obfuscation bits, but at least that would mean that a customer would only have 1 log in generated. You could then use the BB cookie system as stands, and if they make changes to passwords, etc, change it in the cart.

That might not be too tricky? Not a quick option though, none are!

Re: trying to add forum (style a forum or session)

Posted: Mon Feb 07, 2011 7:05 pm
by axel
I was thinking about them sharing db for log ins hmmm, I will take a look in the morning maybe i can make something work :mrgreen:
the only this was setting up moderators and admins for the forum may have to give them access rights to the store aswell >< not always the best idea

Thanks

Axel.

Re: trying to add forum (style a forum or session)

Posted: Tue Feb 08, 2011 11:05 am
by Martin
axel wrote:...now basically it gives an error

Fatal error: Cannot redeclare redirect() (previously declared in xxx\lib\general.php:3505) in xxx\phpBB3\includes\functions.php on line 2473
Just to get back to the original problem...

The reason it wasn't letting you integrate with the error above was because the function redirect() has been defined in both the phpBB3 and the ISC code so it just borks and sulks with that error.

I'm pretty sure the phpBB3 code has some form of hook system that allows external authentication from another system so your first port of call might be to look at how other auth' systems have been written in or mod'd for phpBB3 and then see how you can apply the lessons from those into this project.