test
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • edroga Friend
    #179889

    Hi, how do I change the slideshow and sidenews for a certain amount of words selected? Now you can set the number of characters. How do I change it? Which files are responsible for this and what the script. Is anyone able to write this?

    MoonSailor Friend
    #464156

    Hi edroga,

    If you need to change maximum characters to maximum words, you will need to hack code of modules. I am sorry wont be able to help you with this customization but can give you the file name where you can try it out :

    You can go to module folder -> helpers/helper.php and rewrite function cut string.

    edroga Friend
    #464959

    Unfortunately, I can not do that. : (
    I once did something similar in jateline II under the relevant functions. But here I have no idea how to change it. Does anybody can help me?

    [PHP]/*Separate word*/
    function separate_word($str, $numberofwords) {
    $array = explode(” “, $str);
    $sizeofstr = sizeof($array);

    if ($numberofwords > $sizeofstr) {
    return $str;
    }

    $strReturn = ”;
    for($i = 0; $i < $numberofwords; $i++ ) {
    $strReturn .= ‘ ‘ . $array[$i];
    }

    }[/PHP]
    [PHP]/*Count words*/
    $number_of_word = explode(” “, $row->introtext);
    $sizeofword = sizeof($number_of_word);

    if ($maxchars && $sizeofword > $maxchars) {
    $doc = JDocument::getInstance ();
    if (function_exists(‘mb_substr’)) {
    $row->introtext1 = SmartTrim::separate_word($row->introtext, $maxchars);
    } else {
    $row->introtext1 = SmartTrim::separate_word($row->introtext, $maxchars);
    }
    }[/PHP]

Viewing 3 posts - 1 through 3 (of 3 total)

This topic contains 3 replies, has 2 voices, and was last updated by  edroga 12 years, 3 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum