View Full Version : *Solved* VB5.1.6 Help with truncated url code
Vaskania
04-04-2015, 11:42 PM
Trying to edit function handle_bbcode_url (includes/class_bbcode.php) to allow for longer urls. I thought it would be easier to just allow longer ones than to try to remove the code altogether, but I seem to be at a stand still.
if (vbstrlen($tmp) > 55 AND $this->is_wysiwyg() == false)
{
$text = htmlspecialchars_uni(vbchop($tmp, 36) . '...' . substr($tmp, -14));
}
In theory, I should be able to change 55 to a higher number to allow for longer urls before truncation kicks in, but it's not working out that way. I could ramp it up to 5500 and it doesn't change anything. I've even tried raising 36 to a higher number- still nothing.
Has this method changed with VB5? Should I be looking elsewhere?
Lynne
04-04-2015, 11:52 PM
Are you making sure to clear the cache (admincp > maintenance and also your browser) after you make the change?
Vaskania
04-05-2015, 12:06 AM
Crap.. no. LOL
CTRL F5 a few times didn't change, but I didn't think to clear the cache in maintenance.
I'll try changing it again and clear everything and see.
Vaskania
04-06-2015, 05:11 PM
No change. I set it to 1000 just to test. Cleared the maintenance cache as well as my browsers. Links are still being truncated.
Lynne
04-06-2015, 08:03 PM
Have you tried just commenting out the line ($text=xxxx)? That should let you know whether you are even editing the correct code or not. Also, you are just talking about URLs in the [ URL ] tags, not the ones make with the Link button, right?
Also, handle_bbcode_url is also in the file /core/vb/library/bbcode.php Have you tried changing it there? It also happens to be in /includes/vb5/template/bbcode.php I honestly couldn't tell you which is the correct file without trying them out myself.
Vaskania
04-16-2015, 05:20 PM
The ones affected seem to be ones that are just pasted right into the body of the post and auto-parsed into links. That's how most of our users insert links. I'll have to play around a bit with manually adding the [ url ][ /url ] tags and see if those are truncated as well.
Thanks for pointing me in the right direction. Had no idea there were multiple files.
For now I've installed this mod: https://vborg.vbsupport.ru/showthread.php?t=288954 which works so far, but the truncated links screw it up if you edit a post (links are truncated in the edit box, which destroy the title rewrite).
/edit
Solved. Did a search files/sub-folders via Notepad++ and got all 3 files at once and edited all 3. One of them did the trick. lol
Lynne
04-16-2015, 08:27 PM
I'm glad you got it working for you. And thanks for posting what you did. :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.