nz_mitch Posted May 6, 2009 Share Posted May 6, 2009 Hi there, We're using SlideShowPro Director and the SSPD Connector for WordPress to pull galleries from Director into WordPress pages using the SSPD API. Anyhow, everything's working really well except the solution we came up with does not seem to have scaled well. The code we're using is the following (it's hooked into the WordPress template): $slideshow = get_post_meta($post->ID, 'slideshow', TRUE); $xml = simplexml_load_file("http://domain.com/wp-content/plugins/slidepress/tools/param.php?gid=$slideshow"); $url = $xml->nativeParams->attributes()->xmlFilePath; $id = ereg_replace('[^0-9]',"",$url); sspdc_photostrip($id,20); Essentially what the code does is it grabs the slideshow ID from a custom field in WordPress, then uses it to fetch the XML configuration file created by SlidePress (this file contains a number of variables, one of which is the ID for the Slideshow in SlideShowPro Director). The variable $url fetches the full URL to the slideshow in director (it too is an XML file). Next, with $id I'm using ereg_replace to strip everything from the URL except for the digits which make up the ID number which is required for the final function to call the gallery. Finally, the function sspdc_photostrip($id,20); builds the gallery, using $id to fetch the right gallery. If I comment out $slideshow, $xml $url and $id and insert the gallery number manually, the gallery builds super fast. If I just call $slideshow and parse that through the function, the gallery obvious does not load as the ID isn't recognised—but everything happens quickly, suggesting that the WordPress part is fine. Essentially, it looks like the issue is in the loading and parsing of the XML file (commenting out $id doesn't seem to make a difference). Can anyone recommend a more efficient way of doing this? As usual I'm at a bit of a loss—any help would be hugely appreciated. If there's any other information that might help, please let me know! Thanks in advance! Quote Link to comment Share on other sites More sharing options...
nz_mitch Posted May 6, 2009 Author Share Posted May 6, 2009 I've been trying to figure out if there's a more efficient method to get the data out of the XML file (as I'm guessing that's where the slow down is) but haven't been able to make anything work. For reference, here's the XML file: − <params> <customParams sspWidth="635" sspHeight="428" navButtonStyle="Default"/> <nativeParams albumBackgroundAlpha="0" albumBackgroundColor="0x262626" albumDescColor="0xCCCCCC" albumDescSize="9" albumPadding="8" albumPreviewScale="Crop to Fit" albumPreviewSize="54,40" albumPreviewStrokeColor="0xFFFFFF" albumPreviewStrokeWeight="0" albumPreviewStyle="Inline Left" albumRolloverColor="0x262626" albumStrokeAppearance="Hidden" albumStrokeColor="0x141414" albumTextAlignment="Center" albumTitleColor="0xFFFFFF" albumTitleSize="10" audioAutoStart="Off" audioLoop="Off" audioPause="Off" audioVolume=".8" autoFinishMode="Switch" cacheContent="None" captionAppearance="Overlay Auto (If Available)" captionBackgroundAlpha=".75" captionBackgroundColor="0x000000" captionElements="Header and Caption" captionHeaderBackgroundAlpha=".8" captionPadding="5,5,5,5" captionPosition="Top" captionTextAlignment="Left" captionTextColor="0xEEEEEE" captionTextSize="9" contentAlign="Center" contentAreaAction="Launch Hyperlink" contentAreaBackgroundAlpha="0" contentAreaBackgroundColor="0x171622" contentAreaInteractivity="Action Area Only" contentAreaStrokeAppearance="Hidden" contentAreaStrokeColor="0x262626" contentFrameAlpha="1" contentFrameColor="0x262626" contentFramePadding="0" contentFrameStrokeAppearance="Hidden" contentFrameStrokeColor="0x333333" contentOrder="Sequential" contentScale="Crop to Fit All" contentScalePercent="1" directorLargePublishing="On" directorLargeQuality="80" directorLargeSharpening="1" directorThumbQuality="60" directorThumbSharpening="1" displayMode="Auto" feedbackBackgroundAlpha=".4" feedbackBackgroundColor="0x000000" feedbackHighlightAlpha=".8" feedbackHighlightColor="0xFFFFFF" feedbackPreloaderAlign="Center" feedbackPreloaderAppearance="Pie" feedbackPreloaderPosition="Inside Content Area" feedbackPreloaderTextSize="12" feedbackScale="1" feedbackTimerAlign="Top Right" feedbackTimerAppearance="Visible" feedbackTimerPosition="Inside Content Area" fullScreenReformat="On" fullScreenTakeOver="On" galleryAppearance="Visible" galleryBackgroundAlpha="0" galleryBackgroundColor="0x1c1c1c" galleryColumns="2" galleryOrder="Left to Right" galleryPadding="10" galleryRows="4" galleryNavActiveColor="0x303030" galleryNavAppearance="Hidden" galleryNavInactiveColor="0x000000" galleryNavRolloverColor="0x262626" galleryNavStrokeAppearance="Hidden" galleryNavStrokeColor="0x141414" galleryNavTextColor="0xCCCCCC" galleryNavTextSize="9" keyboardControl="On" mediaPlayerAppearance="Hidden" mediaPlayerBackgroundAlpha=".25" mediaPlayerBackgroundColor="0x000000" mediaPlayerBufferColor="0x000000" mediaPlayerControlColor="0xFFFFFF" mediaPlayerElapsedBackgroundColor="0xFFFFFF" mediaPlayerElapsedTextColor="0x000000" mediaPlayerPosition="Bottom" mediaPlayerProgressColor="0xCCCCCC" mediaPlayerScale=".8" mediaPlayerTextColor="0xEEEEEE" mediaPlayerTextSize="9" mediaPlayerVolumeBackgroundColor="0x000000" mediaPlayerVolumeHighlightColor="0xCCCCCC" navAppearance="Hidden" navBackgroundAlpha="1" navBackgroundColor="0x121212" navButtonsAppearance="All Visible" navButtonColor="0xEEEEEE" navGradientAlpha=".3" navGradientAppearance="Glass Dark" navLinkAppearance="Thumbnails" navLinkCurrentColor="0xEEEEEE" navLinkPreviewAppearance="Hidden" navLinkPreviewBackgroundAlpha="1" navLinkPreviewBackgroundColor="0xFFFFFF" navLinkPreviewScale="Proportional" navLinkPreviewSize="80,60" navLinkPreviewStrokeWeight="1" navLinkRolloverColor="0xFFFFFF" navLinkSpacing="10" navLinksBackgroundAlpha="1" navLinksBackgroundColor="0x121212" navNumberLinkColor="0x999999" navNumberLinkSize="9" navPosition="Bottom" navThumbLinkBackgroundColor="0x666666" navThumbLinkInactiveAlpha="1" navThumbLinkShadowAlpha=".6" navThumbLinkSize="20,20" navThumbLinkStrokeWeight="1" permalinks="Off" smoothing="Off" startup="Load Album" textStrings="Previous Screen,Next Screen,Screen,of,No caption,No title,Playing,Paused,Click play to start audio" toolAppearanceContentArea="Hidden" toolAppearanceNav="Visible" toolColor="0x222222" toolTextColor="0xEEEEEE" toolTextSize="9" toolDelayContentArea="0" toolDelayNav=".5" toolTimeoutContentArea="0" toolLabels="Gallery,Previous Group,Previous,Next,Next Group,Pause,Play,Full Screen,Normal Screen,Open Link" transitionDirection="Left to Right" transitionLength="2" transitionPause="4" transitionStyle="Blur" typeface="Lucida Grande,Lucida Sans Unicode,Verdana,Arial,_sans" typefaceHead="Lucida Grande,Lucida Sans Unicode,Verdana,Arial,_sans" typefaceEmbed="Off" videoAutoStart="On" videoBufferTime="5" xmlFilePath="http://domain.com/ssp-director/images.php?album=54" xmlFileType="Director"/> </params> You'll see it's the number "54" right at the end of the the XML file I'm after.. Quote Link to comment Share on other sites More sharing options...
nz_mitch Posted June 1, 2009 Author Share Posted June 1, 2009 Just givin' this a cheeky bump. <3 Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted June 1, 2009 Share Posted June 1, 2009 A code profiler can give you a better estimation of where the big slow down is more than anything else. I don't suppose you have anything nifty like that? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.