Shorten the Lenght of text in featured listings...

Discussion in 'Customizations' started by rockabilly, Nov 12, 2010.

  1. rockabilly Customer

    I am using 4.2.1 Developer with the deepsea template.

    I was searching in the forum for a way to shorten the length of the text in the featured listings.
    I found a way to do this back in 2007, so I gave it a try, but this code is not up to date.
    It does work, however it puts a �
    after the text, and the listings do not refresh and rotate.
    I replaced $output.=$loop[$x][title] ."<br />";
    in the function.feature_listings_horizontal.php file, as it describes below.
    Can anyone help me so it works with 4.2.1 Developer?

    Thanks....



    Replace:

    $output.=$loop[$x][title] ."<br />";

    With:

    $limit = '25'; // Set to your preference
    $textin = $loop[$x][title];
    if(strlen($textin)>$limit){
    $textin = substr($textin,0,$limit);
    $textout = substr($textin,0,-(strlen(strrchr($textin,' '))) )."…";}
    else{$textout = $textin;}
    $output.=$textout ."<br />";


    This shortens the string to whatever you specify as the limit, drops any word fragment, and ads the ellipsis (…)


    original thread: http://www.68classifieds.com/forums/v3-1-questions-support/2475-text-too-long.html

Share This Page