phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Two mods for PMs

Goto page 1, 2  Next
 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 428
Location: Québec


flag
PostPosted: Wed Oct 19, 2011 3:52 pm 
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: 621
Location: Spain


flag
PostPosted: Wed Oct 19, 2011 6:40 pm 
Post subject: Re: Two mods for PMs

Hi icon_smile.gif

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: 428
Location: Québec


flag
PostPosted: Wed Oct 19, 2011 10: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: 621
Location: Spain


flag
PostPosted: Thu Oct 20, 2011 5:24 am 
Post subject: Re: Two mods for PMs

Ah, in that case I have no suggestions. icon_sad.gif

Greetings. icon_smile.gif

_________________
phpBB2 will never die, I hope!
Back to top
lumpy burgertushie
Board Member



Joined: 19 Nov 2008

Posts: 224


flag
PostPosted: Thu Oct 20, 2011 4: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: 428
Location: Québec


flag
PostPosted: Thu Oct 20, 2011 9: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: 428
Location: Québec


flag
PostPosted: Fri Oct 21, 2011 8: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: 428
Location: Québec


flag
PostPosted: Thu Nov 03, 2011 2:51 am 
Post subject: Re: Two mods for PMs

Alright, I made a new MOD out of it, considering the changes were pretty expansive:
http://www.phpbb2refugees.com/viewtopic.php?p=6416#6416
Back to top
hoimyr
Board Member



Joined: 16 Apr 2009

Posts: 115
Location: Oslo


flag
PostPosted: Wed Nov 09, 2011 9:44 pm 
Post subject: Re: Two mods for PMs

Nice! Good work. icon_wink.gif

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. icon_rolleyes.gif Will see if i figgure it out but if you know.. let us know. icon_wink.gif
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 428
Location: Québec


flag
PostPosted: Wed Nov 09, 2011 10: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: 663
Location: Texas


flag
PostPosted: Wed Nov 09, 2011 11: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: 428
Location: Québec


flag
PostPosted: Thu Nov 10, 2011 1:18 am 
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


flag
PostPosted: Thu Nov 10, 2011 9:15 pm 
Post subject: Re: Two mods for PMs

wow you are quick!! icon_biggrin.gif 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


flag
PostPosted: Tue Nov 22, 2011 9: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


flag
PostPosted: Wed Nov 23, 2011 7: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
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 2 All times are GMT
Goto page 1, 2  Next
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0311 seconds using 15 queries. (SQL 0.0034 Parse 0.0010 Other 0.0267)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo