PDA

View Full Version : How to show full URL in vb4.2.x


helenblog
12-13-2015, 12:17 PM
Hello,

I have read all guides from vbulletin.org and vbulletin.com to show full URL in vb4.2x but seem there is any guides to make this work as expected.

Can you share me ways to enable/show full URL in vbulletin post (vb4.2x) without trim URL with (...) when showing on post content.

Thanks

Dave
12-13-2015, 12:29 PM
The /includes/class_bbcode.php file will have to be modified for this.
Look for
$text = htmlspecialchars_uni(vbchop($tmp, 36) . '...' . substr($tmp, -14));
around line 2421 and replace with
$text = str_replace(' ', '', $text);

MarkFL
12-13-2015, 01:31 PM
Another alternative would be to create the following plugin:

Product: vBulletin

Hook Location: postbit_display_complete

Title: Show Full Links

Execution Order: 5

Plugin PHP Code:

$post['message'] = preg_replace('/(<a.*?href=")(.*?)(".*?>)(.*?\.\.\..*?)<\/a>/', "$1$2$3$2" . '</a>', $post['message']);

Plugin is Active: Yes

helenblog
12-14-2015, 01:20 AM
Thanks Dave and MarkFL!

I like MarkFL's way because I will not lose codes when updating vb versions.

MarkFL
12-14-2015, 01:26 AM
Thanks Dave and MarkFL!

I like MarkFL's way because I will not lose codes when doing update vb versions.

Dave's suggestion is more efficient as it stops the trimming from even being done in the first place (and will work anywhere BBCodes are parsed), but you're right, using a plugin will ensure you won't have to edit the core file again if you do an update (and you only need it to work in post content). :)

Dave
12-14-2015, 06:27 AM
Yep, I would rather use a plugin as well.