Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] phpBB-osCommerce Bridge


gabrielk

Recommended Posts

Hey guys

 

I've sorted all my errors and this contrib is working great :) All I'm going to change is the part that writes the username to allow the user to choose a username. I've nearly finished so if anybody is intrested post back and il post instructions.

Link to comment
Share on other sites

  • Replies 149
  • Created
  • Last Reply

Top Posters In This Topic

Finished

 

Demo @ My Web Site Check it out.

 

I was thinking of adding a option? What about if we add if a username is already taken offer a alternative? Let me know what you think :)

 

 

PS: This is a live shop so don't buy anything if you don't want it!

Link to comment
Share on other sites

  • 3 weeks later...

After my installation tonight, I brought up www.mystore.com/forum and it is redirecting me to www.mystore.com/forum/install/install.php and blasting a 404 Not Found up.

 

My guess is that phpBB is not recognizing the MySQL database and, thinking it's a new installation, is attempting to guide me through the installation process.

 

Can anyone tell me where I might be off here?

 

Thanks in advance!

 

--Isaac--

Link to comment
Share on other sites

Well, Folks. I have installed the bridge contribution and couldn't be more excited.... except for the plethora of errors popping off all over the place!

 

Now when one of my customers clicks the "login" link on the store's main page, the following errors are presented:

 

Warning: main(./webextension.inc) [function.main]: failed to open stream: No such file or directory in /home/moonl/public_html/login.php on line 17

Warning: main(./webextension.inc) [function.main]: failed to open stream: No such file or directory in /home/moonl/public_html/login.php on line 17

Warning: main() [function.include]: Failed opening './webextension.inc' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/moonl/public_html/login.php on line 17

Warning: main(./webcommon.) [function.main]: failed to open stream: No such file or directory in /home/moonl/public_html/login.php on line 18

Warning: main(./webcommon.) [function.main]: failed to open stream: No such file or directory in /home/moonl/public_html/login.php on line 18

Warning: main() [function.include]: Failed opening './webcommon.' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/moonl/public_html/login.php on line 18

Warning: Cannot modify header information - headers already sent by (output started at /home/moonl/public_html/login.php:17) in /home/moonl/public_html/includes/functions/general.php on line 1231

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/moonl/public_html/login.php:17) in /home/moonl/public_html/includes/functions/sessions.php on line 97

 

I'm not sure what's going on here. I have nearly ripped out ALL my hair! My login.php file around line 19 reads like this:

 

  // Added for phpBB-osCommerce Bridge
 define("IN_LOGIN", true);
 define('IN_PHPBB', true);
 $phpbb_root_path = './web';
 include($phpbb_root_path . 'extension.inc');
 include($phpbb_root_path . 'common.'.$phpEx);
 // End phpBB-osCommerce Bridge

 

If anyone has any input, I'd appreciate it! I'm getting desparate at this point! :'(

Link to comment
Share on other sites

Quick update-

 

Turns out adding the line of code to my create_account.php gives me this error now upon account creation:

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/cworks/public_html/includes/functions/database.php on line 99

Warning: Cannot modify header information - headers already sent by (output started at /home/cworks/public_html/includes/functions/database.php:99) in /home/cworks/public_html/includes/functions/general.php on line 33

 

Was anyone able to come up with a solution to this problem? I'm now stuck with the exact same issue myself! Would greatly appreciate someone posting a fix if they have one.

 

Thanks! :)

Link to comment
Share on other sites

Was anyone able to come up with a solution to this problem? I'm now stuck with the exact same issue myself! Would greatly appreciate someone posting a fix if they have one.

 

Thanks! :)

 

Has anyone actually got this contribution to work properly?? I have done some research and as it happens, there is some kind of critical error with the MySQL syntax that is generating this error. I'm still working on a fix, but I literally have ZERO knowledge of MySQL so it's definitely slow-going and very much on-the-job training!

 

Anyway I was just wondering if anyone has actually been successful with this contribution as I'm far from even being able to successfully create an account. I would really like to get this thing working correctly soon if at all possible, and it's feeling more and more hopeless.

 

Can anyone give me SOME kind of encouragement (if not a fix *g*)? :)

Link to comment
Share on other sites

OMG! :D

 

After what feels like twelve lifetimes, I finally got this fixed!

 

The mistake was in the create_account.php file.

 

There is a code block for insertion that reads:

 

// Added for phpBB Intergration
// Find if username exists already, append a number if it does.
// Username = first name + last initial + number.
// This function is repeated in account_edit.php & login.php
$new_username = strtolower($firstname) . strtolower(substr($lastname,0,1));
$unQuery = tep_db_query("SELECT count(*) AS count FROM ".TABLE_PHPBB_USERS." WHERE username LIKE '".$new_username."%'");
if($unQuery) {
$unResult = tep_db_fetch_array($unQuery);
if($unResult['count']>0) {
	// Username exists; find out how many there are an append the next # to it.
	$unCount = $unResult['count'];
	$unCount++;
}
} else {
$unCount = '';
}
$new_username = $new_username.$unCount;

// This array set is repeated (with some differences) in login.php
// We’re only entering the most basic information, relying on 
// the forum defaults for most things.  
  $sql_data_array2 = array(
				  'user_id' => $customer_id,
				  'username' => $new_username,
				  'user_password' => md5($password),
				  'user_session_time' => time(),
				  'user_regdate' => time(),
				  'user_email' => $email_address,
				  'user_from' => tep_get_zone_name((int)($country),(int)($zone_id),0)
				  );						 
  tep_db_perform(TABLE_PHPBB_USERS, $sql_data_array2);
// Insert our new user into the default group.
// If you want your new signups to go to a different group,
// change "VALUES ('1'" to the actual user group id.
  tep_db_query("insert into " . TABLE_PHPBB_USER_GROUPS . " (group_id, user_id, user_pending) VALUES ('1', $customer_id, 0)");
session_begin($customer_id, encode_ip(tep_get_ip_address()), PAGE_INDEX, FALSE, $autologin, 0);
$userdata = tep_db_fetch_array($check_bbusers_query);
$last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time; 
tep_db_query("UPDATE " . TABLE_PHPBB_USERS . " SET user_session_time = '".$current_time."', user_session_page = '0', user_lastvisit = '".$last_visit."' WHERE user_id ='" . $check_customer['customers_id'] . "'");
$userdata['user_lastvisit'] = $last_visit;
// End phpBB-osCommerce Bridge

 

....whereas it *SHOULD* read:

 

// Added for phpBB Intergration
// Find if username exists already, append a number if it does.
// Username = first name + last initial + number.
// This function is repeated in account_edit.php & login.php
$check_bbusers_query = tep_db_query("select *  from " . TABLE_PHPBB_USERS . " where user_id = '" . $check_customer['customers_id'] . "'");
$new_username = strtolower($firstname) . strtolower(substr($lastname,0,1));
$unQuery = tep_db_query("SELECT count(*) AS count FROM ".TABLE_PHPBB_USERS." WHERE username LIKE '".$new_username."%'");
if($unQuery) {
$unResult = tep_db_fetch_array($unQuery);
if($unResult['count']>0) {
	// Username exists; find out how many there are and append the next # to it.
	$unCount = $unResult['count'];
	$unCount++;
}
} else {
$unCount = '';
}
$new_username = $new_username.$unCount;

// This array set is repeated (with some differences) in login.php
// We’re only entering the most basic information, relying on 
// the forum defaults for most things.  
   $sql_data_array2 = array('user_id' => $customer_id,
				  'username' => $new_username,
				  'user_password' => md5($password),
				  'user_session_time' => time(),
				  'user_regdate' => time(),
				  'user_email' => $email_address,
				  'user_from' => tep_get_zone_name((int)($country),(int)($zone_id),0)
				  );						 
  tep_db_perform(TABLE_PHPBB_USERS, $sql_data_array2);
// Insert our new user into the default group.
// If you want your new signups to go to a different group,
// change "VALUES ('1'" to the actual user group id.
  tep_db_query("insert into " . TABLE_PHPBB_USER_GROUPS . " (group_id, user_id, user_pending) VALUES ('1', $customer_id, 0)");
session_begin($customer_id, encode_ip(tep_get_ip_address()), PAGE_INDEX, FALSE, $autologin, 0);
$userdata = tep_db_fetch_array($check_bbusers_query);
$last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time; 
tep_db_query("UPDATE " . TABLE_PHPBB_USERS . " SET user_session_time = '".$current_time."', user_session_page = '0', user_lastvisit = '".$last_visit."' WHERE user_id ='" . $check_customer['customers_id'] . "'");
$userdata['user_lastvisit'] = $last_visit;
// End phpBB-osCommerce Bridge

 

...the only difference being the $check_bbusers_query line. One little simple line broke my store for quite some time, and now it's up and running like a charm!

Link to comment
Share on other sites

Okay so I got everything up and running and it's all working great (except for the admin screens, of course).

 

Now, all of a sudden, no matter what username or email address I enter, my forums tell me I have entered an incorrect username or password. I can't get in to the forums at all.

 

Any ideas where I could go to check my coding?

Link to comment
Share on other sites

  • 3 weeks later...
how can i make the username to be capitalized? i know id have to change the create account and update account bits of code, but how should i modify the "create username" string? anyone knows?

 

nvm found the ucfirst thing. but if i edit something in my account, it checks if name exist, and assigns me the number if i edit my own account, not sure how to fix it. im using username instead of first name, because my users place more importance in their nicks, so i want the forums to reflect that.

Link to comment
Share on other sites

  • 2 weeks later...

Hello I have followed all the installation instructions of the "phpBB OsCommerce Bridge" and it looks like it works fine except when I try to login... it gives me this error:

 

1146 - Table 'mysite_osc1.phpbb_users' doesn't exist

 

UPDATE phpbb_users SET user_password = '52c3643736deade012545a9344eecb5b:2a' WHERE user_id='2'

 

[TEP STOP]

 

what is wrong? please help! thanks.

(sorry I posted in the wrong place before)

Link to comment
Share on other sites

Hey guys

 

I've sorted all my errors and this contrib is working great :) All I'm going to change is the part that writes the username to allow the user to choose a username. I've nearly finished so if anybody is intrested post back and il post instructions.

 

 

I am also having the same kind of issues with this hack, what did you do to resolve them?

 

Can you please post?

 

Jakewoos

Link to comment
Share on other sites

Hey everyone!

 

Finally got this thing working and thrilled to have it!

 

Problem: I noticed in Google that pages in my phpBB directory are being indexed with session ID's!

 

YIKES!

 

Any ideas how I can stop this? I have my OsC pages set correctly where they do not get indexed with SID's, but it's just the phpBB pages now.

 

Any ideas? Please help!

 

Thanks in advance,

 

Isaac

Link to comment
Share on other sites

  • 4 weeks later...

For some reason I cannot access phpBB Admin Panel from the osCommerce Admin pannel. I get this error screen.... >_<

 

I have been reading this thread and I tried inserting the code

echo $adminCheck;
after line 10 in forum_admin_login.php. It returns the value "Resource id#39" and it is shown in the screenshot using the link above. Does anyone know what that value represents? My GROUP_ID is 16, no where near 39, and I'm totally stumped.

 

BTW I have installed both phpBB and osCommerce with zero mods. I have not modified anything. I figure I need to make sure 100% functionality is there first before wasting time on the 'bling'.

 

I also have a problem creating a new account. I get an error message, however, if I click back, the database is updated.... Anyone have the same problem?

 

 

The only thing that is working correctly is the "Forums" link inside the Configuration section of the osCommerce Admin Panel (below Sessions and above Catalog in the left column of the screenshot link above).... :-"

Don't give up. I see light ahead...!

Link to comment
Share on other sites

  • 1 month later...

I can't seem to get this one working either :-/. Wont login when im in the admin panel, and when I try to login to the admin area at the forum I get redirected to /forum/ instead of /phpbb2/ , it forwards me to the forum folder automaticly, so its basicly impossible to get inside the admin panel there too.

 

Hope Gabriel gets back and helps us :o.

 

I've read everything and I cant find anything to help me.

Link to comment
Share on other sites

  • 1 month later...

I got this installed and all seems fine on the forum side - BUT I cannot log onto the store.

 

When I attempt to log in at the store login page - the page just refreshes. I cannot access any of the store account pages. When I go over to the forum though - I see I *am* logged in to the forums. The accounts on the store side *are* being created - I just can't log into the store as any of them.

 

Any ideas?

 

thanks

 

Jason

Edited by jasonabc
Link to comment
Share on other sites

  • 4 months later...
  • 2 months later...
  • 2 weeks later...
I am having trouble keeping people logged in. They can go to phpbb all right but when they try to go back to the catalog they get logged off.

 

Any reason for this?

 

Thanks

 

It is designed this way, mine works the same. Any click of logged users out of the catalog brake the shop session. I would preffer to keep them logged in while browsing my site.

 

Also. in my admin area admin/configuration/forums

I have 5 records, 2 of them are doubled

 

Forum Administrator Display Name

Forum Administrator Display Name

Forum Administrator E-Mail

Forum Administrator E-Mail

Forum Administrator Password

 

Seems like something is wrong. Any suggestions?

 

Sergei

Link to comment
Share on other sites

  • 1 month later...

HEADING_TITLE

 

If you see this page, there was a problem logging in to the forums. You can try to or else re-check your settings.

 

 

Am getting this error and cannot access through the admin console, can anyone assist with this. Loads of people have the issue but no fixes???

Link to comment
Share on other sites

  • 2 weeks later...
HEADING_TITLE

 

If you see this page, there was a problem logging in to the forums. You can try to or else re-check your settings.

 

 

Am getting this error and cannot access through the admin console, can anyone assist with this. Loads of people have the issue but no fixes???

 

 

As I see the above problem and loging out customers between OSC and phpbb has no solution here so I tried another

phpBB2.0.22 Integration v1.3

for my RC1 based shop

 

Some reports.

- phpBB2.0.22 Integration is much easy to install, thanks to fine docs.

- No problem with access to phpbb Admin via OSC admin

- It keep customers logged between OSC and phpbb and save shopping cart content

 

Sergei

Link to comment
Share on other sites

  • 1 month later...

Hi!

 

I've installed the bridge and it seems everything is working except one:

 

Wenn I add all the changes to the catalog/login.php I will not be logged in into oscommerce. I've figured out that the problem ist the following line:

session_begin($customer_id, encode_ip(tep_get_ip_address()), PAGE_INDEX, FALSE, $autologin, $admin);

When i commented it out i can login to oscommerce but not to the phpbb. (Wenn not commented out, i CAN'T login oscommerce, BUT I'm logged in into the forum)

 

Can anybody help me solving this problem? I did a lot of research in google and the forum here but i can't find anything....

 

Thnx a lot!

Cheers, Michael

Link to comment
Share on other sites

Hi folks,

 

Unfortunately I won't be able to help with any current problems with this contribution. It was created as part of a project I was working on at the time, and I haven't had an osCommerce testbed in over a year. Hopefully someone else with knowledge of PHP can become involved and ensure this mod works with the latest releases of phpBB and osCommerce.

Link to comment
Share on other sites

hi!

 

@Gabriel: thnx for your answer - no problem! I can understand you!

 

for all:

I've tried a little bit to debug the contribution and phpbb... as a result i got it working by disabling the following line in

phpbb/sessions.php line: 261
//$SID = 'sid=' . $session_id;

 

I don't know really why and do not have time to analyze the hole forum code but it seems to work.

 

Cheers, michael

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...