Thread: Private Messages Enhancements - PMCrypt - Private Message Encryption
View Single Post
  #70  
Old 01-11-2009, 09:26 PM
kevbentz kevbentz is offline
 
Join Date: Jul 2007
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, I've got this "functioning" enough to decrypt PM's again, but am getting this error:

Parse error: syntax error, unexpected ';' in /public_html/includes/functions_newpost.php(1881) : eval()'d code on line 3

and it doesn't matter if the PM's are encrytped or not (I'm using some test PM's that are not encrypted to test functionality).

This highlighted section is the part of the code I'm having a problem with (this is from the .xml file for this add-in). If I remove the ";" at the end of the line it works for unencrypted PM's but not for encrypted PM's. If I leave it there, I get the error stated above:

Code:
<plugin active="1" executionorder="5">
			<title>PMCrypt :: Decrypt an encrypted reply</title>
			<hookname>private_newpm_reply</hookname>
			<phpcode><![CDATA[if ($pm['encrypt']){
			unset($pm);
			if ($pm = $db->query_first_slave("SELECT pm.*, pmtext.* FROM `" . TABLE_PREFIX . "pm` AS pm LEFT JOIN `" . TABLE_PREFIX . "pmtext` AS pmtext ON(`pmtext.pmtextid` = pm.pmtextid) WHERE `pm.userid` = '" . $vbulletin->userinfo['userid'] . "' AND `pm.pmid` = '" . $vbulletin->GPC['pmid'] . "'";)){
				// quote reply
				$originalposter = fetch_quote_username($pm['fromusername']);
				$pm['message'] = encrypt_decrypt(base64_decode($pm['message']));
				// allow quotes to remain with an optional request variable
				// this will fix a problem with forwarded PMs and replying to them
				if ($vbulletin->GPC['stripquote']){
					$pagetext = strip_quotes($pm['message']);
				}
				else{
					// this is now the default behavior -- leave quotes, like vB2
					$pagetext = $pm['message'];
				}
				$pagetext = trim(htmlspecialchars_uni($pagetext));
				eval('$pm[\'message\'] = "' . fetch_template('newpost_quote', 0, false) . '";');
				// work out FW / RE bits
				if (preg_match('#^' . preg_quote($vbphrase['forward_prefix'], '#') . '#i', $pm['title'])){
					$pm['title'] = substr($pm['title'], strlen($vbphrase['forward_prefix']) + 1);
				}
				elseif (preg_match('#^' . preg_quote($vbphrase['reply_prefix'], '#') . '#i', $pm['title'])){
					$pm['title'] = substr($pm['title'], strlen($vbphrase['reply_prefix']) +1);
				}
				else{
					$pm['title'] = preg_replace('#^[a-z]{2}:#i', '', $pm['title']);
				}
				$pm['title'] = trim($pm['title']);
				if ($vbulletin->GPC['forward']){
					$pm['title'] = $vbphrase['forward_prefix'] . " $pm[title]";
					$pm['recipients'] = '';
					$pm['forward'] = 1;
				}
				else{
					$pm['title'] = $vbphrase['reply_prefix'] . " $pm[title]";
					$pm['recipients'] = $pm['fromusername'] . ' ; ';
					$pm['forward'] = 0;
				}
			}
		}]]></phpcode>
		</plugin>
Any help?
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01321 seconds
  • Memory Usage 1,773KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete