Page 1 of 1

phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Fri Jul 07, 2006 6:08 pm
Author: Teelk
This is the official release of the phpBB 2.0.21 update for IntegraMOD 1.4.0.

Thanks go to Jason Sanborn for the majority of the update work. <img>

Included in the update package are manual instructions which should be used if you have modified your IntegraMOD 1.4.0 from the stock package. Also included are premodded files which can be used to overwrite your existing files, and should be used if you haven't modified your IM install.

You're board must be up to 2.0.20 before applying this update.

If you get an "invalid mirror error" please try another mirror, as the file may not propegate all mirrors yet.

[url=http]Download Link[/url]

PostPosted: Fri Jul 07, 2006 9:29 pm
Author: tekguru
Cheers Teelk!

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Fri Jul 07, 2006 10:15 pm
Author: febern
updating......... <img>

PostPosted: Sat Jul 08, 2006 3:04 am
Author: Unregistered
finally! <img>

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Sat Jul 08, 2006 3:57 am
Author: Unregistered
the FIND codes in LOGIN.PHP

Code: Select all
                    $redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) ] . '<br><br>' . sprintf($lang['Click_return_login'], "<a>", '</a>') . '<br><br>' .  sprintf($lang['Click_return_index'], '<a>', '</a>');                       message_die(GENERAL_MESSAGE, $message);                 }

Should be

Code: Select all
                    $redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) ] . '<br><br>' . sprintf($lang['Click_return_login'], "<a>", '</a>') . '<br><br>' .  sprintf($lang['Click_return_index'], '<a>', '</a>');                       message_die(GENERAL_MESSAGE, $message);                 }

Am i right? Am jus referin to the ("index.$phpEx") and ("portal.$phpEx") conflict..

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Sat Jul 08, 2006 6:40 am
Author: Dr. Bantham
I have updated my site and everything seems to be running smooth. I used the pre-modded version of login.php since the FIND statement fell short and I do not believe any mods that I added previously had touched upon that file. Thanks to the dev team for getting this one out!

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Sat Jul 08, 2006 7:34 am
Author: obiku
Tnx for the release, starting to update

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Sat Jul 08, 2006 2:00 pm
Author: tmotley
Updated with no problems... sweetness. <img>

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Sat Jul 08, 2006 2:39 pm
Author: obiku
It works like a charm

PostPosted: Sat Jul 08, 2006 11:48 pm
Author: tekguru
In there perfctly with no problems so far, cheers guys!

PostPosted: Sun Jul 09, 2006 9:00 am
Author: ayasha
sweet work you guys :lol:

PostPosted: Sun Jul 09, 2006 10:19 am
Author: MrGrim
Could somehelp me?

PostPosted: Sun Jul 09, 2006 10:46 am
Author: obiku
"Trag";p="11358" wrote:Could somehelp me?
With what??

PostPosted: Sun Jul 09, 2006 10:53 am
Author: MrGrim
"obiku";p="11360" wrote:
"Trag";p="11358" wrote:Could somehelp me?
With what??
the upgrade...amod plus was installed along with whos online. And a friend of mine did the install and the upgrades to .2.0.20 but he is out of town and not sure when he will return. <img>

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Sun Jul 09, 2006 11:14 am
Author: obiku
One question, in the mod it says this
Code: Select all
#-----[ FIND ]---------------------------------------------# Line 658         global $template, $lang, $phpEx, $phpbb_root_path;         global $nav_links;  ##-----[ REPLACE WITH ]---------------------------------------------#         global $template, $lang, $phpEx, $phpbb_root_path, $db;         global $nav_links;    
If I do a search I can find those lines, but there is something extra
Code: Select all
        global $template, $lang, $phpEx, $phpbb_root_path;         global $nav_links;         global $db;  
Do we have to remove that last global $db; I think it should be removed.

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Sun Jul 09, 2006 11:20 am
Author: Teelk
Good eye, I didn't catch that. Technically you can just skip that edit altogether since it's there to add the global $db which is already there. I'll ammend the update, but can't upload it since I don't have access to sourceforge currently.

I'll post when the file is updated.

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Sun Jul 09, 2006 11:28 am
Author: obiku
I think you can better leave the mod as it is, including in the search the global $db;. This because a lot of people already applied the Mod.

Then you can point the ones who already updated to remove the global $db;. So all updates are the same for futher updates

PostPosted: Sun Jul 09, 2006 12:06 pm
Author: MrGrim
obiku that a no?

PostPosted: Sun Jul 09, 2006 1:20 pm
Author: obiku
"Trag";p="11376" wrote:obiku that a no?
???
Explain your self? Don't know what you mean

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Sun Jul 09, 2006 2:33 pm
Author: obiku
I found something what needs an explanation. in the Mod there is this code change.
Code: Select all
# #-----[ OPEN ]--------------------------------------------- # search.php  ##-----[ FIND ]---------------------------------------------# Line 343                 if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < 3 ) )  ##-----[ REPLACE WITH ]---------------------------------------------#                 if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < $board_config['search_min_chars'] ) )  ##-----[ FIND ]---------------------------------------------# Line 463                 if (preg_match('#^[*%]+$#', trim($split_search[$i])) || preg_match('#^[^*]{1,2}$#', str_replace(array('*', '%'), '', trim($split_search[$i]))))  ##-----[ REPLACE WITH ]---------------------------------------------#                 if ( strlen(str_replace(array('*', '%'), '', trim($split_search[$i]))) < $board_config['search_min_chars'] )  ##-----[ FIND ]---------------------------------------------# Line 643             if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < 3 ) )  ##-----[ REPLACE WITH ]---------------------------------------------#             if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < $board_config['search_min_chars'] ) )

The hard coded value of the minimum requered chars is changed to one that is in de boardconfig.
if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < 3 ) )
if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < $board_config['search_min_chars'] ) )
Thats great, and the value is put in the database by the update_to_latest.php. But shouldn't it be in the ACP config, so you can change it?
If not, than you can just let that part of code change away.

PostPosted: Sun Jul 09, 2006 4:18 pm
Author: MrGrim
"obiku";p="11380" wrote:
"Trag";p="11376" wrote:obiku that a no?
???
Explain your self? Don't know what you mean
About helping me with the upgrade?

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Mon Jul 10, 2006 2:41 pm
Author: Teelk
"obiku";p="11388" wrote:I found something what needs an explanation. in the Mod there is this code change.
Code: Select all
# #-----[ OPEN ]--------------------------------------------- # search.php  ##-----[ FIND ]---------------------------------------------# Line 343                 if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < 3 ) )  ##-----[ REPLACE WITH ]---------------------------------------------#                 if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < $board_config['search_min_chars'] ) )  ##-----[ FIND ]---------------------------------------------# Line 463                 if (preg_match('#^[*%]+$#', trim($split_search[$i])) || preg_match('#^[^*]{1,2}$#', str_replace(array('*', '%'), '', trim($split_search[$i]))))  ##-----[ REPLACE WITH ]---------------------------------------------#                 if ( strlen(str_replace(array('*', '%'), '', trim($split_search[$i]))) < $board_config['search_min_chars'] )  ##-----[ FIND ]---------------------------------------------# Line 643             if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < 3 ) )  ##-----[ REPLACE WITH ]---------------------------------------------#             if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < $board_config['search_min_chars'] ) )

The hard coded value of the minimum requered chars is changed to one that is in de boardconfig.
if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < 3 ) )
if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < $board_config['search_min_chars'] ) )
Thats great, and the value is put in the database by the update_to_latest.php. But shouldn't it be in the ACP config, so you can change it?
If not, than you can just let that part of code change away.
That is a good question obiku, but one which I don't have an answer to... that question should be posed to phpBB I think as there's nothing in the original phpBB updates to include this in the ACP... but, I'll see what's up...

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Mon Jul 10, 2006 7:55 pm
Author: Michaelo
Globals can be replace with single line to remove any confusion:
Code: Select all
global $template, $lang, $phpEx, $phpbb_root_path, $nav_links, $db;


search_min_chars is in config but have we added the facility to edit the value in ACP? Don't think so!

Mike

PostPosted: Mon Jul 10, 2006 7:58 pm
Author: Unregistered
replace with?

PostPosted: Mon Jul 10, 2006 8:04 pm
Author: Michaelo
Unregistered correct your profile data please... you can't be 96 <img>

The line is intended to show how globals should be defined i.e In one line... no need for seperate lines...

PostPosted: Mon Jul 10, 2006 8:06 pm
Author: Unregistered
hehe il think abt it after i wake up.. now almost fallin asleep..

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Tue Jul 11, 2006 5:44 am
Author: atomhead
worked great, thank you.

PostPosted: Tue Jul 11, 2006 8:14 am
Author: Master Dwarf
Cheers to Jason for his hard work and dedication. Thanks.

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 7:34 am
Author: Juppertje
line not fount in includes/functions_post.php

Code: Select all
 ##-----[ FIND ]---------------------------------------------# Line 180             $message .= htmlspecialchars($part) . clean_html($tag);         }           $message = addslashes($message);  ##-----[ REPLACE WITH ]---------------------------------------------#             $message .= preg_replace($html_entities_match, $html_entities_replace, $part) . clean_html($tag);         }           $message = addslashes($message);


i have not that line ]<php>sql_query($sql)) )     {         message_die(GENERAL_ERROR, 'Tried obtaining data for a non-existent user', '', __LINE__, __FILE__, $sql);     }     $usertodata = $db->sql_fetchrow($result);       // prepare wpm message     $bbcode_uid = make_bbcode_uid();     $wpm_message = str_replace("'", "''", $wpm_message);       if(empty($wpm_message))     {         $wpm_message = "Thank you for registering.";     }     $wpm_message = prepare_message(trim($wpm_message), 0, 1, 1, $bbcode_uid);       $msg_time = time();       // Do inbox limit stuff     $sql = "SELECT COUNT(privmsgs_id) AS inbox_items, MIN(privmsgs_date) AS oldest_post_time         FROM " . PRIVMSGS_TABLE . "         WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . "             OR privmsgs_type = " . PRIVMSGS_READ_MAIL . "               OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " )             AND privmsgs_to_userid = " . $usertodata['user_id'];     if ( !($result = $db->sql_query($sql)) )     {         message_die(GENERAL_MESSAGE, $lang['No_such_user']);     }       $sql_priority = ( SQL_LAYER == 'mysql' ) ? 'LOW_PRIORITY' : '';       if ( $inbox_info = $db->sql_fetchrow($result) )     {         if ( $inbox_info['inbox_items'] >= $board_config['max_inbox_privmsgs'] )         {             $sql = "DELETE $sql_priority FROM " . PRIVMSGS_TABLE . "                 WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . "                     OR privmsgs_type = " . PRIVMSGS_READ_MAIL . "                     OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . "  )                     AND privmsgs_date = " . $inbox_info['oldest_post_time'] . "                     AND privmsgs_to_userid = " . $usertodata['user_id'];             if ( !$db->sql_query($sql) )             {                 message_die(GENERAL_ERROR, 'Could not delete your oldest privmsgs', '', __LINE__, __FILE__, $sql);             }         }     }       $sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig)         VALUES (" . PRIVMSGS_NEW_MAIL . ", '" . str_replace("'", "''", $wpm_subject) . "', " . $swpm_config['wpm_userid'] . ", " . $usertodata['user_id'] . ", $msg_time, '$user_ip', 0, 1, 1, 1)";       if ( !($result = $db->sql_query($sql_info, BEGIN_TRANSACTION)) )     {         message_die(GENERAL_ERROR, "Could not insert private message sent info.", "", __LINE__, __FILE__, $sql_info);     }       $privmsg_sent_id = $db->sql_nextid();       $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text)         VALUES ($privmsg_sent_id, '" . $bbcode_uid . "', '" . str_replace("'", "''", $wpm_message) . "')";       if ( !$db->sql_query($sql, END_TRANSACTION) )     {         message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql_info);     }       // Add to the users new pm counter     $sql = "UPDATE " . USERS_TABLE . "         SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = '9999999999'         WHERE user_id = " . $usertodata['user_id'];     if ( !$status = $db->sql_query($sql) )     {         message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql);     }       if ( $send_email && $usertodata['user_notify_pm'] && !empty($usertodata['user_email']) && $usertodata['user_active'] )     {         $email_headers = 'From: ' . $board_config['board_email'] . "nReturn-Path: " . $board_config['board_email'] . "rn";           $script_name = preg_replace('/^/?(.*?)/?$/', "\1", trim($board_config['script_path']));         $script_name = ( $script_name != '' ) ? $script_name . '/privmsg.'.$phpEx : 'privmsg.'.$phpEx;         $server_name = trim($board_config['server_name']);         $server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';         $server_port = ( $board_config['server_port'] <80>use_template('privmsg_notify', $usertodata['user_lang']);         $emailer->extra_headers($email_headers);         $emailer->email_address($usertodata['user_email']);         $emailer->set_subject(); //$lang['Notification_subject']                     $emailer->assign_vars(array(             'USERNAME' => $usertodata['username'],             'SITENAME' => $board_config['sitename'],             'EMAIL_SIG' => str_replace('<br>', "n", "-- n" . $board_config['board_email_sig']),               'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox')         );           $emailer->send();         $emailer->reset();     }       return;}// end wpm mod//// This function will prepare a posted message for// entry into the database.//function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0){     global $board_config, $html_entities_match, $html_entities_replace;       //     // Clean up the message     //     $message = trim($message);       if ($html_on)     {         $allowed_html_tags = split(',', $board_config['allow_html_tags']);           $end_html = 0;         $start_html = 1;         $tmp_message = '';         $message = ' ' . $message . ' ';           while ($start_html = strpos($message, '<', $start_html))         {             $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1, ($start_html - $end_html - 1)));               if ($end_html = strpos($message, '>', $start_html))             {                 $length = $end_html - $start_html + 1;                 $hold_string = substr($message, $start_html, $length);                   if (($unclosed_open = strrpos(' ' . $hold_string, '<')) != 1)                 {                     $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($hold_string, 0, $unclosed_open - 1));                     $hold_string = substr($hold_string, $unclosed_open - 1);                 }                   $tagallowed = false;                 for ($i = 0; $i < sizeof($allowed_html_tags); $i++)                 {                     $match_tag = trim($allowed_html_tags[$i]);                     if (preg_match('#^</?' . $match_tag . '[> ]#i', $hold_string))                     {                         $tagallowed = (preg_match('#^</?' . $match_tag . ' .*?(style[ ]*?=|on[w]+[ ]*?=)#i', $hold_string)) ? false : true;                     }                 }                   $tmp_message .= ($length && !$tagallowed) ? preg_replace($html_entities_match, $html_entities_replace, $hold_string) : $hold_string;                   $start_html += $length;             }             else             {                 $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $start_html, strlen($message)));                   $start_html = strlen($message);                 $end_html = $start_html;             }         }           if ($end_html != strlen($message) && $tmp_message != '')         {             $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1));         }           $message = ($tmp_message != '') ? trim($tmp_message) : trim($message);     }     else     {         $message = preg_replace($html_entities_match, $html_entities_replace, $message);     }       if($bbcode_on && $bbcode_uid != '')     {         $message = bbencode_first_pass($message, $bbcode_uid);     }       return $message;}  function unprepare_message($message){     global $unhtml_specialchars_match, $unhtml_specialchars_replace;       return preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, $message);}  //// Prepare a message for posting// //-- mod : calendar --------------------------------------------------------------------------------// here we have added//   , $topic_calendar_time = 0, $topic_calendar_duration = 0//-- modifyfunction prepare_post(&$mode, &$post_data, &$bbcode_on, &$html_on, &$smilies_on, &$error_msg, &$username, &$bbcode_uid, &$subject, &$message, &$poll_title, &$poll_options, &$poll_length, &$max_vote, &$hide_vote, &$tothide_vote, &$topic_desc, $topic_calendar_time = 0, $topic_calendar_duration = 0, $topic_calendar_repeat)//-- fin mod : calendar ----------------------------------------------------------------------------{     global $board_config, $userdata, $lang, $phpEx, $phpbb_root_path;       // Check username     if (!empty($username))     {         $username = phpbb_clean_username($username);           if (!$userdata['session_logged_in'] || ($userdata['session_logged_in'] && $username != $userdata['username']))         {             include($phpbb_root_path . 'includes/functions_validate.'.$phpEx);               $result = validate_username($username);             if ($result['error'])             {                 $error_msg .= (!empty($error_msg)) ? '<br>' . $result['error_msg'] : $result['error_msg'];             }         }         else         {             $username = '';         }     }       // Check subject     if (!empty($subject))     {         $subject = htmlspecialchars(trim($subject));     }     else if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))     {         $error_msg .= (!empty($error_msg)) ? '<br>' . $lang['Empty_subject'] : $lang['Empty_subject'];     }  // Check Topic Desciptionif ( !empty($topic_desc) )    {       $topic_desc = htmlspecialchars(trim($topic_desc));    }       // Check message     if (!empty($message))     {         $bbcode_uid = ($bbcode_on) ? make_bbcode_uid() : '';         $message = prepare_message(trim($message), $html_on, $bbcode_on, $smilies_on, $bbcode_uid);     }     else if ($mode != 'delete' && $mode != 'poll_delete')     {         $error_msg .= (!empty($error_msg)) ? '<br>' . $lang['Empty_message'] : $lang['Empty_message'];     }//-- mod : calendar --------------------------------------------------------------------------------//-- add     //     // check calendar date     //     if ((!empty($topic_calendar_time)) && ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])))     {         $year    = intval(date( 'Y', $topic_calendar_time));         $month   = intval(date( 'm', $topic_calendar_time));         $day     = intval(date( 'd', $topic_calendar_time));         if (!checkdate($month, $day, $year))         {             $error_msg .= (!empty($error_msg) ? '<br>' : '') . sprintf($lang['Date_error'], $day, $month, $year);         }     }//-- fin mod : calendar ----------------------------------------------------------------------------       //     // Handle poll stuff     //     if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))     {         $poll_length = (isset($poll_length)) ? max(0, ($poll_length+$poll_length_h/24)) : 0;         $$max_vote = (isset($max_vote)) ? max(0, intval($max_vote)) : 0;         $$hide_vote = (isset($hide_vote)) ? max(0, intval($hide_vote)) : 0;         $$tothide_vote = (isset($tothide_vote)) ? max(0, intval($tothide_vote)) : 0;           if (!empty($poll_title))         {             $poll_title = htmlspecialchars(trim($poll_title));         }           if(!empty($poll_options))         {             $temp_option_text = array();             while(list($option_id, $option_text) = @each($poll_options))             {                 $option_text = trim($option_text);                 if (!empty($option_text))                 {                     $temp_option_text[$option_id] = htmlspecialchars($option_text);                 }             }             $option_text = $temp_option_text;               if (count($poll_options) <2> $board_config['max_poll_options'])             {                 $error_msg .= (!empty($error_msg)) ? '<br>' . $lang['To_many_poll_options'] : $lang['To_many_poll_options'];             }             else if ($poll_title == '')             {                 $error_msg .= (!empty($error_msg)) ? '<br>' . $lang['Empty_poll_title'] : $lang['Empty_poll_title'];             }         }     }       return;}  //// Post a new topic/reply/poll or edit existing post/poll////-- mod : announces -------------------------------------------------------------------------------// here we have added//   , $topic_announce_duration = 0//-- modify//-- mod : calendar --------------------------------------------------------------------------------// here we have added//   , $topic_calendar_time = 0, $topic_calendar_duration = 0//-- modify//-- mod : post icon -------------------------------------------------------------------------------// here we added//   , $post_icon = 0//-- modifyfunction submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length, &$max_vote, &$hide_vote, &$tothide_vote, $forcetime='', &$topic_desc, &$news_category, $topic_announce_duration = 0, $topic_calendar_time = 0, $topic_calendar_duration = 0, $post_icon = 0, $topic_calendar_repeat)//-- fin mod : post icon ---------------------------------------------------------------------------//-- fin mod : calendar ----------------------------------------------------------------------------//-- fin mod : announces ---------------------------------------------------------------------------{     global $board_config, $lang, $db, $phpbb_root_path, $phpEx;     global $userdata, $user_ip, $post_info;  // BEGIN cmx_slash_news_mod     if( isset( $news_category ) && is_numeric( $news_category ) )     {         $news_id = intval( $news_category );     }     else     {         $news_id = 0;     }// END cmx_slash_news_mod       include($phpbb_root_path . 'includes/functions_search.'.$phpEx);       $current_time = time();     $lastposttime = 0;   // MOD: Delayed Topics       if ($mode == 'newtopic' || $mode == 'reply' )     {         if ($board_config['points_post'] && !$post_info['points_disabled'])         {             $points = abs(($mode == 'newtopic') ? $board_config['points_topic'] : $board_config['points_reply']);               if ($userdata['user_id'] != ANONYMOUS)             {                 add_points($userdata['user_id'], $points);             }         }     }     if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost')     {         //         // Flood control         //         $where_sql = ($userdata['user_id'] == ANONYMOUS) ? "poster_ip = '$user_ip'" : 'poster_id = ' . $userdata['user_id'];         $sql = "SELECT MAX(post_time) AS last_post_time             FROM " . POSTS_TABLE . "             WHERE $where_sql";         if ($result = $db->sql_query($sql))         {             if ($row = $db->sql_fetchrow($result))             {                 if (intval($row['last_post_time']) > 0 && ($current_time - intval($row['last_post_time'])) < intval($board_config['flood_interval']) && intval($row['last_post_time']) < $current_time)                 {                     message_die(GENERAL_MESSAGE, $lang['Flood_Error']);                 }                 $lastposttime = intval($row['last_post_time']);  // MOD: Delayed Topics             }         }     }       if ($mode == 'editpost')     {         remove_search_post($post_id);     }       //-----------------------------------------------------------------------------     // MOD: Delayed Topics       // If we're not trying to force the time, use the current time...     $exta = '';     $delayed = 0;       $old_forcetime = '';if (mode != 'newtopic') {         // how do I read from the topic?         $myquery = "SELECT topic_time FROM ". TOPICS_TABLE ." WHERE topic_id = $topic_id";         if ($myresult = $db->sql_query($myquery)) {             if ($myrow = $db->sql_fetchrow($myresult)) {                 if ($myrow['topic_time'] > time()) {                                         $old_forcetime = $myrow['topic_time'];                     $delayed = 1;                 }             }         }     }     if ($forcetime == '') {         $forcetime = time();         if ($old_forcetime){             $extra = ", topic_time = $forcetime";         }     } else {         $delayed = 1;         $extra = ", topic_time = $forcetime";     }         // MOD: Delayed Topics {end}     //-----------------------------------------------------------------------------         if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))     {         $topic_vote = (!empty($poll_title) && count($poll_options) >= 2) ? 1 : 0;  //-- mod : announces -------------------------------------------------------------------------------// here we added //   topic_announce_duration,//   $topic_announce_duration,//// and//   , topic_announce_duration = $topic_announce_duration//-- modify//-- mod : calendar --------------------------------------------------------------------------------// here we have added//   , topic_calendar_time, topic_calendar_duration//   , $topic_calendar_time, $topic_calendar_duration// and//   , topic_calendar_time = $topic_calendar_time, topic_calendar_duration = $topic_calendar_duration//-- modify//-- mod : post icon -------------------------------------------------------------------------------// here we added//   , topic_icon//   , $post_icon//// and//   , topic_icon = $post_icon//-- modify       // correct timezone and summertime     if($topic_calendar_time) user2boardtime($topic_calendar_time);             $sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_desc, topic_poster, topic_time, forum_id, news_id, topic_status, topic_type, topic_icon, topic_calendar_time, topic_calendar_duration, topic_announce_duration, topic_calendar_repeat, topic_vote) VALUES ('$post_subject', '$topic_desc', " . $userdata['user_id'] . ", $forcetime, $forum_id, $news_id, " . TOPIC_UNLOCKED . ", $topic_type, $post_icon, $topic_calendar_time, $topic_calendar_duration, " . intval($topic_announce_duration) . ", '$topic_calendar_repeat', $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_desc = '$topic_desc', news_id = $news_id, topic_type = $topic_type, topic_icon=$post_icon, topic_calendar_time = $topic_calendar_time, topic_calendar_duration = $topic_calendar_duration, topic_announce_duration = " . intval($topic_announce_duration) . "$extra, topic_calendar_repeat = '$topic_calendar_repeat'  " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";//-- fin mod : post icon ---------------------------------------------------------------------------//-- fin mod : calendar ----------------------------------------------------------------------------//-- fin mod : announces ---------------------------------------------------------------------------         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);         }           if ($mode == 'newtopic')         {             $topic_id = $db->sql_nextid();         }     }       //-----------------------------------------------------------------------------     // MOD: Delayed Topics       // is our topic a delayed topic?     $extra = '';     $post_time = $current_time;       if ($delayed == 1)     {         if ($mode == 'newtopic')         {             $extra = ", post_time = $forcetime";             $post_time = $forcetime;         }         else if ($mode == 'reply')         {             // post after last postif($old_forcetime > time()){     $post_time = intval($old_forcetime); } else {     $post_time = time(); }         }     }       // MOD: Delayed Topics {end}     //-----------------------------------------------------------------------------         $edited_sql = ($mode == 'editpost' && !$post_data['last_post'] && $post_data['poster_post']) ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : "";//-- mod : post icon -------------------------------------------------------------------------------// here we added// , post_icon// , $post_icon//// and//  , post_icon = $post_icon//-- modify     $sql = ($mode != "editpost") ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig, post_icon) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $post_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig, $post_icon)" : "UPDATE " . POSTS_TABLE . " SET post_username = '$post_username', enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig, post_icon = $post_icon" . $edited_sql . " $extra WHERE post_id = $post_id";//-- fin mod : post icon ---------------------------------------------------------------------------     if (!$db->sql_query($sql, BEGIN_TRANSACTION))     {         message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);     }       if ($mode != 'editpost')     {         $post_id = $db->sql_nextid();     }       $sql = ($mode != 'editpost') ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text) VALUES ($post_id, '$post_subject', '$bbcode_uid', '$post_message')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '$post_message',  bbcode_uid = '$bbcode_uid', post_subject = '$post_subject' WHERE post_id = $post_id";     if (!$db->sql_query($sql))     {         message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);     }       add_search_words('single', $post_id, stripslashes($post_message), stripslashes($post_subject));       //     // Add poll     //     if (($mode == 'newtopic' || ($mode == 'editpost' && $post_data['edit_poll'])) && !empty($poll_title) && count($poll_options) >= 2)     {         $sql = (!$post_data['has_poll']) ? "INSERT INTO " . VOTE_DESC_TABLE . " (topic_id, vote_text, vote_start, vote_length, vote_max, vote_hide, vote_tothide) VALUES ($topic_id, '$poll_title', $current_time, '$max_vote', '$hide_vote', '$tothide_vote', " . ($poll_length * 86400) . ")" : "UPDATE " . VOTE_DESC_TABLE . " SET vote_text = '$poll_title', vote_length = " . ($poll_length * 86400) . ", vote_max = '$max_vote', vote_hide = '$hide_vote', vote_tothide = '$tothide_vote' WHERE topic_id = $topic_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);         }           $delete_option_sql = '';         $old_poll_result = array();         if ($mode == 'editpost' && $post_data['has_poll'])         {             $sql = "SELECT vote_option_id, vote_result                   FROM " . VOTE_RESULTS_TABLE . "                 WHERE vote_id = $poll_id                 ORDER BY vote_option_id ASC";             if (!($result = $db->sql_query($sql)))             {                 message_die(GENERAL_ERROR, 'Could not obtain vote data results for this topic', '', __LINE__, __FILE__, $sql);             }               while ($row = $db->sql_fetchrow($result))             {                 $old_poll_result[$row['vote_option_id']] = $row['vote_result'];                   if (!isset($poll_options[$row['vote_option_id']]))                 {                     $delete_option_sql .= ($delete_option_sql != '') ? ', ' . $row['vote_option_id'] : $row['vote_option_id'];                 }             }         }         else         {             $poll_id = $db->sql_nextid();         }           @reset($poll_options);           $poll_option_id = 1;         while (list($option_id, $option_text) = each($poll_options))         {             if (!empty($option_text))             {                 $option_text = str_replace("'", "''", htmlspecialchars($option_text));                 $poll_result = ($mode == "editpost" && isset($old_poll_result[$option_id])) ? $old_poll_result[$option_id] : 0;                   $sql = ($mode != "editpost" || !isset($old_poll_result[$option_id])) ? "INSERT INTO " . VOTE_RESULTS_TABLE . " (vote_id, vote_option_id, vote_option_text, vote_result) VALUES ($poll_id, $poll_option_id, '$option_text', $poll_result)" : "UPDATE " . VOTE_RESULTS_TABLE . " SET vote_option_text = '$option_text', vote_result = $poll_result WHERE vote_option_id = $option_id AND vote_id = $poll_id";                 if (!$db->sql_query($sql))                 {                     message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);                 }                 $poll_option_id++;             }         }           if ($delete_option_sql != '')         {             $sql = "DELETE FROM " . VOTE_RESULTS_TABLE . "                 WHERE vote_option_id IN ($delete_option_sql)                     AND vote_id = $poll_id";             if (!$db->sql_query($sql))             {                 message_die(GENERAL_ERROR, 'Error deleting pruned poll options', '', __LINE__, __FILE__, $sql);             }         }     }     //-----------------------------------------------------------------------------     // MOD: Delayed Topics       // If we modified the forced date, we need to redate the messages to reflect that  if ($delayed && $mode == 'editpost' && $post_data['first_post'] && $old_forcetime != $forcetime)     {         $sql = "UPDATE " . POSTS_TABLE . " set post_time=$forcetime WHERE forum_id = $forum_id and topic_id = $topic_id";         if ( !$db->sql_query($sql) )         {             message_die(GENERAL_ERROR, 'Error in redating delayed topic', '', __LINE__, __FILE__, $sql);         }     }       // MOD: Delayed Topics {end}     //-----------------------------------------------------------------------------  //-- mod : categories hierarchy --------------------------------------------------------------------//-- add     board_stats();     cache_tree(true);//-- fin mod : categories hierarchy ----------------------------------------------------------------       $meta = '<meta>';     $message = $lang['Stored'] . '<br><br>' . sprintf($lang['Click_view_message'], '<a>', '</a>') . '<br><br>' . sprintf($lang['Click_return_forum'], '<a>', '</a>');       return false;}  //// Update post stats and details//function update_post_stats(&$mode, &$post_data, &$forum_id, &$topic_id, &$post_id, &$user_id) {     global $db;       // prepare update of topics table     // get first poster and first posttime     $sql = "SELECT poster_id, post_time                         FROM ".POSTS_TABLE."                      WHERE topic_id = ".$topic_id."               ORDER BY post_time ASC                      LIMIT 1 ";     if (!$db->sql_query($sql)) {         message_die(GENERAL_ERROR, 'Error in fetching first post data', '', __LINE__, __FILE__, $sql);     }     if ($row = $db->sql_fetchrow($result)) {         $topicposter = $row['poster_id'];         $topictime = $row['post_time'];     }     //get replies, firts post and last post     $sql = "SELECT count( post_id )-1 AS replies,                                  min( post_id )  AS firstpost,                                  max( post_id )  AS lastpost                         FROM ".POSTS_TABLE."                      WHERE topic_id = ".$topic_id;     if (!$db->sql_query($sql)) {         message_die(GENERAL_ERROR, 'Error in fetching topic posts data', '', __LINE__, __FILE__, $sql);     }     if ($row = $db->sql_fetchrow($result)) {         $replies = $row['replies'];         $firstpost = $row['firstpost'];         $lastpost = $row['lastpost'];     }     // extra's only for poll delete     if ($mode == 'poll_delete'){         $extra = ', topic_vote = 0';     }     if(isset($topicposter) && isset($topictime)){         // update the topics table         $sql = "UPDATE " . TOPICS_TABLE . "                 SET topic_poster = ".$topicposter.",                         topic_time = ".$topictime    .",                         topic_replies = ".$replies    .",                         topic_first_post_id = ".$firstpost    .",                         topic_last_post_id  = ".$lastpost ."                         ".$extra."                 WHERE topic_id = ".$topic_id;         if (!$db->sql_query($sql)) {             message_die(GENERAL_ERROR, 'Error in updating topics', '', __LINE__, __FILE__, $sql);         }     }     // prepare update of forums table     // get forum posts and last post     $sql = "SELECT count( p.post_id ) AS posts,                                  max( p.post_id ) last_post                         FROM ".POSTS_TABLE." p                                      LEFT OUTER JOIN                                  ".APPROVE_POSTS_TABLE." ap                                     ON ( p.post_id = ap.post_id )                      WHERE forum_id = ".$forum_id."                           AND post_time <time>sql_query($sql)) {         message_die(GENERAL_ERROR, 'Error in fetching posts data', '', __LINE__, __FILE__, $sql);     }     if ($row = $db->sql_fetchrow($result)) {         $posts = $row['posts'];         $lastpost = $row['last_post'];     }     // get forum topics     $sql = "SELECT count( t.topic_id ) AS topics                         FROM ".TOPICS_TABLE." t                         LEFT OUTER JOIN                                  ".APPROVE_POSTS_TABLE." ap                                     ON (t.topic_id = ap.topic_id)                      WHERE forum_id = ".$forum_id."                           AND topic_time <time>sql_query($sql)) {         message_die(GENERAL_ERROR, 'Error in fetching topics data', '', __LINE__, __FILE__, $sql);     }     if ($row = $db->sql_fetchrow($result)) {         $topics = $row['topics'];     } else {         $topics = 0;     }     if($lastpost <1>sql_query($sql)) {             message_die(GENERAL_ERROR, 'Error in updating forums', '', __LINE__, __FILE__, $sql);         }     }     // only continue the old code if not edit mode     $sign = ($mode == 'delete') ? '- 1' : '+ 1';     if ($mode != 'poll_delete' && $mode != 'editpost')     {         $sql = "UPDATE " . USERS_TABLE . "             SET user_posts = user_posts $sign             WHERE user_id = $user_id";         if (!$db->sql_query($sql, END_TRANSACTION))         {             message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);         }     } //-- mod : categories hierarchy -------------------------------------------------------------------- //-- add     // keep even in edit mode     board_stats();     cache_tree(true); //-- fin mod : categories hierarchy ----------------------------------------------------------------     // only continue the old code if not edit mode     if ($mode != 'editpost'){         $sql = "SELECT ug.user_id, g.group_id as g_id, u.user_posts, g.group_count, g.group_count_max FROM (" . GROUPS_TABLE . " g, ".USERS_TABLE." u)             LEFT JOIN ". USER_GROUP_TABLE." ug ON g.group_id=ug.group_id AND ug.user_id=$user_id             WHERE u.user_id=$user_id             AND g.group_single_user=0             AND g.group_count_enable=1             AND g.group_moderator<>$user_id";         if ( !($result = $db->sql_query($sql)) )         {             message_die(GENERAL_ERROR, 'Error geting users post stat', '', __LINE__, __FILE__, $sql);         }         while ($group_data = $db->sql_fetchrow($result))         {     $user_already_added = (empty($group_data['user_id'])) ? FALSE : TRUE;     $user_add = ($group_data['group_count'] == $group_data['user_posts'] && $user_id!=ANONYMOUS) ? TRUE : FALSE;     $user_remove = ($group_data['group_count'] > $group_data['user_posts'] || $group_data['group_count_max'] <group_data>sql_query($sql)) )                 {                     message_die(GENERAL_ERROR, 'Error insert users, group count', '', __LINE__, __FILE__, $sql);                 }             } else             if ( $user_already_added && $user_remove)             {                 //remove user from auto group                 $sql = "DELETE FROM " . USER_GROUP_TABLE . "                     WHERE group_id=".$group_data['g_id']."                     AND user_id=$user_id";                 if ( !($db->sql_query($sql)) )                 {                     message_die(GENERAL_ERROR, 'Could not remove users, group count', '', __LINE__, __FILE__, $sql);                 }             }         }     }     return; }//// Delete a post/poll//function delete_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id){     global $board_config, $lang, $db, $phpbb_root_path, $phpEx;     global $userdata, $user_ip;       if ($mode != 'poll_delete')     {         include($phpbb_root_path . 'includes/functions_search.'.$phpEx);           $sql = "DELETE FROM " . POSTS_TABLE . "             WHERE post_id = $post_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);         }           $sql = "DELETE FROM " . POSTS_TEXT_TABLE . "             WHERE post_id = $post_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);         }           if ($post_data['last_post'])         {             if ($post_data['first_post'])             {                 $forum_update_sql .= ', forum_topics = forum_topics - 1';                 $sql = "DELETE FROM " . TOPICS_TABLE . "                     WHERE topic_id = $topic_id                         OR topic_moved_id = $topic_id";                 if (!$db->sql_query($sql))                 {                     message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);                 }                   $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "                     WHERE topic_id = $topic_id";                 if (!$db->sql_query($sql))                 {                     message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);                 }                 $sql = "DELETE FROM " . BOOKMARK_TABLE . "                     WHERE topic_id = $topic_id";                 if ( !$db->sql_query($sql) )                 {                     message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);                 }             }         }           remove_search_post($post_id);     }       if ($mode == 'poll_delete' || ($mode == 'delete' && $post_data['first_post'] && $post_data['last_post']) && $post_data['has_poll'] && $post_data['edit_poll'])     {         $sql = "DELETE FROM " . VOTE_DESC_TABLE . "             WHERE topic_id = $topic_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);         }           $sql = "DELETE FROM " . VOTE_RESULTS_TABLE . "             WHERE vote_id = $poll_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);         }           $sql = "DELETE FROM " . VOTE_USERS_TABLE . "             WHERE vote_id = $poll_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);         }     }       if ($mode == 'delete' && $post_data['first_post'] && $post_data['last_post'])     {         $meta = '<meta>';         $message = $lang['Deleted'];     }     else     {         $meta = '<meta>';         $message = (($mode == 'poll_delete') ? $lang['Poll_delete'] : $lang['Deleted']) . '<br><br>' . sprintf($lang['Click_return_topic'], '<a>', '</a>');     }       $message .=  '<br><br>' . sprintf($lang['Click_return_forum'], '<a>', '</a>');//-- mod : categories hierarchy --------------------------------------------------------------------//-- add     board_stats();     cache_tree(true);//-- fin mod : categories hierarchy ----------------------------------------------------------------       return;}  //// Handle user notification on new post//function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$post_id, &$notify_user){     global $board_config, $lang, $db, $phpbb_root_path, $phpEx;     global $userdata, $user_ip;       $current_time = time();       if ($mode != 'delete')     {         if ($mode == 'reply')         {             $sql = "SELECT ban_userid                 FROM " . BANLIST_TABLE;             if (!($result = $db->sql_query($sql)))             {                 message_die(GENERAL_ERROR, 'Could not obtain banlist', '', __LINE__, __FILE__, $sql);             }               $user_id_sql = '';             while ($row = $db->sql_fetchrow($result))             {                 if (isset($row['ban_userid']) && !empty($row['ban_userid']))                 {                     $user_id_sql .= ', ' . $row['ban_userid'];                 }             }               $sql = "SELECT u.user_id, u.user_email, u.user_lang                 FROM " . TOPICS_WATCH_TABLE . " tw, " . USERS_TABLE . " u                 WHERE tw.topic_id = $topic_id                     AND tw.user_id NOT IN (" . $userdata['user_id'] . ", " . ANONYMOUS . $user_id_sql . ")                     AND tw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . "                     AND u.user_id = tw.user_id";             if (!($result = $db->sql_query($sql)))             {                 message_die(GENERAL_ERROR, 'Could not obtain list of topic watchers', '', __LINE__, __FILE__, $sql);             }               $update_watched_sql = '';             $bcc_list_ary = array();                         if ($row = $db->sql_fetchrow($result))             {                 // Sixty second limit                 @set_time_limit(60);                   do                 {                     if ($row['user_email'] != '')                     {                         $bcc_list_ary[$row['user_lang']][] = $row['user_email'];                     }                     $update_watched_sql .= ($update_watched_sql != '') ? ', ' . $row['user_id'] : $row['user_id'];                 }                 while ($row = $db->sql_fetchrow($result));                   //                 // Let's do some checking to make sure that mass mail functions                 // are working in win32 versions of php.                 //                 if (preg_match('/[c-z]:\.*/i', getenv('PATH')) && !$board_config['smtp_delivery'])                 {                     $ini_val = (@phpversion() >= '4.0.0') ? 'ini_get' : 'get_cfg_var';                       // We are running on windows, force delivery to use our smtp functions                     // since php's are broken by default                     $board_config['smtp_delivery'] = 1;                     $board_config['smtp_host'] = @$ini_val('SMTP');                 }                   if (sizeof($bcc_list_ary))                 {                     include($phpbb_root_path . 'includes/emailer.'.$phpEx);                     $emailer = new emailer($board_config['smtp_delivery']);                       $script_name = preg_replace('/^/?(.*?)/?$/', '1', trim($board_config['script_path']));                     $script_name = ($script_name != '') ? $script_name . '/viewtopic.'.$phpEx : 'viewtopic.'.$phpEx;                     $server_name = trim($board_config['server_name']);               

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 2:01 pm
Author: Teelk
That line should be within the prepare_message function. You're prepare_message function is quite a bit different then it should be. Have you added any MODs that would have changed this function?

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 2:05 pm
Author: Juppertje
"Teelk";p="11694" wrote:That line should be within the prepare_message function. You're prepare_message function is quite a bit different then it should be. Have you added any MODs that would have changed this function?


the only mod what i have installed once (long time ago ) is the country mod flags forum IM nothing else, but without the change in the first part all seems to function well, I hope only that in the future i wont get any problems, until now i always manualy upgraded to the newest version of phpbb and never had any problems until the upgrade now from 2.0.20 to 2.0.21

before i only edited files when i had problems with mysql 5 you helped me before with this issue do not know anymore if that was with this file <img>

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 2:12 pm
Author: Teelk
Ok, country flags shouldn't change that function, so I don't know where the discrepency lies. You can try replacing your prepare_message function with the following one and see if everything still works...
Code: Select all
function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0){     global $board_config, $html_entities_match, $html_entities_replace;       //     // Clean up the message     //     $message = trim($message);       if ($html_on)     {         // If HTML is on, we try to make it safe         // This approach is quite agressive and anything that does not look like a valid tag         // is going to get converted to HTML entities         $message = stripslashes($message);         $html_match = '#<[^w<40>#';         $matches = array();           $message_split = preg_split($html_match, $message);         preg_match_all($html_match, $message, $matches);           $message = '';           foreach ($message_split as $part)         {             $tag = array(array_shift($matches[0]), array_shift($matches[1]), array_shift($matches[2]));             $message .= preg_replace($html_entities_match, $html_entities_replace, $part) . clean_html($tag);         }           $message = addslashes($message);         $message = str_replace('&quot;', '&quot;', $message);     }     else     {         $message = preg_replace($html_entities_match, $html_entities_replace, $message);     }       if($bbcode_on && $bbcode_uid != '')     {         $message = bbencode_first_pass($message, $bbcode_uid);     }       return $message;}

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 2:38 pm
Author: Juppertje
sorry i do not understand what you mean are we talking about the same file includes/functions_post.php ?

My file is much longer then the part you show me above here <img>


do you mean this part to replace with your part?

[code]function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0){     global $board_config, $html_entities_match, $html_entities_replace;       //     // Clean up the message     //     $message = trim($message);       if ($html_on)     {         $allowed_html_tags = split(',', $board_config['allow_html_tags']);           $end_html = 0;         $start_html = 1;         $tmp_message = '';         $message = ' ' . $message . ' ';           while ($start_html = strpos($message, '<', $start_html))         {             $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1, ($start_html - $end_html - 1)));               if ($end_html = strpos($message, '>', $start_html))             {                 $length = $end_html - $start_html + 1;                 $hold_string = substr($message, $start_html, $length);                   if (($unclosed_open = strrpos(' ' . $hold_string, '<')) != 1)                 {                     $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($hold_string, 0, $unclosed_open - 1));                     $hold_string = substr($hold_string, $unclosed_open - 1);                 }                   $tagallowed = false;                 for ($i = 0; $i < sizeof($allowed_html_tags); $i++)                 {                     $match_tag = trim($allowed_html_tags[$i]);                     if (preg_match('#^</?' . $match_tag . '[> ]#i', $hold_string))                     {                         $tagallowed = (preg_match('#^</?' . $match_tag . ' .*?(style[ ]*?=|on[w]+[ ]*?=)#i', $hold_string)) ? false ]

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 2:45 pm
Author: Teelk
Yes, yours is incorrect, replace it with the code I provided and see if your forum is still ok.

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 2:51 pm
Author: Juppertje
"Teelk";p="11702" wrote:Yes, yours is incorrect, replace it with the code I provided and see if your forum is still ok.



i now have placed the file back with your changes and still works fine as before with the old file

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 2:54 pm
Author: Juppertje
oops got an error now if i want to post a reply

Fatal error: Call to undefined function: clean_html() in /var/www/www.mysite.nl/forum/includes/functions_post.php on line 180

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 2:57 pm
Author: Teelk
You're functions_post.php seems to be out of date. The function clean_html was added in 2.0.20. I suggest overwriting your functions_post.php with the premodded one from the update.

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 3:03 pm
Author: Juppertje
"Teelk";p="11706" wrote:You're functions_post.php seems to be out of date. The function clean_html was added in 2.0.20. I suggest overwriting your functions_post.php with the premodded one from the update.


i replaced the file now with the new file from the map premoded and i got still the same error <img>

Fatal error: Call to undefined function: clean_html() in /var/www/www.mysite.nl/forum/includes/functions_post.php on line 180

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 3:06 pm
Author: Teelk
Ok, I don't know what's happening... the clean_html function is in the premodded functions_post.php and therefore that message shouldn't be happening.

Are you sure that you updated to 2.0.20 before trying this update?

PostPosted: Wed Jul 12, 2006 3:07 pm
Author: Unregistered
whats your previous version? is it 2.0.20 ?

PostPosted: Wed Jul 12, 2006 3:07 pm
Author: Unregistered
ops.. teelk.. heh

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 3:08 pm
Author: Juppertje
"Teelk";p="11708" wrote:Ok, I don't know what's happening... the clean_html function is in the premodded functions_post.php and therefore that message shouldn't be happening.

Are you sure that you updated to 2.0.20 before trying this update?


yes i did a while ago when 2.0.20 was released here maybe you can post here a complete file and i wil try to place that maybe that will sove the problem

PostPosted: Wed Jul 12, 2006 3:09 pm
Author: Unregistered
i tried premodded files when i was tryin to upgrade to 2.0.20.. and codes from previous patches were missing.. i rather go for the manual code updates..

PostPosted: Wed Jul 12, 2006 3:13 pm
Author: Unregistered
give us ur site link.. il check the version <img>

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 3:17 pm
Author: Juppertje

PostPosted: Wed Jul 12, 2006 3:20 pm
Author: Unregistered
the rss news page isnt there.. if rss news page is in the server then it wil show the version <img>

PostPosted: Wed Jul 12, 2006 3:22 pm
Author: Juppertje
"Unregistered";p="11717" wrote:the rss news page isnt there.. if rss news page is in the server then it wil show the version <img>



Protected by phpBB Security ÂÂÂ © phpBB-Amod :: phpBB Security ÂÂÂ © heeft 109 hack pogingen geblokkeerd.
Powered by IntegraMOD 1.4.0 ÂÂÂ © 2004, 2005 The Integramod Group
[ Ondersteuning: IntegraMOD Nederland(s)ÂÂÂ © :: Vertaling: The Dutch Team ]
[ Forum powered by phpBB 2.0.21 ÂÂÂ © 2001, 2005 phpBB Group :: FI Theme :: Alle tijden zijn GMT - 1 uur ]
[Page generation time: 1.6428s (PHP: 87% | SQL: 13%) | SQL queries: 66 | GZIP disabled | Debug on]

PostPosted: Wed Jul 12, 2006 3:24 pm
Author: Unregistered
u sure ur previous version is 2.0.20 ?

PostPosted: Wed Jul 12, 2006 3:26 pm
Author: Juppertje
"Unregistered";p="11719" wrote:u sure ur previous version is 2.0.20 ?



yes otherwise i would not say that and before that i had 2.0.19 etc

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 3:34 pm
Author: Unregistered
please be patient til a moderator comes and review your posts.. am sure they wil find a solution for your problem <img>

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 4:56 pm
Author: Juppertje
anyone please help me outh 1:56 am here now i wil wait 1 more hour before i go to bed

the functions_post i now have works half when i post i get error

Error geting users post stat

DEBUG MODE

SQL Error : 1054 Unknown column 'g.group_id' in 'on clause'

SELECT ug.user_id, g.group_id as g_id, u.user_posts, g.group_count, g.group_count_max FROM phpbb_groups g, phpbb_users u LEFT JOIN phpbb_user_group ug ON g.group_id=ug.group_id AND ug.user_id=2 WHERE u.user_id=2 AND g.group_single_user=0 AND g.group_count_enable=1 AND g.group_moderator<>2

Line : 772

when i hit 2x back i can see my post

File : functions_post.php
looks like now:

[code]<?php/***************************************************************************  *                            functions_post.php  *                            -------------------  *   begin                ]+;))#', '#<41>sql_query($sql)) )     {         message_die(GENERAL_ERROR, 'Tried obtaining data for a non-existent user', '', __LINE__, __FILE__, $sql);     }     $usertodata = $db->sql_fetchrow($result);       // prepare wpm message     $bbcode_uid = make_bbcode_uid();     $wpm_message = str_replace("'", "''", $wpm_message);       if(empty($wpm_message))     {         $wpm_message = "Thank you for registering.";     }     $wpm_message = prepare_message(trim($wpm_message), 0, 1, 1, $bbcode_uid);       $msg_time = time();       // Do inbox limit stuff     $sql = "SELECT COUNT(privmsgs_id) AS inbox_items, MIN(privmsgs_date) AS oldest_post_time         FROM " . PRIVMSGS_TABLE . "         WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . "             OR privmsgs_type = " . PRIVMSGS_READ_MAIL . "               OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " )             AND privmsgs_to_userid = " . $usertodata['user_id'];     if ( !($result = $db->sql_query($sql)) )     {         message_die(GENERAL_MESSAGE, $lang['No_such_user']);     }       $sql_priority = ( SQL_LAYER == 'mysql' ) ? 'LOW_PRIORITY' : '';       if ( $inbox_info = $db->sql_fetchrow($result) )     {         if ( $inbox_info['inbox_items'] >= $board_config['max_inbox_privmsgs'] )         {             $sql = "DELETE $sql_priority FROM " . PRIVMSGS_TABLE . "                 WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . "                     OR privmsgs_type = " . PRIVMSGS_READ_MAIL . "                     OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . "  )                     AND privmsgs_date = " . $inbox_info['oldest_post_time'] . "                     AND privmsgs_to_userid = " . $usertodata['user_id'];             if ( !$db->sql_query($sql) )             {                 message_die(GENERAL_ERROR, 'Could not delete your oldest privmsgs', '', __LINE__, __FILE__, $sql);             }         }     }       $sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig)         VALUES (" . PRIVMSGS_NEW_MAIL . ", '" . str_replace("'", "''", $wpm_subject) . "', " . $swpm_config['wpm_userid'] . ", " . $usertodata['user_id'] . ", $msg_time, '$user_ip', 0, 1, 1, 1)";       if ( !($result = $db->sql_query($sql_info, BEGIN_TRANSACTION)) )     {         message_die(GENERAL_ERROR, "Could not insert private message sent info.", "", __LINE__, __FILE__, $sql_info);     }       $privmsg_sent_id = $db->sql_nextid();       $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text)         VALUES ($privmsg_sent_id, '" . $bbcode_uid . "', '" . str_replace("'", "''", $wpm_message) . "')";       if ( !$db->sql_query($sql, END_TRANSACTION) )     {         message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql_info);     }       // Add to the users new pm counter     $sql = "UPDATE " . USERS_TABLE . "         SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = '9999999999'         WHERE user_id = " . $usertodata['user_id'];     if ( !$status = $db->sql_query($sql) )     {         message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql);     }       if ( $send_email && $usertodata['user_notify_pm'] && !empty($usertodata['user_email']) && $usertodata['user_active'] )     {         $email_headers = 'From: ' . $board_config['board_email'] . "nReturn-Path: " . $board_config['board_email'] . "rn";           $script_name = preg_replace('/^/?(.*?)/?$/', "\1", trim($board_config['script_path']));         $script_name = ( $script_name != '' ) ? $script_name . '/privmsg.'.$phpEx : 'privmsg.'.$phpEx;         $server_name = trim($board_config['server_name']);         $server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';         $server_port = ( $board_config['server_port'] <80>use_template('privmsg_notify', $usertodata['user_lang']);         $emailer->extra_headers($email_headers);         $emailer->email_address($usertodata['user_email']);         $emailer->set_subject(); //$lang['Notification_subject']                     $emailer->assign_vars(array(             'USERNAME' => $usertodata['username'],             'SITENAME' => $board_config['sitename'],             'EMAIL_SIG' => str_replace('<br>', "n", "-- n" . $board_config['board_email_sig']),               'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox')         );           $emailer->send();         $emailer->reset();     }       return;}// end wpm mod//// This function will prepare a posted message for// entry into the database.//function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0){     global $board_config, $html_entities_match, $html_entities_replace;       //     // Clean up the message     //     $message = trim($message);       if ($html_on)     {         // If HTML is on, we try to make it safe         // This approach is quite agressive and anything that does not look like a valid tag         // is going to get converted to HTML entities         $message = stripslashes($message);         $html_match = '#<[^w<40>#';         $matches = array();           $message_split = preg_split($html_match, $message);         preg_match_all($html_match, $message, $matches);           $message = '';           foreach ($message_split as $part)         {             $tag = array(array_shift($matches[0]), array_shift($matches[1]), array_shift($matches[2]));             $message .= preg_replace($html_entities_match, $html_entities_replace, $part) . clean_html($tag);         }           $message = addslashes($message);         $message = str_replace('&quot;', '&quot;', $message);     }     else     {         $message = preg_replace($html_entities_match, $html_entities_replace, $message);     }       if($bbcode_on && $bbcode_uid != '')     {         $message = bbencode_first_pass($message, $bbcode_uid);     }       return $message;}  function unprepare_message($message){     global $unhtml_specialchars_match, $unhtml_specialchars_replace;       return preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, $message);}  //// Prepare a message for posting// //-- mod : calendar --------------------------------------------------------------------------------// here we have added//   , $topic_calendar_time = 0, $topic_calendar_duration = 0//-- modifyfunction prepare_post(&$mode, &$post_data, &$bbcode_on, &$html_on, &$smilies_on, &$error_msg, &$username, &$bbcode_uid, &$subject, &$message, &$poll_title, &$poll_options, &$poll_length, &$max_vote, &$hide_vote, &$tothide_vote, &$topic_desc, $topic_calendar_time = 0, $topic_calendar_duration = 0, $topic_calendar_repeat)//-- fin mod : calendar ----------------------------------------------------------------------------{     global $board_config, $userdata, $lang, $phpEx, $phpbb_root_path;       // Check username     if (!empty($username))     {         $username = phpbb_clean_username($username);           if (!$userdata['session_logged_in'] || ($userdata['session_logged_in'] && $username != $userdata['username']))         {             include($phpbb_root_path . 'includes/functions_validate.'.$phpEx);               $result = validate_username($username);             if ($result['error'])             {                 $error_msg .= (!empty($error_msg)) ? '<br>' . $result['error_msg'] : $result['error_msg'];             }         }         else         {             $username = '';         }     }       // Check subject     if (!empty($subject))     {         $subject = htmlspecialchars(trim($subject));     }     else if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))     {         $error_msg .= (!empty($error_msg)) ? '<br>' . $lang['Empty_subject'] : $lang['Empty_subject'];     }  // Check Topic Desciptionif ( !empty($topic_desc) )    {       $topic_desc = htmlspecialchars(trim($topic_desc));    }       // Check message     if (!empty($message))     {         $bbcode_uid = ($bbcode_on) ? make_bbcode_uid() : '';         $message = prepare_message(trim($message), $html_on, $bbcode_on, $smilies_on, $bbcode_uid);     }     else if ($mode != 'delete' && $mode != 'poll_delete')     {         $error_msg .= (!empty($error_msg)) ? '<br>' . $lang['Empty_message'] : $lang['Empty_message'];     }//-- mod : calendar --------------------------------------------------------------------------------//-- add     //     // check calendar date     //     if ((!empty($topic_calendar_time)) && ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])))     {         $year    = intval(date( 'Y', $topic_calendar_time));         $month   = intval(date( 'm', $topic_calendar_time));         $day     = intval(date( 'd', $topic_calendar_time));         if (!checkdate($month, $day, $year))         {             $error_msg .= (!empty($error_msg) ? '<br>' : '') . sprintf($lang['Date_error'], $day, $month, $year);         }     }//-- fin mod : calendar ----------------------------------------------------------------------------       //     // Handle poll stuff     //     if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))     {         $poll_length = (isset($poll_length)) ? max(0, ($poll_length+$poll_length_h/24)) : 0;         $$max_vote = (isset($max_vote)) ? max(0, intval($max_vote)) : 0;         $$hide_vote = (isset($hide_vote)) ? max(0, intval($hide_vote)) : 0;         $$tothide_vote = (isset($tothide_vote)) ? max(0, intval($tothide_vote)) : 0;           if (!empty($poll_title))         {             $poll_title = htmlspecialchars(trim($poll_title));         }           if(!empty($poll_options))         {             $temp_option_text = array();             while(list($option_id, $option_text) = @each($poll_options))             {                 $option_text = trim($option_text);                 if (!empty($option_text))                 {                     $temp_option_text[intval($option_id)] = htmlspecialchars($option_text);                   }             }             $option_text = $temp_option_text;               if (count($poll_options) <2> $board_config['max_poll_options'])             {                 $error_msg .= (!empty($error_msg)) ? '<br>' . $lang['To_many_poll_options'] : $lang['To_many_poll_options'];             }             else if ($poll_title == '')             {                 $error_msg .= (!empty($error_msg)) ? '<br>' . $lang['Empty_poll_title'] : $lang['Empty_poll_title'];             }         }     }       return;}  //// Post a new topic/reply/poll or edit existing post/poll////-- mod : announces -------------------------------------------------------------------------------// here we have added//   , $topic_announce_duration = 0//-- modify//-- mod : calendar --------------------------------------------------------------------------------// here we have added//   , $topic_calendar_time = 0, $topic_calendar_duration = 0//-- modify//-- mod : post icon -------------------------------------------------------------------------------// here we added//   , $post_icon = 0//-- modifyfunction submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length, &$max_vote, &$hide_vote, &$tothide_vote, $forcetime='', &$topic_desc, &$news_category, $topic_announce_duration = 0, $topic_calendar_time = 0, $topic_calendar_duration = 0, $post_icon = 0, $topic_calendar_repeat)//-- fin mod : post icon ---------------------------------------------------------------------------//-- fin mod : calendar ----------------------------------------------------------------------------//-- fin mod : announces ---------------------------------------------------------------------------{     global $board_config, $lang, $db, $phpbb_root_path, $phpEx;     global $userdata, $user_ip, $post_info;  // BEGIN cmx_slash_news_mod     if( isset( $news_category ) && is_numeric( $news_category ) )     {         $news_id = intval( $news_category );     }     else     {         $news_id = 0;     }// END cmx_slash_news_mod       include($phpbb_root_path . 'includes/functions_search.'.$phpEx);       $current_time = time();     $lastposttime = 0;   // MOD: Delayed Topics       if ($mode == 'newtopic' || $mode == 'reply' )     {         if ($board_config['points_post'] && !$post_info['points_disabled'])         {             $points = abs(($mode == 'newtopic') ? $board_config['points_topic'] : $board_config['points_reply']);               if ($userdata['user_id'] != ANONYMOUS)             {                 add_points($userdata['user_id'], $points);             }         }     }     if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost')     {         //         // Flood control         //         $where_sql = ($userdata['user_id'] == ANONYMOUS) ? "poster_ip = '$user_ip'" : 'poster_id = ' . $userdata['user_id'];         $sql = "SELECT MAX(post_time) AS last_post_time             FROM " . POSTS_TABLE . "             WHERE $where_sql";         if ($result = $db->sql_query($sql))         {             if ($row = $db->sql_fetchrow($result))             {                 if (intval($row['last_post_time']) > 0 && ($current_time - intval($row['last_post_time'])) < intval($board_config['flood_interval']) && intval($row['last_post_time']) < $current_time)                 {                     message_die(GENERAL_MESSAGE, $lang['Flood_Error']);                 }                 $lastposttime = intval($row['last_post_time']);  // MOD: Delayed Topics             }         }     }       if ($mode == 'editpost')     {         remove_search_post($post_id);     }       //-----------------------------------------------------------------------------     // MOD: Delayed Topics       // If we're not trying to force the time, use the current time...     $exta = '';     $delayed = 0;       $old_forcetime = '';if (mode != 'newtopic') {         // how do I read from the topic?         $myquery = "SELECT topic_time FROM ". TOPICS_TABLE ." WHERE topic_id = $topic_id";         if ($myresult = $db->sql_query($myquery)) {             if ($myrow = $db->sql_fetchrow($myresult)) {                 if ($myrow['topic_time'] > time()) {                                         $old_forcetime = $myrow['topic_time'];                     $delayed = 1;                 }             }         }     }     if ($forcetime == '') {         $forcetime = time();         if ($old_forcetime){             $extra = ", topic_time = $forcetime";         }     } else {         $delayed = 1;         $extra = ", topic_time = $forcetime";     }         // MOD: Delayed Topics {end}     //-----------------------------------------------------------------------------         if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))     {         $topic_vote = (!empty($poll_title) && count($poll_options) >= 2) ? 1 : 0;  //-- mod : announces -------------------------------------------------------------------------------// here we added //   topic_announce_duration,//   $topic_announce_duration,//// and//   , topic_announce_duration = $topic_announce_duration//-- modify//-- mod : calendar --------------------------------------------------------------------------------// here we have added//   , topic_calendar_time, topic_calendar_duration//   , $topic_calendar_time, $topic_calendar_duration// and//   , topic_calendar_time = $topic_calendar_time, topic_calendar_duration = $topic_calendar_duration//-- modify//-- mod : post icon -------------------------------------------------------------------------------// here we added//   , topic_icon//   , $post_icon//// and//   , topic_icon = $post_icon//-- modify       // correct timezone and summertime     if($topic_calendar_time) user2boardtime($topic_calendar_time);             $sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_desc, topic_poster, topic_time, forum_id, news_id, topic_status, topic_type, topic_icon, topic_calendar_time, topic_calendar_duration, topic_announce_duration, topic_calendar_repeat, topic_vote) VALUES ('$post_subject', '$topic_desc', " . $userdata['user_id'] . ", $forcetime, $forum_id, $news_id, " . TOPIC_UNLOCKED . ", $topic_type, $post_icon, $topic_calendar_time, $topic_calendar_duration, " . intval($topic_announce_duration) . ", '$topic_calendar_repeat', $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_desc = '$topic_desc', news_id = $news_id, topic_type = $topic_type, topic_icon=$post_icon, topic_calendar_time = $topic_calendar_time, topic_calendar_duration = $topic_calendar_duration, topic_announce_duration = " . intval($topic_announce_duration) . "$extra, topic_calendar_repeat = '$topic_calendar_repeat'  " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";//-- fin mod : post icon ---------------------------------------------------------------------------//-- fin mod : calendar ----------------------------------------------------------------------------//-- fin mod : announces ---------------------------------------------------------------------------         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);         }           if ($mode == 'newtopic')         {             $topic_id = $db->sql_nextid();         }     }       //-----------------------------------------------------------------------------     // MOD: Delayed Topics       // is our topic a delayed topic?     $extra = '';     $post_time = $current_time;       if ($delayed == 1)     {         if ($mode == 'newtopic')         {             $extra = ", post_time = $forcetime";             $post_time = $forcetime;         }         else if ($mode == 'reply')         {             // post after last postif($old_forcetime > time()){     $post_time = intval($old_forcetime); } else {     $post_time = time(); }         }     }       // MOD: Delayed Topics {end}     //-----------------------------------------------------------------------------         $edited_sql = ($mode == 'editpost' && !$post_data['last_post'] && $post_data['poster_post']) ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : "";//-- mod : post icon -------------------------------------------------------------------------------// here we added// , post_icon// , $post_icon//// and//  , post_icon = $post_icon//-- modify     $sql = ($mode != "editpost") ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig, post_icon) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $post_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig, $post_icon)" : "UPDATE " . POSTS_TABLE . " SET post_username = '$post_username', enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig, post_icon = $post_icon" . $edited_sql . " $extra WHERE post_id = $post_id";//-- fin mod : post icon ---------------------------------------------------------------------------     if (!$db->sql_query($sql, BEGIN_TRANSACTION))     {         message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);     }       if ($mode != 'editpost')     {         $post_id = $db->sql_nextid();     }       $sql = ($mode != 'editpost') ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text) VALUES ($post_id, '$post_subject', '$bbcode_uid', '$post_message')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '$post_message',  bbcode_uid = '$bbcode_uid', post_subject = '$post_subject' WHERE post_id = $post_id";     if (!$db->sql_query($sql))     {         message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);     }       add_search_words('single', $post_id, stripslashes($post_message), stripslashes($post_subject));       //     // Add poll     //     if (($mode == 'newtopic' || ($mode == 'editpost' && $post_data['edit_poll'])) && !empty($poll_title) && count($poll_options) >= 2)     {         $sql = (!$post_data['has_poll']) ? "INSERT INTO " . VOTE_DESC_TABLE . " (topic_id, vote_text, vote_start, vote_length, vote_max, vote_hide, vote_tothide) VALUES ($topic_id, '$poll_title', $current_time, '$max_vote', '$hide_vote', '$tothide_vote', " . ($poll_length * 86400) . ")" : "UPDATE " . VOTE_DESC_TABLE . " SET vote_text = '$poll_title', vote_length = " . ($poll_length * 86400) . ", vote_max = '$max_vote', vote_hide = '$hide_vote', vote_tothide = '$tothide_vote' WHERE topic_id = $topic_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);         }           $delete_option_sql = '';         $old_poll_result = array();         if ($mode == 'editpost' && $post_data['has_poll'])         {             $sql = "SELECT vote_option_id, vote_result                   FROM " . VOTE_RESULTS_TABLE . "                 WHERE vote_id = $poll_id                 ORDER BY vote_option_id ASC";             if (!($result = $db->sql_query($sql)))             {                 message_die(GENERAL_ERROR, 'Could not obtain vote data results for this topic', '', __LINE__, __FILE__, $sql);             }               while ($row = $db->sql_fetchrow($result))             {                 $old_poll_result[$row['vote_option_id']] = $row['vote_result'];                   if (!isset($poll_options[$row['vote_option_id']]))                 {                     $delete_option_sql .= ($delete_option_sql != '') ? ', ' . $row['vote_option_id'] : $row['vote_option_id'];                 }             }         }         else         {             $poll_id = $db->sql_nextid();         }           @reset($poll_options);           $poll_option_id = 1;         while (list($option_id, $option_text) = each($poll_options))         {             if (!empty($option_text))             {                 $option_text = str_replace("'", "''", htmlspecialchars($option_text));                 $poll_result = ($mode == "editpost" && isset($old_poll_result[$option_id])) ? $old_poll_result[$option_id] : 0;                   $sql = ($mode != "editpost" || !isset($old_poll_result[$option_id])) ? "INSERT INTO " . VOTE_RESULTS_TABLE . " (vote_id, vote_option_id, vote_option_text, vote_result) VALUES ($poll_id, $poll_option_id, '$option_text', $poll_result)" : "UPDATE " . VOTE_RESULTS_TABLE . " SET vote_option_text = '$option_text', vote_result = $poll_result WHERE vote_option_id = $option_id AND vote_id = $poll_id";                 if (!$db->sql_query($sql))                 {                     message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);                 }                 $poll_option_id++;             }         }           if ($delete_option_sql != '')         {             $sql = "DELETE FROM " . VOTE_RESULTS_TABLE . "                 WHERE vote_option_id IN ($delete_option_sql)                     AND vote_id = $poll_id";             if (!$db->sql_query($sql))             {                 message_die(GENERAL_ERROR, 'Error deleting pruned poll options', '', __LINE__, __FILE__, $sql);             }         }     }     //-----------------------------------------------------------------------------     // MOD: Delayed Topics       // If we modified the forced date, we need to redate the messages to reflect that  if ($delayed && $mode == 'editpost' && $post_data['first_post'] && $old_forcetime != $forcetime)     {         $sql = "UPDATE " . POSTS_TABLE . " set post_time=$forcetime WHERE forum_id = $forum_id and topic_id = $topic_id";         if ( !$db->sql_query($sql) )         {             message_die(GENERAL_ERROR, 'Error in redating delayed topic', '', __LINE__, __FILE__, $sql);         }     }       // MOD: Delayed Topics {end}     //-----------------------------------------------------------------------------  //-- mod : categories hierarchy --------------------------------------------------------------------//-- add     board_stats();     cache_tree(true);//-- fin mod : categories hierarchy ----------------------------------------------------------------       $meta = '<meta>';     $message = $lang['Stored'] . '<br><br>' . sprintf($lang['Click_view_message'], '<a>', '</a>') . '<br><br>' . sprintf($lang['Click_return_forum'], '<a>', '</a>');       return false;}  //// Update post stats and details//function update_post_stats(&$mode, &$post_data, &$forum_id, &$topic_id, &$post_id, &$user_id) {     global $db;       // prepare update of topics table     // get first poster and first posttime     $sql = "SELECT poster_id, post_time                         FROM ".POSTS_TABLE."                      WHERE topic_id = ".$topic_id."               ORDER BY post_time ASC                      LIMIT 1 ";     if (!$db->sql_query($sql)) {         message_die(GENERAL_ERROR, 'Error in fetching first post data', '', __LINE__, __FILE__, $sql);     }     if ($row = $db->sql_fetchrow($result)) {         $topicposter = $row['poster_id'];         $topictime = $row['post_time'];     }     //get replies, firts post and last post     $sql = "SELECT count( post_id )-1 AS replies,                                  min( post_id )  AS firstpost,                                  max( post_id )  AS lastpost                         FROM ".POSTS_TABLE."                      WHERE topic_id = ".$topic_id;     if (!$db->sql_query($sql)) {         message_die(GENERAL_ERROR, 'Error in fetching topic posts data', '', __LINE__, __FILE__, $sql);     }     if ($row = $db->sql_fetchrow($result)) {         $replies = $row['replies'];         $firstpost = $row['firstpost'];         $lastpost = $row['lastpost'];     }     // extra's only for poll delete     if ($mode == 'poll_delete'){         $extra = ', topic_vote = 0';     }     if(isset($topicposter) && isset($topictime)){         // update the topics table         $sql = "UPDATE " . TOPICS_TABLE . "                 SET topic_poster = ".$topicposter.",                         topic_time = ".$topictime    .",                         topic_replies = ".$replies    .",                         topic_first_post_id = ".$firstpost    .",                         topic_last_post_id  = ".$lastpost ."                         ".$extra."                 WHERE topic_id = ".$topic_id;         if (!$db->sql_query($sql)) {             message_die(GENERAL_ERROR, 'Error in updating topics', '', __LINE__, __FILE__, $sql);         }     }     // prepare update of forums table     // get forum posts and last post     $sql = "SELECT count( p.post_id ) AS posts,                                  max( p.post_id ) last_post                         FROM ".POSTS_TABLE." p                                      LEFT OUTER JOIN                                  ".APPROVE_POSTS_TABLE." ap                                     ON ( p.post_id = ap.post_id )                      WHERE forum_id = ".$forum_id."                           AND post_time <time>sql_query($sql)) {         message_die(GENERAL_ERROR, 'Error in fetching posts data', '', __LINE__, __FILE__, $sql);     }     if ($row = $db->sql_fetchrow($result)) {         $posts = $row['posts'];         $lastpost = $row['last_post'];     }     // get forum topics     $sql = "SELECT count( t.topic_id ) AS topics                         FROM ".TOPICS_TABLE." t                         LEFT OUTER JOIN                                  ".APPROVE_POSTS_TABLE." ap                                     ON (t.topic_id = ap.topic_id)                      WHERE forum_id = ".$forum_id."                           AND topic_time <time>sql_query($sql)) {         message_die(GENERAL_ERROR, 'Error in fetching topics data', '', __LINE__, __FILE__, $sql);     }     if ($row = $db->sql_fetchrow($result)) {         $topics = $row['topics'];     } else {         $topics = 0;     }     if($lastpost <1>sql_query($sql)) {         message_die(GENERAL_ERROR, 'Error in updating forums', '', __LINE__, __FILE__, $sql);     }     // only continue the old code if not edit mode     $sign = ($mode == 'delete') ? '- 1' : '+ 1';     if ($mode != 'poll_delete' && $mode != 'editpost')     {         $sql = "UPDATE " . USERS_TABLE . "             SET user_posts = user_posts $sign             WHERE user_id = $user_id";         if (!$db->sql_query($sql, END_TRANSACTION))         {             message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);         }     } //-- mod : categories hierarchy -------------------------------------------------------------------- //-- add     // keep even in edit mode     board_stats();     cache_tree(true); //-- fin mod : categories hierarchy ----------------------------------------------------------------     // only continue the old code if not edit mode     if ($mode != 'editpost'){         $sql = "SELECT ug.user_id, g.group_id as g_id, u.user_posts, g.group_count, g.group_count_max FROM " . GROUPS_TABLE . " g, ".USERS_TABLE." u             LEFT JOIN ". USER_GROUP_TABLE." ug ON g.group_id=ug.group_id AND ug.user_id=$user_id             WHERE u.user_id=$user_id             AND g.group_single_user=0             AND g.group_count_enable=1             AND g.group_moderator<>$user_id";         if ( !($result = $db->sql_query($sql)) )         {             message_die(GENERAL_ERROR, 'Error geting users post stat', '', __LINE__, __FILE__, $sql);         }         while ($group_data = $db->sql_fetchrow($result))         {     $user_already_added = (empty($group_data['user_id'])) ? FALSE : TRUE;     $user_add = ($group_data['group_count'] == $group_data['user_posts'] && $user_id!=ANONYMOUS) ? TRUE : FALSE;     $user_remove = ($group_data['group_count'] > $group_data['user_posts'] || $group_data['group_count_max'] <group_data>sql_query($sql)) )                 {                     message_die(GENERAL_ERROR, 'Error insert users, group count', '', __LINE__, __FILE__, $sql);                 }             } else             if ( $user_already_added && $user_remove)             {                 //remove user from auto group                 $sql = "DELETE FROM " . USER_GROUP_TABLE . "                     WHERE group_id=".$group_data['g_id']."                     AND user_id=$user_id";                 if ( !($db->sql_query($sql)) )                 {                     message_die(GENERAL_ERROR, 'Could not remove users, group count', '', __LINE__, __FILE__, $sql);                 }             }         }     }     return; }//// Delete a post/poll//function delete_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id){     global $board_config, $lang, $db, $phpbb_root_path, $phpEx;     global $userdata, $user_ip;       if ($mode != 'poll_delete')     {         include($phpbb_root_path . 'includes/functions_search.'.$phpEx);           $sql = "DELETE FROM " . POSTS_TABLE . "             WHERE post_id = $post_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);         }           $sql = "DELETE FROM " . POSTS_TEXT_TABLE . "             WHERE post_id = $post_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);         }           if ($post_data['last_post'])         {             if ($post_data['first_post'])             {                 $forum_update_sql .= ', forum_topics = forum_topics - 1';                 $sql = "DELETE FROM " . TOPICS_TABLE . "                     WHERE topic_id = $topic_id                         OR topic_moved_id = $topic_id";                 if (!$db->sql_query($sql))                 {                     message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);                 }                   $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "                     WHERE topic_id = $topic_id";                 if (!$db->sql_query($sql))                 {                     message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);                 }                 $sql = "DELETE FROM " . BOOKMARK_TABLE . "                     WHERE topic_id = $topic_id";                 if ( !$db->sql_query($sql) )                 {                     message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);                 }             }         }           remove_search_post($post_id);     }       if ($mode == 'poll_delete' || ($mode == 'delete' && $post_data['first_post'] && $post_data['last_post']) && $post_data['has_poll'] && $post_data['edit_poll'])     {         $sql = "DELETE FROM " . VOTE_DESC_TABLE . "             WHERE topic_id = $topic_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);         }           $sql = "DELETE FROM " . VOTE_RESULTS_TABLE . "             WHERE vote_id = $poll_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);         }           $sql = "DELETE FROM " . VOTE_USERS_TABLE . "             WHERE vote_id = $poll_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);         }     }       if ($mode == 'delete' && $post_data['first_post'] && $post_data['last_post'])     {         $meta = '<meta>';         $message = $lang['Deleted'];     }     else     {         $meta = '<meta>';         $message = (($mode == 'poll_delete') ? $lang['Poll_delete'] : $lang['Deleted']) . '<br><br>' . sprintf($lang['Click_return_topic'], '<a>', '</a>');     }       $message .=  '<br><br>' . sprintf($lang['Click_return_forum'], '<a>', '</a>');//-- mod : categories hierarchy --------------------------------------------------------------------//-- add     board_stats();     cache_tree(true);//-- fin mod : categories hierarchy ----------------------------------------------------------------       return;}  //// Handle user notification on new post//function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$post_id, &$notify_user){     global $board_config, $lang, $db, $phpbb_root_path, $phpEx;     global $userdata, $user_ip;       $current_time = time();       if ($mode != 'delete')     {         if ($mode == 'reply')         {             $sql = "SELECT ban_userid                 FROM " . BANLIST_TABLE;             if (!($result = $db->sql_query($sql)))             {                 message_die(GENERAL_ERROR, 'Could not obtain banlist', '', __LINE__, __FILE__, $sql);             }               $user_id_sql = '';             while ($row = $db->sql_fetchrow($result))             {                 if (isset($row['ban_userid']) && !empty($row['ban_userid']))                 {                     $user_id_sql .= ', ' . $row['ban_userid'];                 }             }               $sql = "SELECT u.user_id, u.user_email, u.user_lang                 FROM " . TOPICS_WATCH_TABLE . " tw, " . USERS_TABLE . " u                 WHERE tw.topic_id = $topic_id                     AND tw.user_id NOT IN (" . $userdata['user_id'] . ", " . ANONYMOUS . $user_id_sql . ")                     AND tw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . "                     AND u.user_id = tw.user_id";             if (!($result = $db->sql_query($sql)))             {                 message_die(GENERAL_ERROR, 'Could not obtain list of topic watchers', '', __LINE__, __FILE__, $sql);             }               $update_watched_sql = '';             $bcc_list_ary = array();                         if ($row = $db->sql_fetchrow($result))             {                 // Sixty second limit                 @set_time_limit(60);                   do                 {                     if ($row['user_email'] != '')                     {                         $bcc_list_ary[$row['user_lang']][] = $row['user_email'];                     }                     $update_watched_sql .= ($update_watched_sql != '') ? ', ' . $row['user_id'] : $row['user_id'];                 }                 while ($row = $db->sql_fetchrow($result));                   //                 // Let's do some checking to make sure that mass mail functions                 // are working in win32 versions of php.                 //                 if (preg_match('/[c-z]:\.*/i', getenv('PATH')) && !$board_config['smtp_delivery'])                 {                     $ini_val = (@phpversion() >= '4.0.0') ? 'ini_get' : 'get_cfg_var';                       // We are running on windows, force delivery to use our smtp functions                     // since php's are broken by default                     $board_config['smtp_delivery'] = 1;                     $board_config['smtp_host'] = @$ini_val('SMTP');                 }                   if (sizeof($bcc_list_ary))                 {                     include($phpbb_root_path . 'includes/emailer.'.$phpEx);                     $emailer = new emailer($board_config['smtp_delivery']);                       $script_name = preg_replace('/^/?(.*?)/?$/', '1', trim($board_config['script_path']));                     $script_name = ($script_name != '') ? $script_name . '/viewtopic.'.$phpEx : 'viewtopic.'.$phpEx;                     $server_name = trim($board_config['server_name']);                     $server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://';                     $server_port = ($board_config['server_port'] <80>from($board_config['board_email']);                     $emailer->replyto($board_config['board_email']);                       $topic_title = (count($orig_word)) ? preg_replace($orig_word, $replacement_word, unprepare_message($topic_title)) : unprepare_message($topic_title);                       @reset($bcc_list_ary);                     while (list($user_lang, $bcc_list) = each($bcc_list_ary))                     {                         $emailer->use_template('topic_notify', $user_lang);                                 for ($i = 0; $i <count>bcc($bcc_list[$i]);                         }                           // The Topic_reply_notification lang string below will be used                         // if for some reason the mail template subject cannot be read                         // ... note it will not necessarily be in the posters own language!                         $emailer->set_subject($lang['Topic_reply_notification']);                                                 // This is a nasty kludge to remove the username var ... till (if?)                         // translators update their templates    

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 5:06 pm
Author: Teelk
You need to apply the fixes in [url=http]this thread[/url], that's a mysql5 error.

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 5:22 pm
Author: Juppertje
"Teelk";p="11729" wrote:You need to apply the fixes in [url=http]this thread[/url], that's a mysql5 error.


ty teelk evrything is working fine now

my includes/functions_post.php looks now like

[code]<?php/***************************************************************************  *                            functions_post.php  *                            -------------------  *   begin                ]+;))#', '#<41>sql_query($sql)) )     {         message_die(GENERAL_ERROR, 'Tried obtaining data for a non-existent user', '', __LINE__, __FILE__, $sql);     }     $usertodata = $db->sql_fetchrow($result);       // prepare wpm message     $bbcode_uid = make_bbcode_uid();     $wpm_message = str_replace("'", "''", $wpm_message);       if(empty($wpm_message))     {         $wpm_message = "Thank you for registering.";     }     $wpm_message = prepare_message(trim($wpm_message), 0, 1, 1, $bbcode_uid);       $msg_time = time();       // Do inbox limit stuff     $sql = "SELECT COUNT(privmsgs_id) AS inbox_items, MIN(privmsgs_date) AS oldest_post_time         FROM " . PRIVMSGS_TABLE . "         WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . "             OR privmsgs_type = " . PRIVMSGS_READ_MAIL . "               OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " )             AND privmsgs_to_userid = " . $usertodata['user_id'];     if ( !($result = $db->sql_query($sql)) )     {         message_die(GENERAL_MESSAGE, $lang['No_such_user']);     }       $sql_priority = ( SQL_LAYER == 'mysql' ) ? 'LOW_PRIORITY' : '';       if ( $inbox_info = $db->sql_fetchrow($result) )     {         if ( $inbox_info['inbox_items'] >= $board_config['max_inbox_privmsgs'] )         {             $sql = "DELETE $sql_priority FROM " . PRIVMSGS_TABLE . "                 WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . "                     OR privmsgs_type = " . PRIVMSGS_READ_MAIL . "                     OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . "  )                     AND privmsgs_date = " . $inbox_info['oldest_post_time'] . "                     AND privmsgs_to_userid = " . $usertodata['user_id'];             if ( !$db->sql_query($sql) )             {                 message_die(GENERAL_ERROR, 'Could not delete your oldest privmsgs', '', __LINE__, __FILE__, $sql);             }         }     }       $sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig)         VALUES (" . PRIVMSGS_NEW_MAIL . ", '" . str_replace("'", "''", $wpm_subject) . "', " . $swpm_config['wpm_userid'] . ", " . $usertodata['user_id'] . ", $msg_time, '$user_ip', 0, 1, 1, 1)";       if ( !($result = $db->sql_query($sql_info, BEGIN_TRANSACTION)) )     {         message_die(GENERAL_ERROR, "Could not insert private message sent info.", "", __LINE__, __FILE__, $sql_info);     }       $privmsg_sent_id = $db->sql_nextid();       $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text)         VALUES ($privmsg_sent_id, '" . $bbcode_uid . "', '" . str_replace("'", "''", $wpm_message) . "')";       if ( !$db->sql_query($sql, END_TRANSACTION) )     {         message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql_info);     }       // Add to the users new pm counter     $sql = "UPDATE " . USERS_TABLE . "         SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = '9999999999'         WHERE user_id = " . $usertodata['user_id'];     if ( !$status = $db->sql_query($sql) )     {         message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql);     }       if ( $send_email && $usertodata['user_notify_pm'] && !empty($usertodata['user_email']) && $usertodata['user_active'] )     {         $email_headers = 'From: ' . $board_config['board_email'] . "nReturn-Path: " . $board_config['board_email'] . "rn";           $script_name = preg_replace('/^/?(.*?)/?$/', "\1", trim($board_config['script_path']));         $script_name = ( $script_name != '' ) ? $script_name . '/privmsg.'.$phpEx : 'privmsg.'.$phpEx;         $server_name = trim($board_config['server_name']);         $server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';         $server_port = ( $board_config['server_port'] <80>use_template('privmsg_notify', $usertodata['user_lang']);         $emailer->extra_headers($email_headers);         $emailer->email_address($usertodata['user_email']);         $emailer->set_subject(); //$lang['Notification_subject']                     $emailer->assign_vars(array(             'USERNAME' => $usertodata['username'],             'SITENAME' => $board_config['sitename'],             'EMAIL_SIG' => str_replace('<br>', "n", "-- n" . $board_config['board_email_sig']),               'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox')         );           $emailer->send();         $emailer->reset();     }       return;}// end wpm mod//// This function will prepare a posted message for// entry into the database.//function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0){     global $board_config, $html_entities_match, $html_entities_replace;       //     // Clean up the message     //     $message = trim($message);       if ($html_on)     {         // If HTML is on, we try to make it safe         // This approach is quite agressive and anything that does not look like a valid tag         // is going to get converted to HTML entities         $message = stripslashes($message);         $html_match = '#<[^w<40>#';         $matches = array();           $message_split = preg_split($html_match, $message);         preg_match_all($html_match, $message, $matches);           $message = '';           foreach ($message_split as $part)         {             $tag = array(array_shift($matches[0]), array_shift($matches[1]), array_shift($matches[2]));         $message .= preg_replace($html_entities_match, $html_entities_replace, $part) . clean_html($tag);         }           $message = addslashes($message);           $message = str_replace('&quot;', '&quot;', $message);     }     else     {         $message = preg_replace($html_entities_match, $html_entities_replace, $message);     }       if($bbcode_on && $bbcode_uid != '')     {         $message = bbencode_first_pass($message, $bbcode_uid);     }       return $message;}  function unprepare_message($message){     global $unhtml_specialchars_match, $unhtml_specialchars_replace;       return preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, $message);}  //// Prepare a message for posting// //-- mod : calendar --------------------------------------------------------------------------------// here we have added//   , $topic_calendar_time = 0, $topic_calendar_duration = 0//-- modifyfunction prepare_post(&$mode, &$post_data, &$bbcode_on, &$html_on, &$smilies_on, &$error_msg, &$username, &$bbcode_uid, &$subject, &$message, &$poll_title, &$poll_options, &$poll_length, &$max_vote, &$hide_vote, &$tothide_vote, &$topic_desc, $topic_calendar_time = 0, $topic_calendar_duration = 0, $topic_calendar_repeat)//-- fin mod : calendar ----------------------------------------------------------------------------{     global $board_config, $userdata, $lang, $phpEx, $phpbb_root_path;       // Check username     if (!empty($username))     {         $username = phpbb_clean_username($username);           if (!$userdata['session_logged_in'] || ($userdata['session_logged_in'] && $username != $userdata['username']))         {             include($phpbb_root_path . 'includes/functions_validate.'.$phpEx);               $result = validate_username($username);             if ($result['error'])             {                 $error_msg .= (!empty($error_msg)) ? '<br>' . $result['error_msg'] : $result['error_msg'];             }         }         else         {             $username = '';         }     }       // Check subject     if (!empty($subject))     {         $subject = htmlspecialchars(trim($subject));     }     else if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))     {         $error_msg .= (!empty($error_msg)) ? '<br>' . $lang['Empty_subject'] : $lang['Empty_subject'];     }  // Check Topic Desciptionif ( !empty($topic_desc) )    {       $topic_desc = htmlspecialchars(trim($topic_desc));    }       // Check message     if (!empty($message))     {         $bbcode_uid = ($bbcode_on) ? make_bbcode_uid() : '';         $message = prepare_message(trim($message), $html_on, $bbcode_on, $smilies_on, $bbcode_uid);     }     else if ($mode != 'delete' && $mode != 'poll_delete')     {         $error_msg .= (!empty($error_msg)) ? '<br>' . $lang['Empty_message'] : $lang['Empty_message'];     }//-- mod : calendar --------------------------------------------------------------------------------//-- add     //     // check calendar date     //     if ((!empty($topic_calendar_time)) && ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])))     {         $year    = intval(date( 'Y', $topic_calendar_time));         $month   = intval(date( 'm', $topic_calendar_time));         $day     = intval(date( 'd', $topic_calendar_time));         if (!checkdate($month, $day, $year))         {             $error_msg .= (!empty($error_msg) ? '<br>' : '') . sprintf($lang['Date_error'], $day, $month, $year);         }     }//-- fin mod : calendar ----------------------------------------------------------------------------       //     // Handle poll stuff     //     if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))     {         $poll_length = (isset($poll_length)) ? max(0, ($poll_length+$poll_length_h/24)) : 0;         $$max_vote = (isset($max_vote)) ? max(0, intval($max_vote)) : 0;         $$hide_vote = (isset($hide_vote)) ? max(0, intval($hide_vote)) : 0;         $$tothide_vote = (isset($tothide_vote)) ? max(0, intval($tothide_vote)) : 0;           if (!empty($poll_title))         {             $poll_title = htmlspecialchars(trim($poll_title));         }           if(!empty($poll_options))         {             $temp_option_text = array();             while(list($option_id, $option_text) = @each($poll_options))             {                 $option_text = trim($option_text);                 if (!empty($option_text))                 {                     $temp_option_text[intval($option_id)] = htmlspecialchars($option_text);                   }             }             $option_text = $temp_option_text;               if (count($poll_options) <2> $board_config['max_poll_options'])             {                 $error_msg .= (!empty($error_msg)) ? '<br>' . $lang['To_many_poll_options'] : $lang['To_many_poll_options'];             }             else if ($poll_title == '')             {                 $error_msg .= (!empty($error_msg)) ? '<br>' . $lang['Empty_poll_title'] : $lang['Empty_poll_title'];             }         }     }       return;}  //// Post a new topic/reply/poll or edit existing post/poll////-- mod : announces -------------------------------------------------------------------------------// here we have added//   , $topic_announce_duration = 0//-- modify//-- mod : calendar --------------------------------------------------------------------------------// here we have added//   , $topic_calendar_time = 0, $topic_calendar_duration = 0//-- modify//-- mod : post icon -------------------------------------------------------------------------------// here we added//   , $post_icon = 0//-- modifyfunction submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length, &$max_vote, &$hide_vote, &$tothide_vote, $forcetime='', &$topic_desc, &$news_category, $topic_announce_duration = 0, $topic_calendar_time = 0, $topic_calendar_duration = 0, $post_icon = 0, $topic_calendar_repeat)//-- fin mod : post icon ---------------------------------------------------------------------------//-- fin mod : calendar ----------------------------------------------------------------------------//-- fin mod : announces ---------------------------------------------------------------------------{     global $board_config, $lang, $db, $phpbb_root_path, $phpEx;     global $userdata, $user_ip, $post_info;  // BEGIN cmx_slash_news_mod     if( isset( $news_category ) && is_numeric( $news_category ) )     {         $news_id = intval( $news_category );     }     else     {         $news_id = 0;     }// END cmx_slash_news_mod       include($phpbb_root_path . 'includes/functions_search.'.$phpEx);       $current_time = time();     $lastposttime = 0;   // MOD: Delayed Topics       if ($mode == 'newtopic' || $mode == 'reply' )     {         if ($board_config['points_post'] && !$post_info['points_disabled'])         {             $points = abs(($mode == 'newtopic') ? $board_config['points_topic'] : $board_config['points_reply']);               if ($userdata['user_id'] != ANONYMOUS)             {                 add_points($userdata['user_id'], $points);             }         }     }     if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost')     {         //         // Flood control         //         $where_sql = ($userdata['user_id'] == ANONYMOUS) ? "poster_ip = '$user_ip'" : 'poster_id = ' . $userdata['user_id'];         $sql = "SELECT MAX(post_time) AS last_post_time             FROM " . POSTS_TABLE . "             WHERE $where_sql";         if ($result = $db->sql_query($sql))         {             if ($row = $db->sql_fetchrow($result))             {                 if (intval($row['last_post_time']) > 0 && ($current_time - intval($row['last_post_time'])) < intval($board_config['flood_interval']) && intval($row['last_post_time']) < $current_time)                 {                     message_die(GENERAL_MESSAGE, $lang['Flood_Error']);                 }                 $lastposttime = intval($row['last_post_time']);  // MOD: Delayed Topics             }         }     }       if ($mode == 'editpost')     {         remove_search_post($post_id);     }       //-----------------------------------------------------------------------------     // MOD: Delayed Topics       // If we're not trying to force the time, use the current time...     $exta = '';     $delayed = 0;       $old_forcetime = '';if (mode != 'newtopic') {         // how do I read from the topic?         $myquery = "SELECT topic_time FROM ". TOPICS_TABLE ." WHERE topic_id = $topic_id";         if ($myresult = $db->sql_query($myquery)) {             if ($myrow = $db->sql_fetchrow($myresult)) {                 if ($myrow['topic_time'] > time()) {                                         $old_forcetime = $myrow['topic_time'];                     $delayed = 1;                 }             }         }     }     if ($forcetime == '') {         $forcetime = time();         if ($old_forcetime){             $extra = ", topic_time = $forcetime";         }     } else {         $delayed = 1;         $extra = ", topic_time = $forcetime";     }         // MOD: Delayed Topics {end}     //-----------------------------------------------------------------------------         if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))     {         $topic_vote = (!empty($poll_title) && count($poll_options) >= 2) ? 1 : 0;  //-- mod : announces -------------------------------------------------------------------------------// here we added //   topic_announce_duration,//   $topic_announce_duration,//// and//   , topic_announce_duration = $topic_announce_duration//-- modify//-- mod : calendar --------------------------------------------------------------------------------// here we have added//   , topic_calendar_time, topic_calendar_duration//   , $topic_calendar_time, $topic_calendar_duration// and//   , topic_calendar_time = $topic_calendar_time, topic_calendar_duration = $topic_calendar_duration//-- modify//-- mod : post icon -------------------------------------------------------------------------------// here we added//   , topic_icon//   , $post_icon//// and//   , topic_icon = $post_icon//-- modify       // correct timezone and summertime     if($topic_calendar_time) user2boardtime($topic_calendar_time);             $sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_desc, topic_poster, topic_time, forum_id, news_id, topic_status, topic_type, topic_icon, topic_calendar_time, topic_calendar_duration, topic_announce_duration, topic_calendar_repeat, topic_vote) VALUES ('$post_subject', '$topic_desc', " . $userdata['user_id'] . ", $forcetime, $forum_id, $news_id, " . TOPIC_UNLOCKED . ", $topic_type, $post_icon, $topic_calendar_time, $topic_calendar_duration, " . intval($topic_announce_duration) . ", '$topic_calendar_repeat', $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_desc = '$topic_desc', news_id = $news_id, topic_type = $topic_type, topic_icon=$post_icon, topic_calendar_time = $topic_calendar_time, topic_calendar_duration = $topic_calendar_duration, topic_announce_duration = " . intval($topic_announce_duration) . "$extra, topic_calendar_repeat = '$topic_calendar_repeat'  " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";//-- fin mod : post icon ---------------------------------------------------------------------------//-- fin mod : calendar ----------------------------------------------------------------------------//-- fin mod : announces ---------------------------------------------------------------------------         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);         }           if ($mode == 'newtopic')         {             $topic_id = $db->sql_nextid();         }     }       //-----------------------------------------------------------------------------     // MOD: Delayed Topics       // is our topic a delayed topic?     $extra = '';     $post_time = $current_time;       if ($delayed == 1)     {         if ($mode == 'newtopic')         {             $extra = ", post_time = $forcetime";             $post_time = $forcetime;         }         else if ($mode == 'reply')         {             // post after last postif($old_forcetime > time()){     $post_time = intval($old_forcetime); } else {     $post_time = time(); }         }     }       // MOD: Delayed Topics {end}     //-----------------------------------------------------------------------------         $edited_sql = ($mode == 'editpost' && !$post_data['last_post'] && $post_data['poster_post']) ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : "";//-- mod : post icon -------------------------------------------------------------------------------// here we added// , post_icon// , $post_icon//// and//  , post_icon = $post_icon//-- modify     $sql = ($mode != "editpost") ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig, post_icon) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $post_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig, $post_icon)" : "UPDATE " . POSTS_TABLE . " SET post_username = '$post_username', enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig, post_icon = $post_icon" . $edited_sql . " $extra WHERE post_id = $post_id";//-- fin mod : post icon ---------------------------------------------------------------------------     if (!$db->sql_query($sql, BEGIN_TRANSACTION))     {         message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);     }       if ($mode != 'editpost')     {         $post_id = $db->sql_nextid();     }       $sql = ($mode != 'editpost') ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text) VALUES ($post_id, '$post_subject', '$bbcode_uid', '$post_message')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '$post_message',  bbcode_uid = '$bbcode_uid', post_subject = '$post_subject' WHERE post_id = $post_id";     if (!$db->sql_query($sql))     {         message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);     }       add_search_words('single', $post_id, stripslashes($post_message), stripslashes($post_subject));       //     // Add poll     //     if (($mode == 'newtopic' || ($mode == 'editpost' && $post_data['edit_poll'])) && !empty($poll_title) && count($poll_options) >= 2)     {         $sql = (!$post_data['has_poll']) ? "INSERT INTO " . VOTE_DESC_TABLE . " (topic_id, vote_text, vote_start, vote_length, vote_max, vote_hide, vote_tothide) VALUES ($topic_id, '$poll_title', $current_time, '$max_vote', '$hide_vote', '$tothide_vote', " . ($poll_length * 86400) . ")" : "UPDATE " . VOTE_DESC_TABLE . " SET vote_text = '$poll_title', vote_length = " . ($poll_length * 86400) . ", vote_max = '$max_vote', vote_hide = '$hide_vote', vote_tothide = '$tothide_vote' WHERE topic_id = $topic_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);         }           $delete_option_sql = '';         $old_poll_result = array();         if ($mode == 'editpost' && $post_data['has_poll'])         {             $sql = "SELECT vote_option_id, vote_result                   FROM " . VOTE_RESULTS_TABLE . "                 WHERE vote_id = $poll_id                 ORDER BY vote_option_id ASC";             if (!($result = $db->sql_query($sql)))             {                 message_die(GENERAL_ERROR, 'Could not obtain vote data results for this topic', '', __LINE__, __FILE__, $sql);             }               while ($row = $db->sql_fetchrow($result))             {                 $old_poll_result[$row['vote_option_id']] = $row['vote_result'];                   if (!isset($poll_options[$row['vote_option_id']]))                 {                     $delete_option_sql .= ($delete_option_sql != '') ? ', ' . $row['vote_option_id'] : $row['vote_option_id'];                 }             }         }         else         {             $poll_id = $db->sql_nextid();         }           @reset($poll_options);           $poll_option_id = 1;         while (list($option_id, $option_text) = each($poll_options))         {             if (!empty($option_text))             {                 $option_text = str_replace("'", "''", htmlspecialchars($option_text));                 $poll_result = ($mode == "editpost" && isset($old_poll_result[$option_id])) ? $old_poll_result[$option_id] : 0;                   $sql = ($mode != "editpost" || !isset($old_poll_result[$option_id])) ? "INSERT INTO " . VOTE_RESULTS_TABLE . " (vote_id, vote_option_id, vote_option_text, vote_result) VALUES ($poll_id, $poll_option_id, '$option_text', $poll_result)" : "UPDATE " . VOTE_RESULTS_TABLE . " SET vote_option_text = '$option_text', vote_result = $poll_result WHERE vote_option_id = $option_id AND vote_id = $poll_id";                 if (!$db->sql_query($sql))                 {                     message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);                 }                 $poll_option_id++;             }         }           if ($delete_option_sql != '')         {             $sql = "DELETE FROM " . VOTE_RESULTS_TABLE . "                 WHERE vote_option_id IN ($delete_option_sql)                     AND vote_id = $poll_id";             if (!$db->sql_query($sql))             {                 message_die(GENERAL_ERROR, 'Error deleting pruned poll options', '', __LINE__, __FILE__, $sql);             }         }     }     //-----------------------------------------------------------------------------     // MOD: Delayed Topics       // If we modified the forced date, we need to redate the messages to reflect that  if ($delayed && $mode == 'editpost' && $post_data['first_post'] && $old_forcetime != $forcetime)     {         $sql = "UPDATE " . POSTS_TABLE . " set post_time=$forcetime WHERE forum_id = $forum_id and topic_id = $topic_id";         if ( !$db->sql_query($sql) )         {             message_die(GENERAL_ERROR, 'Error in redating delayed topic', '', __LINE__, __FILE__, $sql);         }     }       // MOD: Delayed Topics {end}     //-----------------------------------------------------------------------------  //-- mod : categories hierarchy --------------------------------------------------------------------//-- add     board_stats();     cache_tree(true);//-- fin mod : categories hierarchy ----------------------------------------------------------------       $meta = '<meta>';     $message = $lang['Stored'] . '<br><br>' . sprintf($lang['Click_view_message'], '<a>', '</a>') . '<br><br>' . sprintf($lang['Click_return_forum'], '<a>', '</a>');       return false;}  //// Update post stats and details//function update_post_stats(&$mode, &$post_data, &$forum_id, &$topic_id, &$post_id, &$user_id) {     global $db;       // prepare update of topics table     // get first poster and first posttime     $sql = "SELECT poster_id, post_time                         FROM ".POSTS_TABLE."                      WHERE topic_id = ".$topic_id."               ORDER BY post_time ASC                      LIMIT 1 ";     if (!$db->sql_query($sql)) {         message_die(GENERAL_ERROR, 'Error in fetching first post data', '', __LINE__, __FILE__, $sql);     }     if ($row = $db->sql_fetchrow($result)) {         $topicposter = $row['poster_id'];         $topictime = $row['post_time'];     }     //get replies, firts post and last post     $sql = "SELECT count( post_id )-1 AS replies,                                  min( post_id )  AS firstpost,                                  max( post_id )  AS lastpost                         FROM ".POSTS_TABLE."                      WHERE topic_id = ".$topic_id;     if (!$db->sql_query($sql)) {         message_die(GENERAL_ERROR, 'Error in fetching topic posts data', '', __LINE__, __FILE__, $sql);     }     if ($row = $db->sql_fetchrow($result)) {         $replies = $row['replies'];         $firstpost = $row['firstpost'];         $lastpost = $row['lastpost'];     }     // extra's only for poll delete     if ($mode == 'poll_delete'){         $extra = ', topic_vote = 0';     }     if(isset($topicposter) && isset($topictime)){         // update the topics table         $sql = "UPDATE " . TOPICS_TABLE . "                 SET topic_poster = ".$topicposter.",                         topic_time = ".$topictime    .",                         topic_replies = ".$replies    .",                         topic_first_post_id = ".$firstpost    .",                         topic_last_post_id  = ".$lastpost ."                         ".$extra."                 WHERE topic_id = ".$topic_id;         if (!$db->sql_query($sql)) {             message_die(GENERAL_ERROR, 'Error in updating topics', '', __LINE__, __FILE__, $sql);         }     }     // prepare update of forums table     // get forum posts and last post     $sql = "SELECT count( p.post_id ) AS posts,                                  max( p.post_id ) last_post                         FROM ".POSTS_TABLE." p                                      LEFT OUTER JOIN                                  ".APPROVE_POSTS_TABLE." ap                                     ON ( p.post_id = ap.post_id )                      WHERE forum_id = ".$forum_id."                           AND post_time <time>sql_query($sql)) {         message_die(GENERAL_ERROR, 'Error in fetching posts data', '', __LINE__, __FILE__, $sql);     }     if ($row = $db->sql_fetchrow($result)) {         $posts = $row['posts'];         $lastpost = $row['last_post'];     }     // get forum topics     $sql = "SELECT count( t.topic_id ) AS topics                         FROM ".TOPICS_TABLE." t                         LEFT OUTER JOIN                                  ".APPROVE_POSTS_TABLE." ap                                     ON (t.topic_id = ap.topic_id)                      WHERE forum_id = ".$forum_id."                           AND topic_time <time>sql_query($sql)) {         message_die(GENERAL_ERROR, 'Error in fetching topics data', '', __LINE__, __FILE__, $sql);     }     if ($row = $db->sql_fetchrow($result)) {         $topics = $row['topics'];     } else {         $topics = 0;     }     if($lastpost <1>sql_query($sql)) {             message_die(GENERAL_ERROR, 'Error in updating forums', '', __LINE__, __FILE__, $sql);         }     }       // only continue the old code if not edit mode     $sign = ($mode == 'delete') ? '- 1' : '+ 1';     if ($mode != 'poll_delete' && $mode != 'editpost')     {         $sql = "UPDATE " . USERS_TABLE . "             SET user_posts = user_posts $sign             WHERE user_id = $user_id";         if (!$db->sql_query($sql, END_TRANSACTION))         {             message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);         }     } //-- mod : categories hierarchy -------------------------------------------------------------------- //-- add     // keep even in edit mode     board_stats();     cache_tree(true); //-- fin mod : categories hierarchy ----------------------------------------------------------------     // only continue the old code if not edit mode     if ($mode != 'editpost'){         $sql = "SELECT ug.user_id, g.group_id as g_id, u.user_posts, g.group_count, g.group_count_max FROM (" . GROUPS_TABLE . " g, ".USERS_TABLE." u)             LEFT JOIN ". USER_GROUP_TABLE." ug ON g.group_id=ug.group_id AND ug.user_id=$user_id             WHERE u.user_id=$user_id             AND g.group_single_user=0             AND g.group_count_enable=1             AND g.group_moderator<>$user_id";         if ( !($result = $db->sql_query($sql)) )         {             message_die(GENERAL_ERROR, 'Error geting users post stat', '', __LINE__, __FILE__, $sql);         }         while ($group_data = $db->sql_fetchrow($result))         {     $user_already_added = (empty($group_data['user_id'])) ? FALSE : TRUE;     $user_add = ($group_data['group_count'] == $group_data['user_posts'] && $user_id!=ANONYMOUS) ? TRUE : FALSE;     $user_remove = ($group_data['group_count'] > $group_data['user_posts'] || $group_data['group_count_max'] <group_data>sql_query($sql)) )                 {                     message_die(GENERAL_ERROR, 'Error insert users, group count', '', __LINE__, __FILE__, $sql);                 }             } else             if ( $user_already_added && $user_remove)             {                 //remove user from auto group                 $sql = "DELETE FROM " . USER_GROUP_TABLE . "                     WHERE group_id=".$group_data['g_id']."                     AND user_id=$user_id";                 if ( !($db->sql_query($sql)) )                 {                     message_die(GENERAL_ERROR, 'Could not remove users, group count', '', __LINE__, __FILE__, $sql);                 }             }         }     }     return; }//// Delete a post/poll//function delete_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id){     global $board_config, $lang, $db, $phpbb_root_path, $phpEx;     global $userdata, $user_ip;       if ($mode != 'poll_delete')     {         include($phpbb_root_path . 'includes/functions_search.'.$phpEx);           $sql = "DELETE FROM " . POSTS_TABLE . "             WHERE post_id = $post_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);         }           $sql = "DELETE FROM " . POSTS_TEXT_TABLE . "             WHERE post_id = $post_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);         }           if ($post_data['last_post'])         {             if ($post_data['first_post'])             {                 $forum_update_sql .= ', forum_topics = forum_topics - 1';                 $sql = "DELETE FROM " . TOPICS_TABLE . "                     WHERE topic_id = $topic_id                         OR topic_moved_id = $topic_id";                 if (!$db->sql_query($sql))                 {                     message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);                 }                   $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "                     WHERE topic_id = $topic_id";                 if (!$db->sql_query($sql))                 {                     message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);                 }                 $sql = "DELETE FROM " . BOOKMARK_TABLE . "                     WHERE topic_id = $topic_id";                 if ( !$db->sql_query($sql) )                 {                     message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);                 }             }         }           remove_search_post($post_id);     }       if ($mode == 'poll_delete' || ($mode == 'delete' && $post_data['first_post'] && $post_data['last_post']) && $post_data['has_poll'] && $post_data['edit_poll'])     {         $sql = "DELETE FROM " . VOTE_DESC_TABLE . "             WHERE topic_id = $topic_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);         }           $sql = "DELETE FROM " . VOTE_RESULTS_TABLE . "             WHERE vote_id = $poll_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);         }           $sql = "DELETE FROM " . VOTE_USERS_TABLE . "             WHERE vote_id = $poll_id";         if (!$db->sql_query($sql))         {             message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);         }     }       if ($mode == 'delete' && $post_data['first_post'] && $post_data['last_post'])     {         $meta = '<meta>';         $message = $lang['Deleted'];     }     else     {         $meta = '<meta>';         $message = (($mode == 'poll_delete') ? $lang['Poll_delete'] : $lang['Deleted']) . '<br><br>' . sprintf($lang['Click_return_topic'], '<a>', '</a>');     }       $message .=  '<br><br>' . sprintf($lang['Click_return_forum'], '<a>', '</a>');//-- mod : categories hierarchy --------------------------------------------------------------------//-- add     board_stats();     cache_tree(true);//-- fin mod : categories hierarchy ----------------------------------------------------------------       return;}  //// Handle user notification on new post//function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$post_id, &$notify_user){     global $board_config, $lang, $db, $phpbb_root_path, $phpEx;     global $userdata, $user_ip;       $current_time = time();       if ($mode != 'delete')     {         if ($mode == 'reply')         {             $sql = "SELECT ban_userid                 FROM " . BANLIST_TABLE;             if (!($result = $db->sql_query($sql)))             {                 message_die(GENERAL_ERROR, 'Could not obtain banlist', '', __LINE__, __FILE__, $sql);             }               $user_id_sql = '';             while ($row = $db->sql_fetchrow($result))             {                 if (isset($row['ban_userid']) && !empty($row['ban_userid']))                 {                     $user_id_sql .= ', ' . $row['ban_userid'];                 }             }               $sql = "SELECT u.user_id, u.user_email, u.user_lang                 FROM " . TOPICS_WATCH_TABLE . " tw, " . USERS_TABLE . " u                 WHERE tw.topic_id = $topic_id                     AND tw.user_id NOT IN (" . $userdata['user_id'] . ", " . ANONYMOUS . $user_id_sql . ")                     AND tw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . "                     AND u.user_id = tw.user_id";             if (!($result = $db->sql_query($sql)))             {                 message_die(GENERAL_ERROR, 'Could not obtain list of topic watchers', '', __LINE__, __FILE__, $sql);             }               $update_watched_sql = '';             $bcc_list_ary = array();                         if ($row = $db->sql_fetchrow($result))             {                 // Sixty second limit                 @set_time_limit(60);                   do                 {                     if ($row['user_email'] != '')                     {                         $bcc_list_ary[$row['user_lang']][] = $row['user_email'];                     }                     $update_watched_sql .= ($update_watched_sql != '') ? ', ' . $row['user_id'] : $row['user_id'];                 }                 while ($row = $db->sql_fetchrow($result));                   //                 // Let's do some checking to make sure that mass mail functions                 // are working in win32 versions of php.                 //                 if (preg_match('/[c-z]:\.*/i', getenv('PATH')) && !$board_config['smtp_delivery'])                 {                     $ini_val = (@phpversion() >= '4.0.0') ? 'ini_get' : 'get_cfg_var';                       // We are running on windows, force delivery to use our smtp functions                     // since php's are broken by default                     $board_config['smtp_delivery'] = 1;                     $board_config['smtp_host'] = @$ini_val('SMTP');                 }                   if (sizeof($bcc_list_ary))                 {                     include($phpbb_root_path . 'includes/emailer.'.$phpEx);                     $emailer = new emailer($board_config['smtp_delivery']);                       $script_name = preg_replace('/^/?(.*?)/?$/', '1', trim($board_config['script_path']));                     $script_name = ($script_name != '') ? $script_name . '/viewtopic.'.$phpEx : 'viewtopic.'.$phpEx;                     $server_name = trim($board_config['server_name']);                     $server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://';                     $server_port = ($board_config['server_port'] <80>from($board_config['board_email']);                     $emailer->replyto($board_config['board_email']);                       $topic_title = (count($orig_word)) ? preg_replace($orig_word, $replacement_word, unprepare_message($topic_title)) : unprepare_message($topic_title);                       @reset($bcc_list_ary);                     while (list($user_lang, $bcc_list) = each($bcc_list_ary))                     {                         $emailer->use_template('topic_notify', $user_lang);                                 for ($i = 0; $i <count>bcc($bcc_list[$i]);                         }                           // The Topic_reply_notification lang string below will be used                         // if for some reason the mail template subject cannot be read                         // ... note it will not necessarily be in the posters own language!                         $emailer->set_subject($lang['Topic_reply_notification']);                                                 // This is a nasty kludge to remove the username var ... till (if?)                         // translators update their templates                         $emailer->msg = preg_replace('#[ ]?{USERNAME}#', '', $emailer->msg);                           $emailer->assign_vars(array(              

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 12, 2006 7:36 pm
Author: Teelk
It's not really necessary, but the gesture is nice. If you really think I deserve it though, you can find it here. http://www.witchhunters.ca/coh/portal.php?page=5

Or, you can donate to this site to help keep it goin'... donate link in upper right corner.

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Thu Jul 13, 2006 12:24 am
Author: Juppertje
"Teelk";p="11734" wrote:It's not really necessary, but the gesture is nice. If you really think I deserve it though, you can find it here. http://www.witchhunters.ca/coh/portal.php?page=5

Or, you can donate to this site to help keep it goin'... donate link in upper right corner.


Hello Teelk to donate to this was inpossible when i press donate i got this error message:
Website PayPal account has not been set up to receive funds, please contact our administrator to report this issue.

So i made a donation tot you <img> for the fast service you gave us our forum is very important to us we have manny customers and sponsors and we do not want to lose them

Again txs for your help

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Thu Jul 13, 2006 12:34 am
Author: Teelk
Thanks, it's appretiated. :mrgreen:

PostPosted: Sat Jul 15, 2006 6:31 am
Author: sop
When im back from vacation, im going to update my forum, but i have a question.

Is this http://integramod.com/forum/viewtopic.php?t=1432 included in the update?

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Mon Jul 17, 2006 8:26 pm
Author: Teelk
It sure is. <img>

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Tue Jul 18, 2006 1:04 am
Author: Juppertje
I found a new strange and small issue:

In ACP under main and then Bots you can vieuw witch bots visite your site and add them as well to your list, now the trange thing is @ out site he almost see everything as googlebot even it isn't @ googlebot but only a normal user?

My quistion is:

1) how can i fix this
2) does sombody have a correct list for me with the ip list of googlebots becaurse mine is messed up now also with ip's of normal users i had to delet whole the googlebot list

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Tue Jul 18, 2006 5:01 am
Author: Wiked
Well I did the update (I cant use the premodded files due to my MODS) and have the following error:

Fatal error: Call to undefined function: phpbb_ltrim() in /clientdata/www/au/v/myforum.com/includes/functions.php on line 644

As per the INSTALL instructions, it was this code change

FIND
Code: Select all
$board_config['default_lang'] = $userdata['user_lang'];


REPLACE WITH
Code: Select all
$default_lang = phpbb_ltrim(basename(phpbb_rtrim($userdata['user_lang'])), "'");


I re-uploaded my original functions.php file and then did the code change a further 5 times all with the same result so I would have to assume that I haven't made an error in changing the code in that file.

Would anybody know whats going on?

In the mean time until I can get some advice from you guys I have uploaded my original includes/function.php file to the site and its working fine. Obviously I would like to complete the upgrade but time isn't critical doing it this way.

Also when I ran the DB update there were no errors at all if that helps.



Thanks

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Tue Jul 18, 2006 5:57 am
Author: Michaelo
Make sure this function is in functions

Code: Select all
 /*** This function is a wrapper for ltrim, as charlist is only supported in php >= 4.1.0* Added in phpBB 2.0.18*/function phpbb_ltrim($str, $charlist = false){     if ($charlist === false)     {         return ltrim($str);     }         $php_version = explode('.', PHP_VERSION);       // php version < 4.1.0     if ((int) $php_version[0] < 4 || ((int) $php_version[0] == 4 && (int) $php_version[1] < 1))     {         while ($str{0} == $charlist)         {             $str = substr($str, 1);         }     }     else     {         $str = ltrim($str, $charlist);     }       return $str;}  

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Tue Jul 18, 2006 6:00 am
Author: Juppertje
"Michaelo";p="12043" wrote:Make sure this function is in functions

Code: Select all
 /*** This function is a wrapper for ltrim, as charlist is only supported in php >= 4.1.0* Added in phpBB 2.0.18*/function phpbb_ltrim($str, $charlist = false){     if ($charlist === false)     {         return ltrim($str);     }         $php_version = explode('.', PHP_VERSION);       // php version < 4.1.0     if ((int) $php_version[0] < 4 || ((int) $php_version[0] == 4 && (int) $php_version[1] < 1))     {         while ($str{0} == $charlist)         {             $str = substr($str, 1);         }     }     else     {         $str = ltrim($str, $charlist);     }       return $str;}  


what has this to do for the Google bot?

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Tue Jul 18, 2006 6:25 am
Author: Wiked
Thank you very much. Works like a charm now except that one of my MODS (Bookmakers MOD) wont let you make a bet and comes back Hacking attempt! but thats hardly up to you to figure that out for me.

Does that mean that I missed adding that code in the 2.0.18 update awhile back?

PostPosted: Tue Jul 18, 2006 6:44 am
Author: CurlyDE
Updated using the premodded files ... everything is working great. Thanks!

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Thu Jul 20, 2006 10:45 am
Author: MadUser
this is so frustrating
how all of you understand the steps to upgrade????????
i searched and searched... and i cant find what goes first:
the file mod
or the update_to_latest.php

<img>

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Thu Jul 20, 2006 11:05 am
Author: obiku
I normaly start the update_to_latest.php first. After that I do the code changes. This because most of the times when I upgrade my board, I do not dissable my board. (I know there are some people who think thats a bad Idea, and they are right <img> )
In my case, if you first put the new code in, and there is a new db table what can be needed, you get errors on your board.

PostPosted: Thu Jul 20, 2006 11:21 am
Author: Master Dwarf
Updated without a hitch using the premodded files. <img>

Are you having problems MadUser or did obiku help?

PostPosted: Thu Jul 20, 2006 11:34 am
Author: MadUser
"Master Dwarf" wrote:Updated without a hitch using the premodded files. <img>

Are you having problems MadUser or did obiku help?
Thanks man but its ok
i did what he said, no problems at all

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Sun Jul 23, 2006 3:33 pm
Author: Juppertje
"Juppertje";p="12025" wrote:I found a new strange and small issue:

In ACP under main and then Bots you can vieuw witch bots visite your site and add them as well to your list, now the trange thing is @ out site he almost see everything as googlebot even it isn't @ googlebot but only a normal user?

My quistion is:

1) how can i fix this
2) does sombody have a correct list for me with the ip list of googlebots becaurse mine is messed up now also with ip's of normal users i had to delet whole the googlebot list


could anybody help me please the list in ACP/main/ Bots managment i have a list what evry day get's longer it say's that everything is a google bot <img> and only 1% of the ip adresses is a real google bot what i have to do to fix this issue it happend afther the update see a part of my list in ACP/main bots management:

Bot naam Bot ip/agent Opties
Googlebot 81.206.229.172 Negeren Toevoegen
Googlebot 83.160.31.174 Negeren Toevoegen
Googlebot 212.187.44.215 Negeren Toevoegen
Googlebot 212.120.87.107 Negeren Toevoegen
Googlebot 84.83.93.20 Negeren Toevoegen
Googlebot 193.173.54.99 Negeren Toevoegen
Googlebot 82.148.221.150 Negeren Toevoegen
Googlebot 86.81.123.30 Negeren Toevoegen
Googlebot 212.19.210.143 Negeren Toevoegen
Googlebot 212.127.145.236 Negeren Toevoegen
Googlebot 80.100.93.212 Negeren Toevoegen
Googlebot 212.123.206.71 Negeren Toevoegen
Googlebot 84.197.47.232 Negeren Toevoegen
Googlebot 217.120.175.8 Negeren Toevoegen
Googlebot 86.84.176.233 Negeren Toevoegen
Googlebot 193.173.195.225 Negeren Toevoegen
Googlebot 83.85.198.181 Negeren Toevoegen
Googlebot 212.238.213.147 Negeren Toevoegen
Googlebot 62.238.3.96 Negeren Toevoegen
Googlebot 84.105.163.111 Negeren Toevoegen
Googlebot 212.83.72.101 Negeren Toevoegen
Googlebot 213.219.166.123 Negeren Toevoegen
Googlebot 84.25.140.77 Negeren Toevoegen
Googlebot 84.104.146.153 Negeren Toevoegen
Googlebot 80.126.156.94 Negeren Toevoegen
Googlebot 62.45.152.170 Negeren Toevoegen
Googlebot 83.118.122.65 Negeren Toevoegen
Googlebot 81.205.1.134 Negeren Toevoegen
Googlebot 195.240.203.54 Negeren Toevoegen
Googlebot 80.126.222.106 Negeren Toevoegen
Googlebot 81.206.173.214 Negeren Toevoegen
Googlebot 81.205.130.20 Negeren Toevoegen
Googlebot 81.70.113.68 Negeren Toevoegen
Googlebot 82.170.23.148 Negeren Toevoegen
Googlebot 83.116.68.130 Negeren Toevoegen
Googlebot 81.68.119.219 Negeren Toevoegen
Googlebot 82.236.217.66 Negeren Toevoegen
Googlebot 82.157.4.246 Negeren Toevoegen
Googlebot 213.10.191.59 Negeren Toevoegen
Googlebot 66.249.66.163 Negeren Toevoegen
Googlebot 81.206.45.182 Negeren Toevoegen
Googlebot 80.242.237.58 Negeren Toevoegen
Googlebot 84.81.190.89 Negeren Toevoegen
Googlebot 80.126.100.166 Negeren Toevoegen
Googlebot 83.180.59.72 Negeren Toevoegen
Googlebot 217.166.113.4 Negeren Toevoegen
Googlebot 84.195.61.186 Negeren Toevoegen
Googlebot 80.126.31.146 Negeren Toevoegen
Googlebot 84.84.135.54 Negeren Toevoegen
Googlebot 84.27.174.185 Negeren Toevoegen
Googlebot 82.173.222.45 Negeren Toevoegen
Googlebot 86.85.232.66 Negeren Toevoegen
Googlebot 87.212.131.110 Negeren Toevoegen
Googlebot 84.80.145.96 Negeren Toevoegen
Googlebot 212.45.53.135 Negeren Toevoegen
Googlebot 86.80.9.128 Negeren Toevoegen
Googlebot 82.74.179.204 Negeren Toevoegen
Googlebot 62.238.238.133 Negeren Toevoegen
Googlebot 82.170.100.118 Negeren Toevoegen
Googlebot 82.168.75.239 Negeren Toevoegen
Googlebot 80.56.21.167 Negeren Toevoegen
Googlebot 81.205.200.55 Negeren Toevoegen
Googlebot 80.57.245.235 Negeren Toevoegen
Googlebot 85.147.192.84 Negeren Toevoegen
Googlebot 83.118.244.197 Negeren Toevoegen
Googlebot 82.93.36.45 Negeren Toevoegen
Googlebot 62.166.9.216 Negeren Toevoegen
Googlebot 213.11.4.10 Negeren Toevoegen
Googlebot 213.51.119.38 Negeren Toevoegen
Googlebot 12.151.160.30 Negeren Toevoegen
Googlebot 24.132.212.73 Negeren Toevoegen
Googlebot 82.156.171.149 Negeren Toevoegen
Googlebot 84.192.118.5 Negeren Toevoegen
Googlebot 24.132.44.160 Negeren Toevoegen
Googlebot 82.156.254.24 Negeren Toevoegen
Googlebot 85.145.212.134 Negeren Toevoegen
Googlebot 83.118.150.72 Negeren Toevoegen
Googlebot 83.84.191.192 Negeren Toevoegen
Googlebot 83.128.82.213 Negeren Toevoegen
Googlebot 84.27.9.194 Negeren Toevoegen
Googlebot 145.117.22.45 Negeren Toevoegen
Googlebot 82.161.185.50 Negeren Toevoegen
Googlebot 81.207.253.164 Negeren Toevoegen
Googlebot 167.202.196.72 Negeren Toevoegen
Googlebot 167.202.196.71 Negeren Toevoegen
Googlebot 83.160.164.205 Negeren Toevoegen
Googlebot 80.127.90.83 Negeren Toevoegen
Googlebot 145.53.212.20 Negeren Toevoegen
Googlebot 83.181.159.74 Negeren Toevoegen
Googlebot 84.29.69.150 Negeren Toevoegen
Googlebot 213.84.148.208 Negeren Toevoegen
Googlebot 217.122.54.21 Negeren Toevoegen
Googlebot 82.174.114.48 Negeren Toevoegen
Googlebot 217.122.149.9 Negeren Toevoegen
Googlebot 80.200.49.233 Negeren Toevoegen
Googlebot 217.136.85.237 Negeren Toevoegen
Googlebot 84.82.212.137 Negeren Toevoegen
Googlebot 213.10.117.13 Negeren Toevoegen
Googlebot 213.118.177.201 Negeren Toevoegen
Googlebot 201.245.242.17 Negeren Toevoegen
Googlebot 81.83.16.223 Negeren Toevoegen
Googlebot 84.81.85.71 Negeren Toevoegen
Googlebot 84.81.66.21 Negeren Toevoegen
Googlebot 62.194.47.58 Negeren Toevoegen
Googlebot 80.57.93.165 Negeren Toevoegen
Googlebot 62.131.224.200 Negeren Toevoegen
Googlebot 84.84.100.129 Negeren Toevoegen
Googlebot 85.146.144.186 Negeren Toevoegen
Googlebot 84.82.154.124 Negeren Toevoegen
Googlebot 83.117.187.157 Negeren Toevoegen
Googlebot 213.93.137.87 Negeren Toevoegen
Googlebot 217.115.228.52 Negeren Toevoegen
Googlebot 213.93.112.227 Negeren Toevoegen
Googlebot 83.83.15.162 Negeren Toevoegen
Googlebot 87.210.66.176 Negeren Toevoegen
Googlebot 80.61.53.42 Negeren Toevoegen
Googlebot 84.81.105.155 Negeren Toevoegen
Googlebot 86.84.3.37 Negeren Toevoegen
Googlebot 80.127.89.18 Negeren Toevoegen
Googlebot 81.59.184.211 Negeren Toevoegen
Googlebot 212.64.3.64 Negeren Toevoegen
Googlebot 83.27.208.140 Negeren Toevoegen
Googlebot 83.118.220.105 Negeren Toevoegen
Googlebot 84.27.244.55 Negeren Toevoegen
Googlebot 62.131.249.101 Negeren Toevoegen
Googlebot 144.95.35.6 Negeren Toevoegen
Googlebot 62.238.221.194 Negeren Toevoegen
Googlebot 81.245.49.134 Negeren Toevoegen
Googlebot 81.59.12.192 Negeren Toevoegen
Googlebot 80.61.246.78 Negeren Toevoegen
Googlebot 80.57.193.224 Negeren Toevoegen
Googlebot 81.59.33.15 Negeren Toevoegen
Googlebot 85.146.172.195 Negeren Toevoegen
Googlebot 84.105.219.4 Negeren Toevoegen
Googlebot 222.121.244.49 Negeren Toevoegen
Googlebot 82.92.116.174 Negeren Toevoegen
Googlebot 82.168.191.60 Negeren Toevoegen
Googlebot 85.146.108.20 Negeren Toevoegen
Googlebot 145.50.39.12 Negeren Toevoegen
Googlebot 86.81.18.161 Negeren Toevoegen
Googlebot 62.195.227.233 Negeren Toevoegen
Googlebot 84.30.240.168 Negeren Toevoegen
Googlebot 213.93.52.219 Negeren Toevoegen
Googlebot 82.72.183.136 Negeren Toevoegen
Googlebot 84.31.52.218 Negeren Toevoegen
Googlebot 62.194.53.108 Negeren Toevoegen
Googlebot 84.29.193.136 Negeren Toevoegen
Googlebot 84.81.239.111 Negeren Toevoegen
Googlebot 84.29.185.115 Negeren Toevoegen
Googlebot 80.57.166.228 Negeren Toevoegen

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 26, 2006 1:13 pm
Author: Juppertje
anybody? or everybody on holliday?

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 26, 2006 2:28 pm
Author: obiku
Can you give us more information, for example
  • When does this problem came up (after or before upgrade to 2.0.21
  • what other mods did you install
  • Who are the IP adresses from

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 26, 2006 3:45 pm
Author: Juppertje
"obiku";p="12465" wrote:Can you give us more information, for example
  • When does this problem came up (after or before upgrade to 2.0.21
  • what other mods did you install
  • Who are the IP adresses from


afther upgrading to 2.0.21
no other mods installed
the ipadresses are from all user who visit our board and the list is getting longer everyday <img>

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Wed Jul 26, 2006 5:31 pm
Author: Teelk
The list is a good thing, it means that google is indexing or at least visiting your site. Adding those bots just means that the Bots MOD can keep track of what those particular bots are indexing.

It would be nice to have a feature to add all bots, and I may look into it in the near future.

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Thu Jul 27, 2006 6:09 am
Author: Juppertje
"Teelk";p="12472" wrote:The list is a good thing, it means that google is indexing or at least visiting your site. Adding those bots just means that the Bots MOD can keep track of what those particular bots are indexing.

It would be nice to have a feature to add all bots, and I may look into it in the near future.


ia m happy manny bots are visiting but all the ip's in list above is mentioned as Google bot but are normal users lol i have now over 400 IP's in list and all metioned as googlebot that is not good they are simple users from a normal internet profider like we have here for example wanadoo and orange when i look up those ip's they are normal ip adresses and not goodlebots but system sees now al ip's like googlebot rofl <img> so somthing is not working as it should be.

PostPosted: Thu Jul 27, 2006 5:33 pm
Author: Eon
The steps worked perfectly for me except for one find. The only problem I have is that my Quotes are rendered useless yet again.

Anybody else have a problem with quick quoting?

PostPosted: Thu Jul 27, 2006 9:08 pm
Author: Teelk
"Eon";p="12549" wrote:The steps worked perfectly for me except for one find. The only problem I have is that my Quotes are rendered useless yet again.

Anybody else have a problem with quick quoting?
Quick Quote is working fine here... what was the find code you couldn't find?

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Sat Jul 29, 2006 3:01 pm
Author: ayasha
i finally got around to doing the upgrading, and everything seems to be working fine.

the html is working in post again, but i cannot get it to work right with the signature.

when i put in

[code]<img src="http]

it converts it to

[code]<img src="http]

when i click on submit, why would it add the symbol in 2 places? and what can i do to correct this?

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Sat Jul 29, 2006 10:17 pm
Author: Teelk
Quite the signature you've got there... may need to censor that...

The last few updates from phpBB have been very poor in my opinion. Especially their handling of HTML, it doesn't seem like they finished the job and as a result HTML is tricky to use. I can't even get HTML to turn on in signatures right now...

Instead, use the bbcode equivilent...

Code: Select all
[flash=,]http://www.linktoyourimage.com/image.jpg[/flash:376yvstt]

PostPosted: Sun Jul 30, 2006 6:13 am
Author: ayasha
i would love to use the img tags, and in 1.4.1 i can use the img tags with the snip of code for my tag, but not in 1.4.0. i was just hoping i could figure out a way the girls on my forum could use it now. this script is for a rotating signature, and very popular item to use on my forum.

thanks for the compliment Teelk, and that particular rotation of sigs is censored <img>

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Mon Jul 31, 2006 9:58 am
Author: Indyzcar
just a quick Q: Apparently the stock dl is version 2.0.13 of phpbb, and the update says that you must have 2.0.20 to upgrade the files.

So... what do I need to do to get up to date?

PostPosted: Mon Jul 31, 2006 11:01 am
Author: Michaelo
Why not use the advanced bbcode in 140?

PostPosted: Tue Aug 01, 2006 7:00 am
Author: Indyzcar
"Michaelo";p="12797" wrote:Why not use the advanced bbcode in 140?


? was that directed towards my post?

PostPosted: Tue Aug 01, 2006 1:03 pm
Author: ayasha
"Michaelo";p="12797" wrote:Why not use the advanced bbcode in 140?


i have thought of that Mike, just trying to figure out if i want to mod that or just wait for 141 to be released with an upgrade path. <img>

PostPosted: Tue Aug 01, 2006 4:53 pm
Author: Michaelo
For now you could just add the edits for off site images but you will have to search the thread to find it because as usual I can't remember... <img>

PostPosted: Fri Aug 11, 2006 9:31 am
Author: gcomfx.com
Okay, you guys know the smilie problem where they don't show up for a while? I think the update caused it to do that weird thing again. Some of my smilies are only working in PREVIEW mode. <img>

PostPosted: Mon Aug 14, 2006 7:57 am
Author: Unregistered
My Version Information block from admin panel showed me this msg:

Your installation does not seem to be up to date. Updates are available for your version of phpBB, please visit http://www.phpbb.com/downloads.php to obtain the latest version.
The latest available version is phpBB 0.0.0. You are running phpBB 2.0.21.

very strange.. <img>

PostPosted: Mon Aug 14, 2006 10:28 am
Author: gcomfx.com
"gcomfx.com";p="13504" wrote:Okay, you guys know the smilie problem where they don't show up for a while? I think the update caused it to do that weird thing again. Some of my smilies are only working in PREVIEW mode. <img>


As usual, now they work correctly again. Even added a few new ones. They are fine now too.

PostPosted: Mon Aug 21, 2006 8:46 pm
Author: Pggar
This was a really long weekend. At least now my forum is fully upgraded. I went from 2.0.19 -> Security 1.0.3 -> 2.0.20 -> 2.0.21.

I used the premodded files and checked every single one of them with the upgrade instructions to see if there was nothing wrong or missing.

I found some differences that I'm going to list. I can't say this are problems. I don't believe they are, but it would be good if someone with more knowledge of the system checked those things. If you used premodded files to upgrade, you might want to check the things I'm going to list now:

[hr:yo7zylfe]
Security 1.0.3
***************
adminindex.php
***************
line 255. (this is different from the original, and it seems to include version 5 of mysql)
Code: Select all
            if( preg_match("/^(3.23|4.|5.)/", $version) )             {                 $db_name = ( preg_match("/^(3.23.[6-9])|(3.23.[1-9][1-9])|(4.)|(5.)/", $version) ) ? "`$dbname`" ]

   
***********************************
languagelang_englishlang_main.php
***********************************
line 1382. (some language entries were deleted)
[code=text]$lang['Login_attempts_exceeded'] = 'The maximum number of %s login attempts has been exceeded. You are not allowed to login for the next %s minutes.';$lang['Please_remove_install'] = 'Please ensure both the install/ directory is deleted';$lang['Please_remove_install'] = 'Please ensure both the prill_install/ directory is deleted';



[hr]
2.0.21
*********************
admin/admin_ranks.php
*********************
Modifications from 2.0.20 were ignored.
That means that the premodded file has most of the code from 2.0.18.


**********************
includes/functions.php
**********************
There are 2 functions from Activity mod on the end of the file.
I believe they are not necessary since they are not used anywhere.


*****************************
includes/functions_portal.php
*****************************
Modification from 2.0.21 instructions was not implemented.
I'm not sure if this was intentional or not.


***************************
includes/functions_post.php
***************************
line 184. (this is a correction from the phpbb forum that was not on the instruction, but was included in the code)
[php]         $message = str_replace('&quot;', '"', $message);[/code]
line 735. the second instruction from 2.0.21 for this file was not implemented. I'm not sure if this was intentional or not.


*********************
includes/sessions.php
*********************
line 85. (this code was added, i didn't find out why)
[php]     //-- mod ]
[hr:yo7zylfe]

They don't look like big issues.
However, if you used the premodded files, you might want to check those differences just to be on the safe side.

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Mon Aug 21, 2006 9:00 pm
Author: Teelk
Hi Pggar,

I'll look into this at the first opportunity. The instructions and premodded should match up, and because they aren't, it may cause problems for some. I'll do a fresh install, complete manual update and compare the files to the premodded for any missing fixes that may be in the instructions. Thanks for bringing this to my attention.

PostPosted: Fri Aug 25, 2006 3:36 pm
Author: Solomon
The IntegraMod_2020_to_2021.txt instructions say:
Code: Select all
#-----[ OPEN ]---------------------------------------------#includes/functions_portal.php  ##-----[ FIND ]---------------------------------------------# Line 22include_once($phpbb_root_path . 'includes/lite.'.$phpEx);  ##-----[ BEFORE, ADD ]---------------------------------------------#if ( !defined('IN_PHPBB') ){     die('Hacking attempt');     exit;}


But the pre-modded file included in the update package does not have this code and is dated]http://integramod.com/forum/viewtopic.php?p=14072#14072[/url]

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Fri Aug 25, 2006 5:30 pm
Author: Teelk
It could possibly be that missing code, I'd add it ASAP. I'm still working on the overall update problem.

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Mon Aug 28, 2006 3:06 am
Author: Skywalker
i have a heavely odded board and the login.php edit says:
Code: Select all
 # #-----[ OPEN ]--------------------------------------------- # login.php  ##-----[ FIND ]---------------------------------------------# Line 161                                         $redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) ] . '<br><br>' . sprintf($lang['Click_return_login'], "<a>", '</a>') . '<br><br>' .  sprintf($lang['Click_return_index'], '<a>', '</a>');                       message_die(GENERAL_MESSAGE, $message);                 }  ##-----[ REPLACE WITH ]---------------------------------------------#                 }                   $redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : '';                 $redirect = str_replace('?', '&', $redirect);                   if (strstr(urldecode($redirect), "n") || strstr(urldecode($redirect), "r"))                 {                     message_die(GENERAL_ERROR, 'Tried to redirect to potentially insecure url.');                 }                   $template->assign_vars(array(                     'META' => "<meta>")                 );                   $message = $lang['Error_login'] . '<br><br>' . sprintf($lang['Click_return_login'], "<a>", '</a>') . '<br><br>' .  sprintf($lang['Click_return_index'], '<a>', '</a>');                   message_die(GENERAL_MESSAGE, $message);  

now can i find that code multiple times...
can someon please expand the code i need to edit so i can found the right place where i need to edit this?
due the many mods the line giving in the setup instruction is wrong

Re: phpBB 2.0.21 update for IntegraMOD 1.4.0

PostPosted: Mon Aug 28, 2006 10:45 pm
Author: hjunk86
I just upgraded my forum today and now my quotes (in posts) are broken. Instead of displaying in boxes (as usual) they show up as [quote=""username";p="post#""] instead of the actual quote box. I managed to fix this on the last upgrade and looked through the forum here and tried a few things to rememdy this problem, but no luck so far...

I used the premodded files to upgrade the board and everything else seems to be working fine. Any help is appreciated.

Thanks,
hjunk86

PostPosted: Tue Aug 29, 2006 12:57 pm
Author: Jacky
"hjunk86" wrote:I just upgraded my forum today and now my quotes (in posts) are broken. Instead of displaying in boxes (as usual) they show up as
Code: Select all
[quote=""username";p="post#""]
instead of the actual quote box. I managed to fix this on the last upgrade and looked through the forum here and tried a few things to rememdy this problem, but no luck so far...

I used the premodded files to upgrade the board and everything else seems to be working fine. Any help is appreciated.

Thanks,
hjunk86
[/quote]I will look at this bug when I have the time.

Meanwhile, you can still find a fix [url=http]here[/url]. but I don't gurantee it will work though. That's why I will be looking at it when I have the time.

[b]EDIT]

PostPosted: Sat Sep 23, 2006 8:13 pm
Author: computerz
Any status on this update?

Is it still broken?

or is it safe to upgrade from 2.0.20 to 2.0.21

PostPosted: Tue Oct 17, 2006 11:48 pm
Author: odius
ya im wonderin the same..
thx 4 any feedback

PostPosted: Fri Oct 20, 2006 8:04 am
Author: netimpact
Hi,

I didn't upgrade since the beginning of IM 1.4, it was 2.017, how could I upgrade to 2.0.21?

Thanks

PostPosted: Sat Oct 21, 2006 2:17 am
Author: Leadfoot
GO here neti and grab the files u need.

Forum Index -> Download Database -> General Downloads -> IntegraMOD 140 -> Updates

Just click on the downloads box and follow the links