johanafm;10963111 wrote:First off, this is bad
while (!feof($file)) {
$line = fgets($file);
and should be
while ($line = fgets($file)) {
Good catch, thanks...
johanafm;10963111 wrote:
And here's your (first) problem
foreach($data as value) {
If you turned on error reporting in php.ini, you'd get this error as well.
I have
error_reporting(E_ALL);
at the top of my script and no errors are thrown! Oh, I see, in my post, I forgot the $, sorry...
Parsing this text:
Animals
Animals > Live Animals
Animals > Pet Supplies
Animals > Pet Supplies > Amphibian Supplies
Animals > Pet Supplies > Fish Supplies
Animals > Pet Supplies > Fish Supplies > Aquarium Supplies
Animals > Pet Supplies > Fish Supplies > Aquariums
Arts & Entertainment
Arts & Entertainment > Artwork
Arts & Entertainment > Artwork > Drawings
Arts & Entertainment > Artwork > Paintings
should generate this HTML:
<ul id="categorymenu" class="mcdropdown_menu">
<li rel="1.0">Animals
<ul>
<li rel="1.1">Live Animals</li>
<li rel="1.2">Pet Supplies
<ul>
<li rel="1.2.1">Amphibian Supplies</li>
<li rel="1.2.2">Fish Supplies
<ul>
<li rel="1.2.2.1">Aquarium Supplies</li>
<li rel="1.2.2.2">Aquariums</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li rel="2.0">Arts & Entertainment
<ul>
<li rel="2.1">Artwork
<ul>
<li rel="2.1.1">Drawings</li>
<li rel="2.1.2">Paintings</li>
</ul>
</li>
</ul>
</li>
</ul>
I need to also change the way that the rel attributes are generated. It needs to have "levels".
Here's a demo page with a preload to Arts & Entertainment > Artwork > Drawings
http://www.partreports.com/cattest.html