vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Cut long urls EVERYWHERE (https://vborg.vbsupport.ru/showthread.php?t=73123)

MeTaL_oRgY 12-20-2004 02:21 PM

Cut long urls EVERYWHERE
 
Ok. .I've made a static board.. blame me.. but I can't just made it 100% wide now (Too lazy to do so..).. so I need help.

At some pages (mostly on online.php) I get very, VERY long urls that really mess up my forum. I need to make it so thatif it's more than x characters long, it'll be cutted and added a ... on it.. so it changes this:
Code:

<a href="http://domain.com/forum/longurl/verylongurl/messinglayout.htm">http://domain.com/forum/longurl/verylongurl/messinglayout.htm</a>
to this:
Code:

<a href="http://domain.com/forum/longurl/verylongurl/messinglayout.htm">http://domain.com/forum/...out.htm</a>
I've found this piece of code:
Code:

$maxchars=20;
  if (strlen($thread['title']) > $maxchars) {
    $thread['title'] = substr($thread['title'], 0, $maxchars - 2) . '...';
  }

but I'm not sure on how to apply it to ANY url written. I'm sure the code should be at global.php but I have no idea on how to set the variables.

Natch 12-21-2004 11:02 AM

You would need to hack the handle_bbcode_url() function to include that element onthe $text variable in there...

MeTaL_oRgY 12-21-2004 04:16 PM

hmm... that sounds kinda.. hard.. and I'm very new at this... I think I'll set it up only for the online.php urls... since that's the place that's messing the layout the most... thnx for the reply natch!


All times are GMT. The time now is 10:10 AM.

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.01504 seconds
  • Memory Usage 1,708KB
  • 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
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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