test
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • dieudonne Friend
    #176674

    Hello,

    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


    1. 2012-05-02_21h36_01
    Saguaros Moderator
    #451172

    Hi 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.

    dieudonne Friend
    #451238

    Hello,

    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 Moderator
    #451269

    Could 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 Friend
    #451462

    Thank.
    I just send you a PM with all the infos.

    dieudonne Friend
    #451637

    Ok, 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 Friend
    #451792

    Ok,

    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>


    1. jaimage.rar
    Saguaros Moderator
    #451794

    You’re welcome :p

    dieudonne Friend
    #451976

    Hello,

    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 Phung

    we 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 510

    dieudonne Friend
    #451980

    Ok, thank to Saguaros :

    <blockquote>you should also replace ‘jaimage.php’ file in JA News Featured module. Please try with attached file.</blockquote>

    Thank.


    1. jaimage.rar
Viewing 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