Viewing 10 replies - 1 through 10 (of 10 total)
  • Did you manage to resolve this problem? I have exactly the same one. I have installed the plugin on two different sites and on both sites it breaks the page when I view a message on the front-end. I tried with default installation, almost no active plugins, and default page template, but no success.

    Thread Starter jesse24

    (@jesse24)

    I did the same as you, but had no luck. I ended up installing buddypress in a sub directory and stripped it back to just a message system.

    Thank you for your reply. That actually sounds like a good solution. Will give it a try.

    Thanks

    Thread Starter jesse24

    (@jesse24)

    No worries, good luck 🙂

    Having same problem. Was anyone able to resolve this other than moving to BuddyPress for messaging?

    No sorry, wasnt able.

    You can delete the contents of the outbox-page.php file though, then at least the inbox messages will work. Then remove the outbox link. This leaves you with a fully functioning Send and Inbox pages.

    But fortunately I found this plugin a LOT better and more functional:
    http://wordpress.org/extend/plugins/cartpauj-pm/ (Even though it hasnt been updated for a while)

    Thanks, sha77ered. This plugin worked like a charm.

    I just fix the problem by my own way.

    The error is generated by wp_nonce_url(), that is the default wordpress confirmation page. Once I remove this function and correct some if logic, everything works fine.

    just change the outbox-page.php by the code bellow.

    <?php
    /**
     * Outbox page
     */
    function rwpm_outbox()
    {
        global $wpdb, $current_user;
    
        // if view message
        if (isset($_GET['view']) && !empty($_GET['id'])) {
            $id = $_GET['id'];
    
            // select message information
            $msg = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'pm WHERE <code>id</code> = "' . $id . '" LIMIT 1');
            $msg->recipient = $wpdb->get_var("SELECT display_name FROM $wpdb->users WHERE user_login = '$msg->recipient'");
            ?>
        <div class="wrap">
            <h2><?php _e('Outbox \ View Message', 'pm4wp'); ?></h2>
    
            <p><a href="?page=rwpm_outbox"><?php _e('Back to outbox', 'pm4wp'); ?></a></p>
            <table class="widefat fixed" cellspacing="0">
                <thead>
                <tr>
                    <th class="manage-column" width="20%"><?php _e('Info', 'pm4wp'); ?></th>
                    <th class="manage-column"><?php _e('Message', 'pm4wp'); ?></th>
                    <th class="manage-column" width="15%"><?php _e('Action', 'pm4wp'); ?></th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td><?php printf(__('<b>Recipient</b>: %s<br /><b>Date</b>: %s', 'pm4wp'), $msg->recipient, $msg->date); ?></td>
                    <td><?php printf(__('<p><b>Subject</b>: %s</p><p>%s</p>', 'pm4wp'), stripcslashes($msg->subject), nl2br(stripcslashes($msg->content))); ?></td>
                    <td>
    						<span class="delete">
    							<a class="delete"
                                   href="<?php echo "?page=rwpm_outbox&delete&id=$msg->id"; ?>"><?php _e('Delete', 'pm4wp'); ?></a>
    						</span>
                    </td>
                </tr>
                </tbody>
                <tfoot>
                <tr>
                    <th class="manage-column" width="20%"><?php _e('Info', 'pm4wp'); ?></th>
                    <th class="manage-column"><?php _e('Message', 'pm4wp'); ?></th>
                    <th class="manage-column" width="15%"><?php _e('Action', 'pm4wp'); ?></th>
                </tr>
                </tfoot>
            </table>
        </div>
        <?php
            // don't need to do more!
            return;
        }
    
        // if delete message
        if (isset($_GET['delete']) && !empty($_GET['id'])) {
            $id = $_GET['id'];
    
            if (!is_array($id)) {
                $id = array($id);
            }
    
            $error = false;
            foreach ($id as $msg_id) {
                // check if the recipient has deleted this message
                $recipient_deleted = $wpdb->get_var('SELECT <code>deleted</code> FROM ' . $wpdb->prefix . 'pm WHERE <code>id</code> = "' . $msg_id . '" LIMIT 1');
                // create corresponding query for deleting message
                if ($recipient_deleted == 2) {
                    $query = 'DELETE from ' . $wpdb->prefix . 'pm WHERE <code>id</code> = "' . $msg_id . '"';
                } else {
                    $query = 'UPDATE ' . $wpdb->prefix . 'pm SET <code>deleted</code> = "1" WHERE <code>id</code> = "' . $msg_id . '"';
                }
    
                if (!$wpdb->query($query)) {
                    $error = true;
                }
            }
            if ($error) {
                $status = __('Error. Please try again.', 'pm4wp');
            } else {
                $status = _n('Message deleted.', 'Messages deleted.', count($id), 'pm4wp');
            }
        }
    
        // show all messages
        $msgs = $wpdb->get_results('SELECT <code>id</code>, <code>recipient</code>, <code>subject</code>, <code>date</code> FROM ' . $wpdb->prefix . 'pm WHERE <code>sender</code> = "' . $current_user->user_login . '" AND <code>deleted</code> != 1 ORDER BY <code>date</code> DESC');
        ?>
    <div class="wrap">
        <h2><?php _e('Outbox', 'pm4wp'); ?></h2>
        <?php
        if (!empty($status)) {
            echo '<div id="message" class="updated fade"><p>', $status, '</p></div>';
        }
        if (empty($msgs)) {
            echo '<p>', __('You have no items in outbox.', 'pm4wp'), '</p>';
        } else {
            $n = count($msgs);
            echo '<p>', sprintf(_n('You wrote %d private message.', 'You wrote %d private messages.', $n, 'pm4wp'), $n), '</p>';
            ?>
            <form action="" method="get">
                <input type="hidden" name="action" value="delete"/> <input type="hidden" name="page" value="rwpm_outbox"/>
    
                <div class="tablenav">
                    <input type="submit" class="button-secondary" value="<?php _e('Delete Selected', 'pm4wp'); ?>"/>
                </div>
    
                <table class="widefat fixed" cellspacing="0">
                    <thead>
                    <tr>
                        <th class="manage-column check-column"><input type="checkbox"/></th>
                        <th class="manage-column"><?php _e('Recipient', 'pm4wp'); ?></th>
                        <th class="manage-column"><?php _e('Subject', 'pm4wp'); ?></th>
                        <th class="manage-column"><?php _e('Date', 'pm4wp'); ?></th>
                    </tr>
                    </thead>
                    <tbody>
                        <?php
                        foreach ($msgs as $msg) {
                            $msg->recipient = $wpdb->get_var("SELECT display_name FROM $wpdb->users WHERE user_login = '$msg->recipient'");
                            ?>
                        <tr>
                            <th class="check-column"><input type="checkbox" name="id[]" value="<?php echo $msg->id; ?>"/>
                            </th>
                            <td><?php echo $msg->recipient; ?></td>
                            <td>
                                <?php
                                echo '<a href="?page=rwpm_outbox&action=view&id='.$msg->id.'">', stripcslashes($msg->subject), '</a>';
                                ?>
                                <div class="row-actions">
    							<span>
    								<a href="<?php echo "?page=rwpm_outbox&view&id=$msg->id"; ?>"><?php _e('View', 'pm4wp'); ?></a>
    							</span>
    							<span class="delete">
    								| <a class="delete"
                                         href="<?php echo "?page=rwpm_outbox&delete&id=$msg->id"; ?>"><?php _e('Delete', 'pm4wp'); ?></a>
    							</span>
                                </div>
                            </td>
                            <td><?php echo $msg->date; ?></td>
                        </tr>
                            <?php
    
                        }
                        ?>
                    </tbody>
                    <tfoot>
                    <tr>
                        <th class="manage-column check-column"><input type="checkbox"/></th>
                        <th class="manage-column"><?php _e('Recipient', 'pm4wp'); ?></th>
                        <th class="manage-column"><?php _e('Subject', 'pm4wp'); ?></th>
                        <th class="manage-column"><?php _e('Date', 'pm4wp'); ?></th>
                    </tr>
                    </tfoot>
                </table>
            </form>
            <?php
    
        }
        ?>
    </div>
    <?php
    }
    ?>

    Awesome! Thank you for sharing.

    Tiagonicastro, with this solution the inbox works but the outbox becomes empty and neither the new or old messages I write appear there. What may cause this problem? The same happens in the back-end version also. Thank you!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Viewing Message Leads to White Broken CSS Page’ is closed to new replies.