-
AuthorPosts
-
dieudonne Friend
dieudonne
- Join date:
- January 2011
- Posts:
- 947
- Downloads:
- 61
- Uploads:
- 266
- Thanks:
- 452
- Thanked:
- 107 times in 3 posts
May 2, 2012 at 7:36 pm #176674Hello,
when JA Featured New is activated (on home page), we have the following error :
Warning: preg_match() expects parameter 2 to be string, object given in /homez.92/eapnwsxr/www/j254/modules/mod_janews_featured/helpers/jaimage.php on line 383
Code from the custom HTML Module :
{jatabs type="modules" animType="animNone" style="teline_iii" position="top" widthTabs="auto" heightTabs="auto" width="auto" height="auto" mouseType="click" duration="1000" colors="10" module="ja-tabs" }{/jatabs}
So what can we do to fix this ??
Thank in advance.
PHP Version : 5.3.10
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
May 3, 2012 at 3:19 am #451172Hi dieudonne,
Maybe you use the old version of JA News Featured module, please open above file
/homez.92/eapnwsxr/www/j254/modules/mod_janews_featured/helpers/jaimage.php
and scroll down to end of this file, there should be function:
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_fulltext) and !empty($images->image_fulltext)) || (isset($images->image_intro) and !empty($images->image_intro))){
$image = (isset($images->image_fulltext) and !empty($images->image_fulltext))?$images->image_fulltext:((isset($images->image_intro) and !empty($images->image_intro))?$images->image_intro:"");
}
else {
$regex = '/<img.+srcs*=s*"([^"]*)"[^>]*>/';
$text = '';
$text .= (isset($row->fulltext))?$row->fulltext:'';
$text .= (isset($row->introtext))?$row->introtext:'';
preg_match($regex, $text, $matches);
$images = (count($matches)) ? $matches : array();
$image = count($images) > 1 ? $images[1] : '';
}
return $image;
}
Make a comparison with the current file and make your change.
Regards.1 user says Thank You to Saguaros for this useful post
dieudonne Frienddieudonne
- Join date:
- January 2011
- Posts:
- 947
- Downloads:
- 61
- Uploads:
- 266
- Thanks:
- 452
- Thanked:
- 107 times in 3 posts
May 3, 2012 at 10:34 am #451238Hello,
I don’t understand. I use the very latest version of all components. In this case (for JA News Featured) the version is 2.5.0.
So I open the jaimage.php, and I don’t find any “function parseImage($row)…”
There is only “function parseImage($text)…”Do I add it (and delete the “function parseImage($text)…”) ?
– – – – – – – – – – –
Update: I modified the file jaimage.php.
First I added the code “function parseImage($row)…”. No change
Second I delete the code “function parseImage($text)…”, and of course don’t delete the “function parseImage($row)…”. No change at all. (all caches is cleared)But the error code change to (mod ja news pro)
Warning: preg_match() expects parameter 2 to be string, object given in /homez.92/eapnwsxr/www/j254/modules/mod_janewspro/helpers/jaimage.php on line 382
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
May 3, 2012 at 2:38 pm #451269Could you pm me FTP account of site you’re working on? I’ll check this for you.
Please add this thread’s url into the message.
Thanks.
dieudonne Frienddieudonne
- Join date:
- January 2011
- Posts:
- 947
- Downloads:
- 61
- Uploads:
- 266
- Thanks:
- 452
- Thanked:
- 107 times in 3 posts
May 4, 2012 at 7:26 pm #451462Thank.
I just send you a PM with all the infos.dieudonne Frienddieudonne
- Join date:
- January 2011
- Posts:
- 947
- Downloads:
- 61
- Uploads:
- 266
- Thanks:
- 452
- Thanked:
- 107 times in 3 posts
May 5, 2012 at 7:54 pm #451637Ok, so now, it is serious.
I made a lot of test with all extensions up-to-date, and we have the following error, every time (in a local website too)
Warning: preg_match() expects parameter 2 to be string, object given in E:xampp-173xampphtdocsjat3modulesmod_janewsprohelpersjaimage.php on line 382
What can we do to fix this ??
dieudonne Frienddieudonne
- Join date:
- January 2011
- Posts:
- 947
- Downloads:
- 61
- Uploads:
- 266
- Thanks:
- 452
- Thanked:
- 107 times in 3 posts
May 7, 2012 at 8:10 am #451792Ok,
a big thank to Saguaros H for the solution :
<blockquote>Please try with attached file and let me know what happens.
It should be located in : modulesmod_janewsprohelpers</blockquote>
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
dieudonne Frienddieudonne
- Join date:
- January 2011
- Posts:
- 947
- Downloads:
- 61
- Uploads:
- 266
- Thanks:
- 452
- Thanked:
- 107 times in 3 posts
May 8, 2012 at 8:25 am #451976Hello,
but problem.
It is not working if there is any “ja news pro” modules on the home page.
We have the following error :Warning: preg_match() expects parameter 2 to be string, object given in /homez.92/eapnwsxr/www/j254/modules/mod_janews_featured/helpers/jaimage.php on line 383
Now it’s come from jaimage.php (in ja news featured)
So what can we do to fix this ?
Thank in advance for any help.
@hung Phungwe try to change the file modulesmod_janewsprohelpersjaimage.php file
delete :
[PHP] preg_match($regex, $text, $matches);
$images = (count($matches)) ? $matches : array();
$image = count($images) > 1 ? $images[1] : ”;[/PHP]and place this in place
[PHP]if(strtolen($text)>3){
preg_match($regex, $text, $matches);
$images = (count($matches)) ? $matches : array();
$image = count($images) > 1 ? $images[1] : ”;
}else{ $image = ”; }[/PHP]but we have a fatal error :
Fatal error: Call to undefined function strtolen() in /homez.92/eapnwsxr/www/j254/modules/mod_janews_featured/helpers/jaimage.php on line 510dieudonne Frienddieudonne
- Join date:
- January 2011
- Posts:
- 947
- Downloads:
- 61
- Uploads:
- 266
- Thanks:
- 452
- Thanked:
- 107 times in 3 posts
May 8, 2012 at 8:35 am #451980Ok, thank to Saguaros :
<blockquote>you should also replace ‘jaimage.php’ file in JA News Featured module. Please try with attached file.</blockquote>
Thank.
AuthorPostsViewing 10 posts - 1 through 10 (of 10 total)This topic contains 10 replies, has 2 voices, and was last updated by dieudonne 12 years, 6 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Problem JaTabs when Ja New Featured actived : Warning: preg_match() expects parameter
Viewing 10 posts - 1 through 10 (of 10 total)