Firefox PHP

Enhanced Private Messages

Posted by Brian Moon 
All files from this thread

File Name File Size   Posted by Date  
pm_enhanced.tar.gz 3.7 KB open | download Brian Moon 02/08/2011 Read message
Enhanced Private Messages
February 08, 2011 07:37AM
Paging
This modules makes it possible to add pages to the private messages list page. It uses the standard Phorum paging logic, so a simple template modification is all that is needed to get it working.

Search
This module also allows searching of ones private messages. The search is a simple filter that searches the author, subject and message.

Templating
For the Emerald template, you can insert this HTML into the top of pm_list.tpl
<div class="nav">
    {INCLUDE "paging"}
    <form action="{URL->ACTION}" method="get">
        <input type="hidden" name="action" value="list" />
        <input type="hidden" name="forum_id" value="{FORUM_ID}" />
        <input type="hidden" name="folder_id" value="{FOLDER_ID}" />
        <input type="text" name="search" value="{SAFE_SEARCH}" />
        <input type="submit" value="{LANG->Search}" />
    </form>
</div>
To have paging at the bottom, you can simply put this at the bottom of pm_list.tpl.
<div class="nav">
    {INCLUDE "paging"}
    <br>
</div>
A more seamless option is to edit pm_list_incoming.tpl and pm_list_outgoing.tpl and wrap the delete button like so.
<div class="nav">
    {INCLUDE "paging"}
    <input type="submit" name="delete" value="{LANG->Delete}" onclick="return confirm('<?php echo addslashes($PHORUM['DATA']['LANG']['AreYouSure'])?>')" />
</div>
That puts the paging to the right of the delete button.

Required Version
This does require a hook that is not available yet in a release. I committed it to 5.2 tonight. I did not commit it to 5.3 as I think we are still planning on supporting paging natively in 5.3 and since that is the case I may do the work and add filtering too.

Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Attachments:
open | download - pm_enhanced.tar.gz (3.7 KB)
Re: Enhanced Private Messages
February 12, 2011 12:26AM
Thanks for this useful addition!

PS: Btw, I receive a PHP notice from your module: Use of undefined constant phorum_page - assumed 'phorum_page'
Re: Enhanced Private Messages
April 20, 2011 11:47AM
Thank you!!

Works like a charm and the search is GREAT!

Huh I have 24 pages of PMs.....

___________
F4 Systems



Edited 1 time(s). Last edit at 04/20/2011 12:02PM by Skye.
Re: Enhanced Private Messages
April 26, 2011 07:15PM
Can't understand with me this module doesn't work.
Will try in a test phorum on a separate sql on emerald to see if it depends from my template.
Re: Enhanced Private Messages
May 03, 2011 05:55PM
It seems I did some mess with the Hack!
Now it's working fine.
Sorry, only registered users may post in this forum.

Click here to login