Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • activha Friend
    #180344

    I am using JA social feed which is working nicely.

    However I need to use the items from the feeds in another part of my website.

    I use the code from html com_k2 ja_wall
    [PHP]$regex = ‘#(<img[^>]*>)#i’;
    if (preg_match ($regex, $item->introtext, $match)) {
    $image = $match[1];
    // get img src
    $regex = ‘#s+srcs*=s*([“‘])([^'”]+)1#i’;
    if (preg_match ($regex, $image, $match)) {
    $item->image = $match[2];
    }
    // get img caption
    $item->image_caption = ”;
    $regex = ‘#salts*=s*([“‘])([^'”]+)1#i’;
    if (preg_match ($regex, $image, $match)) {
    $item->image_caption = $match[2];
    }
    }[/PHP]
    in order to get the images which is working nicely when images are uploaded with k2, but which is failing when images come from JA social feed import.

    For an example of feeds : test feed
    For a use example : test user using second item of test feed

    Can someone help on this to have the images correctly extracted for JA social feeds ?

    I use the module mod_k2_content with the attached default template to show the items in the user page


    1. default.zip
    Sherlock Friend
    #465818

    Hi activha,

    <blockquote>I use the code from html com_k2 ja_wall
    PHP Code:
    $regex = ‘#(<img[^>]*>)#i’;
    if (preg_match ($regex, $item->introtext, $match)) {
    $image = $match[1];
    // get img src
    $regex = ‘#s+srcs*=s*([“‘])([^'”]+)1#i’;
    if (preg_match ($regex, $image, $match)) {
    $item->image = $match[2];
    }
    // get img caption
    $item->image_caption = ”;
    $regex = ‘#salts*=s*([“‘])([^'”]+)1#i’;
    if (preg_match ($regex, $image, $match)) {
    $item->image_caption = $match[2];
    }
    } </blockquote>

    Which part are you using the above code to get images ? Is it a module or a template layout ? You can pm me your url, the admin account as well as the FTP Info, also let me know which module or files.. where you put that code, I would need a directly checking into the code to detect the problem.

    activha Friend
    #465849

    PM sent with the informations

    Thanks

    Sherlock Friend
    #465881

    Hi activha,

    I took a look at the url http://wall.activ-ha.com/index.php?option=com_k2&view=itemlist&task=user&id=57:jean-claude-machuron&Itemid=652 but not sure which item is a JA social retrieved item , Do JA social retrieved items have images in the back-end and those images could not be shown in the front-end ?

    activha Friend
    #465930

    I have attached a screenshot with the three items coming from JA Social

    The src is linked to the item link instead of the item image which is why no image is displayed.

    Thanks


    1. screenshot
    activha Friend
    #465953

    It seems that I also have some problems while importing content from youtube
    See http://wall.activ-ha.com/index.php?option=com_k2&view=itemlist&layout=category&task=category&id=62&Itemid=866 and try to open an item, it is impossible to scroll down

    Could it be linked ?
    this is the latest version of JA social , it worked ok with the previous one

    activha Friend
    #465970

    I solved the problem of scrolling but it definitely seems that you have some problem with JA Social

    The items imported are correctly shown in front end but it is impossible to edit them, I get impossible to decode data, and when unsetting gzip I have lots of calendar error DateTime::__construct(): Failed to parse time string (30-11–0001 00:09:21) at position 0 (3): Unexpected character

    I guess that this may be part of my problem as img tags and src do not appear at all in introtext when trying to get the object via php.

    This is strange as it gets through K2 correctly though

    Definitely need helps here

    activha Friend
    #465971

    Well I feel stupid, solved the problem of images not showing :-[
    This was only the module that I used which stripped the introtext to a limit and removed tags !!

    But still have the problem of decoding data in the backend, still impossible to open and read K2 items retrieved by JA social in the backend

    Sherlock Friend
    #466049

    <blockquote>But still have the problem of decoding data in the backend, still impossible to open and read K2 items retrieved by JA social in the backend </blockquote>

    Which error message you received when editing a k2 item in the back-end ? Let me know a specific k2 item that I can check to see the problem occurring.

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

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

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