So I'm working on a script for my BF2 Clan's website to display Ventrillo info and, long story short, I don't know how to set it up so it can search through an unknown nesting of channels.
as in... I can hard code it with nested loops to go through 3 levels, which is what we have, but if we decide to add more I'd rather use recursion to prevent having to re-code the thing.
Currently, the FIRST level of channels is hard coded, and beyond that it calls a function to find any nested channels.
Attached is a sample of the code to get the channels below the first set, but how to I make it reference itself without causing an endless loop?
$CID is "Channel ID"
$CHANS is an array with all the of the information about the channels
$chan is a count of the total channels
"PID" is "Parent ID", tells which CID to list a channel under.
Let me know if you need to see the arrays or anything
apparently the AT code function doesn't add carriage returns, sorry for the formatting.
as in... I can hard code it with nested loops to go through 3 levels, which is what we have, but if we decide to add more I'd rather use recursion to prevent having to re-code the thing.
Currently, the FIRST level of channels is hard coded, and beyond that it calls a function to find any nested channels.
Attached is a sample of the code to get the channels below the first set, but how to I make it reference itself without causing an endless loop?
$CID is "Channel ID"
$CHANS is an array with all the of the information about the channels
$chan is a count of the total channels
"PID" is "Parent ID", tells which CID to list a channel under.
Let me know if you need to see the arrays or anything
apparently the AT code function doesn't add carriage returns, sorry for the formatting.
