Topic: Update XML files & missing first image

Hi

I am having similar problems.
http://www.perceptionav.com/?p=595  here is a single post on the site I am developing.  I have a separate simpleviewer gallery embedded on each post in this wordpress site. 

my problem as it currently stands:

broken links and thumbnails:

  • I have to go through EACH post, "update" each one for the thumbnails to appear, and THEN go back through each and every XML file to correct the improper automatically generated links. 

  • after I do so, the first picture in the gallery doesn't automatically appear. as illustrated by teh above link.

Is there a way to "auto-update" all of the wordpress pages so the thumbnails appear? 

Heres what I've been trying to do:

Upon moving the site from local mamp development to the server, all links were broken. 

I "updated" the page and the thumbnails would work, but no main picture. 

Next I found the xml files and did find and replace on all entries that were incorrect.  For some reason, the software was creating links where it would be "perceptionav.comwp-content/"  So  i did a find and replace to correct that.  I don't know why the automatic link didn't have a / .  I also changed all localhost:8888 to the actual site url.

Every time I "update" the post in wordpress or install a new instance of simpleviewer, it is automatically generating broken links.

Would anyone have any insight on how I could fix this easily? 

Thank you
Eric

Last edited by edrasin (2012-08-23 03:54:17)

Re: Update XML files & missing first image

my problem as it currently stands:

broken links and thumbnails:

This is caused by WP-SimpleViewer creating a static XML file for each gallery which contains correct and working links at the time of gallery creation (but whose links will become broken if the WordPress installation is moved).

I have to go through EACH post, "update" each one for the thumbnails to appear, and THEN go back through each and every XML file to correct the improper automatically generated links.

This should not be the case. Updating a post containing a gallery should rebuild the gallery's XML file, including both the thumbURLs and imageURLs (not just the thumbURLs).

Is there a way to "auto-update" all of the wordpress pages so the thumbnails appear?

Not at present but we are currently considering a switch to using a dynamically generated XML file which would create an XML file on-the-fly at the time of the gallery being viewed rather than created. This should avoid the problem of having to rebuild XML files completely.

I don't know why the automatic link didn't have a / .

Both the thumbURLs and imageURLs in the XML file should be absolute (and start with 'http://'). There should be no circumstances where the plugin uses a leading slash to denote the root directory.

after I do so, the first picture in the gallery doesn't automatically appear. as illustrated by teh above link.

I am not sure what is causing this but I notice that you are using WP-SimpleViewer v2.1.2.
Please try upgrading the plugin to the current version v2.3.1: http://www.simpleviewer.net/simpleviewe … pleviewer/
There have been many changes to both the plugin: http://www.simpleviewer.net/simpleviewe … r/#history
... and SimpleViewer itself: http://www.simpleviewer.net/simpleviewer/history.html
... and you may find that one or both of your problems are solved by this update.

Steven Speirs
SimpleViewer Support Team.

Re: Update XML files & missing first image

ok I updated wordpress and the plugin and am still having the same issues: 

I updated the post and still wasn't working. 

I deleted the old gallery and added a new simpleviewer gallery on this post:  http://www.perceptionav.com/?p=505

here is an example of how there is code being generated in the xml file of the new post. 

<image imageURL="http://perceptionav.comwp-content/uploads/2012/04/Colbert-Report-3.jpg" thumbURL="http://www.perceptionav.com/wp-content/uploads/2012/04/Colbert-Report-3-150x99.jpg" linkURL="http://perceptionav.comwp-content/uploads/2012/04/Colbert-Report-3.jpg" linkTarget="_blank">

what am I doing wrong?

when i go in and correct the xml file the picture still doesn't show up.

Last edited by edrasin (2012-08-23 22:34:56)

Re: Update XML files & missing first image

Thank you for the code snippet. I understand better about the missing slash now.
When using the Media Library as a source of image, the imageURL and linkURL are constructed purely by built-in WordPress functions.
Check all the user-changeable paths in your 'Dashboard -> Settings' section to see if there is perhaps an entry which looks like 'http://perceptionav.com' to which you could add a trailing slash.

Steven Speirs
SimpleViewer Support Team.

Re: Update XML files & missing first image

Here's an alternative method for WordPress to fetch the URL of the image attachment.
Open up the 'wp-simpleviewer.php' file in a plain text editor and scroll down to line 630.
Immediately below the line:

$image = wp_get_attachment_image_src($attachment->ID);

... insert the following code:

$full = wp_get_attachment_image_src($attachment->ID, 'full');

Now, replace both instances of $attachment->guid (on lines 633 and 635) with $full[0].
Re-upload the file to its original location and update your post to see if this makes a difference.

Steven Speirs
SimpleViewer Support Team.

Re: Update XML files & missing first image

Steven Speirs wrote:

Thank you for the code snippet. I understand better about the missing slash now.
When using the Media Library as a source of image, the imageURL and linkURL are constructed purely by built-in WordPress functions.
Check all the user-changeable paths in your 'Dashboard -> Settings' section to see if there is perhaps an entry which looks like 'http://perceptionav.com' to which you could add a trailing slash.

it appears that when attempting to add a / to the main site url in teh settings section, wordpress automatically removes it.

Re: Update XML files & missing first image

ok i added your code in and now when I add a new instance of the gallery to each post, the pictures and thumbnails display as they should. 

I have to delete the shortcode for simpleviewer, update the post, and then insert a brand new instance of simpleviewer and update again. 

now I just need to go through all 100 pages and make new galleries!   anyhow, cheers and thanks for all the fish!

Re: Update XML files & missing first image

it appears that when attempting to add a / to the main site url in teh settings section, wordpress automatically removes it.

Neither my own 'WordPress Address (URL)' nor 'Site Address (URL)' (in the 'Dashboard -> Setttings -> General' section) have trailing slashes and yet WP-SimpleViewer v2.3.1 constructs the imageURLs and linkURLs correctly without having to modify any code in my own WordPress installation (v3.4.1).

ok i added your code in and now when I add a new instance of the gallery to each post, the pictures and thumbnails display as they should.

Thank you for reporting. It looks like this method of constructing the URL is more robust than the other (it works on my installation, too) so I will ensure that this is used in future versions of the plugin.

I have to delete the shortcode for simpleviewer, update the post, and then insert a brand new instance of simpleviewer and update again.

With the modification in place, just updating the post (or editing the gallery) should now work (without having to remove and re-enter the gallery shortcode).

Steven Speirs
SimpleViewer Support Team.