fixes to PhpBB contribution
#61
Posted 07 June 2004 - 11:42 PM
I have looked for similar code in the page or pages that are giving me the errors but i can't find any code similar to the code that is being said to be commented out for viewtopic.php. If i'm misreading the link you told me to check please explain for me.
#62
Posted 08 June 2004 - 02:29 AM
account_edit.php
// #CHAVEIRO16# BEGIN PHPBB2
$sql_data_array = array('username' => strtoupper(substr($firstname,0,1)) . ucwords(strtolower($lastname)),
//'user_from' => tep_get_zone_name((int)($customer_country_id),(int)($customer_zone_id)),
'user_session_time' => time(),
'user_email' => $email_address);
tep_db_perform(TABLE_PHPBB_USERS, $sql_data_array,'update', "user_id = '" . tep_db_input($customer_id) . "'");
// #CHAVEIRO16# END PHPBB2
create_account.php
// #CHAVEIRO16# BEGIN PHPBB2
$sql_data_array2 = array('user_id' => $customer_id,
'user_active' =>1,
'username' => strtoupper(substr($firstname,0,1)) . ucwords(strtolower($lastname)),
'user_password' => md5($password),
'user_session_time' => time(),
'user_session_page' => 0,
'user_lastvisit' => '',
'user_regdate' => time(),
'user_level' => 0,
'user_posts' => 0,
'user_timezone' => 0.00,
'user_style' => 1,
'user_lang' => 'english',
'user_dateformat' => 'D M d, Y g:i a',
'user_new_privmsg' => 0,
'user_unread_privmsg' => 0,
'user_last_privmsg' => 0,
'user_emailtime' => '',
'user_viewemail' => 0,
'user_attachsig' => 1,
'user_allowhtml' => 0,
'user_allowbbcode' => 1,
'user_allowsmile' => 1,
'user_allowavatar' => 1,
'user_allow_pm' => 1,
'user_allow_viewonline' => 1,
'user_notify' => 0,
'user_notify_pm' => 1,
'user_popup_pm' => 1,
'user_rank' => 0,
'user_avatar' => '',
'user_avatar_type' => 0,
'user_email' => $email_address,
'user_icq' => '',
'user_website' => '',
//'user_from' => tep_get_zone_name((int)($country),(int)($zone_id)),
'user_sig' => '',
'user_sig_bbcode_uid' => '',
'user_aim' => '',
'user_yim' => '',
'user_msnm' => '',
'user_occ' => '',
'user_interests' => '',
'user_actkey' => '',
'user_newpasswd' => '');
tep_db_perform(TABLE_PHPBB_USERS, $sql_data_array2);
tep_db_query("insert into " . TABLE_PHPBB_GROUPS . " (group_name, group_description, group_single_user, group_moderator) VALUES ('', 'Personal User', 1, 0)");
tep_db_query("insert into " . TABLE_PHPBB_USER_GROUPS . " (group_id, user_id, user_pending)VALUES ('".tep_db_insert_id()."', $customer_id, 0)");
// #CHAVEIRO16# END PHPBB2
Since the user will not be updating information from the forum because their primary account manager is their oscommerce account, it seems that zone code is not needed for the contribution. And if it is, it seems to work fine without it. If you would like to test it, you can go to:Onpoint Systems Forum
In case you can't see where i did the change, the code has // in front of it.
Now to tackle the next task.
Jcall thanks for all your help.
#63
Posted 08 June 2004 - 04:41 AM
Fatal error: Cannot instantiate non-existent class: sql_db in \catalog\includes\modules\phpbb2\includes\db.php on line 60This is what i have in line 60 of that page.
// Make the database connection.
$db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false);
if(!$db->db_connect_id)
{
message_die(CRITICAL_ERROR, "Could not connect to the database");
}
I read somewhere that i had to set my default database to mysql and rename my table to mysql. Now i don't want to rename my table to MYSQL. Where can i change the forums or phpbb2 default database to my database name?
#64
Posted 08 June 2004 - 03:00 PM
Quote
account_edit.php
CODE
// #CHAVEIRO16# BEGIN PHPBB2
$sql_data_array = array('username' => strtoupper(substr($firstname,0,1)) . ucwords(strtolower($lastname)),
//'user_from' => tep_get_zone_name((int)($customer_country_id),(int)($customer_zone_id)),
'user_session_time' => time(),
'user_email' => $email_address);
tep_db_perform(TABLE_PHPBB_USERS, $sql_data_array,'update', "user_id = '" . tep_db_input($customer_id) . "'");
// #CHAVEIRO16# END PHPBB2
create_account.php
CODE
// #CHAVEIRO16# BEGIN PHPBB2
$sql_data_array2 = array('user_id' => $customer_id,
'user_active' =>1,
'username' => strtoupper(substr($firstname,0,1)) . ucwords(strtolower($lastname)),
'user_password' => md5($password),
'user_session_time' => time(),
'user_session_page' => 0,
'user_lastvisit' => '',
'user_regdate' => time(),
'user_level' => 0,
'user_posts' => 0,
'user_timezone' => 0.00,
'user_style' => 1,
'user_lang' => 'english',
'user_dateformat' => 'D M d, Y g:i a',
'user_new_privmsg' => 0,
'user_unread_privmsg' => 0,
'user_last_privmsg' => 0,
'user_emailtime' => '',
'user_viewemail' => 0,
'user_attachsig' => 1,
'user_allowhtml' => 0,
'user_allowbbcode' => 1,
'user_allowsmile' => 1,
'user_allowavatar' => 1,
'user_allow_pm' => 1,
'user_allow_viewonline' => 1,
'user_notify' => 0,
'user_notify_pm' => 1,
'user_popup_pm' => 1,
'user_rank' => 0,
'user_avatar' => '',
'user_avatar_type' => 0,
'user_email' => $email_address,
'user_icq' => '',
'user_website' => '',
//'user_from' => tep_get_zone_name((int)($country),(int)($zone_id)),
'user_sig' => '',
'user_sig_bbcode_uid' => '',
'user_aim' => '',
'user_yim' => '',
'user_msnm' => '',
'user_occ' => '',
'user_interests' => '',
'user_actkey' => '',
'user_newpasswd' => '');
tep_db_perform(TABLE_PHPBB_USERS, $sql_data_array2);
tep_db_query("insert into " . TABLE_PHPBB_GROUPS . " (group_name, group_description, group_single_user, group_moderator) VALUES ('', 'Personal User', 1, 0)");
tep_db_query("insert into " . TABLE_PHPBB_USER_GROUPS . " (group_id, user_id, user_pending)VALUES ('".tep_db_insert_id()."', $customer_id, 0)");
// #CHAVEIRO16# END PHPBB2
Don't forget to change the login.php as well! Otherwise, your customers won't be able to login and receive the same error as with the ones above:
// #CHAVEIRO16# BEGIN PHPBB2
$last_visit = 0;
$current_time = time();
$check_bbusers_query = tep_db_query("select * from " . TABLE_PHPBB_USERS . " where user_id = '" . $check_customer['customers_id'] . "'");
if (!tep_db_num_rows($check_bbusers_query)) {
// Creates forum account if does't exists already
$sql_data_array = array('user_id' => $customer_id,
'user_active' =>1,
'username' => strtoupper(substr($check_customer['customers_firstname'],0,1)) . ucwords(strtolower($check_customer['customers_lastname'])),
'user_password' => md5($password),
'user_session_time' => time(),
'user_session_page' => 0,
'user_lastvisit' => '',
'user_regdate' => time(),
'user_level' => 0,
'user_posts' => 0,
'user_timezone' => 0.00,
'user_style' => 1,
'user_lang' => 'english',
'user_dateformat' => 'D M d, Y g:i a',
'user_new_privmsg' => 0,
'user_unread_privmsg' => 0,
'user_last_privmsg' => 0,
'user_emailtime' => '',
'user_viewemail' => 0,
'user_attachsig' => 1,
'user_allowhtml' => 0,
'user_allowbbcode' => 1,
'user_allowsmile' => 1,
'user_allowavatar' => 1,
'user_allow_pm' => 1,
'user_allow_viewonline' => 1,
'user_notify' => 0,
'user_notify_pm' => 1,
'user_popup_pm' => 1,
'user_rank' => 0,
'user_avatar' => '',
'user_avatar_type' => 0,
'user_email' => $check_customer['customers_email_address'],
'user_icq' => '',
'user_website' => '',
//'user_from' => tep_get_zone_name((int)($check_country['entry_country_id']),(int)($check_country['entry_zone_id'])),
'user_sig' => '',
'user_sig_bbcode_uid' => '',
'user_aim' => '',
'user_yim' => '',
'user_msnm' => '',
'user_occ' => '',
'user_interests' => '',
'user_actkey' => '',
'user_newpasswd' => '');
tep_db_perform(TABLE_PHPBB_USERS, $sql_data_array);
tep_db_query("insert into " . TABLE_PHPBB_GROUPS . " (group_name, group_description, group_single_user, group_moderator) VALUES ('', 'Personal User', 1, 0)");
tep_db_query("insert into " . TABLE_PHPBB_USER_GROUPS . " (group_id, user_id, user_pending)VALUES ('".tep_db_insert_id()."', $customer_id, 0)");
} else {
$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;
}
// #CHAVEIRO16# END PHPBB2
#65
Posted 08 June 2004 - 03:17 PM
Warning: Cannot modify header information - headers already sent by (output started at /home/domain/public_html/modules.php:28) in /home/domain/public_html/includes/functions/general.php on line 42
#66
Posted 08 June 2004 - 04:15 PM
#67
Posted 08 June 2004 - 04:40 PM
#68
Posted 08 June 2004 - 05:52 PM
The reason i ask is because I get the same error:
Warning: Cannot modify header information - headers already sent by (output started at /catalog/modules.php:28) in /catalog/includes/functions/general.php on line 42But i can't understand your fix. I get this error when i click on profile link and mail link in the forum. I'm using the orange101 template from phpbb. If you could explain that a little more i would appreciate it. Thanks.
#69
Posted 08 June 2004 - 06:06 PM
phpbb2.de theme
On this one the search function wouldn' work though. The search works on the standard theme though.
#70
Posted 08 June 2004 - 09:38 PM
// The user is not authed, if they're not logged in then redirect
// them, else show them an error message
//
if ( !$is_auth[$is_auth_type] )
{
if ( $userdata['session_logged_in'] )
{
message_die(GENERAL_MESSAGE, sprintf($lang['Sorry_' . $is_auth_type], $is_auth[$is_auth_type . "_type"]));
}
switch( $mode )
{
case 'newtopic':
$redirect = "mode=newtopic&" . POST_FORUM_URL . "=" . $forum_id;
break;
case 'reply':
case 'topicreview':
$redirect = "mode=reply&" . POST_TOPIC_URL . "=" . $topic_id;
break;
case 'quote':
case 'editpost':
$redirect = "mode=quote&" . POST_POST_URL ."=" . $post_id;
break;
}
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
Edited by SwissChris, 08 June 2004 - 09:39 PM.
#71
Posted 08 June 2004 - 11:10 PM
Warning: Cannot modify header information - headers already sent by (output started at \catalog\modules.php:28) in \catalog\includes\modules\phpbb2\posting.php on line 589So what i did was comment out the following code from \catalog\includes\modules\phpbb2\posting.php.
//setcookie($board_config['cookie_name'] . '_t', serialize($tracking_topics), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);Which is on line 589. After that change a logged in user is able to post fine, can you believe that!
Here is the other funny thing which is what you said in your last post. When an unregistered user attempts to add a post i get this error:
Warning: Cannot modify header information - headers already sent by (output started at catalog\modules.php:28) in \catalog\includes\functions\general.php on line 29and your right, it's the last to lines of that redirect section. Looks like we have to find were FILENAME_LOGIN is defined and check the url, unless you have already fixed it.
#72
Posted 09 June 2004 - 12:01 AM
Quote
Situation:
Registered user required to open topics or to post a reply. When opening a new topic and one is not logged in the above error occurs. Simply included a javacript redirect in the case someone is not logged in and everybody not logged in is redirected to login.php. Probably, there are more ellegant methods to solve it, but it works fine for me:
//
// The user is not authed, if they're not logged in then redirect
// them, else show them an error message
//
if ( !$is_auth[$is_auth_type] )
{
if ( $userdata['session_logged_in'] )
{
message_die(GENERAL_MESSAGE, sprintf($lang['Sorry_' . $is_auth_type], $is_auth[$is_auth_type . "_type"]));
}
switch( $mode )
{
case 'newtopic':
$redirect = "mode=newtopic&" . POST_FORUM_URL . "=" . $forum_id;
break;
case 'reply':
case 'topicreview':
$redirect = "mode=reply&" . POST_TOPIC_URL . "=" . $topic_id;
break;
case 'quote':
case 'editpost':
$redirect = "mode=quote&" . POST_POST_URL ."=" . $post_id;
break;
}
?>
<script LANGUAGE="Javascript">
<!-- Begin
if (navigator.javaEnabled())
window.location = "login.php";
else
window.location = "login.php";
// End -->
</script>
<?php
}
#73
Posted 09 June 2004 - 12:12 AM
Here is a simple solution to:
Quote
Situation:
Registered user required to open topics or to post a reply. When opening a new topic and one is not logged in the above error occurs. Simply included a javacript redirect in the case someone is not logged in and everybody not logged in is redirected to login.php. Probably, there are more ellegant methods to solve it, but it works fine for me:
New Code about line 326 of includes/modules/phpbb/posting.php
//
// The user is not authed, if they're not logged in then redirect
// them, else show them an error message
//
if ( !$is_auth[$is_auth_type] )
{
if ( $userdata['session_logged_in'] )
{
message_die(GENERAL_MESSAGE, sprintf($lang['Sorry_' . $is_auth_type], $is_auth[$is_auth_type . "_type"]));
}
switch( $mode )
{
case 'newtopic':
$redirect = "mode=newtopic&" . POST_FORUM_URL . "=" . $forum_id;
break;
case 'reply':
case 'topicreview':
$redirect = "mode=reply&" . POST_TOPIC_URL . "=" . $topic_id;
break;
case 'quote':
case 'editpost':
$redirect = "mode=quote&" . POST_POST_URL ."=" . $post_id;
break;
}
?>
<script LANGUAGE="Javascript">
<!-- Begin
if (navigator.javaEnabled())
window.location = "login.php";
else
window.location = "login.php";
// End -->
</script>
<?php
}
Original Code to replace with the above
//
// The user is not authed, if they're not logged in then redirect
// them, else show them an error message
//
if ( !$is_auth[$is_auth_type] )
{
if ( $userdata['session_logged_in'] )
{
message_die(GENERAL_MESSAGE, sprintf($lang['Sorry_' . $is_auth_type], $is_auth[$is_auth_type . "_type"]));
}
switch( $mode )
{
case 'newtopic':
$redirect = "mode=newtopic&" . POST_FORUM_URL . "=" . $forum_id;
break;
case 'reply':
case 'topicreview':
$redirect = "mode=reply&" . POST_TOPIC_URL . "=" . $topic_id;
break;
case 'quote':
case 'editpost':
$redirect = "mode=quote&" . POST_POST_URL ."=" . $post_id;
break;
}
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
#74
Posted 09 June 2004 - 12:46 AM
#75
Posted 09 June 2004 - 02:32 AM
Will try to figure it out. Guess it be asking to much to have some kind of guide for themes? The standard just seems blend. Will post once I figure it out, so one can adjust themes. Please do the same!!!!
Also, did any of you get the login box to work?
Edited by SwissChris, 09 June 2004 - 02:36 AM.
#76
Posted 09 June 2004 - 03:45 AM
1x profile.php
5x privmsg.php
From:
$navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
To:
?> <script LANGUAGE="Javascript"> <!-- Begin if (navigator.javaEnabled()) window.location = "login.php"; else window.location = "login.php"; // End --> </script> <?php
#77
Posted 09 June 2004 - 05:12 AM
-jared
#78
Posted 09 June 2004 - 06:25 AM
We are using the latest phpbb2 contribution from oscommerce which is PHPBB 2.0.8a implementation by Chaverio. The other forums that i have seen are discussing an earlier version of the contribution.
SwissChris,
I'm currently using a template i downloaded from PHPBB which is not the default. All the fixes we have applied have worked correctly. I also applied the changes to profile.php and privmsg.php, which i must say worked great again. Thanks.
But when i try to change the forum with the Jump To: drop down box i get:
Sorry File Doesn't Exist!
Is that the same thing your talking about ?(jumping to another forum by choosing it from the drop down box).
#79
Posted 09 June 2004 - 07:11 AM
I just got done rewriting the subSilver to my needs. Adapted it to bcInvert a simple, yet nice looking theme. At this stage, it's easier for me to get them together this way.
Edited by SwissChris, 09 June 2004 - 07:16 AM.
#80
Posted 09 June 2004 - 07:25 AM
Were you able to control users via the phpbb admin. Like ban them etc. Just wondering because my username search windows appears to be an error. Works on the user front though?
Edited by SwissChris, 09 June 2004 - 07:25 AM.









