Following up a previous post, I’ve now managed to fully render the virtual networks connecting users and boards in all directions.
Last Friday I went to Matt Northam with some issues nesting repeat regions to achieve this, basically I had an SQL query returning the ‘boards’ of which user was part of, based on session variables, then needing to use those results in a second query matching other users who are also part of these user groups – the first post explains this a bit better. Anyway we couldn’t fix it, the first repeat region would execute but the ‘inner’ would go unrecognised.
Later on though, I tried again instead with completely creating the second recordset (the inner query) actually within the outer repeat region, meaning the SQL would be executed each time the loop is initialised, guaranteeing it being refreshed – and it worked. It was then an intricate case of appending and aggregating arrays of the recognised users into larger container arrays – essentially because one user could relate to another user through multiple connections – then looping through these to display them properly.
With some tweaking this was replicated for the Immediate Network based on finding users connecting to groups that you have created, then formatting everything so usernames and board names are links to relevant pages.
A lot of conditional statements and some hand-coded PHP and SQL were needed but the end result is quite useful.
Also on Friday I spoke to Matt about some problems passing PHP variables to Flash. With absolutely no reason that either of us could find, Flash was accepting some variables – static, sessions and POST variables – and completely ignoring those defined by the GET method, which was needed. In the end we used the <param> and <embed> tags to pass variables directly, rather than using the Actionscript of before to read an echo output from the PHP. GET variables worked fine this way.
This now means I have a complete communication between the SQL through PHP to Flash with a pretty clean retrieval from the database when I need it. The way in which Flash Media Server assigns instances to .swf visits means I can also handle the large majority of user authentication through the PHP/HTML that I’ve been developing so far, perhaps only to use further Actionscript authentication as additional verification.