PHP källkod för att generera wiki kartor
The mapping engine have been slightly modified after writing this text: It is currently undocumented how this wiki creates the 1-Complex sphere maps!
The introduction to the 1-Complex map have been made in a special oscillating way, haha you can not be entirely sure to get one of these kinds of maps ;)
Här är källkoden som används för att kunna generera wikikartorna på Gudinna Wiki.
PHP sourcecode for this wiki's map generator.
This is the source code for generating the (Map function) on this wiki. The code was made from inspiration of Ward's wikis VisualTour. The source is in Alpha stage and not well documented and can be much improved. It might be tricky to adept the code for your web environment but if you do please tell about it!
Differences in approach compared to VisualTour
I loved wards wikis VisualTour function but i thought it had a problem finding associative linking between the pages since i wanted the mapping function help me getting a owerview of wards wiki. I decided to write a mapping solution that was based on the webservers referer_log for input, this enabled the system to respond correctly to the users needs by analysing their browsing patterns. All popular accesses between pages by the users result in arrows on the map, interesting to know is that the visitors of this wiki are actually creating the map while browsing pages, similar to trails formed in forests by walking explorers. Just keep klicking on the right trail on the map (orange boxes) and the map will continue in the direction of your choice and many other visitors.
Improved the output from webdot by feeding in a more complex .dot file with tuned colors, fonts and shapes.
The code....
- parser.php.txt This php file is executed on the server once a day. It parces the referer_log file generated by apache and inserts all references from one node to another node into a mysql database that is run on the server. FInnaly the script clears out all .dot files generated by the other php files.
- The parser is executed by running a cronjob that starts each day with the command /usr/local/bin/wget -q -T 0 -t 0 http://www.gudinna.com/wiki/parser.php --delete-after > /dev/null
- karta.php.txt is executed by the visitor and generates the actually html document that is returned to the user. The graph is generated with help of webdot and graphviz from a .dot file that is generated on request. (This document contains some HTML so please view the file in a text only textprocessor),
- makedot.php.txt generates the .dot file from data previously collected by parser.php.
- gettitle.php.txt parses out the page title from the original .xml document that each page on Gudinna Wiki is stored in.
- exists.inc.php.txt helps makedot.php keep tracks on nodes that has allready been processed during .dot file generation.
Database setup
The map generator requires a working mySQL database.
The database is setup as follow:
- Database graph
- Table list
- Table referals
- Field id int(11)
- Field refer int(11)
- Field link int(11)
Webserver setup
In order to greate a graph from .dot files webdot is installed on the webserver and used.
- This server uses Graphviz 1.10.20040214 and webdot ( if an older version of webdot is used like 1.7 (OpenBSD package) then the graphs will work but look extremly ugly. )
The Webserver is compleated from two parts
- One Swiki/Squeak/Commance wiki server running on port 8000
- One apache webserver with PHP4 and mod_rewrite and mod_proxy installed
- The transparent proxy setup is documented here
Comments and suggestions:
I was thinking of getting a map made of my own wiki, and found you writing on wardswiki :) // dach
http://streamlab.info - visitor of this wiki ..
response: nice looking projects.. hope it becomes its full potential! - xerxes
Referenser till aktuell sida