For my own site, I have implemented a UserCP option to allow the user to opt-out of this modication. You never know how old the users computer might be, and while jQuery is very lightweight and
shouldn't cause any problems, you just never know.
I apologize for not making this a part of the Product Install automated process, but so far I've gotten
no answers to my query of how to do so. As soon as I find out, I'll gladly update the product!
- Go to AdminCP -> User Profile Fields -> Add New User Profile Field
- Profile Field Type: Single-Selection Radio Buttons
- Title: Enable Truncate Quotes
- Description: Turn the Quotes Truncation system on/off
- Options:
- Set Default: Yes
- Display Order: 8
- Field Required: No
- Field Editable by User: Yes
- Private Field: Yes
- Field Searchable on Members List: No
- Show on Members List: No
- Allow Users to input their own value for this option: No
- Which page displays this option: Options: Thread Viewing
- Save
Take note of the "name" of the new Field after you click save. Mine, for example, is "field12".
Go to AdminCP->Styles & Templates->Style Manager->Edit your styles Templates
Edit headinclude_bottom
Find the line:
Code:
<vb:if condition="$vboptions['dbd_tq_enabled'] == 1">
Replace with:
Code:
<vb:if condition="$vboptions['dbd_tq_enabled'] == 1"><vb:if condition="$bbuserinfo['field12'] == Enabled">
Find the close of the if at the bottom:
Replace it with:
Complete example using the self-hosted method:
Code:
<vb:if condition="$vboptions['dbd_tq_enabled'] == 1">
<vb:if condition="$bbuserinfo['field12'] == Enabled">
<script type="text/javascript" src="/clientscript/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/clientscript/jquery.jtruncate.pack.js"></script>
<script type="text/javascript">
jq=jQuery.noConflict();
jq(document).ready(function(){
jq('.message').jTruncate({
length: {vb:raw vboptions.dbd_tq_length},
minTrail: {vb:raw vboptions.dbd_tq_minTrail},
moreText: "{vb:raw vboptions.dbd_tq_moreText}",
lessText: "{vb:raw vboptions.dbd_tq_lessText}",
ellipsisText: "{vb:raw vboptions.dbd_tq_ellipsisText}",
moreAni: '{vb:raw vboptions.dbd_tq_moreAni}',
lessAni: '{vb:raw vboptions.dbd_tq_lessAni}'
});
});
</script>
</vb:if></vb:if>
And now your users have the option to decide for themselves