I have a problem with long URLs in the commments and story texts (http://forums.pligg.com/general-help...ry-text.html): They end in the middle of the sidebar.
Is it possible to shorten their display like it is here in preview mode: some 20 characters and three dots ?
P.S.: If I would know how to code the story-id (Individual comment link) some of my problems would disappear. :-)
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| Shorten URLs |
| |||
|
Anyone interested?
|
| |||
|
Could this code be helpful apart from the missing dots at the end? <?php $text = preg_replace('@http://((\S{1,20})\S+)@','<a href="http://\\1" target="_blank">\\2</a>',$text); ?> |
| |||
|
I´ve found a wordpress plugin called shrinkylink (void *). Maybe it can be used with little adaption. |
| |||
|
Another solution would be wrapping. See on the browser side (FF): https://addons.mozilla.org/de/firefox/addon/2547 |
| ||||
|
Here is a function that will shorten text to a certain amount of characters PHP Code: Code: $sampleText = 'This is some sample text. This is some sample text' ShortenText(sampleText); Code: This is some sample ... BTW, I have lost my touch for PHP since I program in ASP.NET all day so it may not be perfect.
__________________ I accept donations for my time helping users like you on the forum and IRC. |
| |||
|
Thank you kbeeveer46, but I have no clue where to call that function. In text_to_html (auto-recognition of hyperlinks in story text) ? |
| |||
|
Anyone interested?
|
| ||||
| This will truncate the story titles. Still working on something for the comments. Click on the 'text changed' links to see the changes that need to be made.
__________________ - Ash |
| |||
|
Thank you, I guess you missed a '' at line 17 of sidebarstories.php. I not sure wheter I got you right: I have a problem with long URLs in the description of a story and in comments, respectively. This has also consequences to the sidebar display of those URL links. I´ve encountered another severe problem: Large comments lead to a size at comment management that pushes the check box for deletion under the sidebars, i.e. they´re without a function. Could you please fix that? Another question: Is revision 1237 related to this problem (http://forums.pligg.com/bug-report/7...sidebar.html)? |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Has anyone got Friendly Urls (Url Method 2) working? | revolver | General Help | 11 | 05-08-2008 12:32 AM |
| Suggestion: Friendlier urls for user page | revolver | General Help | 0 | 07-06-2007 12:44 PM |
| Friendly URL's for categories works, but for stories not | sixlaneve | General Help | 5 | 01-16-2007 12:20 AM |
| Problem with URLs linking to pages not found | frhs00 | Bug Report | 7 | 12-29-2006 05:35 PM |
| Simplified Friendly Urls idea | revolver | Suggestions | 0 | 11-07-2006 01:20 PM |




Linear Mode

