I am trying to create a weighted banner system for my website.
This is my XML:
<banners>
<images>
<src>banners/ad_1.png</src>
<alt>Banner ad 1</alt>
<views>9</views>
</images>
<images>
<src>banners/ad_2.png</src>
<alt>Banner ad 2</alt>
<views>9</views>
</images>
</banners>
I want to display the image with the lowest view. Once I have that image, increment the view to show that the banner has been shown.
I don’t want to use simpleXML. All the dom manipulation will directly be using this $dom variable:
$dom = new DOMDocument();
$dom->load($file_name);
I have been at this for over 3 hours and my code just keeps getting bigger and bigger. I have figured out how to increment it and place it back into the XML file. I just don’t know how to pull the image that has the lowest views for display.
Any help, even ideas would be GREATLY appreciated!
I hope that helps! Sorry for mega commenting. Got bored.