Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • ssinha Friend
    #200716

    Using Teline IV template on Joomla 2.5, when I have more than two images in an article, the JA News Featured always picks up the second picture for the module on the front page which is just like the one on your Teline IV demo page. I want it to pick up the first image that is before the readmore line and not the second one in the bottom. How can I change it so it picks up the first image in the article?

    Because of this problem, I am unable to put more than one image on any article.

    Thanks.

    ssinha Friend
    #547046

    Still waiting for a response.

    Saguaros Moderator
    #547263

    You can make a quick search on forum as there would be thread discussing the same question. Here is one of theme: http://www.joomlart.com/forums/topic/ja-news-featured-displays-the-2nd-image-instead-of-1st/#post-503301

    Kindly follow it.

    ssinha Friend
    #547921

    I did do a search before posting but failed to find this thread. Anyhow, I followed it and I am getting an error when I follow the suggestion. The poster in that thread did mention that there is an extra ‘(‘ in the code that is causing the parse error. I need to know which ‘(‘ to take out as I am not experienced in this area. Thanks for your help.

    ssinha Friend
    #547955

    Never mind. I finally figured it out. The correct code is:

    function parseImage($row)
    {
    //check to see if there is an intro image or fulltext image first
    $images = “”;
    if (isset($row->images)) {
    $images = json_decode($row->images);
    }
    if(isset($images->image_intro) and !empty($images->image_intro)){
    $image = (isset($images->image_intro) and !empty($images->image_intro))?$images->image_intro:””;
    }
    else {
    $regex = ‘/<img.+srcs*=s*”([^”]*)”[^>]*>/’;
    $text = ”;
    $text .= (isset($row->introtext))?$row->introtext:”;
    preg_match($regex, $text, $matches);
    $images = (count($matches)) ? $matches : array();
    $image = count($images) > 1 ? $images[1] : ”;
    }
    return $image;
    }

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

This topic contains 5 replies, has 2 voices, and was last updated by  ssinha 9 years, 7 months ago.

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