vB Quote
Author Message
I believe that tagging syntax on forums should generally be as simple as possible, as most people aren't really coders.
MyBB generally conforms well to this (tags are generally quite simple), except the new quote tag introduced in MyBB 1.4.

Personally, something like this is a bit too much code IMO:

Code:
[quote='Joe' pid='13892' dateline='1239871234987' some_other_crap='98j2983j4ad']

...and the user probably doesn't really know the reasoning behind everything.
This plugin turns something like the above to something similar to vB quoting, like:

Code:
[quote=Joe;13892]

which, IMO, is much simpler and nicer.

This plugin also has a few other features:

  • [ and ] characters in usernames don't break up the quote
  • username will automatically be updated if a user's username gets changed
  • user profile link in quote

The package includes a MyBB 1.4 and a MyBB 1.6/1.8 version.  Ensure you upload the correct .php file to your inc/plugins/ folder.
Note that the MyBB 1.4 version doesn't handle [ and ] characters completely right, whereas the 1.6 version does.


Update on 19th May, 2010: Also note: it may be possible for users to gain some information about posts in hidden forums/threads/posts by playing around with the pid in the quote.  I haven't implemented any protection against this in this plugin, but I don't really think this is really that big of an issue as they can only really get the timestamp and user who made the post but not the content.

Update on 4th Jan, 2011: This plugin won't modify existing quotes in any way, eg, it won't change the syntax or style of quotes made before this plugin was activated.
(This post was last modified: 03-10-2016 09:44 PM by ZiNgA BuRgA.)
Find all posts by this user
Quote this message in a reply
Download: vbquote-1.16.7z (3.81 KB)
Plugin Version: 1.16
Last Updated: 03-10-2016, 09:44 PM

Downloads: 1,008
MyBB Compatibility: 1.4.x, 1.6.x, 1.8.x
Plugin License: GPLv3
Uploader: ZiNgA BuRgA
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,355
Joined: Jan 2008
Post: #81
RE: vB Quote
Double check your plugins, in particular anything that adds links around posted usernames or affects usernames in posts.

My Blog
10-23-2012 09:27 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #82
RE: vB Quote
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.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
11-14-2014 02:08 AM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,355
Joined: Jan 2008
Post: #83
RE: vB Quote
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)));


My Blog
11-16-2014 08:55 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,355
Joined: Jan 2008
Post: #84
RE: vB Quote
v1.14: MyBB 1.8 compatibility fixes

My Blog
12-09-2014 07:59 PM
Find all posts by this user Quote this message in a reply
Tbo29 Offline
Junior Member
**
Posts: 1
Joined: Feb 2015
Post: #85
RE: vB Quote
Needs same fetch_array fix as in Xthreads for becoming compatible with Mybb 1.8.4. Did this and now it works again.
02-19-2015 01:48 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #86
RE: vB Quote
@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.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
(This post was last modified: 02-19-2015 06:09 PM by Sama34.)
02-19-2015 06:07 PM
Visit this user's website Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,355
Joined: Jan 2008
Post: #87
RE: vB Quote
(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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
--- 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

My Blog
03-11-2015 09:49 PM
Find all posts by this user Quote this message in a reply
eldenroot Offline
Junior Member
**
Posts: 21
Joined: Dec 2015
Post: #88
RE: vB Quote
@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


Attached File(s) Thumbnail(s)
   
(This post was last modified: 03-09-2016 03:19 AM by eldenroot.)
03-09-2016 12:46 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,355
Joined: Jan 2008
Post: #89
RE: vB Quote
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.

My Blog
03-10-2016 09:44 PM
Find all posts by this user Quote this message in a reply
eldenroot Offline
Junior Member
**
Posts: 21
Joined: Dec 2015
Post: #90
RE: vB Quote
Thank you, does it have any side effect on loading time or server impact?
03-11-2016 05:47 AM
Find all posts by this user Quote this message in a reply


Forum Jump: