Code: Select all
function xml_flash_slideshow() {
// check if there is anything posted
if(isset($_POST['save_changes'])) {
updateXmlFile();
} else if(isset($_POST['reorder']) == 'true') {
updateXmlFile();
} else {
// load xml file
$settings_doc = new DOMDocument();
$settings_doc -> load(ABSPATH.'wp-content/plugins/xml flash slideshow/xml/settings.xml');
// get settings from file
$width = $settings_doc -> getElementsByTagName("width") -> item(0) -> nodeValue;
$height = $settings_doc -> getElementsByTagName("height") -> item(0) -> nodeValue;
$border_width = $settings_doc -> getElementsByTagName("border_width") -> item(0) -> nodeValue;
$border_radius = $settings_doc -> getElementsByTagName("border_radius") -> item(0) -> nodeValue;
$border_top_color = $settings_doc -> getElementsByTagName("border_top_color") -> item(0) -> nodeValue;
$border_btm_color = $settings_doc -> getElementsByTagName("border_btm_color") -> item(0) -> nodeValue;
$border_dropshadow = $settings_doc -> getElementsByTagName("border_dropshadow")-> item(0) -> nodeValue;
$img_dot_color = $settings_doc -> getElementsByTagName("img_dot_color") -> item(0) -> nodeValue;
$images = $settings_doc -> getElementsByTagName("image");
foreach ($images as $image) {
$paths = $image -> getElementsByTagName( "path" );
$path_obj = $paths -> item(0) -> nodeValue;
$links = $image -> getElementsByTagName( "link" );
$link_obj = $links -> item(0) -> nodeValue;
$path[] = $path_obj;
$link[] = $link_obj;
}
}
I forgot to mention... this is the error php is generating:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in xml flash slideshow.php on line 30
line 30 in the file is : $width = $settings_doc -> getElementsByTagName("width") -> item(0) -> nodeValue;
... just in case I'm wrong about the error being from method chaining. Thanks again.