jacatslwi – how to make it display only the first image… and not the last ?
Forums Joomla Templates Club JA ZinC jacatslwi - how to make it display only the first image... and not the last ?
im glad you like it…. and what you say does make sense… it makes it alot more flexible.
dont forget to remove the $row line i said in the other post….
if you dont remove it, it starts to take text from the last image in the article… in my case this is nothing which is why it comes up as blanc. When you remove the line, it takes text from the beggining of the article… It starts with the first letter of the first line.
Miro
oh, and thanks for the thanks!
<em>@mitov 109896 wrote:</em><blockquote>ONE MORE THING YOU MUST DO… I HAVE JUST FOUND OUT!!!!!
After you do the above, it dosent display any text…. so you need to remove one more line from the helper.php file. Find the line:
$row->introtext = preg_replace( $regex1, ”, $row->introtext );
and remove it… don’t add anything else!
NOW WORKS LIKE A CHARM!</blockquote>
I didn’t remove this. Didn’t see your post until just now. I have text showing? Hmmm. Maybe I will leave this alone for now. No sense fixing it if it aint broke as they say.
Thanks again!
Ok paint me dumb…. I see what you are saying about that other line now. I had text… wrong text. Took the line out… fine now.
changing line 23 in helper.php (just add U behind the existing line) from
$regex = "/<img.+srcs*=s*"([^"]*)"[^>]*>/";
to
$regex = "/<img.+srcs*=s*"([^"]*)"[^>]*>/U";
sets the string to ungreedy. Now it should alway display the first article image.
This topic contains 19 replies, has 5 voices, and was last updated by cofra 15 years, 6 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum