-
AuthorPosts
-
ssinha Friend
ssinha
- Join date:
- July 2014
- Posts:
- 183
- Downloads:
- 57
- Uploads:
- 11
- Thanks:
- 68
- Thanked:
- 12 times in 1 posts
August 22, 2014 at 1:04 am #200716Using 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 Friendssinha
- Join date:
- July 2014
- Posts:
- 183
- Downloads:
- 57
- Uploads:
- 11
- Thanks:
- 68
- Thanked:
- 12 times in 1 posts
August 24, 2014 at 3:05 pm #547046Still waiting for a response.
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
August 26, 2014 at 7:15 am #547263You 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 Friendssinha
- Join date:
- July 2014
- Posts:
- 183
- Downloads:
- 57
- Uploads:
- 11
- Thanks:
- 68
- Thanked:
- 12 times in 1 posts
September 1, 2014 at 9:28 pm #547921I 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 Friendssinha
- Join date:
- July 2014
- Posts:
- 183
- Downloads:
- 57
- Uploads:
- 11
- Thanks:
- 68
- Thanked:
- 12 times in 1 posts
September 2, 2014 at 1:09 pm #547955Never 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;
}1 user says Thank You to ssinha for this useful post
-
AuthorPosts
This topic contains 5 replies, has 2 voices, and was last updated by ssinha 10 years, 2 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum