vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Private Messages Enhancements - Private Message Quote Formatting (https://vborg.vbsupport.ru/showthread.php?t=292996)

kh99 12-14-2012 11:00 PM

Private Message Quote Formatting
 
1 Attachment(s)
What is it?
----------------------------
This mod arranges quotes in a PM to be in a "conversational" order instead of being nested. This solves the problem of displaying deeply-nested quotes. This mod also has an option to add a date/time stamp to quoted PMs.

Also, I'm not much of an html/css person - this mod mostly provides variables which can be checked in the template, and a bare-bones css file. If anyone comes up with css for a better looking format and wants to share it, please do (and maybe I'll put it in a later version).

(vb4 version is here: https://vborg.vbsupport.ru/showthread.php?t=292968)


Installation:
----------------------------
Just import the product XML file from the Product Manager. This doesn't change stored PMs in any way (unless you enable the date/time stamp option - see below), so you can uninstall or disable the product at any time to go back to the original PM template.

If you'd like to customize the format, you can edit the kh99_pm_quote, kh99_pm_quote_bit, and/or the kh99_pm_quote.css templates.

If you want to add date/time tags to PM quotes, go to the adminCP options under "Private Messaging Options" and set "Add Date and Time to Quotes" to yes. Note that if you later uninstall this mod, any messages quoted while this option was on will still contain a date/time tag, but it will display after the name in a default format and timezone. If this is a concern, it's probably better that you don't enable this option.

Also note that the date/time option only adds the timestamp to newly quoted messages - it will not add one to quotes in existing messages.

Note: Because I forgot to set a product id for version 0.90, when upgrading from 0.90 to a later version the mod installs as a separate product so that it looks like this mod is installed twice. If that happens you should just be able to uninstall version 0.9.

History:
----------------------------
1.0 (Jan 01, 2013)
  • Fixed issue with white page on some forums
  • All templates now cached (I hope).
0.91 (Dec 22, 2012)
  • Fixed conflict with at least one mod that adds default text formmating
  • Fixed problem with html in pm notification email
  • Option to show only N newest quotes and hide the rest
  • Optional Date/Time tag added to quotes in PMs
  • Added enable/disable option for the entire product, in admincp
  • Templates are now cached
0.9 (Dec 14, 2012)
  • Initial Release

CoffeeLovesYou 12-15-2012 07:43 AM

This is a very nice addition, kh99!
Thank you very much
I hated when I had a PM I kept responding to for a long time because the quotes started to look really weird. This solves the issue!

edit:
:(
After installing this, I get this error.
Fatal error: Call to undefined method vB_Template::fetch_css_path() in /MYFORUMPATH/global.php(607) : eval()'d code on line 507
I replaced my actual forums path with MYFORUMPATH to protect my forum's path privacy lol but that is the error I'm getting.
No, it isn't all over the site, only when I go to private.php (aka my private messages)

kh99 12-15-2012 12:51 PM

Yeah, sorry, I somehow managed to attach the vb4 version. It's fixed now.

Black Tiger 12-15-2012 02:27 PM

This looks very nice.
I've tagged it for now, and wait until it's a bit more tested. Normally I could do that too, but my board is reasonably modded and has VBA CMPS on it, so at this point I don't take any risks. But I like this mod!

Fluke667 12-16-2012 12:08 PM

Thank you it looks so nice :)

blind-eddie 12-16-2012 01:41 PM

Wow, what a difference... Default quote in pm gets huge when you reply alot, I never liked the way it looked.... Very nice... Thank you for sharing your addon.

CoffeeLovesYou 12-16-2012 04:59 PM

For some reason I don't see ANY quotes in ANY of my PMs after installing this again.
In the PM reply you can see about 4 or 5 quotes but none of them are showing up when I go to actually read the PM.

Why?

https://vborg.vbsupport.ru/external/2012/12/15.png

kh99 12-16-2012 05:25 PM

I'm not sure, but it seems like maybe the template isn't working. You installed the vb4 version when I accidentally posted it, right? Did you completely uninstall that one? Maybe uninstalling and reinstalling, if you haven't already.

What verson of vb are you running?

CoffeeLovesYou 12-16-2012 08:37 PM

Yes, I completely uninstalled and reinstalled.
I am running vB3.8.7

kh99 12-16-2012 08:53 PM

Could you try creating a new style with no parent and see if that works?

Also, do you have any other mods that have to do with PMs? Maybe go to the Plugin Manager, sort by hook location, and see if anything else is using bbcode_create.

Kolektor 12-19-2012 12:45 PM

thanks for this. it's good to see that still there are coders making mods for 3.8.x series.

ctrlbrk 12-20-2012 05:52 AM

Looks good. But what about adding a date/time header to each quote box?

Also you need to cache your templates.

kh99 12-20-2012 07:30 AM

Quote:

Originally Posted by ctrlbrk (Post 2391791)
Looks good. But what about adding a date/time header to each quote box?

I was just thinking about that a couple days ago. The existing quotes don't have that information available, but I'll see how hard it would be to add for new quotes.


Quote:

Also you need to cache your templates.
I can't believe I forgot all about that. Thanks.

ctrlbrk 12-21-2012 12:26 AM

There is another (major) problem, apparently the formatting of emails is messed up with half-HTML half-CSS half-original text.

For example here is a PM email

http://screencast.com/t/ZgwWxxBq

kh99 12-21-2012 12:37 AM

Could you post the message (showing bbcode) that caused that?

ctrlbrk 12-21-2012 01:03 AM

Quote:

Originally Posted by kh99 (Post 2391984)
Could you post the message (showing bbcode) that caused that?

Best I can tell, any/all PM's that contain a quote (vb quote) will trigger the problem.

No bbcode being used or inserted by the user.

Examples:
http://screencast.com/t/iQOyaszXjY

First user sent "test 123" then second user replied "reply test", and the resulting email was:

http://screencast.com/t/bfJwu9uOTFQk

kh99 12-21-2012 01:12 AM

Oh, I see. I missed that you were talking about the email. I'll look in to that, thanks.

Max Taxable 12-21-2012 01:13 AM

I am watching this - I'm guilty of asking for this for v3.... So throw rocks at ME if it causes problems meanwhile I'll just wait and let the rest of you take all the risk! :D

kh99 12-21-2012 01:24 AM

Well, that's why it's beta - I haven't tested it a lot. I don't think I even looked at a PM email when this was installed because it never occurred to me that it could be a problem.

Edit: oops - I forgot to mark the vb3 version as beta....

Max Taxable 12-21-2012 01:26 AM

Normally I test stuff full speed ahead and damn the torpedoes, but on this one I'm not sure if will uninstall completely. Otherwise I would have right at it.

kh99 12-21-2012 01:36 AM

Obviously others are interested in the vb3 version so it doesn't matter to me if you wait or decide not to install it at all. But for anyone else who might be worried about it, this makes no database changes and has no custom uninstall code, so uninstalling won't be a problem.

Max Taxable 12-21-2012 01:37 AM

Quote:

Originally Posted by kh99 (Post 2392003)
Obviously others are interested in the vb3 version so it doesn't matter to me if you wait or decide not to install it at all. But for anyone else who might be worried about it, this makes no database changes and has no uninstall code, so uninstalling won't be a problem.

Nice to know.

I thought it was a good idea (it is) that's why I asked for it for v3.

ctrlbrk 12-21-2012 01:47 AM

Yes, I very much want this to work... just need to fix the emails, or trigger them to be sent in HTML mode.

Max Taxable 12-21-2012 02:18 AM

Quote:

Originally Posted by ctrlbrk (Post 2392008)
Yes, I very much want this to work...

Me too.

kh99 12-21-2012 02:34 AM

It turns out that it wasn't a big fix. I'll release a new version tomorrow.

ctrlbrk 12-21-2012 03:11 AM

Quote:

Originally Posted by kh99 (Post 2392014)
It turns out that it wasn't a big fix. I'll release a new version tomorrow.

Excellent, thanks. Crossing fingers for adding the date/time as well, I know it will take some PHP and query but I think is worth it :)

kh99 12-21-2012 10:14 AM

Quote:

Originally Posted by ctrlbrk (Post 2392017)
Excellent, thanks. Crossing fingers for adding the date/time as well, I know it will take some PHP and query but I think is worth it :)

I'll look in to doing that. But one thing about that: it will be something that won't go away when you uninstall the mod. It's going to have to go in as part of the name of the person you're quoting.

ctrlbrk 12-21-2012 10:27 AM

Quote:

Originally Posted by kh99 (Post 2392035)
I'll look in to doing that. But one thing about that: it will be something that won't go away when you uninstall the mod. It's going to have to go in as part of the name of the person you're quoting.

Or just a $variable? I figure you'll need to do a SELECT query to find the info, then the plug-in could just throw it in a $variable? I for instance would prefer to be able to float: right; the date on the other side of the quote box. But either way, it is welcome.

kh99 12-21-2012 11:12 AM

Quote:

Originally Posted by ctrlbrk (Post 2392037)
Or just a $variable? I figure you'll need to do a SELECT query to find the info, then the plug-in could just throw it in a $variable? I for instance would prefer to be able to float: right; the date on the other side of the quote box. But either way, it is welcome.

I'm not sure what you mean by a variable. (Edit: oh, I think I see now, you mean a variable you can use in the template). Maybe you have an idea of how to do it that I haven't thought about. But the quote is just a bbcode with the user's name as an option and the text as the parameter, like: [QUOTE=ctrlbrk]Or just a $variable?...[/quote]. That's all the information there is. It *might* be possible to do a query for previous messages matching the quoted text (assuming it hasn't been deleted), but I'm not going to try to do anything like that - it might end up being more complicated than the entire mod is now.

So that just leaves adding it to the option somehow. Quoting posts uses that method by adding the post id after a semicolon, like [QUOTE=ctrlbrk;2392037]Or just a $variable?...[/quote], then the code looks for that, strips it off and uses it to create the little arrow that takes you to the post. I might be able to do something similar with the date and time, but then if my mod is uninstalled it will still be there (unless I go through all PMs on the system and delete it when I uninstall). That might not be a problem if it's text - my mod can strip it off and make it a variable in the template, and if it's uninstalled it will just appear after the name. Adjusting the timezone might be a bit of an issue but I think I can deal with that.

Anyway, let me know if you have a different idea.

kh99 12-21-2012 11:52 AM

Hmm...I suppose I could just do one query to try to match the quoted text and username, and if it fails (like if the message was deleted) then it just won't show up. I don't like that as mush as including it as part of the option text, but I'm not the one requesting it. Would you rather it be a hit-and-miss type of thing that depends on the quoted message still being in the system (but it would work for existing pms with quotes and would go away completely if uninstalled), or make it part of the option, in which case it would not be there for pre-existing pms and it wouldn't go away when uninstalled, but it would stay around even if the mod is uninstalled? (In either case it will be a variable that you can float right, as long as this mod stays installed).

ctrlbrk 12-21-2012 11:54 AM

Hmm. I figured that there was a hook that contained the private message ID somewhere, so you could know exactly what to query. But I haven't looked at the hooks or dumped any arrays to see what is available.

Once you have the PM ID#, I was thinking just to do a SELECT lookup, retrieve the date/time, then make that available as a $variable that can be used within the template.

For the moment, I'd just like the email bug fixed :)

ctrlbrk 12-21-2012 12:05 PM

Perhaps $pmdm->pmtext['pmtextid'] from looking briefly

kh99 12-21-2012 12:08 PM

Quote:

Originally Posted by ctrlbrk (Post 2392046)
Hmm. I figured that there was a hook that contained the private message ID somewhere, so you could know exactly what to query. But I haven't looked at the hooks or dumped any arrays to see what is available.

Well right, at the time the message is first quoted I can find the date/time, it's just that it needs to be stored as part of the quote tag or else I'd need to find it again (using only the user name and quoted text) every time the message is displayed.


Quote:

For the moment, I'd just like the email bug fixed :)
I'll definitely be releasing that fix today, but I wanted to see what else I can get done in the same release.

Edit: I had a power outage here yesterday, so I'm a bit behind but it's basically done and I'll be releasing it soon.

kh99 12-22-2012 04:16 PM

Quote:

Originally Posted by ctrlbrk (Post 2391791)
But what about adding a date/time header to each quote box?

Also you need to cache your templates.

Quote:

Originally Posted by ctrlbrk (Post 2391982)
There is another (major) problem, apparently the formatting of emails is messed up with half-HTML half-CSS half-original text.

OK, I released another version (0.91) that fixes the above, and also a problem someone asked about in the vb4 thread where it was incompatible with another mod. Also adds a cutoff setting that someone asked for via PM.

Edit: oops - I added a template to format the date/time in a new message, and now I've forgotten to cache that one. I'll add it next update (or you can add it in the cache_templates plugin if you want to take care of it before then).

Abu2 12-22-2012 11:09 PM

Quote:

0.91 (Dec 22, 2012)
Hi. I've a white screen on forum/private.php with new version.
Also, new version of product installs as a new product and it doesn't rewrite old one.
Previous version works great.

kh99 12-22-2012 11:11 PM

Quote:

Originally Posted by Abu2 (Post 2392329)
Hi. I've a white screen on forum/private.php with new version.
Also, new version of product installs as a new product and doesn't rewrite old one.

Hmm...I think the reason for installing as a new product is that I forgot to set the product ID on the previous version. I think it should be OK to uninstall the 0.9 version, but if it still doesn't work uninstall the 0.91 version as well, then reinstall it. (It might be the cause of the white screen, but I'll do some more testing as well).

Abu2 12-22-2012 11:17 PM

I reinstalled it, but... The same - white screen...

kh99 12-22-2012 11:21 PM

OK. I just tried it myself and didn't see any problems, so possibly it's a conflict with something on your forum, and I'd like to figure out what it is. Do you have any access to your php or web server error logs, to see if there's any information there? Also, which version of vb are you running?

Edit: Another thing you could do - there are 4 plugins, you could try disabling the separate plugins one at a time to see if you can figure out which one is the problem. That would at least let me know which part to focus on.

Abu2 12-23-2012 12:33 AM

I use 3.8.6. No errors in error.log.
I switched off all of PM's and quote mods, - no result.

But previous version 9.0 works.
Mabe problem in plugin hooks...

I tried to disable them step by step, but...

kh99 12-23-2012 12:38 AM

Could you try going to the Plugin Manager, find the section for "Private Message Quote Formatting", and disable those plugins one at a time, to see if you can figure out if one of them is causing the problem?


All times are GMT. The time now is 01:51 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01405 seconds
  • Memory Usage 1,839KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete