Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • activha Friend
    #183387

    Upgrading to 1.0.7 changed the size of intro text which is now way too important and not limited as in previous versions.

    Is there a new setting somewhere ?

    When my intro text is say 100 words, it was limited to 30 characters only in 1.0.6 and with 1.0.7 the whole 100 words are displayed

    Ninja Lead Moderator
    #477472

    I’m not sure what you are implying. Just for better clarification, please include screenshot and your site URL here for further investigation.

    activha Friend
    #478474

    Well try to go to http://activ-ha.com/économie to see the problems :

    – first introtext is not limited
    – a post is always loaded at each cron job ( numbers 11, 12, 13, 14 & 15 for these last hours, it will be repeated endly if I dont stop the plugin)

    Ninja Lead Moderator
    #478490

    Thanks for contacting to us. You can fix it with my suggestion:
    <blockquote>templates/ja_wall/template_tools.php</blockquote>
    find this script

    public static function extractFirstParagraph($text){
    static $regex = '#<p[^>]*>(.*)</p>#i';
    static $allowtag = '<a><b><strong><br>';

    $result = '';
    if (preg_match_all ($regex, $text, $matches)) {
    $p = array();
    $c = 0;

    foreach ($matches[1] as $match) {
    $t = trim(strip_tags ($match, $allowtag));
    if ($t) $p[] = $t;
    $c += strlen($t);
    if ($c > 50) break;
    }
    $t = implode ('<br/>', $p);

    $result = (strlen($t) > 7) ? $t : trim(strip_tags ($text, $allowtag));
    } else {
    $result = trim(strip_tags ($text, $allowtag));
    }

    return $result;
    }

    change to

    public static function extractFirstParagraph($title, $max=100)
    {
    if($title!=''){
    if(is_array($title)) list($string, $match_to) = $title;
    else { $string = $title; $match_to = $title{0}; }

    $match_start = stristr($string, $match_to);
    $match_compute = strlen($string) - strlen($match_start);

    if (strlen($string) > $max)
    {
    if ($match_compute < ($max - strlen($match_to)))
    {
    $pre_string = substr($string, 0, $max);
    $pos_end = strrpos($pre_string, " ");
    if($pos_end === false) $string = $pre_string."...";
    else $string = substr($pre_string, 0, $pos_end)."...";
    }
    else if ($match_compute > (strlen($string) - ($max - strlen($match_to))))
    {
    $pre_string = substr($string, (strlen($string) - ($max - strlen($match_to))));
    $pos_start = strpos($pre_string, " ");
    $string = "...".substr($pre_string, $pos_start);
    if($pos_start === false) $string = "...".$pre_string;
    else $string = "...".substr($pre_string, $pos_start);
    }
    else
    {
    $pre_string = substr($string, ($match_compute - round(($max / 3))), $max);
    $pos_start = strpos($pre_string, " "); $pos_end = strrpos($pre_string, " ");
    $string = "...".substr($pre_string, $pos_start, $pos_end)."...";
    if($pos_start === false && $pos_end === false) $string = "...".$pre_string."...";
    else $string = "...".substr($pre_string, $pos_start, $pos_end)."...";
    }

    $match_start = stristr($string, $match_to);
    $match_compute = strlen($string) - strlen($match_start);
    }

    return $string;
    }else{
    return $string ='';
    }
    }

    Let me know if it helps

    activha Friend
    #478538

    Well this code replaces completely the first one that we use on other areas of the website.

    Is this possible to combine both ? (For now I have deactivated introtext in the category activations)

    And do you have a suggestion for the repeated items retrieved by JA Social plugin on the same page

    Ninja Lead Moderator
    #478667

    I have checked on new version JA Wall Template, i see it apply this function extractFirstParagraph many time on customize template, see the screenshot

    You can apply this fixes with only home page on your site by:

    1) Download and extract this my attachment file, copy it to this path
    <blockquote>templates/ja_wall/template_tools.php</blockquote>
    2) <blockquote>Open templates/ja_wall/html/com_content/featured/default_item.php file</blockquote>
    find

    $introtext = WallHelper::extractFirstParagraph($this->item->introtext);
    change to

    $introtext = WallHelper::DropText($this->item->introtext);


    1. Cut_String
    1. template_tools.zip
    activha Friend
    #478714

    Thanks I’ll do it this way !

    Could you help us solve the second problem i.e. the repeated item always retrieved by JA Social ?
    It always retrieve one item each cron job and I cannot figure why ?
    See http://activ-ha.com/économie

    Ninja Lead Moderator
    #478858

    About the problem of duplicate item when JA Social Feed get data from social networks you can upgrade the plugin to latest version : http://www.joomlart.com/forums/downloads.php?do=cat&id=20440

    Let me know if it helps

    activha Friend
    #478889

    No this is already the latest version 1.0.7 this is why I am asking your help on this

    Ninja Lead Moderator
    #479048

    <em>@activha 354045 wrote:</em><blockquote>No this is already the latest version 1.0.7 this is why I am asking your help on this</blockquote>
    I would need to take a closer look at your site. Please pm me with admin access and ftp account. I shall check it

    activha Friend
    #479252

    I sent PM yesterday, did you have time to have a look ?

    Ninja Lead Moderator
    #479353

    <em>@activha 354511 wrote:</em><blockquote>I sent PM yesterday, did you have time to have a look ?</blockquote>
    I have received your pm but I need to check the source code on your site. Please pm me ftp account on your site. I shall check it

    activha Friend
    #479806

    I cannot PM ftp account as we use AWS with ssh only.

    but on the website you have access to extplorer for the source code.

    Can you help me on this ?

    Duplicates items are really frustrating.

    By the way, I still have problem with the introtext code. Droptext function does not work very well for all introtext and I cannot use one or the other function, we need both on a page.
    Unless we found a way to put some ja social retrieved introtext in full text only ?

    Ninja Lead Moderator
    #479823

    I have tried to access com_extplorer component on your site but no success, see the screenshot.

    I can not help you more as i do not have access on your site.


    1. Source
    activha Friend
    #480053

    Well I just tried now with chrome and safari and had no problem with Extplorer to browse files and folder on my macbook air !

    Could you try with another browser maybe ?

Viewing 15 posts - 1 through 15 (of 20 total)

This topic contains 20 replies, has 2 voices, and was last updated by  Ninja Lead 11 years, 10 months ago.

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