Ultimate Points error

Callum93

Madly Diligent
Joined
Mar 16, 2008
Messages
9,782
Reaction score
0
FP$
6
I have a problem with the Ultimate poitns MOD and the Instant post redirect clashing

Code:
    // Start Ultimate Points
                'user_points'         => $points,
                // End Ultimate Points
             );

             if ($mode == 'edit')
             {
                $data['topic_replies_real'] = $post_data['topic_replies_real'];
                $data['topic_replies'] = $post_data['topic_replies'];
             }

             // The last parameter tells submit_post if search indexer has to be run
             $redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message, ($update_message || $update_subject) ? true : false);

             if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === true) && ($mode == 'post' || $mode == 'reply' || $mode == 'quote'))
             {
                $captcha->reset();
             }

             // Check the permissions for post approval. Moderators are not affected.
             if ((!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) || !empty($post_data['force_approved_state']))
             {
                meta_refresh(10, $redirect_url);
                $message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD'];
                $message .= (($user->data['user_id'] == ANONYMOUS) ? '' : ' '. $user->lang['POST_APPROVAL_NOTIFY']);
             }
             else
             {
                                         // Start Ultimate Points
                if ( $auth->acl_get('u_use_points') && $config['points_enable'] )
                {
                   meta_refresh(3, $redirect_url); // Increased the refresh time to give user the chance to read their points

                   $sql_array = array(
                       'SELECT'    => 'user_points',
                       'FROM'      => array(
                           USERS_TABLE => 'v',
                       ),
                      'WHERE'      => 'user_id = ' . (int) $user->data['user_id'],
                   );
                   $sql = $db->sql_build_query('SELECT', $sql_array);
                   $result = $db->sql_query($sql);
                   $user_points_new = $db->sql_fetchfield('user_points');

                   $user_points_received = ($user_points_new - $user_points_old);

                   if ( $mode == 'quote' OR $mode == 'reply' )
                   {
                      $points_received = sprintf($user->lang['POINTS_RECEIVED_REPLY_MESSAGE'], (number_format_points($user_points_received)), $config['points_name']);
                   }
                   else if ( $mode == 'edit' )
                   {
                      $points_received = sprintf($user->lang['POINTS_RECEIVED_EDIT_MESSAGE'], (number_format_points($user_points_received)), $config['points_name']);
                   }
                   else
                   {
                      $points_received = sprintf($user->lang['POINTS_RECEIVED_POST_MESSAGE'], (number_format_points($user_points_received)), $config['points_name']);
                   }

                   $message = ($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED';
                   $message = $user->lang[$message] . '<br /><br />' . $points_received . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $redirect_url . '">', '</a>');
                }
                else
                {
                   meta_refresh(3, $redirect_url); // Show normal refresh time
                   //-- mod : Instant Post Redirect ------------------------------------------------------------
    //-- add
                redirect($redirect_url);
    //-- fin mod : Instant Post Redirect --------------------------------------------------------
                   $message = ($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED';
                   $message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $redirect_url . '">', '</a>');
                }
                // End Ultimate Points

Anyone know where the instant post redirect code should go?
 
Do you want to show if the user got cash for posting?

If not, you can remove the conflicting code, and post the instant direct to thread code.

You can't have both.
 
Thanks a lot, I have now fixed it! rep once I can give rep to you again.
 
Back
Top Bottom