Jump to content



Photo
- - - - -

fixes to PhpBB contribution


  • Please log in to reply
185 replies to this topic

#61   dmarre

dmarre
  • Members
  • 43 posts
  • Real Name:Webmaster

Posted 07 June 2004 - 23:42

Jcall,
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   dmarre

dmarre
  • Members
  • 43 posts
  • Real Name:Webmaster

Posted 08 June 2004 - 02:29

I can't believe it, finally after many hours of work that damn message has gone away. I noticed that i was also getting this message in account_edit.php after entering the contributions code. So what i did was comment out the code which was being duplicated in account_edit.php and create_acount.php. The code contains, tep_get_zone_name

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   dmarre

dmarre
  • Members
  • 43 posts
  • Real Name:Webmaster

Posted 08 June 2004 - 04:41

Talking about the next task, here it is. When i click on any of the links in the forum like, FAQ/search/memberlist/usergroups/profile/mail, etc. i get this error.
Fatal error: Cannot instantiate non-existent class: sql_db in \catalog\includes\modules\phpbb2\includes\db.php on line 60
This 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   SwissChris

SwissChris
  • Members
  • 74 posts
  • Real Name:Christian

Posted 08 June 2004 - 15:00

I can't believe it, finally after many hours of work that damn message has gone away. I noticed that i was also getting this message in account_edit.php after entering the contributions code. So what i did was comment out the code which was being duplicated in account_edit.php and create_acount.php. The code contains, tep_get_zone_name

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   SwissChris

SwissChris
  • Members
  • 74 posts
  • Real Name:Christian

Posted 08 June 2004 - 15:17

Did anybody solve this issue on viewprofile etc. ?

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   SwissChris

SwissChris
  • Members
  • 74 posts
  • Real Name:Christian

Posted 08 June 2004 - 16:15

Ok, I found a solution. Take a template from phpbb206 and it will solve your viewprofile problems altogether!

#67   SwissChris

SwissChris
  • Members
  • 74 posts
  • Real Name:Christian

Posted 08 June 2004 - 16:40

Nice! Now, I got another problem instead. Post Reply and drop down categories and title search does not work!

#68   dmarre

dmarre
  • Members
  • 43 posts
  • Real Name:Webmaster

Posted 08 June 2004 - 17:52

What do you mean by take a template from phpbb206? Is that the same as adding a template from phpbb or is that from the oscommerce contribution?
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 42
But 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   SwissChris

SwissChris
  • Members
  • 74 posts
  • Real Name:Christian

Posted 08 June 2004 - 18:06

Honestly, I have no clue why it worked, but I went to phpbb2.de and downloaded:

phpbb2.de theme

On this one the search function wouldn' work though. The search works on the standard theme though.

#70   SwissChris

SwissChris
  • Members
  • 74 posts
  • Real Name:Christian

Posted 08 June 2004 - 21:38

Ok, I see where your problem is! I have still the same one as you do. I was logged in and it only happens if you require registered users to open topics or make posts. The problem is in the code of posting.php in the last two lines:

// 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 - 21:39.


#71   dmarre

dmarre
  • Members
  • 43 posts
  • Real Name:Webmaster

Posted 08 June 2004 - 23:10

Oh i see, you just downloaded the files for your template and reinstalled and it happend to just work fine. Cool. I decided to look at the message you were getting when posting and i get this error when posting with a logged in user:
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 589
So 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 29
and 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   SwissChris

SwissChris
  • Members
  • 74 posts
  • Real Name:Christian

Posted 09 June 2004 - 00:01

Here is a simple solution to:

Warning: Cannot modify header information - headers already sent by (output started at /home/swissm5/public_html/modules.php:28) in /home/swissm5/public_html/includes/functions/general.php on line 42



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   SwissChris

SwissChris
  • Members
  • 74 posts
  • Real Name:Christian

Posted 09 June 2004 - 00:12

Sorry! Here's a bit more detail on how to go about the changes:


Here is a simple solution to:

Warning: Cannot modify header information - headers already sent by (output started at /home/swissm5/public_html/modules.php:28) in /home/swissm5/public_html/includes/functions/general.php on line 42



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   dmarre

dmarre
  • Members
  • 43 posts
  • Real Name:Webmaster

Posted 09 June 2004 - 00:46

YES, YES, YES, YES, YYYEAAAHHHH, you are the man. Thanks alot SwissChris, that did it. Hope everything is working fine on your side.

#75   SwissChris

SwissChris
  • Members
  • 74 posts
  • Real Name:Christian

Posted 09 June 2004 - 02:32

Yes, all seems working fine, but when you add standard phpbb 2.0.8 themes to the osc phpbb contrib, the drop down selection for categories won't work properly. Let's see who figures that one out! Do you encounter the same issue?

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!!!! /laugh.gif' class='bbc_emoticon' alt=':lol:' />

Also, did any of you get the login box to work?

Edited by SwissChris, 09 June 2004 - 02:36.


#76   SwissChris

SwissChris
  • Members
  • 74 posts
  • Real Name:Christian

Posted 09 June 2004 - 03:45

Don't forget to edit profile.php and privmsg.php the same way.

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   jcall

jcall
  • Members
  • 3,093 posts
  • Real Name:Jared Call
  • Gender:Male
  • Location:Saratoga Springs, UT

Posted 09 June 2004 - 05:12

there is a *very* similar discussion in another topic at http://forums.oscomm...=ST&f=7&t=62964 .

-jared

#78   dmarre

dmarre
  • Members
  • 43 posts
  • Real Name:Webmaster

Posted 09 June 2004 - 06:25

Jcall,
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   SwissChris

SwissChris
  • Members
  • 74 posts
  • Real Name:Christian

Posted 09 June 2004 - 07:11

Yes, exactly right! I have not read into the code to much yet, but I am sure there is an easy solution. Maybe the creator of the mod could give us a hint...?

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.


#80   SwissChris

SwissChris
  • Members
  • 74 posts
  • Real Name:Christian

Posted 09 June 2004 - 07:25

Question:

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.