Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Blog post linking does not show images
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Nov 4, 2012 - 10:32 am

sorry, have lost the bubble here while gone...  so let me understand one thing...

first, talking about inserting posts into image and NOT the featured image, right?

second, what is the img source url in the wp post after inserting the image into the post using the wp media loader?  and what is the image its trying to load after the wp post is saved?  they should be identical or something is changing it...

can you take the image url when you edit the post and paste it into the url of your browser and load it?  asking if the direct url to image will load... might not be web accessible...

Avatar
Petra
Member
Free Members
sp_UserOfflineSmall Offline
Nov 4, 2012 - 1:12 pm

No problem :)

There is nothing wrong with the URL. When I post in WP it shows the picture. Then in the post I set the option to put the post in the forum. When looking at the post in the forum it doesn't show the image, but a message "Image can not be found" In Chrome it shows the URL that it's reffering to (not to be found). If you follow the link (message) you get the image. If the post is edited and saved, without any changes made, the image shows up.

As said I tried turning off all the plugins (WP and SP) without any change. There is also an other problem at this moment. Maybe it's confusing to this disscussion maybe it's related so....
In the page of the forum at the bottom it should show the number of groups, members etc. The text is there but it doesn't show the info. I thought I maybe forgot to turn something on, but when I was browsing through the error log in the toolbox it's shows a whole bunch of error messages.

One of the errors: f
ile: /simple-press/forum/content/sp-common-view-functions.php
line: 2090
function: sp_ForumStats
Notice | Trying to get property of non-object

If there is no relation, then it's something for another time. One problem at a time :) .

Avatar
Brandon
U.S.
SP Wrangler
Free Members
sp_UserOfflineSmall Offline
Nov 4, 2012 - 1:46 pm

Mr Papa said
sorry, have lost the bubble here while gone...  so let me understand one thing...

Had 2 different people with similar problems. I split out the topic so easier to understand.

@Petra use this topic.

@Massimo  Please use this for your issue.

https://simple-press.com/suppo.....n-sp-post/

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 4, 2012 - 2:10 pm

We need to see these. Can you please make a linked blog post as you usually do - with an image. Then let me have the url to the unedited blog post and the url to the unedited forum post it created. It is the only way I can start to make any sense of this thread...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Petra
Member
Free Members
sp_UserOfflineSmall Offline
Nov 4, 2012 - 2:26 pm

Blog post:

http://www.capelle-fotografeer.....hives/1873

 

Forum post:

http://www.capelle-fotografeer...../test-foto

 

When you look at the link it shows the exact URL where the image is. So when you click on the message the systems goes to the correct image.

If you need anything else it might take a little while before you hear from me. I'm from the Netherlands and it's already late in the evening here :)

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 4, 2012 - 2:41 pm

Yes- it would now be useful to know what the forum post content is in the database itself. Is that going to be possible?

Table 'sfposts' - column 'post-content' - well one of the last posts in the table...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Petra
Member
Free Members
sp_UserOfflineSmall Offline
Nov 4, 2012 - 2:49 pm

<a href="http://www.capelle-fotografeert.nl/?attachment_id=1855" rel="attachment wp-att-1855"><img class="alignnone size-large wp-image-1855" src="http://www.capelle-fotografeert.nl/wp-content/uploads/2012/11/IMG_0052-800x600.jpg" alt="" width="800" height="600" /></a>

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 4, 2012 - 3:06 pm

That's a different post but that should be OK as long as it has not been edited since it's creation.

Would you be able and willing to make a small code edit to a core file so that we can dump some data to the screen,. This can be immediately reverted of course.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Petra
Member
Free Members
sp_UserOfflineSmall Offline
Nov 4, 2012 - 3:13 pm

<a href="http://www.capelle-fotografeert.nl/wp-content/uploads/2012/11/IMG_0052.jpg"><img class="alignnone size-large wp-image-1855" src="http://www.capelle-fotografeert.nl/wp-content/uploads/2012/11/IMG_0052-800x600.jpg" alt="" width="800" height="600" /></a>

This one is of the post we were talking about, sorry, took the last one, didn't think or look :( .

 

As long as you talk me through it, I don't think that has to be a problem. I'll start making a copy of the file I have to edit :) .

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 4, 2012 - 3:25 pm

Ok - sounds good. The file in question is simple-press/sp-api/sp-api-filters.php.

This is a big file I am afraid but the function we need is called sp_format_display_image($match) and is over half way down - starting around line 1170.

The portion of code to look for is:

# see if we can determine if the image still exists before going further. So is it relative?
if (substr($src[1], 0, 7) == 'http://') {
    $response = wp_remote_get($src[1]);
    if (is_wp_error($response) || wp_remote_retrieve_response_code($response) != 200) {
        return '['.sp_text('Image Can Not Be Found').']';
    }
}

What I would like to do is comment out that return statement and temporarily replace it with the following:

# see if we can determine if the image still exists before going further. So is it relative?
if (substr($src[1], 0, 7) == 'http://') {
    $response = wp_remote_get($src[1]);
    if (is_wp_error($response) || wp_remote_retrieve_response_code($response) != 200) {
//        return '['.sp_text('Image Can Not Be Found').']';
        return wp_remote_retrieve_response_code($response);
    }
}

This will (a) have the effect of pin-pointing where the problem lay and (b) showing us what the status is that WP is reporting back to us. The response code should show up in the post when the page is re-loaded

Hopefully this will shed some light on the issue. If the response code is 200 then I will probably have to ask you to make a further edit I am afraid but at least we will have discounted the first and obvious possibility.

Please remember to use a plain text editor and not a word processor for this!

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 639
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 616
Members: 17343
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10116
Posts: 79582