Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Shortening Links

rustyrusty New
edited May 2009 in Vanilla 1.0 Help
On my forum we have a Gumtree/eBay finds thread where people post up links of things they've found on eBay that they think other forum members may be interested in. This thread gets quite messy with auto-parsed links and I'd like the links to be parsed as [click] instead of http://cgi.ebay.co.uk/Terry-Dolan-60cm-Racing-Bike-Fixed-Wheel-Track-Bike_W0QQitemZ280342656631QQcmdZViewItemQQptZUK_Bikes_GL?hash=item280342656631&_trksid=p3286.c0.m14&_trkparms=72%3A1688%7C66%3A2%7C65%3A12%7C39%3A1%7C240%3A1318%7C301%3A0%7C293%3A1%7C294%3A50. I'm unsure which extension is auto-parsing links for me so I've listed all of my active extensions below. I have also noticed that when people quote an auto-parsed link that the link breaks. This can be remedied by inserting a space before the [/quote] tag but I'm unsure how to alter this. Any advice will be gratefully received.

Add Comments 1.2
AjaxQuote 1.0
Category Jumper 1.0
Default Icon 0.3
Discussion Filters 2.0
Discussion View Count 1.2.1
Extended Application Form 1.0
Forced BBCode 0.1.0
Forced Category 1.0
Google Analytics 1.2
Google Map Directory 0.5
JQmedia 0.6.3
JQuery v14-1.2.1
Low-Cal Vanilla 0.4.3
Make It Simple Text Formatter 1.00
Members Page 1.2.1
Meta tags 0.1
ModTools 0.06.10b
New Applicants 1.3
Nuggets 1.1.5
Optimize Tables 0.4
Page Manager 2.5.3
Preview Post 2.5.2
Quick Whisper 1.0
Quote Depth 0.1.0
Sitemaps 0.1
Whisper Notification 0.1
Yellow Fade 0.1

Comments

  • Check out my notes in the make it simple text formatter of Jan 31 (s ee http://lussumo.com/addons/index.php?PostBackAction=AddOn&AddOnID=399 )
    A small change in the code will "trim" the visible part of URLs to a maximum length (I used 66).

    If you want just "click" if the link is longer than 66 chars use this:

    Look for (line 66?)
    $Word = '<a href="'.$Word.'" target="_blank" rel="nofollow">->link<-</a>';
    REPLACE this line with
    if( strlen($Word) > 66 ) { $Word = '[<a href="'.$Word.'" title="'.$Word.'" target="_blank" rel="nofollow">click</a>]'; } else { $Word = '<a href="'.$Word.'" title="'.$Word.'" target="_blank" rel="nofollow">'.$Word.'</a>'; }

    if you always want it to say "click" (even if the link could be displayed) use:

    Look for (line 66?)
    $Word = '<a href="'.$Word.'" target="_blank" rel="nofollow">->link<-</a>';
    REPLACE this line with
    $Word = '[<a href="'.$Word.'" title="'.$Word.'" target="_blank" rel="nofollow">click</a>]';
  • I used the second option there and it hasn't seemed to change anything. I'm thinking there might be another extension parsing links. Any ideas?
  • Perhaps turn off forced bb code and preview post, then try again (or turn off anything but make it simple formatter and then try)

    MISF requires links to start with http://, otherwise it will not recognize them.
Sign In or Register to comment.