PDA

View Full Version : Limiting size of quotes?


bfdzio
09-26-2011, 01:51 PM
Anyone know how to limit the size of quoted text? I have the ability for people to quote just certain parts of a post but sometimes people will still quote an entire post that is really big. It isn't a big issue but I would like to clean things up because it is annoying for users on mobile.

I would like to find a way to make it like I have seen on some vbulletin based forums where if the amount of words inside the quote box exceeds a certain amount, or number of characters...that it replaces the text that would be shown with something else (I would probably just put a link in it that is more obvious than the go to post button).

Any ideas?

Mooff
09-26-2011, 03:52 PM
plugin with hook location bbcode_(something) (check the php file for which hook you need) and some if condition whether you are in the bbcode_quote. There the quoted text should be in the variable $code, use some php functions like strlen($code) to find out how long it is and if it is above 1000 characters or something manipulate it to $code = substr($code, 1000) and $code .= '<a href="">read full quote here</a>'.

bfdzio
09-27-2011, 01:26 PM
Appreciate it, I actually found a good solution in the meantime that I might stick with. I'll share it here in case anyone searches and finds this post but another guy on the forum posted this:

add this to your headerinclude template:
<vb:literal><style>
div.quote_container {max-height:180px;overflow:auto;}
</style></vb:literal>

editing max-height will change how big the quote box can be and will add a scroll bar to it.

Mooff
09-27-2011, 02:12 PM
i see, that's a nice and easy way to do it.

But i would put
div.quote_container {max-height:180px;overflow:auto;}
in the additional.css and not in the headinclude template.

Vibhor
09-12-2013, 03:27 PM
What would be the solution for this for boards running on vBulletin 3?