View Full Version : Show Thread Enhancements - iQuote vB3 - Fast & Easy Text Quoting
MoMan
09-13-2010, 10:00 PM
New version (1.1) released 3/23/2011: added support for social groups.
This is a vBulletin 3 implementation of the following mod: https://vborg.vbsupport.ru/showthread.php?t=248504
It allows users to quickly quote selected parts of a post inline. Simply highlight some text, and the quote option will appear. As of v1.1, social groups are also supported, but the quoting will only work properly if you have this template mod (https://vborg.vbsupport.ru/showthread.php?t=204056&highlight=postbit) installed.
On my board, this is one of my users' favorite features!
Note: this requires quick reply to be on and your showthread template must have the $template_hook['showthread_after_activeusers'] hook! To check if the mod is working, view the page of any showthread page and search for 'iquote'. If there are no matches, then the template hook isn't there.
Installation instructions are provided in the zip. Enjoy!
Kolektor
09-14-2010, 08:32 AM
nice cool idea!
Wonksta
09-14-2010, 10:29 AM
Awesome!
jorge_kai
09-14-2010, 11:12 AM
this mod is awesome! !
work for me in one of my sites: fansdeapple.com
but not in other one: htcmania.com :(
any idea?
thanks!!
bada_bing
09-14-2010, 01:23 PM
Does not work in vb 3.85
UNINSTALLED...
MoMan
09-14-2010, 04:17 PM
If it doesn't work for you, your showthread template is likely missing the $template_hook[showthread_after_activeusers] hook. Read the readme before complaining!
jorge_kai
09-14-2010, 04:38 PM
works, thanks!!
drsli
09-14-2010, 05:14 PM
This is really awesome! I added it right away to our forum and it works perfectly. Thank you very much for sharing. :)
FrankieGersnet
09-15-2010, 08:45 AM
If it doesn't work for you, your showthread template is likely missing the $template_hook[showthread_after_activeusers] hook. Read the readme before complaining!
Where does one enter this as I can't get this interesting mod to work either? :(
MoMan
09-15-2010, 12:00 PM
In your template.
FrankieGersnet
09-15-2010, 12:31 PM
In your template.
Sorry - far from an expert, so where about in my template? I assume in the 'showthread' part of my style manager but where about?
I've tried a couple of random places but still doesn't seem to work unfortunately.
Thanks for your help.
:)
MoMan
09-15-2010, 01:06 PM
Open up your style manager, then select and open your showthread template. Click on the "view original" link and do a control-f for the above code- that'll tell you where to look in your version.
Note: if your showthread template is currently NOT customized, then you likely uploaded the files to the wrong place. All the instructions are in the readme file attached in the zip.
Arcade Fire
09-15-2010, 04:20 PM
Works fine, thanks!!
slobra
09-15-2010, 09:25 PM
Installed and voted 5, nice mod. :) Has anyone complained about security token errors after installing this? I'm using 3.8.2. Maybe just a coincidence, but after install even though several users tested successfully I did have a user complain about a security token error when trying to upload images to an unrelated new post. I don't see any value="$session[sessionhash]" code in any of the templates from this mod so I doubt it's related, but thought I'd ask. Haven't installed any other mods.
MoMan
09-16-2010, 01:53 AM
This only includes a single JS file and some css- so no, I don't think so.
NAZIA
09-19-2010, 12:49 AM
So we can not use this, with FB like button?
MoMan
09-20-2010, 02:47 PM
Sure you can!
Thelonius Beck
09-20-2010, 08:14 PM
Awesome! Thank you.
NAZIA
09-24-2010, 09:16 AM
but it is not working . here at my site.
will try to do something for this.. :)
thanks for tha mod
Mike08
09-24-2010, 11:43 AM
Thanks ;)
Thanks for porting this great add-on to vB3! Is there any way to customize the position (cursor offset) of the popup menu?
webuser00
10-01-2010, 09:38 PM
Is there any way to have it jump down to the quick-reply box once a user selects some text to quote?
(this would avoid having the user manually scroll down to the quick-reply portion to see the text)
MoMan
10-19-2010, 07:10 AM
Thanks for porting this great add-on to vB3! Is there any way to customize the position (cursor offset) of the popup menu?
Is there any way to have it jump down to the quick-reply box once a user selects some text to quote?
(this would avoid having the user manually scroll down to the quick-reply portion to see the text)
Both of these things sound like they'd be very easy to do with some simple JS. You should ask Vitaly for help on that!
BirdOPrey5
10-20-2010, 02:06 AM
Thanks... nice mod... any way to get it to copy smilies and images though?
WebkinzCoast
10-21-2010, 06:15 PM
Still not working for me? I have the right hook, and I'm positive that I uploaded the files in the right places.
BirdOPrey5
10-23-2010, 04:57 PM
There's a bug in Opera... It inserts a line-break after the "=" in-between the username and the post id number when quoting part of a post, so you get something like:
Not the latest, I know, but I'm on a slow connection and I always reject its attempts to update.
or, when rendered:
Not the latest, I know, but I'm on a slow connection and I always reject its attempts to update.
Edit: also happening in firefox... OK in Chrome.
MoMan
10-25-2010, 10:00 PM
You guys should check vitaly's thread for potential upgrades or improvements to the JS.
BirdOPrey5
10-25-2010, 11:11 PM
I looked in the original thread and he has a link to his website with the vb4 version:
http://github.com/rcdesign/vb-iquote
The VB4 version has a single javascript file to upload, a lot smaller than the 3 in this version... do you know if the vb4 javascript file will work on this version?
viper357
03-02-2011, 05:06 AM
I looked in the original thread and he has a link to his website with the vb4 version:
http://github.com/rcdesign/vb-iquote
The VB4 version has a single javascript file to upload, a lot smaller than the 3 in this version... do you know if the vb4 javascript file will work on this version?
Joe, any luck with this?
vijayninel
03-02-2011, 08:07 AM
Thanks working perfectly. :)
BirdOPrey5
03-02-2011, 12:28 PM
Joe, any luck with this?
No, never made head or tails of the new javascript, just kept the original that came with the 3.x version.
viper357
03-02-2011, 12:34 PM
Thanks.
MoMan
03-23-2011, 06:04 PM
I've now updated this mod to version 1.1.
New features include reduction of the size of the JS (by 6kb) and support for quoting social group messages.
Note that in order for the quoting to work correctly within social groups, you need to be using this template: https://vborg.vbsupport.ru/showthread.php?t=204056&highlight=postbit, as the JS checks for the presence of an <a class="bigusername"> element to retrieve the userids. If you aren't using the template, the quoting will still work, but it won't reference usernames.
BirdOPrey5
03-23-2011, 08:27 PM
Update installed and working. Thanks. :up:
FYI - Still seeing the bug I mentioned in post # 26, in Opera / Firefox there is an extra line-break in the quote code. Anyone else confirm this or is it just me?
MoMan
03-24-2011, 12:23 AM
I can't reproduce it, but I do have an idea of what might be causing it. Can I get a link to the site you're experiencing the issue on? It's likely because there's an extra line break in one of your postbit templates.
A potential fix would be to either edit the template, or to call a trim function on the username variable inside the JS.
<a class="bigusername">
Username
</a>
Change to:
<a class="bigusername">Username</a>
BirdOPrey5
03-24-2011, 12:38 AM
I can't reproduce it, but I do have an idea of what might be causing it. Can I get a link to the site you're experiencing the issue on? It's likely because there's an extra line break in one of your postbit templates.
A potential fix would be to either edit the template, or to call a trim function on the username variable inside the JS.
<a class="bigusername">
Username
</a>
Change to:
<a class="bigusername">Username</a>
That's very possible... will check it out...
The site is my forum. www.juot.net/forums/ but you'd have to register to try it. I'll check out the postbit now and report back. I did a lot of editing in it.
BirdOPrey5
03-24-2011, 12:47 AM
Yes, that's exactly what it was, an extra line-break in the HTML code. Working great now, thanks. :up:
viper357
03-24-2011, 06:20 AM
I've now updated this mod to version 1.1.
New features include reduction of the size of the JS (by 6kb) and support for quoting social group messages. Thank You. :)
viper357
03-24-2011, 08:03 AM
A bug I've just picked up after installing the updated version. It prevents this hack from displaying at the bottom of threads. https://vborg.vbsupport.ru/showthread.php?t=197487
Any idea on how to fix it?
MoMan
03-25-2011, 04:16 AM
In showthread_complete, change
$template_hook[\'showthread_after_activeusers\'] = "
to
$template_hook[\'showthread_after_activeusers\'] .= "
MoMan
03-25-2011, 04:34 AM
Is there any way to have it jump down to the quick-reply box once a user selects some text to quote?
(this would avoid having the user manually scroll down to the quick-reply portion to see the text)
An update on this:
While I won't be implementing this feature because users on my board almost always use it to multi-quote, this is very easy to add if you know some basic JS (which I've picked up since the original release of this mod ;)).
In the main event handler, right before the final return statement, simply add this line:
window.location.hash='qrform';
viper357
03-25-2011, 06:18 AM
In showthread_complete, change
$template_hook[\'showthread_after_activeusers\'] = "
to
$template_hook[\'showthread_after_activeusers\'] .= "
Just to clarify, I can't find that template, is that in the plugin Add js to showthread?
if ($vbulletin->userinfo['userid'] > 0)
{
eval('$template_hook[\'showthread_after_activeusers\'] = "' . fetch_template('rcd_iquote_clientscript') . fetch_template('rcd_iquote_context_menu') . '";');
}
MoMan
03-25-2011, 11:29 PM
Yes, I was referring to that plugin. You can also re-download the product file, as I've made the update in it.
viper357
03-26-2011, 06:44 AM
Thanks MoMan, appreciate it, working fine now. :)
imedic
07-18-2011, 08:45 AM
An update on this:
While I won't be implementing this feature because users on my board almost always use it to multi-quote, this is very easy to add if you know some basic JS (which I've picked up since the original release of this mod ;)).
In the main event handler, right before the final return statement, simply add this line:
window.location.hash='qrform';
Finnaly I get this on 3.8 :) Iupii Installed and working like a charm. Unfortunately I am newbie in basic JS and cant find the place where to add the line you said.
It would be great to say it in the usual format:
In file :
Find: ....
After add: window.location.hash='qrform';
Suggestion:
You might solve all problems if this line is not coming in effect if you hold CTR (o other key) so you can multi quote (if you hold CTRL) and reposition the page to quick answer as it is obvious you want to reply to something you quoted :)
Or you can add another link in menu appearing, quick multiquote or single multiquote (obvious what each will do). I can run wild and wished for a quote this in a PM to user link too... I am using this mod (quote message in a PM to user that is very handy) ....
Many thanks for this as it is one of the handiest mods I have ever used on vb4 and did not have (yet) on 3.8
Voted, installed and best mark for you. :)
This interactivity with the content should be the new direction vb should go ...
PS Did I mention I love this mod :)
MoMan
07-26-2011, 10:25 AM
You would probably want to replace this code:
// scroll to saved position if possible
if (false !== s)
{
window.scrollTo( s[0], s[1] );
// Verify that page is scrolled, otherwise try again (make sense for IE & Opera only)
window.setTimeout( function() {
var s_now = iQuote.getScrollXY();
if ( s_now[0] != s[0] || s_now[1] != s[1] )
{
window.scrollTo( s[0], s[1] );
}
}, 10 );
}
return false;
},
with:
window.location.hash='qrform';
return false;
},
imedic
08-09-2011, 09:08 AM
Many thanks for your reply. Unfortunately I have not find the code to replace.
Can you please specify the file that needs to be edited. I have looked in all files from upload folder.
Sorry for coming so late but I was caught in many other projects.
MoMan
08-09-2011, 12:07 PM
rcd_iquote.js
Note that you should download v1.0 not 1.1, as 1.1 has minified JS.
elzarie
08-13-2011, 06:54 PM
Real Great , but can't get it to work although checked it that the hook is there :(
cclaerhout
08-15-2011, 09:34 AM
Thank you for this implementation ; it works great. I've just changed the appearance of the popup menu to make it minimalist. Thank you !
imedic
08-17-2011, 11:19 AM
Many thanks for suggestion. I have made the modification and minified the file. Only uploading the file (minified) from the previous version over last version worked.
For who is lazy and want the file already edited so after citation page to be repositioned over the quick reply box can use attached file.
Best regards and thank you for a great great mod. It should be developed further to be able to quote that text in a PM / email or maybe even in social media.
Nice way to interact with content.
I will keep an eye here and vote all stars and nominate it too. This should be standard in vb
NOTE: Dont forget to change extension of saved file to .js (I cant upload js file to vb)!
cclaerhout
08-21-2011, 02:30 PM
The members of "my" forum LOVE that addon. They also wanted to have this function in the 'newreply' page with the Advanced Editor. Fortunately the Javascript file was greatly documented. It took me hours, but I've succeed to do it :)
Thanks again Imedic to convert this hack to vB 3 !
P.S :
This mod uses what I called a "minimalist design". I didn't want a big menu to display.
To make it work with the "newreply' page, your template 'newreply_reviewbit' must not have been edited, which shouldn't be a problem.
MoMan
09-02-2011, 11:21 AM
FYI version 1.1 in the original post supports social groups, but I've lost the non-minified file and will have to go looking for it.
I'd very much like to add the functionality for PMs as well.
Konstantinos
09-13-2011, 05:39 PM
it works well but in chrome when u click the instant quote while the quoted text enters into quick reply the popup stays there and doesnt vanish :)
edit. it also quotes singatures and if someone has quoted someone else in a post and u quote the quoted text it inserts the quote username wrong ;)
mk craig 42
02-13-2012, 03:45 AM
Everything works great however, it doesn't display the name
for example, it does this when I click it:
=;2333]This is my quoted text
As opposed to this:
This is my quoted text
Any ideas? Here is my js file:
var iQuote={selected_post_number:0,selected_text:"",context_menu:null,init:function(a){var b=fetch_object(a);if(!b){return}var c=fetch_tags(b,"td");for(var d=0;d<c.length;d++){if(!c[d].id||-1===c[d].id.indexOf("td_post_")){continue}var e=c[d].id;var f=e.substr(e.lastIndexOf("_")+1);YAHOO.util.Event.on(e,"mouseup",iQuote.selectionEnd,f);YAHOO.util.Event.on(e,"mousedown",iQuote.selectionStart,f)}iQuote.context_menu=new YAHOO.widget.Menu("iquote_popup_menu",{clicktohide:false});iQuote.context_menu.render(d ocument.body)},selectionStart:function(a,b){var c=window.event||a;var d=!YAHOO.env.ua.ie&&c.button==0||YAHOO.env.ua.ie&&c.button==1;if(d){if(window.getSelection){window.g etSelection().removeAllRanges()}else if(document.selection){document.selection.empty()} }if(iQuote.context_menu){iQuote.hide_menu()}iQuote .selected_post_number=b},selectionEnd:function(a,b ){var c=window.event||a;var d=!YAHOO.env.ua.ie&&c.button==0||YAHOO.env.ua.ie&&c.button==1;if(!d){return}if(iQuote.selected_post_ number&&iQuote.selected_post_number==b){iQuote.selected_te xt=iQuote.getSelectedText();if(""!==iQuote.selected_text){var e=YAHOO.util.Event.getXY(a);e[0]=e[0]+7;e[1]=e[1]-35;iQuote.context_menu.cfg.setProperty("xy",e);if(!YAHOO.env.ua.ie){var f=function(a){var b=document.createRange();b.setStart(a.anchorNode,a .anchorOffset);b.setEnd(a.focusNode,a.focusOffset) ;window.getSelection().addRange(b)};var g=function(a,b,c){f(c);iQuote.context_menu.unsubsc ribe("blur",g)};var h=function(a,b,c){iQuote.context_menu.subscribe("blur",g,c);iQuote.context_menu.blur();iQuote.context_me nu.unsubscribe("focus",h)};if(window.getSelection){var i=window.getSelection().getRangeAt(0);var j={anchorNode:i.startContainer,anchorOffset:i.star tOffset,focusNode:i.endContainer,focusOffset:i.end Offset};iQuote.context_menu.subscribe("focus",h,j)}}iQuote.context_menu.show();var k=function(a){iQuote.hide_menu();return true};YAHOO.util.Event.on(document,"keydown",k);YAHOO.util.Event.on(document,"contextmenu",k)}}else{iQuote.selected_text="";iQuote.selected_post_number=0}},getSelectedText:f unction(){if(window.getSelection){return window.getSelection().toString()}if(document.getSe lection){return document.getSelection()}if(document.selection&&document.selection.createRange){return document.selection.createRange().text}return""},quote_text:function(){if(!iQuote.selected_post_n umber||!iQuote.selected_text){return false}var a=iQuote.getScrollXY();iQuote.qr_activate(iQuote.s elected_post_number);var b=iQuote.getPosterName(iQuote.selected_post_number );var c=vB_Editor[QR_EditorID].wysiwyg_mode?"<br /><br />":"\r\n\r\n";vB_Editor[QR_EditorID].insert_text(""+iQuote.selected_text+""+c,false);iQuote.selected_post_number=0;iQuote.sel ected_text="";iQuote.hide_menu();window.location.hash="qrform";return false},qr_activate:function(a){var b=fetch_object("collapseobj_quickreply");if(b&&b.style.display=="none"){toggle_collapse("quickreply")}},getPosterName:function(a){var b=document.getElementById("postmenu_"+a);var c=YAHOO.util.Dom.getElementsByClassName("bigusername","a",b)[0];c=c.text||c.textContent||c.innerText||c.innerHTML .replace(/<[^>]+>/g,"");return PHP.htmlspecialchars(c)},hide_menu:function(){var a=iQuote.context_menu.srcElement.cloneNode(true);a .id="iquote_popup_menu";iQuote.context_menu.destroy();iQuote.context_menu =new YAHOO.widget.Menu(a,{clicktohide:false});iQuote.co ntext_menu.render(document.body)},getScrollXY:func tion(){var a=0,b=0;if(typeof window.pageYOffset=="number"){b=window.pageYOffset;a=window.pageXOffset}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop )){b=document.body.scrollTop;a=document.body.scrol lLeft}else if(document.documentElement&&(document.documentElement.scrollLeft||document.doc umentElement.scrollTop)){b=document.documentElemen t.scrollTop;a=document.documentElement.scrollLeft} if(typeof window.pageYOffset!="number"&&!document.body&&!document.documentElement){return false}return[a,b]}}
BirdOPrey5
02-13-2012, 11:19 AM
I would check your postbit or postbit_legacy template- actually try it on a complete default style and see if you have the same problem or not.
mk craig 42
02-13-2012, 02:36 PM
I would check your postbit or postbit_legacy template- actually try it on a complete default style and see if you have the same problem or not.
Thanks for your reply BirdOPrey5, I found the problem, but I don't know how to fix it!
It's because I have Username Images installed, so I was testing this on myself, where I have a username image & it's not fetching my username.. I logged on today and tried on someone who doesn't have a username image, and it worked perfectly...
Any ideas of a fix to that, here is that section on my postbit_legacy
<!-- User Name Images by World Domination -->
<div id="postmenu_$post[postid]">
<if condition="$show['profile']">
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]"><if condition="$post['field5']"><img src="$post[field5]" max-width="170" max-height="30" border="0"/></a> <else />$post[musername]</a></if><script type="text/javascript"> vbmenu_register("postmenu_$post[postid]", true); </script><else />$post[musername]</if>$threadauthor</div></center>
<center><if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if></center>
BirdOPrey5
02-14-2012, 01:34 PM
I don't know if it would work but I'd try this...
change this code:
<if condition="$post['field5']"><img src="$post[field5]" max-width="170" max-height="30" border="0"/></a> <else />$post[musername]</a></if>
to this:
<if condition="$post['field5']"><img src="$post[field5]" max-width="170" max-height="30" border="0"/><span style="display:none;">$post[musername]</span></a><else />$post[musername]</a></if>
I'm not sure it will help or not- it will at least create the username but it will be invisible.
mk craig 42
02-14-2012, 11:11 PM
I don't know if it would work but I'd try this...
change this code:
<if condition="$post['field5']"><img src="$post[field5]" max-width="170" max-height="30" border="0"/></a> <else />$post[musername]</a></if>
to this:
<if condition="$post['field5']"><img src="$post[field5]" max-width="170" max-height="30" border="0"/><span style="display:none;">$post[musername]</span></a><else />$post[musername]</a></if>
I'm not sure it will help or not- it will at least create the username but it will be invisible.
You genius! I never even thought to do something like that! Worked like a charm, thanks so much :)
karabaja3
05-24-2015, 09:40 PM
Does anyone know how to disable usage in the latest post?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.