[2.0.18] Extended Private Message Notification

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply

Rating:

Excellent!
31
74%
Very Good
9
21%
Good
1
2%
Fair
1
2%
Poor
0
No votes
 
Total votes: 42

GrooveCollection
Registered User
Posts: 157
Joined: Sat Apr 16, 2005 2:40 pm

Post by GrooveCollection » Mon Nov 07, 2005 8:47 pm

After the update to .18 this mod doesn't seem to work anymore.
Of course the code is still in there, so I don't know how to fix this.

Any help ?

cheers 8)

ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 » Mon Nov 07, 2005 11:45 pm

GrooveCollection wrote: After the update to .18 this mod doesn't seem to work anymore.
Of course the code is still in there, so I don't know how to fix this.

Any help ?

cheers 8)

I'll made a 2.0.18-competible version asap.

~Mac

ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 » Tue Nov 08, 2005 2:55 pm

A new updated version is available at http://sourceforge.net/project/showfile ... _id=107948

Meanwhile, feedbacks are welcome before I send this for validation.

~Mac

ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 » Thu Dec 22, 2005 5:59 am

MOD Updated to version 1.2.0
See first post for Download Link

schmidtedv
Registered User
Posts: 28
Joined: Wed Mar 09, 2005 8:12 pm

Post by schmidtedv » Wed Jan 11, 2006 8:43 am

Well, seems still to work with 2.0.19, but, still there has to be the change in privmsg.php into this:

Code: Select all

$message_text = trim(stripslashes($HTTP_POST_VARS['message']));
				$message_text = pm_message_to_plain_text($message_text);


Otherwise it looks wrong for code or quote in mail....

Am I right or did I do something wrong? :-)

And I did a little change in bbcode.php to make it easier for declare what's a quote, even if it's with username included...

Code: Select all

$text = preg_replace('/\[quote=\"(.*?)\"\]/', $newline . $lang['Quote'].' - \\1 '. $lang['wrote'].':'.$q1, $text);

Maybe any idea, how to get this done even for another MOD which allows download of PM's? Would be nice to use pm_message_to_plain_text in this too because for now it's messed up when downloading included code...

Code: Select all

	if (count($mark_list))
	{
		$i=0;
		$crlf = "\r\n";
		$pmtext = $lang['Private_Messaging']." (".$board_config['sitename'].")".$crlf;
		$user_dateformat = ($userdata['user_dateformat']) ? $userdata['user_dateformat'] : $board_config['default_dateformat'];
		$pmtext .= $disp_folder . " (". date($user_dateformat,time()). ")".$crlf.$crlf;
		while($mark_list[$i] != "")
		{
			$sql = "SELECT pt.privmsgs_text, us.username, us.user_id, pm.privmsgs_date, pm.privmsgs_subject
				FROM " . PRIVMSGS_TEXT_TABLE . " pt, " . PRIVMSGS_TABLE . " pm, " . USERS_TABLE . " us 
				WHERE pt.privmsgs_text_id = " . $mark_list[$i] . " AND pm.privmsgs_id = " . $mark_list[$i] . "
				AND us.user_id = pm.privmsgs_from_userid";
			if ( $result = $db->sql_query($sql) )
			{
				$db_row = $db->sql_fetchrow($result);
				$tmpmsg = wordwrap($db_row['privmsgs_text'],78,$crlf);
				$from = ($folder=='inbox' || $folder=='savebox') ? $lang['From'] : $lang['To'];
				$pmtext .= "----------------------------------------".$crlf;
				$pmtext .= $from.": ".$db_row['username'].$crlf;
				$pmtext .= $lang['Posted'].": ".create_date($board_config['default_dateformat'], $db_row['privmsgs_date'], $board_config['board_timezone']).$crlf;
				$pmtext .= $lang['Subject'].": ".$db_row['privmsgs_subject'].$crlf.$crlf;
				$pmtext .= $tmpmsg.$crlf;
			}
			else
			{
				print $sql."<p>";
				message_die(GENERAL_ERROR, 'Could not read private message info', '', __LINE__, __FILE__, $sql);
			}
			$i++;
		}
		$filename = $board_config['sitename'].", ".$disp_folder.", ".date("dmy",time()).".txt";
		header('Content-Type: text/x-delimtext; name="' . $filename . '"');
		header("Content-Disposition: attachment;filename=".$filename);
		header("Content-Transfer-Encoding: plain/text");
		header("Content-Length: ".strlen($pmtext));
		print $pmtext;
		exit;
	}

net83it
Registered User
Posts: 500
Joined: Sun Jan 15, 2006 2:42 pm
Location: Sicily
Contact:

Post by net83it » Sun Jan 15, 2006 2:46 pm

installed and it works fine on 2.0.19
thank you very much! :)

SQinAZ
Registered User
Posts: 33
Joined: Sun Sep 28, 2003 4:27 pm
Contact:

Post by SQinAZ » Mon Jan 16, 2006 7:05 am

This is exactly what I have spent the last hour searching for, and pray that it will do what I want it to do, once I implement it. :)

Thank you so much, to all of the programmers who make our dreams come true!
SQinAZ

SQinAZ
Registered User
Posts: 33
Joined: Sun Sep 28, 2003 4:27 pm
Contact:

Post by SQinAZ » Tue Jan 17, 2006 3:27 am

Just installed this, and want to relay what a very beautiful hack this is. :) Very nicely done, not just the hack itself, but the info on how to easily implement it. No glitches, no stress. I am such a happy camper!!! :)

Thank you, Author: ycl6. You are marvelous! I would give you a big smooch if I were near your physical being.
SQinAZ

Eddy Kiprich
Registered User
Posts: 149
Joined: Sun Dec 18, 2005 1:22 pm
Location: The Netherlands

Post by Eddy Kiprich » Tue Jan 17, 2006 1:54 pm

Installed the mod works greath, thanks!!! :D

if you want you can get my language/lang_dutch/email/privmsg_notify.tpl translated file for a future release.

ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 » Tue Jan 17, 2006 3:05 pm

You may email or PM it to me, I'll add it in the next release. :wink:

~Mac

brianboros
Registered User
Posts: 24
Joined: Mon Jul 11, 2005 1:09 am

Post by brianboros » Thu Jan 19, 2006 4:01 am

is there anyway to you can make it so you cant double post at all untill someone else posts?
http://bwoinfo.com/board/index.php? My PHPBB Forum.... Got any sugestions?

schmidtedv
Registered User
Posts: 28
Joined: Wed Mar 09, 2005 8:12 pm

Post by schmidtedv » Thu Jan 19, 2006 9:20 pm

If I have this new function in bbcode.php and would ike to use it for downloading pm's (and topics/posts maybe) too, any idea what I have to do in privmsg.php with the following code:

Code: Select all

else if ( $download && $mark_list )
{
	if ( !$userdata['session_logged_in'] )
	{
		$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
		header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true));
		exit;
	}

	switch($folder)
	{
		case 'inbox':
			$disp_folder = $lang['Inbox'];
		break;

		case 'outbox':
			$disp_folder = $lang['Outbox'];
		break;

		case 'sentbox':
			$disp_folder = $lang['Sentbox'];
		break;

		case 'savebox':
			$disp_folder = $lang['Savebox'];
		break;
	}

	if (count($mark_list))
	{
		$i=0;
		$agent = getenv("HTTP_USER_AGENT");
		if (preg_match("/windows/i",$agent)) $crlf = "\r\n";
		else if (preg_match("/linux/i",$agent)) $crlf = "\n";
		else $crlf = "\r\n";

		$download_text = $lang['Private_Messaging']." (".$board_config['sitename'].")".$crlf;
		$user_dateformat = ($userdata['user_dateformat']) ? $userdata['user_dateformat'] : $board_config['default_dateformat'];
		$download_text .= $disp_folder . " (". date($user_dateformat,time()). ")".$crlf.$crlf;

		while($mark_list[$i] != "")
		{
			$sql = "SELECT pt.privmsgs_text, pt.privmsgs_bbcode_uid, us.username, us.user_id, pm.privmsgs_date, pm.privmsgs_subject
				FROM " . PRIVMSGS_TEXT_TABLE . " pt, " . PRIVMSGS_TABLE . " pm, " . USERS_TABLE . " us 
				WHERE pt.privmsgs_text_id = " . $mark_list[$i] . " AND pm.privmsgs_id = " . $mark_list[$i] . "
				AND us.user_id = ";

			if ($folder == 'sentbox' || $folder == 'outbox') $sql .= "pm.privmsgs_to_userid";
			else $sql .= "pm.privmsgs_from_userid";

			if ( $result = $db->sql_query($sql) )
			{
				$db_row = $db->sql_fetchrow($result);

				$bbcode_uid = $db_row['privmsgs_bbcode_uid'];

				$message = $db_row['privmsgs_text'];
				$message = strip_tags($message);
				$message = preg_replace("/\[.*?:$bbcode_uid:?.*?\]/si", '', $message);
				$message = preg_replace('/\[url\]|\[\/url\]/si', '', $message);
				$message = preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
				$message = unprepare_message($message);
				$message = preg_replace('/(/', '(', $message);
				$message = preg_replace('/)/', ')', $message);
				$message = preg_replace('/:/', ':', $message);
				$message = preg_replace('/[/', '[', $message);
				$message = preg_replace('/]/', ']', $message);
				$message = preg_replace('/{/', '{', $message);
				$message = preg_replace('/}/', '}', $message);

				$from = ($folder=='inbox' || $folder=='savebox') ? $lang['From'] : $lang['To'];
				$download_text .= "----------------------------------------".$crlf;
				$download_text .= $from.": ".$db_row['username'].$crlf;
				$download_text .= $lang['Posted'].": ".date($user_dateformat,time($db_row['privmsgs_date'])).$crlf.$crlf;
				$download_text .= $lang['Subject'].": ".$db_row['privmsgs_subject'].$crlf;
				$download_text .= $lang['Message'].": ".$crlf.$message.$crlf.$crlf;
			}
			else
			{
				print $sql."<p>";
				message_die(GENERAL_ERROR, 'Could not read private message info', '', __LINE__, __FILE__, $sql);
			}
			$i++;
		}
		$disp_folder = str_replace(' ', '_', $disp_folder);
		$filename = $board_config['sitename']."_".$disp_folder."_".date("dmY_His",time()).".txt";
		header('Content-Type: text/x-delimtext; name="' . $filename . '"');
		header("Content-Disposition: attachment;filename=".$filename);
		header("Content-Transfer-Encoding: plain/text");
		header("Content-Length: ".strlen($download_text));
		print $download_text;
		exit;
	}
}
I tried to put out the $message-part and just call

Code: Select all

$message_text = htmlspecialchars(trim(stripslashes($db_row['privmsgs_text'])));
				$message_text = pm_message_to_plain_text($message_text);
instead, but this seems not to work

Shanana
Registered User
Posts: 368
Joined: Sat Aug 28, 2004 4:03 am
Location: USA [from London, England]

Post by Shanana » Thu Feb 23, 2006 10:54 am

Does this work with 2.0.19?

Eddy Kiprich
Registered User
Posts: 149
Joined: Sun Dec 18, 2005 1:22 pm
Location: The Netherlands

Post by Eddy Kiprich » Thu Feb 23, 2006 11:03 am

Shanana wrote: Does this work with 2.0.19?


I use this mod with a 2.0.19 database, works greath.

User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw » Tue Mar 07, 2006 6:02 pm

Help! I have this installed, and it works great. Only problem is, that when i submit i get this:

Code: Select all

Warning: Compilation failed: missing terminating ] for character class at offset 1 in /home/wiedler/public_html/igor/forum/includes/bbcode.php on line 843

Warning: Cannot modify header information - headers already sent by (output started at /home/wiedler/public_html/igor/forum/includes/bbcode.php:843) in /home/wiedler/public_html/igor/forum/includes/page_header.php on line 593

Warning: Cannot modify header information - headers already sent by (output started at /home/wiedler/public_html/igor/forum/includes/bbcode.php:843) in /home/wiedler/public_html/igor/forum/includes/page_header.php on line 595

Warning: Cannot modify header information - headers already sent by (output started at /home/wiedler/public_html/igor/forum/includes/bbcode.php:843) in /home/wiedler/public_html/igor/forum/includes/page_header.php on line 596
The mail is sent without the PM text, my bbcode.php looks like this (843 und 844):

Code: Select all

   $text = preg_replace('/[/', '[', $text);
   $text = preg_replace('/]/', ']', $text);

Post Reply

Return to “[2.0.x] MOD Database Releases”