-
AuthorPosts
-
activha Friend
activha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
August 29, 2012 at 10:00 pm #180344I 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
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
August 30, 2012 at 7:56 am #465818Hi 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 Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
August 30, 2012 at 1:37 pm #465849PM sent with the informations
Thanks
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
August 31, 2012 at 2:15 am #465881Hi 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 Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
August 31, 2012 at 11:21 am #465930I 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
activha Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
August 31, 2012 at 8:29 pm #465953It 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 downCould it be linked ?
this is the latest version of JA social , it worked ok with the previous oneactivha Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
September 1, 2012 at 6:53 pm #465970I 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 Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
September 1, 2012 at 7:53 pm #465971Well 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 FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
September 4, 2012 at 3:58 am #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.
AuthorPostsViewing 9 posts - 1 through 9 (of 9 total)This topic contains 9 replies, has 2 voices, and was last updated by Sherlock 12 years, 2 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Retrieving images from JA social feed ?
Viewing 9 posts - 1 through 9 (of 9 total)