php-windows Digest 7 Aug 2012 21:25:11 -0000 Issue 4063
Topics (messages 30944 through 30945):
Web-based interactive fiction game engine
30944 by: Jacob Kruger
Partly client-side, but primarily server side rendition of a sort of data
tree-view implementation using PHP, MySQL, and some javascript/JQuery
30945 by: Jacob Kruger
Administrivia:
To subscribe to the digest, e-mail:
php-windows-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-windows-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-wind...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
The parchment project seems to be able to handle Z-code/inform/glulx games, and
while think it just makes use of something like javascript to update like a
text area text field, I tested it very quickly, and seemed to work quite usably.
Here's the sort of front-end interface, where you can try it out:
http://iplayif.com/
and, here's the google code/project page:
http://code.google.com/p/parchment/
See that they do though reckon on the project source pages that the actual
source code is hosted on gitHub - various pieces/parts, including interpreter,
format converter, etc.:
http://code.google.com/p/parchment/wiki/Source?tm=4
Anyway - on the main code gitHub page, I hit shift + enter on code link, and in
new window downloaded a zip file of the source code:
https://github.com/curiousdannii/parchment
Did now also just quickly dump parchment source in my wamp server www folder,
and it ran fine on my own machine as well, FWIW.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
--- End Message ---
--- Begin Message ---
If you want to check out what I think is now a working/operational
version/instance of a sort of encapsulated HTML list item data structure tree
view, including editing/adding/deleting/display state storing, etc., you can
check out:
https://dl.dropbox.com/u/13327195/skillsTreeView.zip
Have made a bit of an effort to thus far compartmentalise/encapsulate it as
well to make it sort of reusable as well, FWIW, but, there might also be bits
of unused/test code in it as well FWIW - especially in the tree_view.php class
implementation file, since that's sort of the include file with most of the
(server-side at least) data implementation functionality code in it, where most
of the interface code is in the javascript/JQuery code in index.php, and the
actual data link-up also happens in index.php, but that's honestly like the
smallest chunk of code...:)
What did partly end up doing for sort of tree view data traversal is child
object traversal, where while it initiates traversing through objectified data
structures from a higher up node, each instance of an object will also continue
the process down through it's own children, sort of manually implemented, since
the PHP array_walk_recursive() function didn't seem to want to cooperate, when
it came to passing varying bits of data through in steps.
And, this uses PHP, mysqli, and then some javascript/JQuery for client-side
interface manipulation, including one or two ajax posts initiated by JQuery,
etc., but anyway - the one file you'll really need to make changes to is the
dbInc.php file, since it tells it where to locate the mysql server, and what
the name of the table is to look into for tree view data, and what field names
to make use of, etc.
What might also be of minor interest is that I am using JQuery code to
occasionally interpret current display state, and then store that in a session
variable, using a sort of background ajax post, to a separate file that only
handles updating it, so that the idea is that when the main page gets reloaded
after doing something like having added a record to the tree view, it should,
in theory remember which nodes had been expanded/collapsed, etc. as well, and
render that display state again, on-the-fly, using the JQuery $(document).ready
handler, after all parts of the document object model are meant to have been
instantiated.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'
--- End Message ---