tiagonicastro
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Plugins
In reply to: [Loco Translate] Memory size errorHi Tim
I was able to add more memory in php.ini, the Sync works perfect.
Thanks for the help.
Forum: Plugins
In reply to: [Loco Translate] Memory size errorThe error occur when I click to Sync on a language.
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 } ?>
Viewing 3 replies - 1 through 3 (of 3 total)