Author |
Message |
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Wed Oct 19, 2011 11:52 am Post subject: Two mods for PMs |
|
|
Hey guys, I'm looking for two mods for private messaging and my search on phpbbhack has yielded no result. I'd like to know if any of you have heard about existing mods that do what I'm looking for, otherwise I'll make my own.
1. PM navigation. Simply put, a pair of Previous/Next PM links to navigate through your inbox/outbox.
2. Multiple recipients. Allow sending a message to multiple users, and I'd probably make the reply feature carry over all existing usernames by default instead of adding a distinct "reply to all" feature. Comma-separated: "user1, user2".
That second one will probably require quite some work, so it would be great if someone has already made it. |
|
Back to top |
|
|
dogs and things Board Member
Joined: 18 Nov 2008
Posts: 628 Location: Spain
|
Posted: Wed Oct 19, 2011 2:40 pm Post subject: Re: Two mods for PMs |
|
|
Hi
What do you want this for, is it for admins to be able to send PMs to multiple users, or for something else? _________________ phpBB2 will never die, I hope! |
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Wed Oct 19, 2011 6:51 pm Post subject: Re: Two mods for PMs |
|
|
No, for everyone. I know it's an existing feature on ProBoards, probably several others as well by now. |
|
Back to top |
|
|
dogs and things Board Member
Joined: 18 Nov 2008
Posts: 628 Location: Spain
|
Posted: Thu Oct 20, 2011 1:24 am Post subject: Re: Two mods for PMs |
|
|
Ah, in that case I have no suggestions.
Greetings. _________________ phpBB2 will never die, I hope! |
|
Back to top |
|
|
lumpy burgertushie Board Member
Joined: 18 Nov 2008
Posts: 266
|
Posted: Thu Oct 20, 2011 12:37 pm Post subject: Re: Two mods for PMs |
|
|
#1.
Code: | ##############################################################
## MOD Title: PM Navigation
## MOD Author: Poupoune < poupoune@phpbb-fr.com > (N/A) http://www.phpbb-fr.Com/
## MOD Description: This MOD allows you to have a navigation tool
## while reading your PMs, so you you don't have
## to always go back to your inbox folder to read
## next pm.
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: ~3 minutes
## Files To Edit: 3
## privmsg.php
## lang_main.php
## privmsgs_read_body.tpl
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes :
##
##############################################################
## MOD History :
##
## 09-07-2004 - Version 1.0.0
## - First Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]----------------------------------------------
#
privmsg.php
#
#-----[ FIND ]----------------------------------------------
#
message_die(GENERAL_ERROR, $lang['No_such_folder']);
break;
}
#
#-----[ AFTER, ADD ]----------------------------------------------
#
// BEGIN PM Navigation MOD
if( $HTTP_GET_VARS['view']=='next' || $HTTP_GET_VARS['view']=='prev' )
{
$sql_condition = ( $HTTP_GET_VARS['view'] == 'next' ) ? '>' : '<';
$sql_ordering = ( $HTTP_GET_VARS['view'] == 'next' ) ? 'ASC' : 'DESC';
$sql_nav = "SELECT pm.privmsgs_id FROM ". PRIVMSGS_TABLE ." pm, ". PRIVMSGS_TABLE ." p2
WHERE p2.privmsgs_id = $privmsgs_id
$pm_sql_user
AND pm.privmsgs_date $sql_condition p2.privmsgs_date
ORDER BY pm.privmsgs_date $sql_ordering LIMIT 1" ;
if ( !($result2 = $db->sql_query($sql_nav)) )
{
message_die(GENERAL_ERROR, 'Could not query private message post information', '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result2) )
{
$privmsgs_id = intval($row['privmsgs_id']);
}
else
{
$message = ( $HTTP_GET_VARS['view'] == 'next' ) ? $lang['No_newer_pm'] : $lang['No_older_pm'];
$mes = $message . '<br /><br />' . sprintf($lang['Click_return_inbox'], '<a href="' . append_sid("privmsg.$phpEx?folder=inbox") . '">', '</a> ') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
message_die(GENERAL_MESSAGE, $mes);
}
}
// END PM Navigation MOD
#
#-----[ FIND ]----------------------------------------------
#
'L_DELETE_MSG' => $lang['Delete_message'],
#
#-----[ AFTER, ADD ]----------------------------------------------
#
// BEGIN PM Navigation MOD
'L_PRIVMSG_NEXT' => $lang['Next_privmsg'],
'L_PRIVMSG_PREVIOUS' => $lang['Previous_privmsg'],
'U_PRIVMSG_NEXT' => append_sid("privmsg.$phpEx?folder=$folder&mode=$mode&" . POST_POST_URL . "=$privmsgs_id&view=next", true),
'U_PRIVMSG_PREVIOUS' => append_sid("privmsg.$phpEx?folder=$folder&mode=$mode&" . POST_POST_URL . "=$privmsgs_id&view=prev", true),
// END PM Navigation MOD
#
#-----[ OPEN ]----------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]----------------------------------------------
#
$lang['Delete_message'] = '
#
#-----[ AFTER, ADD ]----------------------------------------------
#
// BEGIN PM Navigation MOD
$lang['Next_privmsg'] = 'Next private message';
$lang['Previous_privmsg'] = 'Previous private message';
$lang['No_newer_pm'] = 'There are no newer private messages.';
$lang['No_older_pm'] = 'There are no older private messages.';
// END PM Navigation MOD
#
#-----[ OPEN ]----------------------------------------------
#
templates/subSilver/privmsgs_read_body.tpl
#
#-----[ FIND ]----------------------------------------------
#
<table border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline">
#
#-----[ AFTER, ADD ]----------------------------------------------
#
<tr>
<td class="row2" colspan="3" align="right"><span class="nav"><a href="{U_PRIVMSG_PREVIOUS}">{L_PRIVMSG_PREVIOUS}</a> :: <a href="{U_PRIVMSG_NEXT}">{L_PRIVMSG_NEXT}</a></span></td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
|
|
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Thu Oct 20, 2011 5:07 pm Post subject: Re: Two mods for PMs |
|
|
Thanks Lumpy, works like a charm! |
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Fri Oct 21, 2011 4:19 pm Post subject: Re: Two mods for PMs |
|
|
I found this MOD for multiple recipients:
Multiple PM Recipients
It's not really ideal, though. It uses a separate field for each recipient, which is a bit messy. There's an AJAX auto-completer for usernames, but it doesn't work on my end. If there's an error with your message and you're sent back, only the first username is kept. There is no "reply to all" option and you can't see other recipients than yourself.
I'll try to fix at least some of these... |
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
|
Back to top |
|
|
hoimyr Board Member
Joined: 16 Apr 2009
Posts: 115 Location: Oslo
|
Posted: Wed Nov 09, 2011 5:44 pm Post subject: Re: Two mods for PMs |
|
|
Nice! Good work.
Have any of you figgured out how to disable the auto-deletion of old messages in the inbox? For the admin.. I want to keep all my messages. Will see if i figgure it out but if you know.. let us know. |
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Wed Nov 09, 2011 6:44 pm Post subject: Re: Two mods for PMs |
|
|
I didn't even know phpBB did that... Is it when the inbox is full and you receive new messages? |
|
Back to top |
|
|
drathbun Board Member
Joined: 24 Jul 2008
Posts: 729 Location: Texas
|
Posted: Wed Nov 09, 2011 7:23 pm Post subject: Re: Two mods for PMs |
|
|
I believe the board admin can set the maximum number of PM's that are retained, and then yes, as new messages come in the old ones are removed. The problem is the setting is board-wide, so if you make the setting "unlimited" then it's unlimited for everyone. There's no way to make it unlimited for just admins. _________________ phpBBDoctor Blog |
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Wed Nov 09, 2011 9:18 pm Post subject: Re: Two mods for PMs |
|
|
Well, it would be easy to hard-code it, wouldn't it? Just add something like
if (user_level == ADMIN)
that would bypass the deletion.
Look for
// See if recipient is at their inbox limit
in privmsgs.php, that's where it happens. I think this would do it:
Code: | FIND
if ($board_config['max_inbox_privmsgs'] && $inbox_info['inbox_items'] >= $board_config['max_inbox_privmsgs'])
REPLACE WITH
if ($board_config['max_inbox_privmsgs'] && $inbox_info['inbox_items'] >= $board_config['max_inbox_privmsgs'] && $to_userdata['user_level'] != ADMIN) |
That would ignore the deletion altogether if the recipient is an admin, so you don't have to set a limit anywhere, and it's just a one-line change. Not tested, of course. |
|
Back to top |
|
|
hoimyr Board Member
Joined: 16 Apr 2009
Posts: 115 Location: Oslo
|
Posted: Thu Nov 10, 2011 5:15 pm Post subject: Re: Two mods for PMs |
|
|
wow you are quick!! Thanks
I can test it on my board.
edit:
Seems i have a modified version of the file and lines so i have to figgure out that first. |
|
Back to top |
|
|
hoimyr Board Member
Joined: 16 Apr 2009
Posts: 115 Location: Oslo
|
Posted: Tue Nov 22, 2011 5:45 pm Post subject: Re: Two mods for PMs |
|
|
Ok tested it.
No bugs or errors but it still deletes the last one.
edit: found another mod. Not tested yet.
http://www.phpbb2.com/pmlimits_mod_1.0.mod |
|
Back to top |
|
|
Holger Board Member
Joined: 19 Jan 2009
Posts: 509 Location: Hanover
|
Posted: Wed Nov 23, 2011 3:54 am Post subject: Re: Two mods for PMs |
|
|
I am using a mod that allows unlimited PMs for the admin.
But I dont remember where I got that from! Will search ... _________________ Love your data! Back it up! |
|
Back to top |
|
|
|