Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
dbd Truncate Quotes Details »»
dbd Truncate Quotes
Version: 0.25, by deadbydawn deadbydawn is offline
Developer Last Online: Nov 2010 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 4.0.3 Rating:
Released: 05-26-2010 Last Update: 05-26-2010 Installs: 18
Uses Plugins Template Edits
Re-useable Code Additional Files  
No support by the author.

About this product
Many times it is convenient to quote someone's reply so that they know the comment is directed at them, however this can become tedious if someone happens to be longwinded. Other times, the replying user simply doesn't understand the difference and quotes someone unnecessarily. Regardless, it leads to a lot of wasted screen space for everyone else to skip over.

That's where this product comes in. Using jQuery, it will automatically truncate quotes to a defined length and replace the remaining text with a "Read More" link. This is all done clientside, so no actual changes are being made to the html (and so it shouldn't affect anything with SEO). When the viewer clicks the read-more link, the div automatically expands showing the rest of the quoted text.

Product Installation breakdown
  • Files to Edit: 0
  • Templates to Edit: 1
  • Files to Upload: 2 (optional)
  • Time to Install: 1 minute

Installation instructions
  1. Decide if you want to host the jquery scripts yourself, or if you would rather use google's CDN. I recommend the self hosted option, but it's your choice.

    1a) self hosted: upload the contents of the upload_via_ftp/ folder to your vb_root/clientscript/ directory
    jquery-1.4.2.min.js -> /clientscript/
    jquery.jtruncate.pack.js -> /clientscript/

    1b) cdn: nothing.
  2. Import product-dbd_truncate_quotes.xml into Product Manager. Set Allow Overwrite to Yes if upgrading.
  3. Go to template editor and add the following to the end of your headinclude_bottom template depending upon your decision from step 1.

    3a) self hosted: add this to the top of the edit you are about to make in the mandatory section below:
    Code:
    		<vb:if condition="$vboptions['dbd_tq_enabled'] == 1">
    		<script type="text/javascript" src="/clientscript/jquery-1.4.2.min.js"></script>
    		<script type="text/javascript" src="/clientscript/jquery.jtruncate.pack.js"></script>
    3b) cdn: add this to the top of the edit you are about to make in the mandatory section below:
    Code:
    		<vb:if condition="$vboptions['dbd_tq_enabled'] == 1">
    		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    		<script type="text/javascript" src="http://jtruncate.googlecode.com/svn/trunk/jquery.jtruncate.js"></script>

    MANDATORY STEP: Now that you have made a choice between 3a or 3b, paste that code into the template followed by this right below it:

    Code:
    	<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>
  4. Go to vbulletin options, scroll down to dbd Truncate Quotes, change the default settings if necessary
  5. Click Installed

Download Now

File Type: zip dbd_truncate_quotes_025.zip (27.7 KB, 53 views)

Screenshots

File Type: jpg dbd_truncated_quotes_screen.jpg (65.9 KB, 0 views)
File Type: png dbd_admincp.png (98.3 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 05-27-2010, 08:34 PM
deadbydawn's Avatar
deadbydawn deadbydawn is offline
 
Join Date: May 2010
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Reserved
Reply With Quote
  #3  
Old 05-27-2010, 10:50 PM
deadbydawn's Avatar
deadbydawn deadbydawn is offline
 
Join Date: May 2010
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
    Code:
    Enabled
    Disabled
  • 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:
Code:
</vb:if>
Replace it with:
Code:
</vb:if></vb:if>
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
Reply With Quote
  #4  
Old 06-15-2010, 11:00 PM
furst furst is offline
 
Join Date: Dec 2005
Posts: 362
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Go to template editor and add the following to the end of your headinclude_bottom template depending upon your decision from step 1.

3a) self hosted: add this to the top of your edit:
im confused, am i adding this edit to the top or bottom/end? first you say to add the following to the end of your headinclude_bottom template then 3a) says add to the top

Which one is it? just a bit confused here.

Also am i adding the other larger edit to the end of 3a) or bottom of the headinclude_bottom template?
Reply With Quote
  #5  
Old 08-02-2010, 08:01 AM
OlijO's Avatar
OlijO OlijO is offline
 
Join Date: Jun 2005
Location: Belgium
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by furst View Post
im confused, am i adding this edit to the top or bottom/end? first you say to add the following to the end of your headinclude_bottom template then 3a) says add to the top

Which one is it? just a bit confused here.

Also am i adding the other larger edit to the end of 3a) or bottom of the headinclude_bottom template?
Agree, it's a little confused and seams to doesn't work for me
Reply With Quote
  #6  
Old 10-27-2010, 05:58 PM
deadbydawn's Avatar
deadbydawn deadbydawn is offline
 
Join Date: May 2010
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My apologies for the confusion (and the delayed response). What I was trying to say there is that you will need to add either 3a or 3b to the top of the mandatory part of step 3 (which I will try to make clearer above).

So, if you were going to host it yourself, your edit to the END of the headinclude_bottom would be:

Code:
		<vb:if condition="$vboptions['dbd_tq_enabled'] == 1">
		<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>

And if you went with option b, CDN hosted, it would be:

Code:
		<vb:if condition="$vboptions['dbd_tq_enabled'] == 1">
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
		<script type="text/javascript" src="http://jtruncate.googlecode.com/svn/trunk/jquery.jtruncate.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>
I hope that helps!
Reply With Quote
  #7  
Old 09-17-2013, 03:54 PM
Ig@r's Avatar
Ig@r Ig@r is offline
 
Join Date: Feb 2002
Location: MN
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's working with 4.2
*Installed*
Thanks
Reply With Quote
  #8  
Old 09-18-2013, 01:17 PM
Ig@r's Avatar
Ig@r Ig@r is offline
 
Join Date: Feb 2002
Location: MN
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My forum is not in the root directory so had to change path in the code
Code:
<script type="text/javascript" src="/forum/clientscript/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/forum/clientscript/jquery.jtruncate.pack.js"></script>
Reply With Quote
  #9  
Old 08-27-2015, 10:51 AM
blue7's Avatar
blue7 blue7 is offline
 
Join Date: Aug 2007
Location: Turkey/Ankara
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It cause problem with this plugin (Image Resizer - Using nCode Script): https://vborg.vbsupport.ru/showthrea...237650&page=10

Is there any way to solve it?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:52 PM.


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.10102 seconds
  • Memory Usage 2,315KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (12)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (3)postbit_attachment
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete