vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   vB's automatic link trimming - how to modify? (https://vborg.vbsupport.ru/showthread.php?t=75240)

MrNase 01-27-2005 03:57 PM

vB's automatic link trimming - how to modify?
 
Hello,

Here's what Iam trying to do:

My bb is located at pagodentreff.de/diskussionsforum/ and the url is pretty long.

The urls gets trimmed but that doesn't look that nice as you can see here:

http://www.pagodentreff.de/diskussio...66&postcount=3


I want to have it so that the links look like:

www.pagodentreff.de/.../t311-rueckleuchten-sl-230.html

instead of

http://www.pagodentreff.de/diskussi...ten-sl-230.html


How can I affect the function so that I can do a str_replace? What function is responsible for that trimming?


Thanks for any reply :)

MrNase 04-08-2005 03:28 PM

Let me bump that thread ;)

Marco van Herwaarden 04-08-2005 06:49 PM

Open includes/functions_bbcodeparse.php

Find:
PHP Code:

            $text htmlspecialchars_uni(substr($tmp035) . '...' substr($tmp, -15)); 

Replace by:
PHP Code:

            $text htmlspecialchars_uni(substr($tmp050 strlen(basename($tmp))) . '.../' basename($tmp)); 


Marco van Herwaarden 04-08-2005 06:50 PM

Could be improved (filename longer then 50 positions for example or always show domain and filename and trim what is in between).

MrNase 04-10-2005 10:13 AM

Thanks for your answer :)

Here's what your code now produces:

http://www. pagodentreff.de/diskussionsforum/t939-nip.../t939-nippel-day--2005--.html

Marco van Herwaarden 04-10-2005 04:19 PM

Complete with the space after www. ??

It is now how you want or not? Like i said it is just a start.

MrNase 04-12-2005 06:42 AM

No, not with the space. I had to add it because vB likes trimming the links so much so my link would have got messed up ;)

The problem is: this little function adds the last section of the url twice as you can see on the example.

Anyway, thanks for your help. It does look better now but I will take a deeper look at it :)

Marco van Herwaarden 04-12-2005 07:03 AM

Then you must have changed something more, because this one is working fine on my testboard:
Code:

http://www.pagodentref.../t939-nippel-day--2005--.html
But as you can see the domain name is also cut off, so maybe you could change it a bit to avoid that.

7casas 04-13-2005 10:24 AM

Hi, it's possible to change the link from the post's title or the category to get something like:
www.mystite.com/VB_hacks
and not:
www.mysite.com/showthread.php?...


All times are GMT. The time now is 03:07 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.01041 seconds
  • Memory Usage 1,731KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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