Use another variable for "short" URL, let's say $DSU.



 // This is for "long" URL

  $str=ereg_replace('\$DU', $nolangurl, $str);
     } else

         $str=ereg_replace('\$DU', $url, $str);

 // This is for "short"

 $str=ereg_replace('\$DSU', substr($nolangurl,0,50), $str);
     } else
         $str=ereg_replace('\$DSU', substr($url,0,50), $str);





Matt Juszczak wrote:
> 
> but wont that ALSO change the actual link URL too?
> 
> Example:
> 
> a href='http://www.yahoo.com'>http://www.yahoo.com</a
> 
> If I changed that
> woudln't it make it
> 
> a href='http://www.yaho....'>http://www.yaho....'</a
> 
> I still want the LINK to be the correct URL, I just dont want the whole
> think printed to the screen.
> Thanks!
> 
> -Matt
> ----- Original Message -----
> From: Den <[EMAIL PROTECTED]>
> To: Matt Juszczak <[EMAIL PROTECTED]>
> Sent: Tuesday, August 28, 2001 6:32 AM
> Subject: Re[2]: Webboard: Limiting length of URL
> 
> > Hello Matt,
> >
> > Tuesday, August 28, 2001, 1:15:18 PM, you wrote:
> >
> > MJ> I use the PHP front end....and I know PHP...but I assume there is no
> way
> > MJ> of including PHP code in the search.htm (template) to do some kind of
> > MJ> substr() function to cut the length short?
> >
> > This is $DU var in search.htm
> > so... seek $DU in template.inc
> > Found!
> > next change 3 lines from:
> >
> > $str=ereg_replace('\$DU', $nolangurl, $str);
> >     } else
> 
> >         $str=ereg_replace('\$DU', $url, $str);
> >
> > to:
> >
> > $str=ereg_replace('\$DU', substr($nolangurl,0,50), $str);
> >     } else
> 
> >         $str=ereg_replace('\$DU', substr($url,0,50), $str);
> >
> > that's all!
> >
> > MJ> -Matt
> >
> > MJ> On 28 Aug 2001, Alexander Barkov wrote:
> >
> > >> Author: Alexander Barkov
> > >> Email: [EMAIL PROTECTED]
> > >> Message:
> > >> > Hello.
> > >> >
> > >> > I was just wondering if ther was a way with mnogosearch to limit the
> length of a URL.  In other words, right now a standard listing would print
> the following to the screen:
> > >> >
> > >> > 1. Mydomain.com - /Music/Crash Test Dummies/Wallpapers
> > >> >
> http://www.mydomain.com/index.php?dir=%2FMusic%2FCrash+Test+Dummies%2FWallpa
> pers
> > >> >
> > >> > As you can see, those URL's get mighty long...and a LOT of them are
> longer...and they've been pushing off the side of the screen and creating a
> scroll bar...and I dont want to do that.  Is there
> > >> anyway to say &quot;Only print the first 100 characters&quot; of the
> URL?  So a listing might look like....
> > >> >
> > >> > 1.  mydomain.com - contact page
> > >> >     http://www.mydomain.com/50_more_characters_or_so....
> > >> >     Mon, 27 Aug 2001 05:53:51 EDT, 27456 bytes
> > >> >
> > >>
> > >> Currently it is not possible. However it is nice feature for TODO.
> > >> I think we'll implement it in 3.2.0 final release.
> > >>
> > >> BTW, Which frontend do you use? PHP, Perl or search.cgi?
> > >>
___________________________________________
If you want to unsubscribe send "unsubscribe general"
to [EMAIL PROTECTED]

Reply via email to