bestbuildpc: Forums
 

 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Let members see the private message they are replying
 
 
Post new topic   Reply to topic    bestbuildpc Forum Index -> RavenNuke -> Mods and Hacks
View previous topic :: View next topic  
Author Message
bestbuildpc
Site Admin
Site Admin


Joined: Jun 30, 2012
Posts: 213
Location: NL

PostPosted: Tue May 28, 2013 23:56    Post subject: Let members see the private message they are replying Reply with quote

This is a very simple mod that will let members see the private message they are replying to at the bottom of the page. The is exactly the same as replying to a post inside the forum.
The View PM mod is a must have for your forums.

This mod works with any version of phpnuke or other ported versions



Code:
##############################################################

## MOD Title: View PM while replying
## MOD Author: Manipe < admin@manipef1.com > (N/A) http://www.manipef1.com
## MOD Description: Lets you see the PM you're replying to just below the input box, very like the topic review when replying to topics.
## MOD Version: 1.0.0
##
##
##
## Installation Level: Easy
## Installation Time: ~ 1 Minute
## Files To Edit:
##      privmsg.php
##
## Included Files: N/A
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##   Made by request from this topic: http://www.phpbb.com/phpBB/viewtopic.php?t=254795
##   
##############################################################
## MOD History:
##
##
##   2005-09-20 - Version 1.0.0
##      - First version, seems to work fine.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
modules/Private_Messages/index.php

#
#-----[ FIND ]------------------------------------------
#
            $mode = 'reply';
         }

#
#-----[ AFTER, ADD ]------------------------------------------
#
// View PM while replying MOD, By Manipe
         if ( $mode == 'reply' )
         {
            // Get individual PM settings re html, smilies
            $sql = "SELECT privmsgs_enable_html, privmsgs_enable_smilies
               FROM " . PRIVMSGS_TABLE . "
               WHERE privmsgs_id = $privmsg_id";
            if ( !($result = $db->sql_query($sql)) )
            {
               message_die(GENERAL_ERROR, 'Could not obtain private message for editing', '', __LINE__, __FILE__, $sql);
            }

            if ( !($privmsg_config = $db->sql_fetchrow($result)) )
            {
               redirect(append_sid("privmsg.$phpEx?folder=$folder", true));
            }

            $privmsg_bbcode_uid = $privmsg['privmsgs_bbcode_uid'];

            $reply_message = $privmsg['privmsgs_text'];
            $reply_subject = $privmsg['privmsgs_subject'];

            if ( !$board_config['allow_html'] || !$userdata['user_allowhtml'])
            {
               if ( $privmsg_config['privmsgs_enable_html'] )
               {
                  $reply_message = preg_replace('#(<)([\/]?.*?)(>)#is', "&lt;\\2&gt;", $reply_message);
               }
            }

            if ( $privmsg_bbcode_uid != '' )
            {
               $reply_message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($reply_message, $privmsg_bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $reply_message);
            }

            $reply_message = make_clickable($reply_message);

            $orig_word = array();
            $replacement_word = array();
            obtain_word_list($orig_word, $replacement_word);

            if ( count($orig_word) )
            {
               $reply_subject = preg_replace($orig_word, $replacement_word, $reply_subject);
               $reply_message = preg_replace($orig_word, $replacement_word, $reply_message);
            }

            if ( $board_config['allow_smilies'] && $privmsg_config['privmsgs_enable_smilies'] )
            {
               $reply_message = smilies_pass($reply_message);
            }

            $reply_message = str_replace("\n", '<br />', $reply_message);

            $template->set_filenames(array(
               'pm_review' => 'posting_topic_review.tpl')
            );
            $template->assign_vars(array(
               'L_AUTHOR' => $lang['From'],
               'L_MESSAGE' => $lang['Private_Message'],
               'L_POSTED' => $lang['Sent'],
               'L_POST_SUBJECT' => $lang['Subject'])
            );
            $template->assign_block_vars('postrow', array(
               'ROW_COLOR' => '#' . $theme['td_color1'],
               'ROW_CLASS' => $theme['td_class1'],

               'MINI_POST_IMG' => $images['icon_minipost'],
               'POSTER_NAME' => $to_username,
               'POST_DATE' => create_date($board_config['default_dateformat'], $privmsg['privmsgs_date'], $board_config['board_timezone']),
               'POST_SUBJECT' => $reply_subject,
               'MESSAGE' => $reply_message,

               'L_MINI_POST_ALT' => $lang['Message'])
            );
            $template->assign_var_from_handle('TOPIC_REVIEW_BOX', 'pm_review');
         }
// View PM while replying MOD, By Manipe

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
  
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    bestbuildpc Forum Index -> RavenNuke -> Mods and Hacks All times are GMT + 2 Hours
 
 Page 1 of 1

 

Jump to:   
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001-2008 phpBB Group
 
Forums ©