WordPress.org

Forums

Private Messages For WordPress
Viewing Message Leads to White Broken CSS Page (11 posts)

  1. jesse24
    Member
    Posted 2 years ago #

    Hi there,

    When viewing a message through the front end of the website, it takes me to a white page, which seems to have broken css. How do I edit that page or how is this issue fixed?

    Thanks
    Jess

    http://wordpress.org/extend/plugins/private-messages-for-wordpress/

  2. sha77ered
    Member
    Posted 2 years ago #

    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.

  3. jesse24
    Member
    Posted 2 years ago #

    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.

  4. sha77ered
    Member
    Posted 2 years ago #

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

    Thanks

  5. jesse24
    Member
    Posted 2 years ago #

    No worries, good luck :)

  6. mjgalbraith
    Member
    Posted 2 years ago #

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

  7. sha77ered
    Member
    Posted 2 years ago #

    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)

  8. mjgalbraith
    Member
    Posted 2 years ago #

    Thanks, sha77ered. This plugin worked like a charm.

  9. tiagonicastro
    Member
    Posted 2 years ago #

    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
    }
    ?>
  10. sha77ered
    Member
    Posted 2 years ago #

    Awesome! Thank you for sharing.

  11. Olivér Bán
    Member
    Posted 2 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Private Messages For WordPress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.