vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=263)
-   -   *Solved* VB5.1.6 Help with truncated url code (https://vborg.vbsupport.ru/showthread.php?t=318119)

Vaskania 04-04-2015 11:42 PM

*Solved* VB5.1.6 Help with truncated url code
 
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.

Code:

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. :)


All times are GMT. The time now is 02:35 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.02599 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete