MyBB Hacks

Full Version: vB Quote
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10
Double check your plugins, in particular anything that adds links around posted usernames or affects usernames in posts.
Hi, there seems to be an issue within 1.8 with this plugin, I have tracked it down to line #188.
[php]echo vbquote_parse_complex($page);/php]

It is probably because MyBB nows outputs all AJAX content with json_encode()? Hope you can help me out with this one.
Yeah, I dunno.  Probably needs a few fixes for it to work on 1.8.  Maybe just try wrapping it in JSON?

PHP Code:
echo json_encode(array('message' => vbquote_parse_complex($page)));

v1.14: MyBB 1.8 compatibility fixes
Needs same fetch_array fix as in Xthreads for becoming compatible with Mybb 1.8.4. Did this and now it works again.
@Yumi can you tell me on where this fixes the issue I commented before? Just checking the code doesn't tell me much considering I couldn't find the issue myself (json_encode alone didn't work for me).

Also, fetch_array doesn't seems to be fixed for 1.8 ?

EDIT: You seems to have added json_encode to the code so may be I just need to try myself.
(02-19-2015 06:07 PM)Sama34 Wrote: [ -> ]@Yumi can you tell me on where this fixes the issue I commented before? Just checking the code doesn't tell me much considering I couldn't find the issue myself (json_encode alone didn't work for me).

Code:
--- Z:/vbq/vbquote.php	Thu Jun 09 21:05:50 2011
+++ Z:/vbq/vbquote18.php	Tue Dec 09 19:50:42 2014
@@ -27,8 +27,8 @@
 		'website'		=> 'http://mybbhacks.zingaburga.com/',
 		'author'		=> 'ZiNgA BuRgA',
 		'authorsite'	=> 'http://zingaburga.com/',
-		'version'		=> '1.13',
-		'compatibility'	=> '16*',
+		'version'		=> '1.14',
+		'compatibility'	=> '16*,17*,18*',
 		'guid'			=> ''
 	);
 }
@@ -198,11 +198,33 @@
 			if(!$ajax_done)
 			{
 				ob_start();
-				function vbquote_xmlhttp_preoutput()
+				if($mybb->version_code >= 1700)
 				{
-					run_shutdown();	// reconstruct objects if destroyed (urgh, won't fix $lang, $templates and $theme)
-					$page = ob_get_clean();
-					echo vbquote_parse_complex($page);
+					function vbquote_xmlhttp_preoutput()
+					{
+						run_shutdown();	// reconstruct objects if destroyed (urgh, won't fix $lang, $templates and $theme)
+						$page = ob_get_clean();
+						$data = @json_decode($page);
+						if(!is_object($data))
+						{ // something not right, bail
+							echo $page;
+							return;
+						}
+						if(isset($data->data)) // newreply
+							$data->data = vbquote_parse_complex($data->data);
+						elseif(isset($data->message)) // editpost
+							$data->message = vbquote_parse_complex($data->message);
+						echo json_encode($data);
+					}
+				}
+				else
+				{
+					function vbquote_xmlhttp_preoutput()
+					{
+						run_shutdown();	// reconstruct objects if destroyed (urgh, won't fix $lang, $templates and $theme)
+						$page = ob_get_clean();
+						echo vbquote_parse_complex($page);
+					}
 				}
 				register_shutdown_function('vbquote_xmlhttp_preoutput');
 				$ajax_done = true;
@@ -261,7 +283,10 @@
 			$url = $mybb->settings['bburl'].'/'.get_post_link($pid).'#pid'.$pid;
 			eval('$linkback = " '.$templates->get('postbit_gotopost', 1, 0).'";');
 			
-			$date = my_date($mybb->settings['dateformat'], $post['dateline']).' '.my_date($mybb->settings['timeformat'], $post['dateline']);
+			if($mybb->version_code >= 1700)
+				$date = my_date('relative', $post['dateline']);
+			else
+				$date = my_date($mybb->settings['dateformat'], $post['dateline']).' '.my_date($mybb->settings['timeformat'], $post['dateline']);
 			
 			$r = '<span style="float: right; font-weight: normal;"> ('.$date.')</span>'
 				.build_profile_link(htmlspecialchars_uni($post['username']), $post['uid']).' '.$lang->wrote.$linkback;


(02-19-2015 06:07 PM)Sama34 Wrote: [ -> ]Also, fetch_array doesn't seems to be fixed for 1.8 ?
Updated to v1.15: compatibility fix for MyBB 1.8.4
@ZiNgA BuRgA - Thank you for this mod! amazing. Any way how to add avatars to the left of username?

EDIT: Can you please add a simple setting page? (Group color on/off without code editing)

EDIT2: php v7 incompatibility error
You'll need to edit the code for those.
No plan for a settings page.

Updated to v1.16 to fix PHP 7 compatibility issue.
Thank you, does it have any side effect on loading time or server impact?
Pages: 1 2 3 4 5 6 7 8 9 10
Reference URL's